commit c623ae999572bca2dcd74b3e3e0f03001c9a97cb Author: Karl Kempe Date: Sun Jan 23 20:42:35 2022 +0000 Updates diff --git a/768f98fcb52f22407ef9.module.wasm b/768f98fcb52f22407ef9.module.wasm new file mode 100644 index 0000000..14ac80c Binary files /dev/null and b/768f98fcb52f22407ef9.module.wasm differ diff --git a/8d6b9881d89a56d8430d.module.wasm b/8d6b9881d89a56d8430d.module.wasm new file mode 100644 index 0000000..8a672ec Binary files /dev/null and b/8d6b9881d89a56d8430d.module.wasm differ diff --git a/asset-manifest.json b/asset-manifest.json new file mode 100644 index 0000000..9b19ca3 --- /dev/null +++ b/asset-manifest.json @@ -0,0 +1,43 @@ +{ + "files": { + "main.css": "/wormhole-nativeswap-example/static/css/main.a55348bc.chunk.css", + "main.js": "/wormhole-nativeswap-example/static/js/main.1f4a20ba.chunk.js", + "main.js.map": "/wormhole-nativeswap-example/static/js/main.1f4a20ba.chunk.js.map", + "runtime-main.js": "/wormhole-nativeswap-example/static/js/runtime-main.042f3d2b.js", + "runtime-main.js.map": "/wormhole-nativeswap-example/static/js/runtime-main.042f3d2b.js.map", + "static/js/2.069fda70.chunk.js": "/wormhole-nativeswap-example/static/js/2.069fda70.chunk.js", + "static/js/2.069fda70.chunk.js.map": "/wormhole-nativeswap-example/static/js/2.069fda70.chunk.js.map", + "static/js/3.568bae82.chunk.js": "/wormhole-nativeswap-example/static/js/3.568bae82.chunk.js", + "static/js/3.568bae82.chunk.js.map": "/wormhole-nativeswap-example/static/js/3.568bae82.chunk.js.map", + "static/js/4.6bf00d2c.chunk.js": "/wormhole-nativeswap-example/static/js/4.6bf00d2c.chunk.js", + "static/js/4.6bf00d2c.chunk.js.map": "/wormhole-nativeswap-example/static/js/4.6bf00d2c.chunk.js.map", + "static/js/5.3e01db43.chunk.js": "/wormhole-nativeswap-example/static/js/5.3e01db43.chunk.js", + "static/js/5.3e01db43.chunk.js.map": "/wormhole-nativeswap-example/static/js/5.3e01db43.chunk.js.map", + "static/js/6.a4e99163.chunk.js": "/wormhole-nativeswap-example/static/js/6.a4e99163.chunk.js", + "static/js/6.a4e99163.chunk.js.map": "/wormhole-nativeswap-example/static/js/6.a4e99163.chunk.js.map", + "static/js/7.4fa99583.chunk.js": "/wormhole-nativeswap-example/static/js/7.4fa99583.chunk.js", + "768f98fcb52f22407ef9.module.wasm": "/wormhole-nativeswap-example/768f98fcb52f22407ef9.module.wasm", + "static/js/7.4fa99583.chunk.js.map": "/wormhole-nativeswap-example/static/js/7.4fa99583.chunk.js.map", + "static/js/8.2404dc93.chunk.js": "/wormhole-nativeswap-example/static/js/8.2404dc93.chunk.js", + "bec391d666b685714f5a.module.wasm": "/wormhole-nativeswap-example/bec391d666b685714f5a.module.wasm", + "static/js/8.2404dc93.chunk.js.map": "/wormhole-nativeswap-example/static/js/8.2404dc93.chunk.js.map", + "static/js/9.12c84b71.chunk.js": "/wormhole-nativeswap-example/static/js/9.12c84b71.chunk.js", + "8d6b9881d89a56d8430d.module.wasm": "/wormhole-nativeswap-example/8d6b9881d89a56d8430d.module.wasm", + "static/js/9.12c84b71.chunk.js.map": "/wormhole-nativeswap-example/static/js/9.12c84b71.chunk.js.map", + "static/js/10.0b02594e.chunk.js": "/wormhole-nativeswap-example/static/js/10.0b02594e.chunk.js", + "ea8de8df1172de587b84.module.wasm": "/wormhole-nativeswap-example/ea8de8df1172de587b84.module.wasm", + "static/js/10.0b02594e.chunk.js.map": "/wormhole-nativeswap-example/static/js/10.0b02594e.chunk.js.map", + "index.html": "/wormhole-nativeswap-example/index.html", + "static/css/main.a55348bc.chunk.css.map": "/wormhole-nativeswap-example/static/css/main.a55348bc.chunk.css.map", + "static/js/2.069fda70.chunk.js.LICENSE.txt": "/wormhole-nativeswap-example/static/js/2.069fda70.chunk.js.LICENSE.txt", + "static/media/eth.364436c5.svg": "/wormhole-nativeswap-example/static/media/eth.364436c5.svg", + "static/media/polygon.97ff139c.svg": "/wormhole-nativeswap-example/static/media/polygon.97ff139c.svg", + "static/media/wormhole-network.5bb90ed1.svg": "/wormhole-nativeswap-example/static/media/wormhole-network.5bb90ed1.svg" + }, + "entrypoints": [ + "static/js/runtime-main.042f3d2b.js", + "static/js/2.069fda70.chunk.js", + "static/css/main.a55348bc.chunk.css", + "static/js/main.1f4a20ba.chunk.js" + ] +} \ No newline at end of file diff --git a/bec391d666b685714f5a.module.wasm b/bec391d666b685714f5a.module.wasm new file mode 100644 index 0000000..50daaf0 Binary files /dev/null and b/bec391d666b685714f5a.module.wasm differ diff --git a/ea8de8df1172de587b84.module.wasm b/ea8de8df1172de587b84.module.wasm new file mode 100644 index 0000000..d4bbb4d Binary files /dev/null and b/ea8de8df1172de587b84.module.wasm differ diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..edf0d90 Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..7ce1fe3 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +NativeSwap
\ No newline at end of file diff --git a/logo192.png b/logo192.png new file mode 100644 index 0000000..969e390 Binary files /dev/null and b/logo192.png differ diff --git a/logo512.png b/logo512.png new file mode 100644 index 0000000..92ae34a Binary files /dev/null and b/logo512.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d2ac001 --- /dev/null +++ b/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "Cross Chain Swap", + "name": "Cross Chain Swap Example Program", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/static/css/main.a55348bc.chunk.css b/static/css/main.a55348bc.chunk.css new file mode 100644 index 0000000..51174c0 --- /dev/null +++ b/static/css/main.a55348bc.chunk.css @@ -0,0 +1,2 @@ +:root{--basis:linear-gradient(160deg,rgba(69,74,117,0.473),rgba(98,104,143,0.445)),linear-gradient(45deg,rgba(153,69,255,0.411),rgba(0,209,139,0.404));--gradient1:#75e4bb;--gradient2:#c1a4e6}#loaderContainer{display:flex;width:-webkit-max-content;width:max-content;height:-webkit-max-content;height:max-content;justify-content:center;align-items:center}@-webkit-keyframes rotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes switch{0%{top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:200px;height:200px;box-shadow:0 -130px 0 -75px #75e4bb;box-shadow:0 -130px 0 -75px var(--gradient1)}25%{top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:200px;height:200px;box-shadow:0 -130px 0 -75px #75e4bb;box-shadow:0 -130px 0 -75px var(--gradient1)}50%{top:calc(100% - 55px);width:50px;height:50px;box-shadow:0 -130px 0 75px #75e4bb;box-shadow:0 -130px 0 75px var(--gradient1);-webkit-transform:translateX(-50%) translateY(0);transform:translateX(-50%) translateY(0)}75%{top:calc(100% - 55px);width:50px;height:50px;box-shadow:0 -130px 0 75px #75e4bb;box-shadow:0 -130px 0 75px var(--gradient1);-webkit-transform:translateX(-50%) translateY(0);transform:translateX(-50%) translateY(0)}to{top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:200px;height:200px;box-shadow:0 -130px 0 -75px #75e4bb;box-shadow:0 -130px 0 -75px var(--gradient1)}}@keyframes switch{0%{top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:200px;height:200px;box-shadow:0 -130px 0 -75px #75e4bb;box-shadow:0 -130px 0 -75px var(--gradient1)}25%{top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:200px;height:200px;box-shadow:0 -130px 0 -75px #75e4bb;box-shadow:0 -130px 0 -75px var(--gradient1)}50%{top:calc(100% - 55px);width:50px;height:50px;box-shadow:0 -130px 0 75px #75e4bb;box-shadow:0 -130px 0 75px var(--gradient1);-webkit-transform:translateX(-50%) translateY(0);transform:translateX(-50%) translateY(0)}75%{top:calc(100% - 55px);width:50px;height:50px;box-shadow:0 -130px 0 75px #75e4bb;box-shadow:0 -130px 0 75px var(--gradient1);-webkit-transform:translateX(-50%) translateY(0);transform:translateX(-50%) translateY(0)}to{top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:200px;height:200px;box-shadow:0 -130px 0 -75px #75e4bb;box-shadow:0 -130px 0 -75px var(--gradient1)}}#circle{width:325px;height:325px;display:block;background:linear-gradient(160deg,rgba(69,74,117,.473),rgba(98,104,143,.445)),linear-gradient(45deg,rgba(153,69,255,.411),rgba(0,209,139,.404));background:var(--basis);border-radius:500%;position:relative;-webkit-animation:rotation 2s linear infinite;animation:rotation 2s linear infinite}#inner{width:200px;height:200px;background:#c1a4e6;background:var(--gradient2);position:absolute;left:50%;top:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);border-radius:100%;box-shadow:0 -130px 0 -75px #222;-webkit-animation:switch 8s ease-in-out infinite;animation:switch 8s ease-in-out infinite} +/*# sourceMappingURL=main.a55348bc.chunk.css.map */ \ No newline at end of file diff --git a/static/css/main.a55348bc.chunk.css.map b/static/css/main.a55348bc.chunk.css.map new file mode 100644 index 0000000..8237116 --- /dev/null +++ b/static/css/main.a55348bc.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://src/css/CircleLoader.css"],"names":[],"mappings":"AAAA,MACE,gJASG,CAGH,mBAA+B,CAC/B,mBACF,CAEA,iBACE,YAAa,CACb,yBAAkB,CAAlB,iBAAkB,CAClB,0BAAmB,CAAnB,kBAAmB,CACnB,sBAAuB,CACvB,kBACF,CACA,4BACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF,CAPA,oBACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF,CACA,0BACE,GACE,OAAQ,CACR,mDAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CACZ,YAAa,CACb,mCAA6C,CAA7C,4CACF,CACA,IACE,OAAQ,CACR,mDAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CACZ,YAAa,CACb,mCAA6C,CAA7C,4CACF,CACA,IACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CACZ,kCAA4C,CAA5C,2CAA4C,CAC5C,gDAAyC,CAAzC,wCACF,CACA,IACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CACZ,kCAA4C,CAA5C,2CAA4C,CAC5C,gDAAyC,CAAzC,wCACF,CACA,GACE,OAAQ,CACR,mDAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CACZ,YAAa,CACb,mCAA6C,CAA7C,4CACF,CACF,CApCA,kBACE,GACE,OAAQ,CACR,mDAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CACZ,YAAa,CACb,mCAA6C,CAA7C,4CACF,CACA,IACE,OAAQ,CACR,mDAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CACZ,YAAa,CACb,mCAA6C,CAA7C,4CACF,CACA,IACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CACZ,kCAA4C,CAA5C,2CAA4C,CAC5C,gDAAyC,CAAzC,wCACF,CACA,IACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CACZ,kCAA4C,CAA5C,2CAA4C,CAC5C,gDAAyC,CAAzC,wCACF,CACA,GACE,OAAQ,CACR,mDAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CACZ,YAAa,CACb,mCAA6C,CAA7C,4CACF,CACF,CACA,QACE,WAAY,CACZ,YAAa,CACb,aAAc,CACd,+IAAwB,CAAxB,uBAAwB,CACxB,kBAAmB,CACnB,iBAAkB,CAClB,6CAAsC,CAAtC,qCACF,CACA,OACE,WAAY,CACZ,YAAa,CACb,kBAA4B,CAA5B,2BAA4B,CAC5B,iBAAkB,CAClB,QAAS,CACT,OAAQ,CACR,mDAA4C,CAA5C,2CAA4C,CAC5C,kBAAmB,CACnB,gCAAiC,CACjC,gDAAyC,CAAzC,wCACF","file":"main.a55348bc.chunk.css","sourcesContent":[":root {\n --basis: linear-gradient(\n 160deg,\n rgba(69, 74, 117, 0.473) 0%,\n rgba(98, 104, 143, 0.445) 100%\n ),\n linear-gradient(\n 45deg,\n rgba(153, 69, 255, 0.411) 0%,\n rgba(0, 209, 139, 0.404) 100%\n );\n /* --gradient1: rgb(26, 212, 150); */\n /* --gradient2: rgb(176, 139, 221); */\n --gradient1: rgb(117, 228, 187);\n --gradient2: rgb(193, 164, 230);\n}\n\n#loaderContainer {\n display: flex;\n width: max-content;\n height: max-content;\n justify-content: center;\n align-items: center;\n}\n@keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes switch {\n 0% {\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n width: 200px;\n height: 200px;\n box-shadow: 0 -130px 0 -75px var(--gradient1);\n }\n 25% {\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n width: 200px;\n height: 200px;\n box-shadow: 0 -130px 0 -75px var(--gradient1);\n }\n 50% {\n top: calc(100% - 55px);\n width: 50px;\n height: 50px;\n box-shadow: 0 -130px 0 75px var(--gradient1);\n transform: translateX(-50%) translateY(0);\n }\n 75% {\n top: calc(100% - 55px);\n width: 50px;\n height: 50px;\n box-shadow: 0 -130px 0 75px var(--gradient1);\n transform: translateX(-50%) translateY(0);\n }\n 100% {\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n width: 200px;\n height: 200px;\n box-shadow: 0 -130px 0 -75px var(--gradient1);\n }\n}\n#circle {\n width: 325px;\n height: 325px;\n display: block;\n background: var(--basis);\n border-radius: 500%;\n position: relative;\n animation: rotation 2s linear infinite;\n}\n#inner {\n width: 200px;\n height: 200px;\n background: var(--gradient2);\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n border-radius: 100%;\n box-shadow: 0 -130px 0 -75px #222;\n animation: switch 8s ease-in-out infinite;\n}\n"]} \ No newline at end of file diff --git a/static/js/10.0b02594e.chunk.js b/static/js/10.0b02594e.chunk.js new file mode 100644 index 0000000..5bfa80f --- /dev/null +++ b/static/js/10.0b02594e.chunk.js @@ -0,0 +1,2 @@ +(this.webpackJsonpNativeSwap=this.webpackJsonpNativeSwap||[]).push([[10],{716:function(n,r,t){"use strict";t.r(r);var e=t(787);t.d(r,"attest_ix",(function(){return e.c})),t.d(r,"transfer_native_ix",(function(){return e.l})),t.d(r,"transfer_wrapped_ix",(function(){return e.m})),t.d(r,"complete_transfer_native_ix",(function(){return e.d})),t.d(r,"complete_transfer_wrapped_ix",(function(){return e.e})),t.d(r,"create_wrapped_ix",(function(){return e.f})),t.d(r,"upgrade_contract_ix",(function(){return e.n})),t.d(r,"register_chain_ix",(function(){return e.k})),t.d(r,"emitter_address",(function(){return e.h})),t.d(r,"custody_signer",(function(){return e.g})),t.d(r,"approval_authority_address",(function(){return e.b})),t.d(r,"wrapped_address",(function(){return e.o})),t.d(r,"wrapped_meta_address",(function(){return e.p})),t.d(r,"parse_wrapped_meta",(function(){return e.j})),t.d(r,"parse_endpoint_registration",(function(){return e.i})),t.d(r,"__wbindgen_json_parse",(function(){return e.a}))},778:function(n,r){n.exports=function(n){if(!n.webpackPolyfill){var r=Object.create(n);r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),Object.defineProperty(r,"exports",{enumerable:!0}),r.webpackPolyfill=1}return r}},787:function(n,r,t){"use strict";(function(n){t.d(r,"c",(function(){return p})),t.d(r,"l",(function(){return h})),t.d(r,"m",(function(){return g})),t.d(r,"d",(function(){return x})),t.d(r,"e",(function(){return m})),t.d(r,"f",(function(){return j})),t.d(r,"n",(function(){return k})),t.d(r,"k",(function(){return A})),t.d(r,"h",(function(){return q})),t.d(r,"g",(function(){return D})),t.d(r,"b",(function(){return E})),t.d(r,"o",(function(){return I})),t.d(r,"p",(function(){return J})),t.d(r,"j",(function(){return N})),t.d(r,"i",(function(){return S})),t.d(r,"a",(function(){return U}));var e=t(791),u=new("undefined"===typeof TextDecoder?(0,n.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});u.decode();var c=null;function i(){return null!==c&&c.buffer===e.l.buffer||(c=new Uint8Array(e.l.buffer)),c}var d=new Array(32).fill(void 0);d.push(void 0,null,!0,!1);var a=d.length;var o=0,f=new("undefined"===typeof TextEncoder?(0,n.require)("util").TextEncoder:TextEncoder)("utf-8"),l="function"===typeof f.encodeInto?function(n,r){return f.encodeInto(n,r)}:function(n,r){var t=f.encode(n);return r.set(t),{read:n.length,written:t.length}};function s(n,r,t){if(void 0===t){var e=f.encode(n),u=r(e.length);return i().subarray(u,u+e.length).set(e),o=e.length,u}for(var c=n.length,d=r(c),a=i(),s=0;s127)break;a[d+s]=v}if(s!==c){0!==s&&(n=n.slice(s)),d=t(d,c,c=s+3*n.length);var p=i().subarray(d+s,d+c);s+=l(n,p).written}return o=s,d}function v(n){var r=function(n){return d[n]}(n);return function(n){n<36||(d[n]=a,a=n)}(n),r}function p(n,r,t,u,c,i){var d=s(n,e.c,e.d),a=o,f=s(r,e.c,e.d),l=o,p=s(t,e.c,e.d),_=o,b=s(u,e.c,e.d),y=o,h=s(c,e.c,e.d),g=o;return v(e.f(d,a,f,l,p,_,b,y,h,g,i))}var _=new Uint32Array(2),b=new BigUint64Array(_.buffer);function y(n,r){var t=r(1*n.length);return i().set(n,t/1),o=n.length,t}function h(n,r,t,u,c,i,d,a,f,l,p){var h=s(n,e.c,e.d),g=o,w=s(r,e.c,e.d),x=o,m=s(t,e.c,e.d),j=o,k=s(u,e.c,e.d),A=o,O=s(c,e.c,e.d),T=o,P=s(i,e.c,e.d),q=o;b[0]=a;var D=_[0],E=_[1];b[0]=f;var I=_[0],J=_[1],N=y(l,e.c),S=o;return v(e.p(h,g,w,x,m,j,k,A,O,T,P,q,d,D,E,I,J,N,S,p))}function g(n,r,t,u,c,i,d,a,f,l,p,h,g){var w=s(n,e.c,e.d),x=o,m=s(r,e.c,e.d),j=o,k=s(t,e.c,e.d),A=o,O=s(u,e.c,e.d),T=o,P=s(c,e.c,e.d),q=o,D=s(i,e.c,e.d),E=o,I=y(a,e.c),J=o;b[0]=l;var N=_[0],S=_[1];b[0]=p;var U=_[0],B=_[1],C=y(h,e.c),M=o;return v(e.q(w,x,m,j,k,A,O,T,P,q,D,E,d,I,J,f,N,S,U,B,C,M,g))}function w(n){return void 0===n||null===n}function x(n,r,t,u,c){var i=s(n,e.c,e.d),d=o,a=s(r,e.c,e.d),f=o,l=s(t,e.c,e.d),p=o,_=y(u,e.c),b=o,h=w(c)?0:s(c,e.c,e.d),g=o;return v(e.g(i,d,a,f,l,p,_,b,h,g))}function m(n,r,t,u,c){var i=s(n,e.c,e.d),d=o,a=s(r,e.c,e.d),f=o,l=s(t,e.c,e.d),p=o,_=y(u,e.c),b=o,h=w(c)?0:s(c,e.c,e.d),g=o;return v(e.h(i,d,a,f,l,p,_,b,h,g))}function j(n,r,t,u){var c=s(n,e.c,e.d),i=o,d=s(r,e.c,e.d),a=o,f=s(t,e.c,e.d),l=o,p=y(u,e.c),_=o;return v(e.i(c,i,d,a,f,l,p,_))}function k(n,r,t,u,c){var i=s(n,e.c,e.d),d=o,a=s(r,e.c,e.d),f=o,l=s(t,e.c,e.d),p=o,_=s(u,e.c,e.d),b=o,h=y(c,e.c),g=o;return v(e.r(i,d,a,f,l,p,_,b,h,g))}function A(n,r,t,u){var c=s(n,e.c,e.d),i=o,d=s(r,e.c,e.d),a=o,f=s(t,e.c,e.d),l=o,p=y(u,e.c),_=o;return v(e.o(c,i,d,a,f,l,p,_))}var O=null;function T(){return null!==O&&O.buffer===e.l.buffer||(O=new Int32Array(e.l.buffer)),O}function P(n,r){return i().subarray(n/1,n/1+r)}function q(n){try{var r=e.a(-16),t=s(n,e.c,e.d),u=o;e.k(r,t,u);var c=T()[r/4+0],i=T()[r/4+1],d=P(c,i).slice();return e.b(c,1*i),d}finally{e.a(16)}}function D(n){try{var r=e.a(-16),t=s(n,e.c,e.d),u=o;e.j(r,t,u);var c=T()[r/4+0],i=T()[r/4+1],d=P(c,i).slice();return e.b(c,1*i),d}finally{e.a(16)}}function E(n){try{var r=e.a(-16),t=s(n,e.c,e.d),u=o;e.e(r,t,u);var c=T()[r/4+0],i=T()[r/4+1],d=P(c,i).slice();return e.b(c,1*i),d}finally{e.a(16)}}function I(n,r,t){try{var u=e.a(-16),c=s(n,e.c,e.d),i=o,d=y(r,e.c),a=o;e.s(u,c,i,d,a,t);var f=T()[u/4+0],l=T()[u/4+1],v=P(f,l).slice();return e.b(f,1*l),v}finally{e.a(16)}}function J(n,r){try{var t=e.a(-16),u=s(n,e.c,e.d),c=o,i=y(r,e.c),d=o;e.t(t,u,c,i,d);var a=T()[t/4+0],f=T()[t/4+1],l=P(a,f).slice();return e.b(a,1*f),l}finally{e.a(16)}}function N(n){var r=y(n,e.c),t=o;return v(e.n(r,t))}function S(n){var r=y(n,e.c),t=o;return v(e.m(r,t))}function U(n,r){var t,e;return function(n){a===d.length&&d.push(d.length+1);var r=a;return a=d[r],d[r]=n,r}(JSON.parse((t=n,e=r,u.decode(i().subarray(t,t+e)))))}}).call(this,t(778)(n))},791:function(n,r,t){"use strict";var e=t.w[n.i];n.exports=e;t(787);e.u()}}]); +//# sourceMappingURL=10.0b02594e.chunk.js.map \ No newline at end of file diff --git a/static/js/10.0b02594e.chunk.js.map b/static/js/10.0b02594e.chunk.js.map new file mode 100644 index 0000000..6c47d9f --- /dev/null +++ b/static/js/10.0b02594e.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../node_modules/@certusone/wormhole-sdk/lib/esm/solana/token/token_bridge.js","../node_modules/webpack/buildin/harmony-module.js","../node_modules/@certusone/wormhole-sdk/lib/esm/solana/token/token_bridge_bg.js"],"names":["module","exports","originalModule","webpackPolyfill","Object","create","children","defineProperty","enumerable","get","l","i","cachedTextDecoder","TextDecoder","require","ignoreBOM","fatal","decode","cachegetUint8Memory0","getUint8Memory0","buffer","wasm","Uint8Array","heap","Array","fill","undefined","push","heap_next","length","WASM_VECTOR_LEN","cachedTextEncoder","TextEncoder","encodeString","encodeInto","arg","view","buf","encode","set","read","written","passStringToWasm0","malloc","realloc","ptr_1","subarray","len","ptr","mem","offset","code","charCodeAt","slice","takeObject","idx","ret","getObject","dropObject","attest_ix","program_id","bridge_id","payer","message","mint","nonce","ptr0","len0","ptr1","len1","ptr2","len2","ptr3","len3","ptr4","len4","u32CvtShim","Uint32Array","uint64CvtShim","BigUint64Array","passArray8ToWasm0","transfer_native_ix","from","amount","fee","target_address","target_chain","ptr5","len5","low6","high6","low7","high7","ptr8","len8","transfer_wrapped_ix","from_owner","token_chain","token_address","ptr6","len6","low8","high8","ptr9","len9","isLikeNone","x","complete_transfer_native_ix","vaa","fee_recipient","complete_transfer_wrapped_ix","create_wrapped_ix","upgrade_contract_ix","spill","register_chain_ix","cachegetInt32Memory0","getInt32Memory0","Int32Array","getArrayU8FromWasm0","emitter_address","retptr","r0","r1","v1","custody_signer","approval_authority_address","wrapped_address","v2","wrapped_meta_address","mint_address","parse_wrapped_meta","data","parse_endpoint_registration","__wbindgen_json_parse","arg0","arg1","obj","addHeapObject","JSON","parse"],"mappings":"2GAAA,23B,kBCAAA,EAAOC,QAAU,SAASC,GACzB,IAAKA,EAAeC,gBAAiB,CACpC,IAAIH,EAASI,OAAOC,OAAOH,GAEtBF,EAAOM,WAAUN,EAAOM,SAAW,IACxCF,OAAOG,eAAeP,EAAQ,SAAU,CACvCQ,YAAY,EACZC,IAAK,WACJ,OAAOT,EAAOU,KAGhBN,OAAOG,eAAeP,EAAQ,KAAM,CACnCQ,YAAY,EACZC,IAAK,WACJ,OAAOT,EAAOW,KAGhBP,OAAOG,eAAeP,EAAQ,UAAW,CACxCQ,YAAY,IAEbR,EAAOG,gBAAkB,EAE1B,OAAOH,I,kCCtBR,yjBAEIY,EAAoB,IADkB,qBAAhBC,aAA8B,EAAIb,EAAOc,SAAS,QAAQD,YAAcA,aACzD,QAAS,CAAEE,WAAW,EAAMC,OAAO,IAC5EJ,EAAkBK,SAClB,IAAIC,EAAuB,KAC3B,SAASC,IAIL,OAH6B,OAAzBD,GAAiCA,EAAqBE,SAAWC,IAAYD,SAC7EF,EAAuB,IAAII,WAAWD,IAAYD,SAE/CF,EAKX,IAAIK,EAAO,IAAIC,MAAM,IAAIC,UAAKC,GAC9BH,EAAKI,UAAKD,EAAW,MAAM,GAAM,GACjC,IAAIE,EAAYL,EAAKM,OASrB,IAAIC,EAAkB,EAElBC,EAAoB,IADkB,qBAAhBC,aAA8B,EAAIhC,EAAOc,SAAS,QAAQkB,YAAcA,aACzD,SACrCC,EAAwD,oBAAjCF,EAAkBG,WACvC,SAAUC,EAAKC,GACb,OAAOL,EAAkBG,WAAWC,EAAKC,IAE3C,SAAUD,EAAKC,GACb,IAAIC,EAAMN,EAAkBO,OAAOH,GAEnC,OADAC,EAAKG,IAAIF,GACF,CACHG,KAAML,EAAIN,OACVY,QAASJ,EAAIR,SAGzB,SAASa,EAAkBP,EAAKQ,EAAQC,GACpC,QAAgBlB,IAAZkB,EAAuB,CACvB,IAAIP,EAAMN,EAAkBO,OAAOH,GAC/BU,EAAQF,EAAON,EAAIR,QAGvB,OAFAV,IAAkB2B,SAASD,EAAOA,EAAQR,EAAIR,QAAQU,IAAIF,GAC1DP,EAAkBO,EAAIR,OACfgB,EAMX,IAJA,IAAIE,EAAMZ,EAAIN,OACVmB,EAAML,EAAOI,GACbE,EAAM9B,IACN+B,EAAS,EACNA,EAASH,EAAKG,IAAU,CAC3B,IAAIC,EAAOhB,EAAIiB,WAAWF,GAC1B,GAAIC,EAAO,IACP,MACJF,EAAID,EAAME,GAAUC,EAExB,GAAID,IAAWH,EAAK,CACD,IAAXG,IACAf,EAAMA,EAAIkB,MAAMH,IAEpBF,EAAMJ,EAAQI,EAAKD,EAAKA,EAAMG,EAAsB,EAAbf,EAAIN,QAC3C,IAAIO,EAAOjB,IAAkB2B,SAASE,EAAME,EAAQF,EAAMD,GAE1DG,GADUjB,EAAaE,EAAKC,GACdK,QAGlB,OADAX,EAAkBoB,EACXF,EASX,SAASM,EAAWC,GAChB,IAAIC,EARR,SAAmBD,GAAO,OAAOhC,EAAKgC,GAQxBE,CAAUF,GAEpB,OATJ,SAAoBA,GACZA,EAAM,KAEVhC,EAAKgC,GAAO3B,EACZA,EAAY2B,GAIZG,CAAWH,GACJC,EAWJ,SAASG,EAAUC,EAAYC,EAAWC,EAAOC,EAASC,EAAMC,GACnE,IAAIC,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAO9B,EAAkBqB,EAAS1C,IAAwBA,KAC1DoD,EAAO3C,EACP4C,EAAOhC,EAAkBsB,EAAM3C,IAAwBA,KACvDsD,EAAO7C,EAEX,OAAOwB,EADGjC,IAAe6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMV,IAGzF,IAAIW,EAAa,IAAIC,YAAY,GAC7BC,EAAgB,IAAIC,eAAeH,EAAWxD,QAClD,SAAS4D,EAAkB7C,EAAKQ,GAC5B,IAAIK,EAAML,EAAoB,EAAbR,EAAIN,QAGrB,OAFAV,IAAkBoB,IAAIJ,EAAKa,EAAM,GACjClB,EAAkBK,EAAIN,OACfmB,EAgBJ,SAASiC,EAAmBrB,EAAYC,EAAWC,EAAOC,EAASmB,EAAMlB,EAAMC,EAAOkB,EAAQC,EAAKC,EAAgBC,GACtH,IAAIpB,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAO9B,EAAkBqB,EAAS1C,IAAwBA,KAC1DoD,EAAO3C,EACP4C,EAAOhC,EAAkBwC,EAAM7D,IAAwBA,KACvDsD,EAAO7C,EACPyD,EAAO7C,EAAkBsB,EAAM3C,IAAwBA,KACvDmE,EAAO1D,EACXgD,EAAc,GAAKK,EACnB,IAAIM,EAAOb,EAAW,GAClBc,EAAQd,EAAW,GACvBE,EAAc,GAAKM,EACnB,IAAIO,EAAOf,EAAW,GAClBgB,EAAQhB,EAAW,GACnBiB,EAAOb,EAAkBK,EAAgBhE,KACzCyE,EAAOhE,EAEX,OAAOwB,EADGjC,IAAwB6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMY,EAAMC,EAAMvB,EAAOwB,EAAMC,EAAOC,EAAMC,EAAOC,EAAMC,EAAMR,IAmBpJ,SAASS,EAAoBnC,EAAYC,EAAWC,EAAOC,EAASmB,EAAMc,EAAYC,EAAaC,EAAejC,EAAOkB,EAAQC,EAAKC,EAAgBC,GACzJ,IAAIpB,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAO9B,EAAkBqB,EAAS1C,IAAwBA,KAC1DoD,EAAO3C,EACP4C,EAAOhC,EAAkBwC,EAAM7D,IAAwBA,KACvDsD,EAAO7C,EACPyD,EAAO7C,EAAkBsD,EAAY3E,IAAwBA,KAC7DmE,EAAO1D,EACPqE,EAAOnB,EAAkBkB,EAAe7E,KACxC+E,EAAOtE,EACXgD,EAAc,GAAKK,EACnB,IAAIQ,EAAOf,EAAW,GAClBgB,EAAQhB,EAAW,GACvBE,EAAc,GAAKM,EACnB,IAAIiB,EAAOzB,EAAW,GAClB0B,EAAQ1B,EAAW,GACnB2B,EAAOvB,EAAkBK,EAAgBhE,KACzCmF,EAAO1E,EAEX,OAAOwB,EADGjC,IAAyB6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMY,EAAMC,EAAMS,EAAaE,EAAMC,EAAMnC,EAAO0B,EAAMC,EAAOS,EAAMC,EAAOC,EAAMC,EAAMlB,IAGrL,SAASmB,EAAWC,GAChB,YAAahF,IAANgF,GAAyB,OAANA,EAUvB,SAASC,EAA4B/C,EAAYC,EAAWC,EAAO8C,EAAKC,GAC3E,IAAI3C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAOQ,EAAkB4B,EAAKvF,KAC9BoD,EAAO3C,EACP4C,EAAO+B,EAAWI,GAAiB,EAAInE,EAAkBmE,EAAexF,IAAwBA,KAChGsD,EAAO7C,EAEX,OAAOwB,EADGjC,IAAiC6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,IAW9F,SAASmC,EAA6BlD,EAAYC,EAAWC,EAAO8C,EAAKC,GAC5E,IAAI3C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAOQ,EAAkB4B,EAAKvF,KAC9BoD,EAAO3C,EACP4C,EAAO+B,EAAWI,GAAiB,EAAInE,EAAkBmE,EAAexF,IAAwBA,KAChGsD,EAAO7C,EAEX,OAAOwB,EADGjC,IAAkC6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,IAU/F,SAASoC,EAAkBnD,EAAYC,EAAWC,EAAO8C,GAC5D,IAAI1C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAOQ,EAAkB4B,EAAKvF,KAC9BoD,EAAO3C,EAEX,OAAOwB,EADGjC,IAAuB6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,IAWxE,SAASuC,EAAoBpD,EAAYC,EAAWC,EAAOmD,EAAOL,GACrE,IAAI1C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAO9B,EAAkBuE,EAAO5F,IAAwBA,KACxDoD,EAAO3C,EACP4C,EAAOM,EAAkB4B,EAAKvF,KAC9BsD,EAAO7C,EAEX,OAAOwB,EADGjC,IAAyB6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,IAUtF,SAASuC,EAAkBtD,EAAYC,EAAWC,EAAO8C,GAC5D,IAAI1C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAO1B,EAAkBmB,EAAWxC,IAAwBA,KAC5DgD,EAAOvC,EACPwC,EAAO5B,EAAkBoB,EAAOzC,IAAwBA,KACxDkD,EAAOzC,EACP0C,EAAOQ,EAAkB4B,EAAKvF,KAC9BoD,EAAO3C,EAEX,OAAOwB,EADGjC,IAAuB6C,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,IAG/E,IAAI0C,EAAuB,KAC3B,SAASC,IAIL,OAH6B,OAAzBD,GAAiCA,EAAqB/F,SAAWC,IAAYD,SAC7E+F,EAAuB,IAAIE,WAAWhG,IAAYD,SAE/C+F,EAEX,SAASG,EAAoBtE,EAAKD,GAC9B,OAAO5B,IAAkB2B,SAASE,EAAM,EAAGA,EAAM,EAAID,GAMlD,SAASwE,EAAgB3D,GAC5B,IACI,IAAI4D,EAASnG,KAAsC,IAC/C6C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACXT,IAAqBmG,EAAQtD,EAAMC,GACnC,IAAIsD,EAAKL,IAAkBI,EAAS,EAAI,GACpCE,EAAKN,IAAkBI,EAAS,EAAI,GACpCG,EAAKL,EAAoBG,EAAIC,GAAIrE,QAErC,OADAhC,IAAqBoG,EAAS,EAALC,GAClBC,EATX,QAYItG,IAAqC,KAOtC,SAASuG,EAAehE,GAC3B,IACI,IAAI4D,EAASnG,KAAsC,IAC/C6C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACXT,IAAoBmG,EAAQtD,EAAMC,GAClC,IAAIsD,EAAKL,IAAkBI,EAAS,EAAI,GACpCE,EAAKN,IAAkBI,EAAS,EAAI,GACpCG,EAAKL,EAAoBG,EAAIC,GAAIrE,QAErC,OADAhC,IAAqBoG,EAAS,EAALC,GAClBC,EATX,QAYItG,IAAqC,KAOtC,SAASwG,EAA2BjE,GACvC,IACI,IAAI4D,EAASnG,KAAsC,IAC/C6C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACXT,IAAgCmG,EAAQtD,EAAMC,GAC9C,IAAIsD,EAAKL,IAAkBI,EAAS,EAAI,GACpCE,EAAKN,IAAkBI,EAAS,EAAI,GACpCG,EAAKL,EAAoBG,EAAIC,GAAIrE,QAErC,OADAhC,IAAqBoG,EAAS,EAALC,GAClBC,EATX,QAYItG,IAAqC,KAStC,SAASyG,EAAgBlE,EAAYsC,EAAeD,GACvD,IACI,IAAIuB,EAASnG,KAAsC,IAC/C6C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAOY,EAAkBkB,EAAe7E,KACxCgD,EAAOvC,EACXT,IAAqBmG,EAAQtD,EAAMC,EAAMC,EAAMC,EAAM4B,GACrD,IAAIwB,EAAKL,IAAkBI,EAAS,EAAI,GACpCE,EAAKN,IAAkBI,EAAS,EAAI,GACpCO,EAAKT,EAAoBG,EAAIC,GAAIrE,QAErC,OADAhC,IAAqBoG,EAAS,EAALC,GAClBK,EAXX,QAcI1G,IAAqC,KAQtC,SAAS2G,EAAqBpE,EAAYqE,GAC7C,IACI,IAAIT,EAASnG,KAAsC,IAC/C6C,EAAOxB,EAAkBkB,EAAYvC,IAAwBA,KAC7D8C,EAAOrC,EACPsC,EAAOY,EAAkBiD,EAAc5G,KACvCgD,EAAOvC,EACXT,IAA0BmG,EAAQtD,EAAMC,EAAMC,EAAMC,GACpD,IAAIoD,EAAKL,IAAkBI,EAAS,EAAI,GACpCE,EAAKN,IAAkBI,EAAS,EAAI,GACpCO,EAAKT,EAAoBG,EAAIC,GAAIrE,QAErC,OADAhC,IAAqBoG,EAAS,EAALC,GAClBK,EAXX,QAcI1G,IAAqC,KAOtC,SAAS6G,EAAmBC,GAC/B,IAAIjE,EAAOc,EAAkBmD,EAAM9G,KAC/B8C,EAAOrC,EAEX,OAAOwB,EADGjC,IAAwB6C,EAAMC,IAOrC,SAASiE,EAA4BD,GACxC,IAAIjE,EAAOc,EAAkBmD,EAAM9G,KAC/B8C,EAAOrC,EAEX,OAAOwB,EADGjC,IAAiC6C,EAAMC,IAG9C,SAASkE,EAAsBC,EAAMC,GACxC,IA3awBvF,EAAKD,EA4a7B,OAtaJ,SAAuByF,GACf5G,IAAcL,EAAKM,QACnBN,EAAKI,KAAKJ,EAAKM,OAAS,GAC5B,IAAI0B,EAAM3B,EAGV,OAFAA,EAAYL,EAAKgC,GACjBhC,EAAKgC,GAAOiF,EACLjF,EAgaAkF,CADGC,KAAKC,OA3aS3F,EA2agBsF,EA3aXvF,EA2aiBwF,EA1avC3H,EAAkBK,OAAOE,IAAkB2B,SAASE,EAAKA,EAAMD,U","file":"static/js/10.0b02594e.chunk.js","sourcesContent":["export * from \"./token_bridge_bg.js\";\n","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","import * as wasm from './token_bridge_bg.wasm';\nvar lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\nvar cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\ncachedTextDecoder.decode();\nvar cachegetUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {\n cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachegetUint8Memory0;\n}\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\nvar heap = new Array(32).fill(undefined);\nheap.push(undefined, null, true, false);\nvar heap_next = heap.length;\nfunction addHeapObject(obj) {\n if (heap_next === heap.length)\n heap.push(heap.length + 1);\n var idx = heap_next;\n heap_next = heap[idx];\n heap[idx] = obj;\n return idx;\n}\nvar WASM_VECTOR_LEN = 0;\nvar lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;\nvar cachedTextEncoder = new lTextEncoder('utf-8');\nvar encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n }\n : function (arg, view) {\n var buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n });\nfunction passStringToWasm0(arg, malloc, realloc) {\n if (realloc === undefined) {\n var buf = cachedTextEncoder.encode(arg);\n var ptr_1 = malloc(buf.length);\n getUint8Memory0().subarray(ptr_1, ptr_1 + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr_1;\n }\n var len = arg.length;\n var ptr = malloc(len);\n var mem = getUint8Memory0();\n var offset = 0;\n for (; offset < len; offset++) {\n var code = arg.charCodeAt(offset);\n if (code > 0x7F)\n break;\n mem[ptr + offset] = code;\n }\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3);\n var view = getUint8Memory0().subarray(ptr + offset, ptr + len);\n var ret = encodeString(arg, view);\n offset += ret.written;\n }\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\nfunction getObject(idx) { return heap[idx]; }\nfunction dropObject(idx) {\n if (idx < 36)\n return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\nfunction takeObject(idx) {\n var ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {string} message\n* @param {string} mint\n* @param {number} nonce\n* @returns {any}\n*/\nexport function attest_ix(program_id, bridge_id, payer, message, mint, nonce) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len3 = WASM_VECTOR_LEN;\n var ptr4 = passStringToWasm0(mint, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len4 = WASM_VECTOR_LEN;\n var ret = wasm.attest_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, nonce);\n return takeObject(ret);\n}\nvar u32CvtShim = new Uint32Array(2);\nvar uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);\nfunction passArray8ToWasm0(arg, malloc) {\n var ptr = malloc(arg.length * 1);\n getUint8Memory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {string} message\n* @param {string} from\n* @param {string} mint\n* @param {number} nonce\n* @param {BigInt} amount\n* @param {BigInt} fee\n* @param {Uint8Array} target_address\n* @param {number} target_chain\n* @returns {any}\n*/\nexport function transfer_native_ix(program_id, bridge_id, payer, message, from, mint, nonce, amount, fee, target_address, target_chain) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len3 = WASM_VECTOR_LEN;\n var ptr4 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len4 = WASM_VECTOR_LEN;\n var ptr5 = passStringToWasm0(mint, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len5 = WASM_VECTOR_LEN;\n uint64CvtShim[0] = amount;\n var low6 = u32CvtShim[0];\n var high6 = u32CvtShim[1];\n uint64CvtShim[0] = fee;\n var low7 = u32CvtShim[0];\n var high7 = u32CvtShim[1];\n var ptr8 = passArray8ToWasm0(target_address, wasm.__wbindgen_malloc);\n var len8 = WASM_VECTOR_LEN;\n var ret = wasm.transfer_native_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, nonce, low6, high6, low7, high7, ptr8, len8, target_chain);\n return takeObject(ret);\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {string} message\n* @param {string} from\n* @param {string} from_owner\n* @param {number} token_chain\n* @param {Uint8Array} token_address\n* @param {number} nonce\n* @param {BigInt} amount\n* @param {BigInt} fee\n* @param {Uint8Array} target_address\n* @param {number} target_chain\n* @returns {any}\n*/\nexport function transfer_wrapped_ix(program_id, bridge_id, payer, message, from, from_owner, token_chain, token_address, nonce, amount, fee, target_address, target_chain) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len3 = WASM_VECTOR_LEN;\n var ptr4 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len4 = WASM_VECTOR_LEN;\n var ptr5 = passStringToWasm0(from_owner, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len5 = WASM_VECTOR_LEN;\n var ptr6 = passArray8ToWasm0(token_address, wasm.__wbindgen_malloc);\n var len6 = WASM_VECTOR_LEN;\n uint64CvtShim[0] = amount;\n var low7 = u32CvtShim[0];\n var high7 = u32CvtShim[1];\n uint64CvtShim[0] = fee;\n var low8 = u32CvtShim[0];\n var high8 = u32CvtShim[1];\n var ptr9 = passArray8ToWasm0(target_address, wasm.__wbindgen_malloc);\n var len9 = WASM_VECTOR_LEN;\n var ret = wasm.transfer_wrapped_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, token_chain, ptr6, len6, nonce, low7, high7, low8, high8, ptr9, len9, target_chain);\n return takeObject(ret);\n}\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {Uint8Array} vaa\n* @param {string | undefined} fee_recipient\n* @returns {any}\n*/\nexport function complete_transfer_native_ix(program_id, bridge_id, payer, vaa, fee_recipient) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passArray8ToWasm0(vaa, wasm.__wbindgen_malloc);\n var len3 = WASM_VECTOR_LEN;\n var ptr4 = isLikeNone(fee_recipient) ? 0 : passStringToWasm0(fee_recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len4 = WASM_VECTOR_LEN;\n var ret = wasm.complete_transfer_native_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);\n return takeObject(ret);\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {Uint8Array} vaa\n* @param {string | undefined} fee_recipient\n* @returns {any}\n*/\nexport function complete_transfer_wrapped_ix(program_id, bridge_id, payer, vaa, fee_recipient) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passArray8ToWasm0(vaa, wasm.__wbindgen_malloc);\n var len3 = WASM_VECTOR_LEN;\n var ptr4 = isLikeNone(fee_recipient) ? 0 : passStringToWasm0(fee_recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len4 = WASM_VECTOR_LEN;\n var ret = wasm.complete_transfer_wrapped_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);\n return takeObject(ret);\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {Uint8Array} vaa\n* @returns {any}\n*/\nexport function create_wrapped_ix(program_id, bridge_id, payer, vaa) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passArray8ToWasm0(vaa, wasm.__wbindgen_malloc);\n var len3 = WASM_VECTOR_LEN;\n var ret = wasm.create_wrapped_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n return takeObject(ret);\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {string} spill\n* @param {Uint8Array} vaa\n* @returns {any}\n*/\nexport function upgrade_contract_ix(program_id, bridge_id, payer, spill, vaa) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passStringToWasm0(spill, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len3 = WASM_VECTOR_LEN;\n var ptr4 = passArray8ToWasm0(vaa, wasm.__wbindgen_malloc);\n var len4 = WASM_VECTOR_LEN;\n var ret = wasm.upgrade_contract_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);\n return takeObject(ret);\n}\n/**\n* @param {string} program_id\n* @param {string} bridge_id\n* @param {string} payer\n* @param {Uint8Array} vaa\n* @returns {any}\n*/\nexport function register_chain_ix(program_id, bridge_id, payer, vaa) {\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(bridge_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(payer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passArray8ToWasm0(vaa, wasm.__wbindgen_malloc);\n var len3 = WASM_VECTOR_LEN;\n var ret = wasm.register_chain_ix(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n return takeObject(ret);\n}\nvar cachegetInt32Memory0 = null;\nfunction getInt32Memory0() {\n if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {\n cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachegetInt32Memory0;\n}\nfunction getArrayU8FromWasm0(ptr, len) {\n return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n* @param {string} program_id\n* @returns {Uint8Array}\n*/\nexport function emitter_address(program_id) {\n try {\n var retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n wasm.emitter_address(retptr, ptr0, len0);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v1 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v1;\n }\n finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n/**\n* @param {string} program_id\n* @returns {Uint8Array}\n*/\nexport function custody_signer(program_id) {\n try {\n var retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n wasm.custody_signer(retptr, ptr0, len0);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v1 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v1;\n }\n finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n/**\n* @param {string} program_id\n* @returns {Uint8Array}\n*/\nexport function approval_authority_address(program_id) {\n try {\n var retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n wasm.approval_authority_address(retptr, ptr0, len0);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v1 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v1;\n }\n finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n/**\n* @param {string} program_id\n* @param {Uint8Array} token_address\n* @param {number} token_chain\n* @returns {Uint8Array}\n*/\nexport function wrapped_address(program_id, token_address, token_chain) {\n try {\n var retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passArray8ToWasm0(token_address, wasm.__wbindgen_malloc);\n var len1 = WASM_VECTOR_LEN;\n wasm.wrapped_address(retptr, ptr0, len0, ptr1, len1, token_chain);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v2 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v2;\n }\n finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n/**\n* @param {string} program_id\n* @param {Uint8Array} mint_address\n* @returns {Uint8Array}\n*/\nexport function wrapped_meta_address(program_id, mint_address) {\n try {\n var retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passArray8ToWasm0(mint_address, wasm.__wbindgen_malloc);\n var len1 = WASM_VECTOR_LEN;\n wasm.wrapped_meta_address(retptr, ptr0, len0, ptr1, len1);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var v2 = getArrayU8FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 1);\n return v2;\n }\n finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n/**\n* @param {Uint8Array} data\n* @returns {any}\n*/\nexport function parse_wrapped_meta(data) {\n var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);\n var len0 = WASM_VECTOR_LEN;\n var ret = wasm.parse_wrapped_meta(ptr0, len0);\n return takeObject(ret);\n}\n/**\n* @param {Uint8Array} data\n* @returns {any}\n*/\nexport function parse_endpoint_registration(data) {\n var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);\n var len0 = WASM_VECTOR_LEN;\n var ret = wasm.parse_endpoint_registration(ptr0, len0);\n return takeObject(ret);\n}\nexport function __wbindgen_json_parse(arg0, arg1) {\n var ret = JSON.parse(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n}\n;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/2.069fda70.chunk.js b/static/js/2.069fda70.chunk.js new file mode 100644 index 0000000..ef29f7b --- /dev/null +++ b/static/js/2.069fda70.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.069fda70.chunk.js.LICENSE.txt */ +(this.webpackJsonpNativeSwap=this.webpackJsonpNativeSwap||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(426)},function(e,t,n){e.exports=n(432)},function(e,t,n){"use strict";n.d(t,"a",(function(){return D})),n.d(t,"b",(function(){return B})),n.d(t,"c",(function(){return j})),n.d(t,"d",(function(){return U})),n.d(t,"e",(function(){return Y})),n.d(t,"f",(function(){return I})),n.d(t,"g",(function(){return L})),n.d(t,"h",(function(){return z})),n.d(t,"i",(function(){return q})),n.d(t,"j",(function(){return H})),n.d(t,"k",(function(){return J})),n.d(t,"l",(function(){return V})),n.d(t,"m",(function(){return W})),n.d(t,"n",(function(){return K})),n.d(t,"o",(function(){return G})),n.d(t,"p",(function(){return Z})),n.d(t,"q",(function(){return X}));var r=n(207),a=n(209),i=n(122),o=n(208);var s=n(28),u=n(36),c=n(41),f=n(40),d=n(18),l=n(8),p=n(9),b=n(27),h=n(15),y=n(16),m=n(221),v=n(1),g=n.n(v),w=["message"],T=g.a.mark(M),k=g.a.mark(E),_=function(e){Object(h.a)(n,e);var t=Object(y.a)(n);function n(e,r){var a,i;Object(p.a)(this,n);var o=e.message,s=Object(d.a)(e,w),u=e.path,c=0===u.length?o:"At path: "+u.join(".")+" -- "+o;return a=t.call(this,c),Object.assign(Object(b.a)(a),s),a.name=a.constructor.name,a.failures=function(){var t;return null!=(t=i)?t:i=[e].concat(Object(f.a)(r()))},a}return Object(l.a)(n)}(Object(m.a)(TypeError));function O(e){return"object"===typeof e&&null!=e}function S(e){return"string"===typeof e?JSON.stringify(e):""+e}function x(e){var t=e.next(),n=t.done,r=t.value;return n?void 0:r}function A(e,t,n,r){if(!0!==e){!1===e?e={}:"string"===typeof e&&(e={message:e});var a=t.path,i=t.branch,o=n.type,s=e,u=s.refinement,f=s.message,d=void 0===f?"Expected a value of type `"+o+"`"+(u?" with refinement `"+u+"`":"")+", but received: `"+S(r)+"`":f;return Object(c.a)(Object(c.a)({value:r,type:o,refinement:u,key:a[a.length-1],path:a,branch:i},e),{},{message:d})}}function M(e,t,n,r){var a,i,o,s;return g.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:O(f=e)&&"function"===typeof f[Symbol.iterator]||(e=[e]),a=Object(u.a)(e),c.prev=2,a.s();case 4:if((i=a.n()).done){c.next=12;break}if(o=i.value,!(s=A(o,t,n,r))){c.next=10;break}return c.next=10,s;case 10:c.next=4;break;case 12:c.next=17;break;case 14:c.prev=14,c.t0=c.catch(2),a.e(c.t0);case 17:return c.prev=17,a.f(),c.finish(17);case 20:case"end":return c.stop()}var f}),T,null,[[2,14,17,20]])}function E(e,t){var n,r,a,i,o,c,d,l,p,b,h,y,m,v,w,T,_,S,x,A,M,P,j,I,C,R,N,D,B=arguments;return g.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:if(n=B.length>2&&void 0!==B[2]?B[2]:{},r=n.path,a=void 0===r?[]:r,i=n.branch,o=void 0===i?[e]:i,c=n.coerce,d=void 0!==c&&c,l=n.mask,p=void 0!==l&&l,b={path:a,branch:o},d&&(e=t.coercer(e,b),p&&"type"!==t.type&&O(t.schema)&&O(e)&&!Array.isArray(e)))for(h in e)void 0===t.schema[h]&&delete e[h];y=!0,m=Object(u.a)(t.validator(e,b)),g.prev=6,m.s();case 8:if((v=m.n()).done){g.next=15;break}return w=v.value,y=!1,g.next=13,[w,void 0];case 13:g.next=8;break;case 15:g.next=20;break;case 17:g.prev=17,g.t0=g.catch(6),m.e(g.t0);case 20:return g.prev=20,m.f(),g.finish(20);case 23:T=Object(u.a)(t.entries(e,b)),g.prev=24,T.s();case 26:if((_=T.n()).done){g.next=53;break}S=Object(s.a)(_.value,3),x=S[0],A=S[1],M=S[2],P=E(A,M,{path:void 0===x?a:[].concat(Object(f.a)(a),[x]),branch:void 0===x?o:[].concat(Object(f.a)(o),[A]),coerce:d,mask:p}),j=Object(u.a)(P),g.prev=30,j.s();case 32:if((I=j.n()).done){g.next=43;break}if(!(C=I.value)[0]){g.next=40;break}return y=!1,g.next=38,[C[0],void 0];case 38:g.next=41;break;case 40:d&&(A=C[1],void 0===x?e=A:e instanceof Map?e.set(x,A):e instanceof Set?e.add(A):O(e)&&(e[x]=A));case 41:g.next=32;break;case 43:g.next=48;break;case 45:g.prev=45,g.t1=g.catch(30),j.e(g.t1);case 48:return g.prev=48,j.f(),g.finish(48);case 51:g.next=26;break;case 53:g.next=58;break;case 55:g.prev=55,g.t2=g.catch(24),T.e(g.t2);case 58:return g.prev=58,T.f(),g.finish(58);case 61:if(!y){g.next=80;break}R=Object(u.a)(t.refiner(e,b)),g.prev=63,R.s();case 65:if((N=R.n()).done){g.next=72;break}return D=N.value,y=!1,g.next=70,[D,void 0];case 70:g.next=65;break;case 72:g.next=77;break;case 74:g.prev=74,g.t3=g.catch(63),R.e(g.t3);case 77:return g.prev=77,R.f(),g.finish(77);case 80:if(!y){g.next=83;break}return g.next=83,[void 0,e];case 83:case"end":return g.stop()}}),k,null,[[6,17,20,23],[24,55,58,61],[30,45,48,51],[63,74,77,80]])}var P=function(){function e(t){var n=this;Object(p.a)(this,e);var r=t.type,a=t.schema,i=t.validator,o=t.refiner,s=t.coercer,u=void 0===s?function(e){return e}:s,c=t.entries,f=void 0===c?g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})):c;this.type=r,this.schema=a,this.entries=f,this.coercer=u,this.validator=i?function(e,t){return M(i(e,t),t,n,e)}:function(){return[]},this.refiner=o?function(e,t){return M(o(e,t),t,n,e)}:function(){return[]}}return Object(l.a)(e,[{key:"assert",value:function(e){return j(e,this)}},{key:"create",value:function(e){return I(e,this)}},{key:"is",value:function(e){return C(e,this)}},{key:"mask",value:function(e){return function(e,t){var n=R(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}},{key:"validate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return R(e,this,t)}}]),e}();function j(e,t){var n=R(e,t);if(n[0])throw n[0]}function I(e,t){var n=R(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function C(e,t){return!R(e,t)[0]}function R(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=E(e,t,n),a=x(r);if(a[0]){var i=new _(a[0],g.a.mark((function e(){var t,n,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Object(u.a)(r),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(!(a=n.value)[0]){e.next=8;break}return e.next=8,a[0];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return[i,void 0]}var o=a[1];return[void 0,o]}function N(e,t){return new P({type:e,schema:null,validator:t})}function D(){return N("any",(function(){return!0}))}function B(e){return new P({type:"array",schema:e,entries:g.a.mark((function t(n){var r,a,i,o,c;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e||!Array.isArray(n)){t.next=18;break}r=Object(u.a)(n.entries()),t.prev=2,r.s();case 4:if((a=r.n()).done){t.next=10;break}return i=Object(s.a)(a.value,2),o=i[0],c=i[1],t.next=8,[o,c,e];case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,12,15,18]])})),coercer:function(e){return Array.isArray(e)?e.slice():e},validator:function(e){return Array.isArray(e)||"Expected an array value, but received: "+S(e)}})}function U(){return N("boolean",(function(e){return"boolean"===typeof e}))}function L(e){return N("instance",(function(t){return t instanceof e||"Expected a `"+e.name+"` instance, but received: "+S(t)}))}function z(e){var t=S(e),n=typeof e;return new P({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:function(n){return n===e||"Expected the literal `"+t+"`, but received: "+S(n)}})}function F(){return N("never",(function(){return!1}))}function q(e){return new P(Object(c.a)(Object(c.a)({},e),{},{validator:function(t,n){return null===t||e.validator(t,n)},refiner:function(t,n){return null===t||e.refiner(t,n)}}))}function H(){return N("number",(function(e){return"number"===typeof e&&!isNaN(e)||"Expected a number, but received: "+S(e)}))}function J(e){return new P(Object(c.a)(Object(c.a)({},e),{},{validator:function(t,n){return void 0===t||e.validator(t,n)},refiner:function(t,n){return void 0===t||e.refiner(t,n)}}))}function V(e,t){return new P({type:"record",schema:null,entries:g.a.mark((function n(r){var a,i;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!O(r)){n.next=11;break}n.t0=g.a.keys(r);case 2:if((n.t1=n.t0()).done){n.next=11;break}return a=n.t1.value,i=r[a],n.next=7,[a,a,e];case 7:return n.next=9,[a,i,t];case 9:n.next=2;break;case 11:case"end":return n.stop()}}),n)})),validator:function(e){return O(e)||"Expected an object, but received: "+S(e)}})}function W(){return N("string",(function(e){return"string"===typeof e||"Expected a string, but received: "+S(e)}))}function K(e){var t=F();return new P({type:"tuple",schema:null,entries:g.a.mark((function n(r){var a,i;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=9;break}a=Math.max(e.length,r.length),i=0;case 3:if(!(i=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid arrayify value");for(var n=[];e;)n.unshift(255&e),e=parseInt(String(e/256));return 0===n.length&&n.push(0),i(new Uint8Array(n))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e)&&(e=e.toHexString()),p(e)){var o=e.substring(2);o.length%2&&("left"===t.hexPad?o="0x0"+o.substring(2):"right"===t.hexPad?o+="0":r.throwArgumentError("hex data is odd-length","value",e));for(var s=[],c=0;ct&&r.throwArgumentError("value out of range","value",arguments[0]);var n=new Uint8Array(t);return n.set(e,t-e.length),i(n)}function p(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var b="0123456789abcdef";function h(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid hexlify value");for(var n="";e;)n=b[15&e]+n,e=Math.floor(e/16);return n.length?(n.length%2&&(n="0"+n),"0x"+n):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){for(var i="0x",o=0;o>4]+b[15&s]}return i}return r.throwArgumentError("invalid hexlify value","value",e)}function y(e){if("string"!==typeof e)e=h(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function m(e,t,n){return"string"!==typeof e?e=h(e):(!p(e)||e.length%2)&&r.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function v(e){var t="0x";return e.forEach((function(e){t+=h(e).substring(2)})),t}function g(e){var t=w(h(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!==typeof e&&(e=h(e)),p(e)||r.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t2*t+2&&r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function k(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(o(e)){var n=c(e);65!==n.length&&r.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=h(n.slice(0,32)),t.s=h(n.slice(32,64)),t.v=n[64],t.v<27&&(0===t.v||1===t.v?t.v+=27:r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=h(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var a=l(c(t._vs),32);t._vs=h(a);var i=a[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),a[0]&=127;var s=h(a);null==t.s?t.s=s:t.s!==s&&r.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?r.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var u=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==u&&r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=T(t.r,32):r.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=T(t.s,32):r.throwArgumentError("signature missing or invalid s","signature",e);var f=c(t.s);f[0]>=128&&r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(f[0]|=128);var d=h(f);t._vs&&(p(t._vs)||r.throwArgumentError("signature invalid _vs","signature",e),t._vs=T(t._vs,32)),null==t._vs?t._vs=d:t._vs!==d&&r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t}function _(e){return h(f([(e=k(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,n){var r=n(33).default,a=n(59).default,i=n(63).default,o=n(161).default,s=n(159).default,u=n(279).default,c=n(281).default;e.exports=function(){"use strict";var e=Math.imul,t=Math.clz32,n=Math.abs,f=Math.max,d=Math.floor,l=function(e){s(c,e);var t=u(c);function c(e,n){var r;if(a(this,c),(r=t.call(this,e)).sign=n,e>c.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return o(r)}return i(c,[{key:"toDebugString",value:function(){var e,t=["BigInt["],n=r(this);try{for(n.s();!(e=n.n()).done;){var a=e.value;t.push((a?(a>>>0).toString(16):a)+", ")}}catch(i){n.e(i)}finally{n.f()}return t.push("]"),t.join("")}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if(2>e||36this.length&&(n=this.length);for(var r=32767&e,a=e>>>15,i=0,o=t,s=0;s>>15,l=c.__imul(f,r),p=c.__imul(f,a),b=c.__imul(d,r),h=o+l+i;i=h>>>30,h&=1073741823,i+=(h+=((32767&p)<<15)+((32767&b)<<15))>>>30,o=c.__imul(d,a)+(p>>>15)+(b>>>15),this.__setDigit(s,1073741823&h)}if(0!=i||0!==o)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(e,t,n){for(var r=0,a=0;a>>15,this.__setHalfDigit(t+a,32767&i)}return r}},{key:"__inplaceSub",value:function(e,t,n){var r=0;if(1&t){t>>=1;for(var a=this.__digit(t),i=32767&a,o=0;o>>1;o++){var s=e.__digit(o),u=(a>>>15)-(32767&s)-r;r=1&u>>>15,this.__setDigit(t+o,(32767&u)<<15|32767&i),r=1&(i=(32767&(a=this.__digit(t+o+1)))-(s>>>15)-r)>>>15}var c=e.__digit(o),f=(a>>>15)-(32767&c)-r;if(r=1&f>>>15,this.__setDigit(t+o,(32767&f)<<15|32767&i),t+o+1>=this.length)throw new RangeError("out of bounds");0==(1&n)&&(r=1&(i=(32767&(a=this.__digit(t+o+1)))-(c>>>15)-r)>>>15,this.__setDigit(t+e.length,1073709056&a|32767&i))}else{t>>=1;for(var d=0;d>>15)-(p>>>15)-(r=1&b>>>15);r=1&h>>>15,this.__setDigit(t+d,(32767&h)<<15|32767&b)}var y=this.__digit(t+d),m=e.__digit(d),v=(32767&y)-(32767&m)-r;r=1&v>>>15;var g=0;0==(1&n)&&(r=1&(g=(y>>>15)-(m>>>15)-r)>>>15),this.__setDigit(t+d,(32767&g)<<15|32767&v)}return r}},{key:"__inplaceRightShift",value:function(e){if(0!==e){for(var t=this.__digit(0)>>>e,n=this.length-1,r=0;r>>e}this.__setDigit(n,t)}}},{key:"__digit",value:function(e){return this[e]}},{key:"__unsignedDigit",value:function(e){return this[e]>>>0}},{key:"__setDigit",value:function(e,t){this[e]=0|t}},{key:"__setDigitGrow",value:function(e,t){this[e]=0|t}},{key:"__halfDigitLength",value:function(){var e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}},{key:"__halfDigit",value:function(e){return 32767&this[e>>>1]>>>15*(1&e)}},{key:"__setHalfDigit",value:function(e,t){var n=e>>>1,r=this.__digit(n),a=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,a)}}],[{key:"BigInt",value:function(e){var t=Number.isFinite;if("number"==typeof e){if(0===e)return c.__zero();if(c.__isOneDigitInt(e))return 0>e?c.__oneDigit(-e,!0):c.__oneDigit(e,!1);if(!t(e)||d(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return c.__fromDouble(e)}if("string"==typeof e){var n=c.__fromString(e);if(null===n)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return n}if("boolean"==typeof e)return!0===e?c.__oneDigit(1,!1):c.__zero();if("object"==typeof e){if(e.constructor===c)return e;var r=c.__toPrimitive(e);return c.BigInt(r)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(e){var t=e.length;if(0===t)return 0;if(1===t){var n=e.__unsignedDigit(0);return e.sign?-n:n}var r=e.__digit(t-1),a=c.__clz30(r),i=30*t-a;if(1024>>=12;var l=f-12,p=12<=f?0:s<<20+f,b=20+f;for(0>>30-l,p=s<>>30-b,b-=30;var h=c.__decideRounding(e,b,u,s);if((1===h||0===h&&1==(1&p))&&0===(p=p+1>>>0)&&0!=++d>>>20&&(d=0,1023<++o))return e.sign?-1/0:1/0;var y=e.sign?-2147483648:0;return o=o+1023<<20,c.__kBitConversionInts[1]=y|o|d,c.__kBitConversionInts[0]=p,c.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(e){if(0===e.length)return e;var t=e.__copy();return t.sign=!e.sign,t}},{key:"bitwiseNot",value:function(e){return e.sign?c.__absoluteSubOne(e).__trim():c.__absoluteAddOne(e,!0)}},{key:"exponentiate",value:function(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return c.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return e.sign&&0==(1&t.__digit(0))?c.unaryMinus(e):e;if(1=c.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){var r=1+(0|n/30),a=new c(r,e.sign&&0!=(1&n));a.__initializeDigits();var i=1<>=1;0!==n;n>>=1)s=c.multiply(s,s),0!=(1&n)&&(o=null===o?s:c.multiply(o,s));return o}},{key:"multiply",value:function(e,t){if(0===e.length)return e;if(0===t.length)return t;var n=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&n--;var r=new c(n,e.sign!==t.sign);r.__initializeDigits();for(var a=0;ac.__absoluteCompare(e,t))return c.__zero();var n,r=e.sign!==t.sign,a=t.__unsignedDigit(0);if(1===t.length&&32767>=a){if(1===a)return r===e.sign?e:c.unaryMinus(e);n=c.__absoluteDivSmall(e,a,null)}else n=c.__absoluteDivLarge(e,t,!0,!1);return n.sign=r,n.__trim()}},{key:"remainder",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>c.__absoluteCompare(e,t))return e;var n=t.__unsignedDigit(0);if(1===t.length&&32767>=n){if(1===n)return c.__zero();var r=c.__absoluteModSmall(e,n);return 0===r?c.__zero():c.__oneDigit(r,e.sign)}var a=c.__absoluteDivLarge(e,t,!1,!0);return a.sign=e.sign,a.__trim()}},{key:"add",value:function(e,t){var n=e.sign;return n===t.sign?c.__absoluteAdd(e,t,n):0<=c.__absoluteCompare(e,t)?c.__absoluteSub(e,t,n):c.__absoluteSub(t,e,!n)}},{key:"subtract",value:function(e,t){var n=e.sign;return n===t.sign?0<=c.__absoluteCompare(e,t)?c.__absoluteSub(e,t,n):c.__absoluteSub(t,e,!n):c.__absoluteAdd(e,t,n)}},{key:"leftShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?c.__rightShiftByAbsolute(e,t):c.__leftShiftByAbsolute(e,t)}},{key:"signedRightShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?c.__leftShiftByAbsolute(e,t):c.__rightShiftByAbsolute(e,t)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(e,t){return 0>c.__compareToBigInt(e,t)}},{key:"lessThanOrEqual",value:function(e,t){return 0>=c.__compareToBigInt(e,t)}},{key:"greaterThan",value:function(e,t){return 0(e=d(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return c.__zero();if(e>=c.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length(e=d(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return c.__zero();if(t.sign){if(e>c.__kMaxLengthBits)throw new RangeError("BigInt too big");return c.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=c.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length>>r)return t}return c.__truncateToNBits(e,t)}},{key:"ADD",value:function(e,t){if(e=c.__toPrimitive(e),t=c.__toPrimitive(t),"string"==typeof e)return"string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=c.__toNumeric(e),t=c.__toNumeric(t),c.__isBigInt(e)&&c.__isBigInt(t))return c.add(e,t);if("number"==typeof e&&"number"==typeof t)return e+t;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(e,t){return c.__compare(e,t,0)}},{key:"LE",value:function(e,t){return c.__compare(e,t,1)}},{key:"GT",value:function(e,t){return c.__compare(e,t,2)}},{key:"GE",value:function(e,t){return c.__compare(e,t,3)}},{key:"EQ",value:function(e,t){for(;;){if(c.__isBigInt(e))return c.__isBigInt(t)?c.equal(e,t):c.EQ(t,e);if("number"==typeof e){if(c.__isBigInt(t))return c.__equalToNumber(t,e);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("string"==typeof e){if(c.__isBigInt(t))return null!==(e=c.__fromString(e))&&c.equal(e,t);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("boolean"==typeof e){if(c.__isBigInt(t))return c.__equalToNumber(t,+e);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("symbol"==typeof e){if(c.__isBigInt(t))return!1;if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else{if("object"!=typeof e)return e==t;if("object"==typeof t&&t.constructor!==c)return e==t;e=c.__toPrimitive(e)}}}},{key:"NE",value:function(e,t){return!c.EQ(e,t)}},{key:"__zero",value:function(){return new c(0,!1)}},{key:"__oneDigit",value:function(e,t){var n=new c(1,t);return n.__setDigit(0,e),n}},{key:"__decideRounding",value:function(e,t,n,r){if(0t)a=-t-1;else{if(0===n)return-1;n--,r=e.__digit(n),a=29}var i=1<>>20)-1023,r=1+(0|n/30),a=new c(r,0>e),i=1048575&c.__kBitConversionInts[1]|1048576,o=c.__kBitConversionInts[0],s=20,u=n%30,f=0;if(20>u){var d=s-u;f=d+32,t=i>>>d,i=i<<32-d|o>>>d,o<<=32-d}else if(20===u)f=32,t=i,i=o,o=0;else{var l=u-s;f=32-l,t=i<>>32-l,i=o<>>2,i=i<<30|o>>>2,o<<=30):t=0,a.__setDigit(p,t);return a.__trim()}},{key:"__isWhitespace",value:function(e){return!!(13>=e&&9<=e)||(159>=e?32==e:131071>=e?160==e||5760==e:196607>=e?10>=(e&=131071)||40==e||41==e||47==e||95==e||4096==e:65279==e)}},{key:"__fromString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0,r=e.length,a=0;if(a===r)return c.__zero();for(var i=e.charCodeAt(a);c.__isWhitespace(i);){if(++a===r)return c.__zero();i=e.charCodeAt(a)}if(43===i){if(++a===r)return null;i=e.charCodeAt(a),n=1}else if(45===i){if(++a===r)return null;i=e.charCodeAt(a),n=-1}if(0===t){if(t=10,48===i){if(++a===r)return c.__zero();if(88===(i=e.charCodeAt(a))||120===i){if(t=16,++a===r)return null;i=e.charCodeAt(a)}else if(79===i||111===i){if(t=8,++a===r)return null;i=e.charCodeAt(a)}else if(66===i||98===i){if(t=2,++a===r)return null;i=e.charCodeAt(a)}}}else if(16===t&&48===i){if(++a===r)return c.__zero();if(88===(i=e.charCodeAt(a))||120===i){if(++a===r)return null;i=e.charCodeAt(a)}}if(0!=n&&10!==t)return null;for(;48===i;){if(++a===r)return c.__zero();i=e.charCodeAt(a)}var o=r-a,s=c.__kMaxBitsPerChar[t],u=c.__kBitsPerCharTableMultiplier-1;if(o>1073741824/s)return null;var f=new c(0|(29+(s*o+u>>>c.__kBitsPerCharTableShift))/30,!1),d=10>t?t:10,l=10>=c.__kBitsPerCharTableShift;var p=[],b=[],h=!1;do{for(var y=0,m=0;;){var v=void 0;if(i-48>>>0>>0>>0>>0>>c.__kBitsPerCharTableShift)/30;f.__inplaceMultiplyAdd(k,T,S)}while(!g)}if(a!==r){if(!c.__isWhitespace(i))return null;for(a++;a>>u-(i-=30))}if(0!==a){if(r>=e.length)throw new Error("implementation bug");e.__setDigit(r++,a)}for(;r>>1)+(85&r))>>>2)+(51&r))>>>4)+(15&r),i=t-1,o=e.__digit(n-1),s=0|(30*n-c.__clz30(o)+a-1)/a;if(e.sign&&s++,268435456>>y,l=30-y;l>=a;)u[f--]=c.__kConversionChars[d&i],d>>>=a,l-=a}var m=(d|o<>>a-l;0!==d;)u[f--]=c.__kConversionChars[d&i],d>>>=a;if(e.sign&&(u[f--]="-"),-1!=f)throw new Error("implementation bug");return u.join("")}},{key:"__toStringGeneric",value:function(e,t,n){var r=e.length;if(0===r)return"";if(1===r){var a=e.__unsignedDigit(0).toString(t);return!1===n&&e.sign&&(a="-"+a),a}var i,o,s=30*r-c.__clz30(e.__digit(r-1)),u=c.__kMaxBitsPerChar[t]-1,f=s*c.__kBitsPerCharTableMultiplier,d=1+(f=0|(f+=u-1)/u)>>1,l=c.exponentiate(c.__oneDigit(t,!1),c.__oneDigit(d,!1)),p=l.__unsignedDigit(0);if(1===l.length&&32767>=p){(i=new c(e.length,!1)).__initializeDigits();for(var b=0,h=2*e.length-1;0<=h;h--){var y=b<<15|e.__halfDigit(h);i.__setHalfDigit(h,0|y/p),b=0|y%p}o=b.toString(t)}else{var m=c.__absoluteDivLarge(e,l,!0,!0);i=m.quotient;var v=m.remainder.__trim();o=c.__toStringGeneric(v,t,!0)}i.__trim();for(var g=c.__toStringGeneric(i,t,!0);o.lengthr?c.__absoluteLess(n):0}},{key:"__compareToNumber",value:function(e,t){if(c.__isOneDigitInt(t)){var r=e.sign,a=0>t;if(r!==a)return c.__unequalSign(r);if(0===e.length){if(a)throw new Error("implementation bug");return 0===t?0:-1}if(1i?c.__absoluteGreater(r):ot)return c.__unequalSign(n);if(0===t)throw new Error("implementation bug: should be handled elsewhere");if(0===e.length)return-1;c.__kBitConversionDouble[0]=t;var r=2047&c.__kBitConversionInts[1]>>>20;if(2047==r)throw new Error("implementation bug: handled elsewhere");var a=r-1023;if(0>a)return c.__absoluteGreater(n);var i=e.length,o=e.__digit(i-1),s=c.__clz30(o),u=30*i-s,f=a+1;if(uf)return c.__absoluteGreater(n);var d=1048576|1048575&c.__kBitConversionInts[1],l=c.__kBitConversionInts[0],p=20,b=29-s;if(b!==(0|(u-1)%30))throw new Error("implementation bug");var h,y=0;if(20>b){var m=p-b;y=m+32,h=d>>>m,d=d<<32-m|l>>>m,l<<=32-m}else if(20===b)y=32,h=d,d=l,l=0;else{var v=b-p;y=32-v,h=d<>>32-v,d=l<>>=0)>(h>>>=0))return c.__absoluteGreater(n);if(o>>2,d=d<<30|l>>>2,l<<=30):h=0;var w=e.__unsignedDigit(g);if(w>h)return c.__absoluteGreater(n);if(wt&&e.__unsignedDigit(0)===n(t):0===c.__compareToDouble(e,t)}},{key:"__comparisonResultToBool",value:function(e,t){return 0===t?0>e:1===t?0>=e:2===t?0t;case 3:return e>=t}if(c.__isBigInt(e)&&"string"==typeof t)return null!==(t=c.__fromString(t))&&c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if("string"==typeof e&&c.__isBigInt(t))return null!==(e=c.__fromString(e))&&c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if(e=c.__toNumeric(e),t=c.__toNumeric(t),c.__isBigInt(e)){if(c.__isBigInt(t))return c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if("number"!=typeof t)throw new Error("implementation bug");return c.__comparisonResultToBool(c.__compareToNumber(e,t),n)}if("number"!=typeof e)throw new Error("implementation bug");if(c.__isBigInt(t))return c.__comparisonResultToBool(c.__compareToNumber(t,e),2^n);if("number"!=typeof t)throw new Error("implementation bug");return 0===n?et:3===n?e>=t:void 0}},{key:"__absoluteAdd",value:function(e,t,n){if(e.length>>30,a.__setDigit(o,1073741823&s)}for(;o>>30,a.__setDigit(o,1073741823&u)}return o>>30,r.__setDigit(i,1073741823&o)}for(;i>>30,r.__setDigit(i,1073741823&s)}return r.__trim()}},{key:"__absoluteAddOne",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.length;null===n?n=new c(r,t):n.sign=t;for(var a=1,i=0;i>>30,n.__setDigit(i,1073741823&o)}return 0!=a&&n.__setDigitGrow(r,1),n}},{key:"__absoluteSubOne",value:function(e,t){for(var n=e.length,r=new c(t=t||n,!1),a=1,i=0;i>>30,r.__setDigit(i,1073741823&o)}if(0!=a)throw new Error("implementation bug");for(var s=n;s2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,a=t.length,i=a;if(r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,a=t.length,i=a;r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,a=t.length,i=a;if(r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,a=t.length,i=a;if(rr?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}},{key:"__multiplyAccumulate",value:function(e,t,n,r){if(0!==t){for(var a,i=32767&t,o=t>>>15,s=0,u=0,f=0;f>>15,b=c.__imul(l,i),h=c.__imul(l,o),y=c.__imul(p,i);s=(a+=u+b+s)>>>30,a&=1073741823,s+=(a+=((32767&h)<<15)+((32767&y)<<15))>>>30,u=c.__imul(p,o)+(h>>>15)+(y>>>15),n.__setDigit(r,1073741823&a)}for(;0!=s||0!==u;r++){var m=n.__digit(r);m+=s+u,u=0,s=m>>>30,n.__setDigit(r,1073741823&m)}}}},{key:"__internalMultiplyAdd",value:function(e,t,n,r,a){for(var i=n,o=0,s=0;s>>15,t),l=f+((32767&d)<<15)+o+i;i=l>>>30,o=d>>>15,a.__setDigit(s,1073741823&l)}if(a.length>r)for(a.__setDigit(r++,i+o);r2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=new c(e.length,!1));for(var r,a=0,i=2*e.length-1;0<=i;i-=2){var o=0|(r=(a<<15|e.__halfDigit(i))>>>0)/t,s=0|(r=((a=0|r%t)<<15|e.__halfDigit(i-1))>>>0)/t;a=0|r%t,n.__setDigit(i>>>1,o<<15|s)}return n}},{key:"__absoluteModSmall",value:function(e,t){for(var n=0,r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}},{key:"__absoluteDivLarge",value:function(e,t,n,r){var a=t.__halfDigitLength(),i=t.length,o=e.__halfDigitLength()-a,s=null;n&&(s=new c(o+2>>>1,!1)).__initializeDigits();var u=new c(a+2>>>1,!1);u.__initializeDigits();var f=c.__clz15(t.__halfDigit(a-1));0>>0;d=0|m/p;for(var v=0|m%p,g=t.__halfDigit(a-2),w=l.__halfDigit(h+a-2);c.__imul(d,g)>>>0>(v<<16|w)>>>0&&(d--,!(32767<(v+=p))););}c.__internalMultiplyAdd(t,d,0,i,u);var T=l.__inplaceSub(u,h,a+1);0!==T&&(T=l.__inplaceAdd(t,h,a),l.__setHalfDigit(h+a,32767&l.__halfDigit(h+a)+T),d--),n&&(1&h?b=d<<15:s.__setDigit(h>>>1,b|d))}if(r)return l.__inplaceRightShift(f),n?{quotient:s,remainder:l}:l;if(n)return s;throw new Error("unreachable")}},{key:"__clz15",value:function(e){return c.__clz30(e)-15}},{key:"__specialLeftShift",value:function(e,t,n){var r=e.length,a=new c(r+n,!1);if(0===t){for(var i=0;i>>30-t}return 0n)throw new RangeError("BigInt too big");var r=0|n/30,a=n%30,i=e.length,o=0!==a&&0!=e.__digit(i-1)>>>30-a,s=i+r+(o?1:0),u=new c(s,e.sign);if(0===a){for(var f=0;f>>30-a}if(o)u.__setDigit(i+r,d);else if(0!==d)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(e,t){var n=e.length,r=e.sign,a=c.__toShiftAmount(t);if(0>a)return c.__rightShiftByMaximum(r);var i=0|a/30,o=a%30,s=n-i;if(0>=s)return c.__rightShiftByMaximum(r);var u=!1;if(r)if(0!=(e.__digit(i)&(1<>>o,b=n-i-1,h=0;h>>o}d.__setDigit(b,p)}return u&&(d=c.__absoluteAddOne(d,!0,d)),d.__trim()}},{key:"__rightShiftByMaximum",value:function(e){return e?c.__oneDigit(1,!0):c.__zero()}},{key:"__toShiftAmount",value:function(e){if(1c.__kMaxLengthBits?-1:t}},{key:"__toPrimitive",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";if("object"!=typeof e)return e;if(e.constructor===c)return e;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive){var n=e[Symbol.toPrimitive];if(n){var r=n(t);if("object"!=typeof r)return r;throw new TypeError("Cannot convert object to primitive value")}}var a=e.valueOf;if(a){var i=a.call(e);if("object"!=typeof i)return i}var o=e.toString;if(o){var s=o.call(e);if("object"!=typeof s)return s}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(e){return c.__isBigInt(e)?e:+e}},{key:"__isBigInt",value:function(e){return"object"==typeof e&&null!==e&&e.constructor===c}},{key:"__truncateToNBits",value:function(e,t){for(var n=0|(e+29)/30,r=new c(n,t.sign),a=n-1,i=0;i>>s}return r.__setDigit(a,o),r.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(e,t,n){for(var r=Math.min,a=0|(e+29)/30,i=new c(a,n),o=0,s=a-1,u=0,f=r(s,t.length);o>>30,i.__setDigit(o,1073741823&d)}for(;o>>h)-u,l&=y-1}return i.__setDigit(s,l),i.__trim()}},{key:"__digitPow",value:function(e,t){for(var n=1;0>>=1,e*=e;return n}},{key:"__isOneDigitInt",value:function(e){return(1073741823&e)===e}}]),c}(c(Array));return l.__kMaxLength=33554432,l.__kMaxLengthBits=l.__kMaxLength<<5,l.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],l.__kBitsPerCharTableShift=5,l.__kBitsPerCharTableMultiplier=1<>>0)/t)},l.__imul=e||function(e,t){return 0|e*t},l}()},function(e,t,n){"use strict";n.r(t),n.d(t,"defineReadOnly",(function(){return f})),n.d(t,"getStatic",(function(){return d})),n.d(t,"resolveProperties",(function(){return l})),n.d(t,"checkProperties",(function(){return p})),n.d(t,"shallowCopy",(function(){return b})),n.d(t,"deepCopy",(function(){return v})),n.d(t,"Description",(function(){return g}));var r=n(8),a=n(9),i=n(1),o=n.n(i),s=n(7),u=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},c=new s.Logger("properties/5.5.0");function f(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function d(e,t){for(var n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function l(e){return u(this,void 0,void 0,o.a.mark((function t(){var n,r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object.keys(e).map((function(t){var n=e[t];return Promise.resolve(n).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(n);case 3:return r=t.sent,t.abrupt("return",r.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function p(e,t){e&&"object"===typeof e||c.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(n){t[n]||c.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function b(e){var t={};for(var n in e)t[n]=e[n];return t}var h={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function y(e){if(void 0===e||null===e||h[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),n=0;ns[n]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r>4],n+=p[15&t[i]];a.push(e+"=Uint8Array(0x"+n+")")}else a.push(e+"="+JSON.stringify(t))}catch(s){a.push(e+"="+JSON.stringify(r[e].toString()))}})),a.push("code=".concat(n)),a.push("version=".concat(this.version));var i=t;a.length&&(t+=" ("+a.join(", ")+")");var s=new Error(t);return s.reason=i,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}},{key:"throwError",value:function(e,t,n){throw this.makeError(e,t,n)}},{key:"throwArgumentError",value:function(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}},{key:"assert",value:function(e,t,n,r){e||this.throwError(t,n,r)}},{key:"assertArgument",value:function(e,t,n,r){e||this.throwArgumentError(t,n,r)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),l&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:l})}},{key:"checkSafeUint53",value:function(t,n){"number"===typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,n,r){r=r?": "+r:"",tn&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}},{key:"checkNew",value:function(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}},{key:"checkAbstract",value:function(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}}],[{key:"globalLogger",value:function(){return c||(c=new e("logger/5.5.0")),c}},{key:"setCensorship",value:function(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}o=!!t,i=!!n}},{key:"setLogLevel",value:function(t){var n=s[t.toLowerCase()];null!=n?u=n:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();b.errors=d,b.levels=f},function(e,t,n){"use strict";function r(e,t){for(var n=0;n=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function L(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function z(e){return 1===e.length?"0"+e:e}function F(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}I.inherits=B,I.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),a=0;a>6|192,n[r++]=63&i|128):U(e,a)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++a)),n[r++]=i>>18|240,n[r++]=i>>12&63|128,n[r++]=i>>6&63|128,n[r++]=63&i|128):(n[r++]=i>>12|224,n[r++]=i>>6&63|128,n[r++]=63&i|128)}else for(a=0;a>>0}return i},I.split32=function(e,t){for(var n=new Array(4*e.length),r=0,a=0;r>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}return n},I.rotr32=function(e,t){return e>>>t|e<<32-t},I.rotl32=function(e,t){return e<>>32-t},I.sum32=function(e,t){return e+t>>>0},I.sum32_3=function(e,t,n){return e+t+n>>>0},I.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},I.sum32_5=function(e,t,n,r,a){return e+t+n+r+a>>>0},I.sum64=function(e,t,n,r){var a=e[t],i=r+e[t+1]>>>0,o=(i>>0,e[t+1]=i},I.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},I.sum64_lo=function(e,t,n,r){return t+r>>>0},I.sum64_4_hi=function(e,t,n,r,a,i,o,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},I.sum64_4_lo=function(e,t,n,r,a,i,o,s){return t+r+i+s>>>0},I.sum64_5_hi=function(e,t,n,r,a,i,o,s,u,c){var f=0,d=t;return f+=(d=d+r>>>0)>>0)>>0)>>0)>>0},I.sum64_5_lo=function(e,t,n,r,a,i,o,s,u,c){return t+r+i+s+c>>>0},I.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},I.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},I.shr64_hi=function(e,t,n){return e>>>n},I.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0};var q={},H=I,J=C;function V(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}q.BlockHash=V,V.prototype.update=function(e,t){if(e=H.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=H.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,r[a++]=e>>>16&255,r[a++]=e>>>8&255,r[a++]=255&e}else for(r[a++]=255&e,r[a++]=e>>>8&255,r[a++]=e>>>16&255,r[a++]=e>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i>>3},K.g1_256=function(e){return G(e,17)^G(e,19)^e>>>10};var $=I,Q=q,ee=K,te=$.rotl32,ne=$.sum32,re=$.sum32_5,ae=ee.ft_1,ie=Q.BlockHash,oe=[1518500249,1859775393,2400959708,3395469782];function se(){if(!(this instanceof se))return new se;ie.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}$.inherits(se,ie);var ue=se;se.blockSize=512,se.outSize=160,se.hmacStrength=80,se.padLength=64,se.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),At(e.length<=this.blockSize);for(var t=e.length;tCt[n]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r>4],n+=Lt[15&t[i]];a.push(e+"=Uint8Array(0x"+n+")")}else a.push(e+"="+JSON.stringify(t))}catch(o){a.push(e+"="+JSON.stringify(r[e].toString()))}})),a.push("code=".concat(n)),a.push("version=".concat(this.version));var i=t;a.length&&(t+=" ("+a.join(", ")+")");var o=new Error(t);return o.reason=i,o.code=n,Object.keys(r).forEach((function(e){o[e]=r[e]})),o}},{key:"throwError",value:function(e,t,n){throw this.makeError(e,t,n)}},{key:"throwArgumentError",value:function(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}},{key:"assert",value:function(e,t,n,r){e||this.throwError(t,n,r)}},{key:"assertArgument",value:function(e,t,n,r){e||this.throwArgumentError(t,n,r)}},{key:"checkNormalize",value:function(t){Ut&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ut})}},{key:"checkSafeUint53",value:function(t,n){"number"===typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,n,r){r=r?": "+r:"",tn&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}},{key:"checkNew",value:function(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}},{key:"checkAbstract",value:function(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}}],[{key:"globalLogger",value:function(){return Nt||(Nt=new e("logger/5.5.0")),Nt}},{key:"setCensorship",value:function(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),jt){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}It=!!t,jt=!!n}},{key:"setLogLevel",value:function(t){var n=Ct[t.toLowerCase()];null!=n?Rt=n:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();zt.errors=Bt,zt.levels=Dt;var Ft=new zt("bytes/5.5.0");function qt(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return qt(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Ht(e){return"number"===typeof e&&e==e&&e%1===0}function Jt(e,t){if(t||(t={}),"number"===typeof e){Ft.checkSafeUint53(e,"invalid arrayify value");for(var n=[];e;)n.unshift(255&e),e=parseInt(String(e/256));return 0===n.length&&n.push(0),qt(new Uint8Array(n))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,t){if("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))return!1;if(t&&e.length!==2+2*t)return!1;return!0}(e)){var r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":Ft.throwArgumentError("hex data is odd-length","value",e));for(var a=[],i=0;i=256)return!1}return!0}(e)?qt(new Uint8Array(e)):Ft.throwArgumentError("invalid arrayify value","value",e)}function Vt(e){return"0x"+Pt.sha256().update(Jt(e)).digest("hex")}new zt("sha2/5.5.0");var Wt=function(){function e(t){Object(d.a)(this,e),Object.assign(this,t)}return Object(l.a)(e,[{key:"encode",value:function(){return m.Buffer.from(Object(k.serialize)(Kt,this))}}],[{key:"decode",value:function(e){return Object(k.deserialize)(Kt,this,e)}},{key:"decodeUnchecked",value:function(e){return Object(k.deserializeUnchecked)(Kt,this,e)}}]),e}(),Kt=new Map;var Gt=function(e){Object(c.a)(n,e);var t=Object(f.a)(n);function n(e){var r;if(Object(d.a)(this,n),(r=t.call(this,{}))._bn=void 0,function(e){return void 0!==e._bn}(e))r._bn=e._bn;else{if("string"===typeof e){var a=T.a.decode(e);if(32!=a.length)throw new Error("Invalid public key input");r._bn=new g.a(a)}else r._bn=new g.a(e);if(r._bn.byteLength()>32)throw new Error("Invalid public key input")}return r}return Object(l.a)(n,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return T.a.encode(this.toBytes())}},{key:"toBytes",value:function(){return this.toBuffer()}},{key:"toBuffer",value:function(){var e=this._bn.toArrayLike(m.Buffer);if(32===e.length)return e;var t=m.Buffer.alloc(32);return e.copy(t,32-e.length),t}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"createWithSeed",value:function(){var e=Object(u.a)(b.a.mark((function e(t,r,a){var i,o;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=m.Buffer.concat([t.toBuffer(),m.Buffer.from(r),a.toBuffer()]),o=Vt(new Uint8Array(i)).slice(2),e.abrupt("return",new n(m.Buffer.from(o,"hex")));case 3:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"createProgramAddress",value:function(){var e=Object(u.a)(b.a.mark((function e(t,r){var a,i,o;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=m.Buffer.alloc(0),t.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");a=m.Buffer.concat([a,E(e)])})),a=m.Buffer.concat([a,r.toBuffer(),m.Buffer.from("ProgramDerivedAddress")]),i=Vt(new Uint8Array(a)).slice(2),!Xt(o=new g.a(i,16).toArray(void 0,32))){e.next=7;break}throw new Error("Invalid seeds, address must fall off the curve");case 7:return e.abrupt("return",new n(o));case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"findProgramAddress",value:function(){var e=Object(u.a)(b.a.mark((function e(t,n){var r,a,i;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=255;case 1:if(0==r){e.next=18;break}return e.prev=2,i=t.concat(m.Buffer.from([r])),e.next=6,this.createProgramAddress(i,n);case 6:a=e.sent,e.next=15;break;case 9:if(e.prev=9,e.t0=e.catch(2),!(e.t0 instanceof TypeError)){e.next=13;break}throw e.t0;case 13:return r--,e.abrupt("continue",1);case 15:return e.abrupt("return",[a,r]);case 18:throw new Error("Unable to find a viable program address nonce");case 19:case"end":return e.stop()}}),e,this,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"isOnCurve",value:function(e){return 1==Xt(e)}}]),n}(Wt);Gt.default=new Gt("11111111111111111111111111111111"),Kt.set(Gt,{kind:"struct",fields:[["_bn","u256"]]});var Zt=y.a.lowlevel;function Xt(e){var t=[Zt.gf(),Zt.gf(),Zt.gf(),Zt.gf()],n=Zt.gf(),r=Zt.gf(),a=Zt.gf(),i=Zt.gf(),o=Zt.gf(),s=Zt.gf(),u=Zt.gf();return Zt.set25519(t[2],Yt),Zt.unpack25519(t[1],e),Zt.S(a,t[1]),Zt.M(i,a,Zt.D),Zt.Z(a,a,t[2]),Zt.A(i,t[2],i),Zt.S(o,i),Zt.S(s,o),Zt.M(u,s,o),Zt.M(n,u,a),Zt.M(n,n,i),Zt.pow2523(n,n),Zt.M(n,n,a),Zt.M(n,n,i),Zt.M(n,n,i),Zt.M(t[0],n,i),Zt.S(r,t[0]),Zt.M(r,r,i),Qt(r,a)&&Zt.M(t[0],t[0],$t),Zt.S(r,t[0]),Zt.M(r,r,i),Qt(r,a)?0:1}var Yt=Zt.gf([1]),$t=Zt.gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Qt(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return Zt.pack25519(n,e),Zt.pack25519(r,t),Zt.crypto_verify_32(n,0,r,0)}new Gt("BPFLoader1111111111111111111111111111111111");var en=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return _.blob(32,e)},tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",t=_.struct([_.u32("length"),_.u32("lengthPadding"),_.blob(_.offset(_.u32(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t);return t.decode=function(e,t){return n(e,t).chars.toString("utf8")},t.encode=function(e,t,n){var a={chars:m.Buffer.from(e,"utf8")};return r(a,t,n)},t.alloc=function(e){return _.u32().span+_.u32().span+m.Buffer.from(e,"utf8").length},t};function nn(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0===(128&r))break}return t}function rn(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}var an=function(){function e(t){var n=this;Object(d.a)(this,e),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((function(e){return new Gt(e)})),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((function(e){return n.indexToProgramIds.set(e.programIdIndex,n.accountKeys[e.programIdIndex])}))}return Object(l.a)(e,[{key:"isAccountSigner",value:function(e){return e=this.header.numRequiredSignatures&&e0?this.signatures[0].signature:null}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");t=this.signatures[0].publicKey}for(var r=0;r-1?c[n].isWritable=c[n].isWritable||e.isWritable:c.push(e)}));var f=c.findIndex((function(e){return e.pubkey.equals(t)}));if(f>-1){var d=c.splice(f,1),l=Object(i.a)(d,1)[0];l.isSigner=!0,l.isWritable=!0,c.unshift(l)}else c.unshift({pubkey:t,isSigner:!0,isWritable:!0});var p,b=Object(a.a)(this.signatures);try{var h=function(){var e=p.value,t=c.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));c[t].isSigner||(c[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))};for(b.s();!(p=b.n()).done;)h()}catch(O){b.e(O)}finally{b.f()}var y=0,m=0,v=0,g=[],w=[];c.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(g.push(t.toString()),y+=1,r||(m+=1)):(w.push(t.toString()),r||(v+=1))}));var k=g.concat(w),_=this.instructions.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:k.indexOf(n.toString()),accounts:e.keys.map((function(e){return k.indexOf(e.pubkey.toString())})),data:T.a.encode(t)}}));return _.forEach((function(e){on(e.programIdIndex>=0),e.accounts.forEach((function(e){return on(e>=0)}))})),new an({header:{numRequiredSignatures:y,numReadonlySignedAccounts:m,numReadonlyUnsignedAccounts:v},accountKeys:k,recentBlockhash:n,instructions:_})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length&&this.signatures.every((function(e,n){return t[n].equals(e.publicKey)})))return e;return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),i=1;i ").concat(un)),a}},{key:"keys",get:function(){return on(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return on(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return on(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(t){for(var n=Object(s.a)(t),r=nn(n),a=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:[],r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((function(e,n){var a={signature:e==T.a.encode(sn)?null:T.a.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(a)})),t.instructions.forEach((function(e){var n=e.accounts.map((function(e){var n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()}))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new cn({keys:n,programId:t.accountKeys[e.programIdIndex],data:T.a.decode(e.data)}))})),r}}]),e}(),dn=new Gt("SysvarC1ock11111111111111111111111111111111"),ln=new Gt("SysvarRecentB1ockHashes11111111111111111111"),pn=new Gt("SysvarRent111111111111111111111111111111111"),bn=(new Gt("SysvarRewards111111111111111111111111111111"),new Gt("SysvarStakeHistory1111111111111111111111111"));new Gt("Sysvar1nstructions1111111111111111111111111");function hn(e,t,n,r){return yn.apply(this,arguments)}function yn(){return(yn=Object(u.a)(b.a.mark((function e(t,n,r,a){var i,o,s;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a&&{skipPreflight:a.skipPreflight,preflightCommitment:a.preflightCommitment||a.commitment},e.next=3,t.sendTransaction(n,r,i);case 3:return o=e.sent,e.next=6,t.confirmTransaction(o,a&&a.commitment);case 6:if(!(s=e.sent.value).err){e.next=9;break}throw new Error("Transaction ".concat(o," failed (").concat(JSON.stringify(s),")"));case 9:return e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mn(e){return new Promise((function(t){return setTimeout(t,e)}))}function vn(e,t){var n=e.layout.span>=0?e.layout.span:function(e,t){var n=0;return e.layout.fields.forEach((function(e){e.span>=0?n+=e.span:"function"===typeof e.alloc&&(n+=e.alloc(t[e.property]))})),n}(e,t),r=m.Buffer.alloc(n),a=Object.assign({instruction:e.index},t);return e.layout.encode(a,r),r}var gn=_.nu64("lamportsPerSignature"),wn=_.struct([_.u32("version"),_.u32("state"),en("authorizedPubkey"),en("nonce"),_.struct([gn],"feeCalculator")]),Tn=wn.span,kn=Object.freeze({Create:{index:0,layout:_.struct([_.u32("instruction"),_.ns64("lamports"),_.ns64("space"),en("programId")])},Assign:{index:1,layout:_.struct([_.u32("instruction"),en("programId")])},Transfer:{index:2,layout:_.struct([_.u32("instruction"),_.ns64("lamports")])},CreateWithSeed:{index:3,layout:_.struct([_.u32("instruction"),en("base"),tn("seed"),_.ns64("lamports"),_.ns64("space"),en("programId")])},AdvanceNonceAccount:{index:4,layout:_.struct([_.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:_.struct([_.u32("instruction"),_.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:_.struct([_.u32("instruction"),en("authorized")])},AuthorizeNonceAccount:{index:7,layout:_.struct([_.u32("instruction"),en("authorized")])},Allocate:{index:8,layout:_.struct([_.u32("instruction"),_.ns64("space")])},AllocateWithSeed:{index:9,layout:_.struct([_.u32("instruction"),en("base"),tn("seed"),_.ns64("space"),en("programId")])},AssignWithSeed:{index:10,layout:_.struct([_.u32("instruction"),en("base"),tn("seed"),en("programId")])},TransferWithSeed:{index:11,layout:_.struct([_.u32("instruction"),_.ns64("lamports"),tn("seed"),en("programId")])}}),_n=function(){function e(){Object(d.a)(this,e)}return Object(l.a)(e,null,[{key:"createAccount",value:function(e){var t=vn(kn.Create,{lamports:e.lamports,space:e.space,programId:E(e.programId.toBuffer())});return new cn({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}},{key:"transfer",value:function(e){var t,n;"basePubkey"in e?(t=vn(kn.TransferWithSeed,{lamports:e.lamports,seed:e.seed,programId:E(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=vn(kn.Transfer,{lamports:e.lamports}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]);return new cn({keys:n,programId:this.programId,data:t})}},{key:"assign",value:function(e){var t,n;"basePubkey"in e?(t=vn(kn.AssignWithSeed,{base:E(e.basePubkey.toBuffer()),seed:e.seed,programId:E(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=vn(kn.Assign,{programId:E(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new cn({keys:n,programId:this.programId,data:t})}},{key:"createAccountWithSeed",value:function(e){var t=vn(kn.CreateWithSeed,{base:E(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:E(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&n.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new cn({keys:n,programId:this.programId,data:t})}},{key:"createNonceAccount",value:function(t){var n=new fn;"basePubkey"in t&&"seed"in t?n.add(e.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:Tn,programId:this.programId})):n.add(e.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:Tn,programId:this.programId}));var r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return n.add(this.nonceInitialize(r)),n}},{key:"nonceInitialize",value:function(e){var t=vn(kn.InitializeNonceAccount,{authorized:E(e.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ln,isSigner:!1,isWritable:!1},{pubkey:pn,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new cn(n)}},{key:"nonceAdvance",value:function(e){var t=vn(kn.AdvanceNonceAccount),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ln,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new cn(n)}},{key:"nonceWithdraw",value:function(e){var t=vn(kn.WithdrawNonceAccount,{lamports:e.lamports});return new cn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:ln,isSigner:!1,isWritable:!1},{pubkey:pn,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"nonceAuthorize",value:function(e){var t=vn(kn.AuthorizeNonceAccount,{authorized:E(e.newAuthorizedPubkey.toBuffer())});return new cn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"allocate",value:function(e){var t,n;"basePubkey"in e?(t=vn(kn.AllocateWithSeed,{base:E(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:E(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=vn(kn.Allocate,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new cn({keys:n,programId:this.programId,data:t})}}]),e}();_n.programId=new Gt("11111111111111111111111111111111");var On=un-300,Sn=function(){function e(){Object(d.a)(this,e)}return Object(l.a)(e,null,[{key:"getMinNumSignatures",value:function(t){return 2*(Math.ceil(t/e.chunkSize)+1+1)}},{key:"load",value:function(){var t=Object(u.a)(b.a.mark((function t(n,r,a,i,o){var s,u,c,f,d,l,p,h,y,v,g,w,T,k;return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.getMinimumBalanceForRentExemption(o.length);case 2:return s=t.sent,t.next=5,n.getAccountInfo(a.publicKey,"confirmed");case 5:if(u=t.sent,c=null,null===u){t.next=16;break}if(!u.executable){t.next=11;break}return console.error("Program load failed, account is already executable"),t.abrupt("return",!1);case 11:u.data.length!==o.length&&(c=c||new fn).add(_n.allocate({accountPubkey:a.publicKey,space:o.length})),u.owner.equals(i)||(c=c||new fn).add(_n.assign({accountPubkey:a.publicKey,programId:i})),u.lamports0?s:1,space:o.length,programId:i}));case 17:if(null===c){t.next=20;break}return t.next=20,hn(n,c,[r,a],{commitment:"confirmed"});case 20:f=_.struct([_.u32("instruction"),_.u32("offset"),_.u32("bytesLength"),_.u32("bytesLengthPadding"),_.seq(_.u8("byte"),_.offset(_.u32(),-8),"bytes")]),d=e.chunkSize,l=0,p=o,h=[];case 25:if(!(p.length>0)){t.next=39;break}if(y=p.slice(0,d),v=m.Buffer.alloc(d+16),f.encode({instruction:0,offset:l,bytes:y},v),g=(new fn).add({keys:[{pubkey:a.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:v}),h.push(hn(n,g,[r,a],{commitment:"confirmed"})),!n._rpcEndpoint.includes("solana.com")){t.next=35;break}return 4,t.next=35,mn(250);case 35:l+=d,p=p.slice(d),t.next=25;break;case 39:return t.next=41,Promise.all(h);case 41:return w=_.struct([_.u32("instruction")]),T=m.Buffer.alloc(w.span),w.encode({instruction:1},T),k=(new fn).add({keys:[{pubkey:a.publicKey,isSigner:!0,isWritable:!0},{pubkey:pn,isSigner:!1,isWritable:!1}],programId:i,data:T}),t.next=47,hn(n,k,[r,a],{commitment:"confirmed"});case 47:return t.abrupt("return",!0);case 48:case"end":return t.stop()}}),t)})));return function(e,n,r,a,i){return t.apply(this,arguments)}}()}]),e}();Sn.chunkSize=On;new Gt("BPFLoader2111111111111111111111111111111111");var xn={exports:{}};!function(e,t){var n="undefined"!==typeof self?self:P,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,a="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!==typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function b(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function h(e){var t=new FileReader,n=b(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"===typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=b(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function T(e){var t=new l;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t}function k(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},m.call(g.prototype),m.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];k.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(S){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function O(e,n){return new Promise((function(r,i){var o=new g(e,n);if(o.signal&&o.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:T(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new k(t,e))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&a&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",u)}),s.send("undefined"===typeof o._bodyInit?null:o._bodyInit)}))}O.polyfill=!0,e.fetch||(e.fetch=O,e.Headers=l,e.Request=g,e.Response=k),t.Headers=l,t.Request=g,t.Response=k,t.fetch=O,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var a=r;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t}(xn,xn.exports);Error;var An=Object(O.e)(Object(O.g)(Gt),Object(O.m)(),(function(e){return new Gt(e)})),Mn=Object(O.n)([Object(O.m)(),Object(O.h)("base64")]),En=Object(O.e)(Object(O.g)(m.Buffer),Mn,(function(e){return m.Buffer.from(e[0],"base64")}));function Pn(e){return Object(O.p)([Object(O.o)({jsonrpc:Object(O.h)("2.0"),id:Object(O.m)(),result:e}),Object(O.o)({jsonrpc:Object(O.h)("2.0"),id:Object(O.m)(),error:Object(O.o)({code:Object(O.q)(),message:Object(O.m)(),data:Object(O.k)(Object(O.a)())})})])}var jn=Pn(Object(O.q)());function In(e){return Object(O.e)(Pn(e),jn,(function(t){return"error"in t?t:Object(o.a)(Object(o.a)({},t),{},{result:Object(O.f)(t.result,e)})}))}function Cn(e){return In(Object(O.o)({context:Object(O.o)({slot:Object(O.j)()}),value:e}))}function Rn(e){return Object(O.o)({context:Object(O.o)({slot:Object(O.j)()}),value:e})}var Nn=Object(O.o)({foundation:Object(O.j)(),foundationTerm:Object(O.j)(),initial:Object(O.j)(),taper:Object(O.j)(),terminal:Object(O.j)()}),Dn=(In(Object(O.b)(Object(O.i)(Object(O.o)({epoch:Object(O.j)(),effectiveSlot:Object(O.j)(),amount:Object(O.j)(),postBalance:Object(O.j)()})))),Object(O.o)({epoch:Object(O.j)(),slotIndex:Object(O.j)(),slotsInEpoch:Object(O.j)(),absoluteSlot:Object(O.j)(),blockHeight:Object(O.k)(Object(O.j)()),transactionCount:Object(O.k)(Object(O.j)())})),Bn=Object(O.o)({slotsPerEpoch:Object(O.j)(),leaderScheduleSlotOffset:Object(O.j)(),warmup:Object(O.d)(),firstNormalEpoch:Object(O.j)(),firstNormalSlot:Object(O.j)()}),Un=Object(O.l)(Object(O.m)(),Object(O.b)(Object(O.j)())),Ln=Object(O.i)(Object(O.p)([Object(O.o)({}),Object(O.m)()])),zn=Object(O.o)({err:Ln}),Fn=Object(O.h)("receivedSignature");Object(O.o)({"solana-core":Object(O.m)(),"feature-set":Object(O.k)(Object(O.j)())}),Cn(Object(O.o)({err:Object(O.i)(Object(O.p)([Object(O.o)({}),Object(O.m)()])),logs:Object(O.i)(Object(O.b)(Object(O.m)())),accounts:Object(O.k)(Object(O.i)(Object(O.b)(Object(O.o)({executable:Object(O.d)(),owner:Object(O.m)(),lamports:Object(O.j)(),data:Object(O.b)(Object(O.m)()),rentEpoch:Object(O.k)(Object(O.j)())})))),unitsConsumed:Object(O.k)(Object(O.j)())}));In(Nn),In(Dn),In(Bn),In(Un),In(Object(O.j)()),Cn(Object(O.o)({total:Object(O.j)(),circulating:Object(O.j)(),nonCirculating:Object(O.j)(),nonCirculatingAccounts:Object(O.b)(An)}));var qn=Object(O.o)({amount:Object(O.m)(),uiAmount:Object(O.i)(Object(O.j)()),decimals:Object(O.j)(),uiAmountString:Object(O.k)(Object(O.m)())}),Hn=(Cn(Object(O.b)(Object(O.o)({address:An,amount:Object(O.m)(),uiAmount:Object(O.i)(Object(O.j)()),decimals:Object(O.j)(),uiAmountString:Object(O.k)(Object(O.m)())}))),Cn(Object(O.b)(Object(O.o)({pubkey:An,account:Object(O.o)({executable:Object(O.d)(),owner:An,lamports:Object(O.j)(),data:En,rentEpoch:Object(O.j)()})}))),Object(O.o)({program:Object(O.m)(),parsed:Object(O.q)(),space:Object(O.j)()})),Jn=(Cn(Object(O.b)(Object(O.o)({pubkey:An,account:Object(O.o)({executable:Object(O.d)(),owner:An,lamports:Object(O.j)(),data:Hn,rentEpoch:Object(O.j)()})}))),Cn(Object(O.b)(Object(O.o)({lamports:Object(O.j)(),address:An}))),Object(O.o)({executable:Object(O.d)(),owner:An,lamports:Object(O.j)(),data:En,rentEpoch:Object(O.j)()})),Vn=(Object(O.o)({pubkey:An,account:Jn}),Object(O.e)(Object(O.p)([Object(O.g)(m.Buffer),Hn]),Object(O.p)([Mn,Hn]),(function(e){return Array.isArray(e)?Object(O.f)(e,En):e}))),Wn=Object(O.o)({executable:Object(O.d)(),owner:An,lamports:Object(O.j)(),data:Vn,rentEpoch:Object(O.j)()}),Kn=(Object(O.o)({pubkey:An,account:Wn}),Object(O.o)({state:Object(O.p)([Object(O.h)("active"),Object(O.h)("inactive"),Object(O.h)("activating"),Object(O.h)("deactivating")]),active:Object(O.j)(),inactive:Object(O.j)()}),In(Object(O.b)(Object(O.o)({signature:Object(O.m)(),slot:Object(O.j)(),err:Ln,memo:Object(O.i)(Object(O.m)()),blockTime:Object(O.k)(Object(O.i)(Object(O.j)()))}))),In(Object(O.b)(Object(O.o)({signature:Object(O.m)(),slot:Object(O.j)(),err:Ln,memo:Object(O.i)(Object(O.m)()),blockTime:Object(O.k)(Object(O.i)(Object(O.j)()))}))),Object(O.o)({subscription:Object(O.j)(),result:Rn(Jn)}),Object(O.o)({pubkey:An,account:Jn})),Gn=(Object(O.o)({subscription:Object(O.j)(),result:Rn(Kn)}),Object(O.o)({parent:Object(O.j)(),slot:Object(O.j)(),root:Object(O.j)()})),Zn=(Object(O.o)({subscription:Object(O.j)(),result:Gn}),Object(O.p)([Object(O.o)({type:Object(O.p)([Object(O.h)("firstShredReceived"),Object(O.h)("completed"),Object(O.h)("optimisticConfirmation"),Object(O.h)("root")]),slot:Object(O.j)(),timestamp:Object(O.j)()}),Object(O.o)({type:Object(O.h)("createdBank"),parent:Object(O.j)(),slot:Object(O.j)(),timestamp:Object(O.j)()}),Object(O.o)({type:Object(O.h)("frozen"),slot:Object(O.j)(),timestamp:Object(O.j)(),stats:Object(O.o)({numTransactionEntries:Object(O.j)(),numSuccessfulTransactions:Object(O.j)(),numFailedTransactions:Object(O.j)(),maxTransactionsPerEntry:Object(O.j)()})}),Object(O.o)({type:Object(O.h)("dead"),slot:Object(O.j)(),timestamp:Object(O.j)(),err:Object(O.m)()})])),Xn=(Object(O.o)({subscription:Object(O.j)(),result:Zn}),Object(O.o)({subscription:Object(O.j)(),result:Rn(Object(O.p)([zn,Fn]))}),Object(O.o)({subscription:Object(O.j)(),result:Object(O.j)()}),Object(O.o)({pubkey:Object(O.m)(),gossip:Object(O.i)(Object(O.m)()),tpu:Object(O.i)(Object(O.m)()),rpc:Object(O.i)(Object(O.m)()),version:Object(O.i)(Object(O.m)())}),Object(O.o)({votePubkey:Object(O.m)(),nodePubkey:Object(O.m)(),activatedStake:Object(O.j)(),epochVoteAccount:Object(O.d)(),epochCredits:Object(O.b)(Object(O.n)([Object(O.j)(),Object(O.j)(),Object(O.j)()])),commission:Object(O.j)(),lastVote:Object(O.j)(),rootSlot:Object(O.i)(Object(O.j)())})),Yn=(In(Object(O.o)({current:Object(O.b)(Xn),delinquent:Object(O.b)(Xn)})),Object(O.p)([Object(O.h)("processed"),Object(O.h)("confirmed"),Object(O.h)("finalized")])),$n=Object(O.o)({slot:Object(O.j)(),confirmations:Object(O.i)(Object(O.j)()),err:Ln,confirmationStatus:Object(O.k)(Yn)}),Qn=(Cn(Object(O.b)(Object(O.i)($n))),In(Object(O.j)()),Object(O.o)({signatures:Object(O.b)(Object(O.m)()),message:Object(O.o)({accountKeys:Object(O.b)(Object(O.m)()),header:Object(O.o)({numRequiredSignatures:Object(O.j)(),numReadonlySignedAccounts:Object(O.j)(),numReadonlyUnsignedAccounts:Object(O.j)()}),instructions:Object(O.b)(Object(O.o)({accounts:Object(O.b)(Object(O.j)()),data:Object(O.m)(),programIdIndex:Object(O.j)()})),recentBlockhash:Object(O.m)()})})),er=Object(O.o)({parsed:Object(O.q)(),program:Object(O.m)(),programId:An}),tr=Object(O.o)({accounts:Object(O.b)(An),data:Object(O.m)(),programId:An}),nr=Object(O.p)([tr,er]),rr=Object(O.p)([Object(O.o)({parsed:Object(O.q)(),program:Object(O.m)(),programId:Object(O.m)()}),Object(O.o)({accounts:Object(O.b)(Object(O.m)()),data:Object(O.m)(),programId:Object(O.m)()})]),ar=Object(O.e)(nr,rr,(function(e){return"accounts"in e?Object(O.f)(e,tr):Object(O.f)(e,er)})),ir=Object(O.o)({signatures:Object(O.b)(Object(O.m)()),message:Object(O.o)({accountKeys:Object(O.b)(Object(O.o)({pubkey:An,signer:Object(O.d)(),writable:Object(O.d)()})),instructions:Object(O.b)(ar),recentBlockhash:Object(O.m)()})}),or=Object(O.o)({accountIndex:Object(O.j)(),mint:Object(O.m)(),uiTokenAmount:qn}),sr=Object(O.o)({err:Ln,fee:Object(O.j)(),innerInstructions:Object(O.k)(Object(O.i)(Object(O.b)(Object(O.o)({index:Object(O.j)(),instructions:Object(O.b)(Object(O.o)({accounts:Object(O.b)(Object(O.j)()),data:Object(O.m)(),programIdIndex:Object(O.j)()}))})))),preBalances:Object(O.b)(Object(O.j)()),postBalances:Object(O.b)(Object(O.j)()),logMessages:Object(O.k)(Object(O.i)(Object(O.b)(Object(O.m)()))),preTokenBalances:Object(O.k)(Object(O.i)(Object(O.b)(or))),postTokenBalances:Object(O.k)(Object(O.i)(Object(O.b)(or)))}),ur=Object(O.o)({err:Ln,fee:Object(O.j)(),innerInstructions:Object(O.k)(Object(O.i)(Object(O.b)(Object(O.o)({index:Object(O.j)(),instructions:Object(O.b)(ar)})))),preBalances:Object(O.b)(Object(O.j)()),postBalances:Object(O.b)(Object(O.j)()),logMessages:Object(O.k)(Object(O.i)(Object(O.b)(Object(O.m)()))),preTokenBalances:Object(O.k)(Object(O.i)(Object(O.b)(or))),postTokenBalances:Object(O.k)(Object(O.i)(Object(O.b)(or)))}),cr=(In(Object(O.i)(Object(O.o)({blockhash:Object(O.m)(),previousBlockhash:Object(O.m)(),parentSlot:Object(O.j)(),transactions:Object(O.b)(Object(O.o)({transaction:Qn,meta:Object(O.i)(sr)})),rewards:Object(O.k)(Object(O.b)(Object(O.o)({pubkey:Object(O.m)(),lamports:Object(O.j)(),postBalance:Object(O.i)(Object(O.j)()),rewardType:Object(O.i)(Object(O.m)())}))),blockTime:Object(O.i)(Object(O.j)())}))),In(Object(O.i)(Object(O.o)({blockhash:Object(O.m)(),previousBlockhash:Object(O.m)(),parentSlot:Object(O.j)(),signatures:Object(O.b)(Object(O.m)()),blockTime:Object(O.i)(Object(O.j)())}))),In(Object(O.i)(Object(O.o)({slot:Object(O.j)(),meta:sr,blockTime:Object(O.k)(Object(O.i)(Object(O.j)())),transaction:Qn}))),In(Object(O.i)(Object(O.o)({slot:Object(O.j)(),transaction:ir,meta:Object(O.i)(ur),blockTime:Object(O.k)(Object(O.i)(Object(O.j)()))}))),Cn(Object(O.o)({blockhash:Object(O.m)(),feeCalculator:Object(O.o)({lamportsPerSignature:Object(O.j)()})})),Object(O.o)({slot:Object(O.j)(),numTransactions:Object(O.j)(),numSlots:Object(O.j)(),samplePeriodSecs:Object(O.j)()})),fr=(In(Object(O.b)(cr)),Cn(Object(O.i)(Object(O.o)({feeCalculator:Object(O.o)({lamportsPerSignature:Object(O.j)()})}))),In(Object(O.m)()),In(Object(O.m)()),Object(O.o)({err:Ln,logs:Object(O.b)(Object(O.m)()),signature:Object(O.m)()})),dr=(Object(O.o)({result:Rn(fr),subscription:Object(O.j)()}),function(){function e(t){Object(d.a)(this,e),this._keypair=void 0,this._keypair=t||y.a.sign.keyPair()}return Object(l.a)(e,[{key:"publicKey",get:function(){return new Gt(this._keypair.publicKey)}},{key:"secretKey",get:function(){return this._keypair.secretKey}}],[{key:"generate",value:function(){return new e(y.a.sign.keyPair())}},{key:"fromSecretKey",value:function(t,n){var r=y.a.sign.keyPair.fromSecretKey(t);if(!n||!n.skipValidation){var a=(new TextEncoder).encode("@solana/web3.js-validation-v1"),i=y.a.sign.detached(a,r.secretKey);if(!y.a.sign.detached.verify(a,i,r.publicKey))throw new Error("provided secretKey is invalid")}return new e(r)}},{key:"fromSeed",value:function(t){return new e(y.a.sign.keyPair.fromSeed(t))}}]),e}()),lr=_.struct([_.u8("numSignatures"),_.u8("padding"),_.u16("signatureOffset"),_.u16("signatureInstructionIndex"),_.u16("publicKeyOffset"),_.u16("publicKeyInstructionIndex"),_.u16("messageDataOffset"),_.u16("messageDataSize"),_.u16("messageInstructionIndex")]),pr=function(){function e(){Object(d.a)(this,e)}return Object(l.a)(e,null,[{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,a=t.signature,i=t.instructionIndex;on(32===n.length,"Public Key must be ".concat(32," bytes but received ").concat(n.length," bytes")),on(64===a.length,"Signature must be ".concat(64," bytes but received ").concat(a.length," bytes"));var o=lr.span,s=o+n.length,u=s+a.length,c=m.Buffer.alloc(u+r.length);return lr.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:i,publicKeyOffset:o,publicKeyInstructionIndex:i,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:i},c),c.fill(n,o),c.fill(a,s),c.fill(r,u),new cn({keys:[],programId:e.programId,data:c})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;on(64===t.length,"Private key must be ".concat(64," bytes but received ").concat(t.length," bytes"));try{var a=dr.fromSecretKey(t),i=a.publicKey.toBytes(),o=y.a.sign.detached(n,a.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:o,instructionIndex:r})}catch(s){throw new Error("Error creating instruction; ".concat(s))}}}]),e}();pr.programId=new Gt("Ed25519SigVerify111111111111111111111111111");var br=new Gt("StakeConfig11111111111111111111111111111111"),hr=Object(l.a)((function e(t,n,r){Object(d.a)(this,e),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}));hr.default=new hr(0,0,Gt.default);var yr=Object.freeze({Initialize:{index:0,layout:_.struct([_.u32("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"authorized";return _.struct([en("staker"),en("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return _.struct([_.ns64("unixTimestamp"),_.ns64("epoch"),en("custodian")],e)}()])},Authorize:{index:1,layout:_.struct([_.u32("instruction"),en("newAuthorized"),_.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:_.struct([_.u32("instruction")])},Split:{index:3,layout:_.struct([_.u32("instruction"),_.ns64("lamports")])},Withdraw:{index:4,layout:_.struct([_.u32("instruction"),_.ns64("lamports")])},Deactivate:{index:5,layout:_.struct([_.u32("instruction")])},Merge:{index:7,layout:_.struct([_.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:_.struct([_.u32("instruction"),en("newAuthorized"),_.u32("stakeAuthorizationType"),tn("authoritySeed"),en("authorityOwner")])}}),mr=(Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),function(){function e(){Object(d.a)(this,e)}return Object(l.a)(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup||hr.default,a=vn(yr.Initialize,{authorized:{staker:E(n.staker.toBuffer()),withdrawer:E(n.withdrawer.toBuffer())},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:E(r.custodian.toBuffer())}}),i={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:pn,isSigner:!1,isWritable:!1}],programId:this.programId,data:a};return new cn(i)}},{key:"createAccountWithSeed",value:function(e){var t=new fn;t.add(_n.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,a=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:a}))}},{key:"createAccount",value:function(e){var t=new fn;t.add(_n.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,a=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:a}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,a=vn(yr.Delegate);return(new fn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:bn,isSigner:!1,isWritable:!1},{pubkey:br,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,a=e.stakeAuthorizationType,i=e.custodianPubkey,o=vn(yr.Authorize,{newAuthorized:E(r.toBuffer()),stakeAuthorizationType:a.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return i&&s.push({pubkey:i,isSigner:!1,isWritable:!1}),(new fn).add({keys:s,programId:this.programId,data:o})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,a=e.authorityOwner,i=e.newAuthorizedPubkey,o=e.stakeAuthorizationType,s=e.custodianPubkey,u=vn(yr.AuthorizeWithSeed,{newAuthorized:E(i.toBuffer()),stakeAuthorizationType:o.index,authoritySeed:r,authorityOwner:E(a.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:dn,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!1,isWritable:!1}),(new fn).add({keys:c,programId:this.programId,data:u})}},{key:"split",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,a=e.lamports,i=new fn;i.add(_n.createAccount({fromPubkey:n,newAccountPubkey:r,lamports:0,space:this.space,programId:this.programId}));var o=vn(yr.Split,{lamports:a});return i.add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"merge",value:function(e){var t=e.stakePubkey,n=e.sourceStakePubKey,r=e.authorizedPubkey,a=vn(yr.Merge);return(new fn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:bn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,a=e.lamports,i=e.custodianPubkey,o=vn(yr.Withdraw,{lamports:a}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:bn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return i&&s.push({pubkey:i,isSigner:!1,isWritable:!1}),(new fn).add({keys:s,programId:this.programId,data:o})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=vn(yr.Deactivate);return(new fn).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}]),e}());mr.programId=new Gt("Stake11111111111111111111111111111111111111"),mr.space=200;var vr=x.a.publicKeyCreate,gr=x.a.ecdsaSign,wr=_.struct([_.u8("numSignatures"),_.u16("signatureOffset"),_.u8("signatureInstructionIndex"),_.u16("ethAddressOffset"),_.u8("ethAddressInstructionIndex"),_.u16("messageDataOffset"),_.u16("messageDataSize"),_.u8("messageInstructionIndex"),_.blob(20,"ethAddress"),_.blob(64,"signature"),_.u8("recoveryId")]),Tr=function(){function e(){Object(d.a)(this,e)}return Object(l.a)(e,null,[{key:"publicKeyToEthAddress",value:function(e){on(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return m.Buffer.from(M.a.keccak_256.update(E(e)).digest()).slice(-20)}catch(t){throw new Error("Error constructing Ethereum address: ".concat(t))}}},{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,a=t.signature,i=t.recoveryId,o=t.instructionIndex;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:a,recoveryId:i,instructionIndex:o})}},{key:"createInstructionWithEthAddress",value:function(t){var n,r=t.ethAddress,a=t.message,i=t.signature,o=t.recoveryId,s=t.instructionIndex,u=void 0===s?0:s;on(20===(n="string"===typeof r?r.startsWith("0x")?m.Buffer.from(r.substr(2),"hex"):m.Buffer.from(r,"hex"):r).length,"Address must be ".concat(20," bytes but received ").concat(n.length," bytes"));var c=12+n.length,f=c+i.length+1,d=m.Buffer.alloc(wr.span+a.length);return wr.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:u,ethAddressOffset:12,ethAddressInstructionIndex:u,messageDataOffset:f,messageDataSize:a.length,messageInstructionIndex:u,signature:E(i),ethAddress:E(n),recoveryId:o},d),d.fill(E(a),wr.span),new cn({keys:[],programId:e.programId,data:d})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;on(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{var a=E(t),i=vr(a,!1).slice(1),o=m.Buffer.from(M.a.keccak_256.update(E(n)).digest()),s=gr(o,a),u=s.signature,c=s.recid;return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:u,recoveryId:c,instructionIndex:r})}catch(f){throw new Error("Error creating instruction; ".concat(f))}}}]),e}();Tr.programId=new Gt("KeccakSecp256k11111111111111111111111111111");new Gt("Va1idator1nfo111111111111111111111111111111"),Object(O.o)({name:Object(O.m)(),website:Object(O.k)(Object(O.m)()),details:Object(O.k)(Object(O.m)()),keybaseUsername:Object(O.k)(Object(O.m)())}),new Gt("Vote111111111111111111111111111111111111111"),_.struct([en("nodePubkey"),en("authorizedVoterPubkey"),en("authorizedWithdrawerPubkey"),_.u8("commission"),_.nu64(),_.seq(_.struct([_.nu64("slot"),_.u32("confirmationCount")]),_.offset(_.u32(),-8),"votes"),_.u8("rootSlotValid"),_.nu64("rootSlot"),_.nu64("epoch"),_.nu64("credits"),_.nu64("lastEpochCredits"),_.nu64(),_.seq(_.struct([_.nu64("epoch"),_.nu64("credits"),_.nu64("prevCredits")]),_.offset(_.u32(),-8),"epochCredits")])}).call(this,n(35))},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function s(e){r(o,a,i,s,u,"next",e)}function u(e){r(o,a,i,s,u,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();t.__esModule=!0,t.s16=t.s8=t.nu64be=t.u48be=t.u40be=t.u32be=t.u24be=t.u16be=t.nu64=t.u48=t.u40=t.u32=t.u24=t.u16=t.u8=t.offset=t.greedy=t.Constant=t.UTF8=t.CString=t.Blob=t.Boolean=t.BitField=t.BitStructure=t.VariantLayout=t.Union=t.UnionLayoutDiscriminator=t.UnionDiscriminator=t.Structure=t.Sequence=t.DoubleBE=t.Double=t.FloatBE=t.Float=t.NearInt64BE=t.NearInt64=t.NearUInt64BE=t.NearUInt64=t.IntBE=t.Int=t.UIntBE=t.UInt=t.OffsetLayout=t.GreedyCount=t.ExternalLayout=t.bindConstructorLayout=t.nameWithProperty=t.Layout=t.uint8ArrayToBuffer=t.checkUint8Array=void 0,t.constant=t.utf8=t.cstr=t.blob=t.unionLayoutDiscriminator=t.union=t.seq=t.bits=t.struct=t.f64be=t.f64=t.f32be=t.f32=t.ns64be=t.s48be=t.s40be=t.s32be=t.s24be=t.s16be=t.ns64=t.s48=t.s40=t.s32=t.s24=void 0;var a=n(21);function i(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function o(e){return i(e),a.Buffer.from(e.buffer,e.byteOffset,e.length)}t.checkUint8Array=i,t.uint8ArrayToBuffer=o;var s=function(){function e(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}return e.prototype.makeDestinationObject=function(){return{}},e.prototype.decode=function(e,t){throw new Error("Layout is abstract")},e.prototype.encode=function(e,t,n){throw new Error("Layout is abstract")},e.prototype.getSpan=function(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span},e.prototype.replicate=function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t},e.prototype.fromArray=function(e){},e}();function u(e,t){return t.property?e+"["+t.property+"]":e}t.Layout=s,t.nameWithProperty=u,t.bindConstructorLayout=function(e,t){if("function"!==typeof e)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof s))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.isCount=function(){throw new Error("ExternalLayout is abstract")},t}(s);t.ExternalLayout=c;var f=function(e){function t(t,n){var r=this;if(void 0===t&&(t=1),!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");return(r=e.call(this,-1,n)||this).elementSpan=t,r}return r(t,e),t.prototype.isCount=function(){return!0},t.prototype.decode=function(e,t){i(e),void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)},t.prototype.encode=function(e,t,n){return 0},t}(c);t.GreedyCount=f;var d=function(e){function t(t,n,r){var a=this;if(!(t instanceof s))throw new TypeError("layout must be a Layout");if(void 0===n)n=0;else if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");return(a=e.call(this,t.span,r||t.property)||this).layout=t,a.offset=n,a}return r(t,e),t.prototype.isCount=function(){return this.layout instanceof l||this.layout instanceof p},t.prototype.decode=function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)},t.prototype.encode=function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)},t}(c);t.OffsetLayout=d;var l=function(e){function t(t,n){var r=e.call(this,t,n)||this;if(6u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}var c=-1;try{c=t.reduce((function(e,t){return e+t.getSpan()}),0)}catch(f){}return(a=e.call(this,c,n)||this).fields=t,a.decodePrefixes=!!r,a}return r(t,e),t.prototype.getSpan=function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var a=r.getSpan(e,t);return t+=a,n+a}),0)}catch(r){throw new RangeError("indeterminate span")}return n},t.prototype.decode=function(e,t){i(e),void 0===t&&(t=0);for(var n=this.makeDestinationObject(),r=0,a=this.fields;rc&&(c=u.getSpan(t,n)))}a=n,n+=c}return a+i-r},t.prototype.fromArray=function(e){for(var t=this.makeDestinationObject(),n=0,r=this.fields;na.span?t=-1:0<=t&&(t+=a.span)}},t}(s);t.Structure=M;var E=function(){function e(e){this.property=e}return e.prototype.decode=function(e,t){throw new Error("UnionDiscriminator is abstract")},e.prototype.encode=function(e,t,n){throw new Error("UnionDiscriminator is abstract")},e}();t.UnionDiscriminator=E;var P=function(e){function t(t,n){var r=this;if(!(t instanceof c&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(r=e.call(this,n||t.property||"variant")||this).layout=t,r}return r(t,e),t.prototype.decode=function(e,t){return this.layout.decode(e,t)},t.prototype.encode=function(e,t,n){return this.layout.encode(e,t,n)},t}(E);t.UnionLayoutDiscriminator=P;var j=function(e){function t(t,n,r){var a,i=this,o=t instanceof l||t instanceof p;if(o)a=new P(new d(t));else if(t instanceof c&&t.isCount())a=new P(t);else{if(!(t instanceof E))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");a=t}if(void 0===n&&(n=null),!(null===n||n instanceof s))throw new TypeError("defaultLayout must be null or a Layout");if(null!==n){if(0>n.span)throw new Error("defaultLayout must have constant span");void 0===n.property&&(n=n.replicate("content"))}var u=-1;n&&0<=(u=n.span)&&o&&(u+=a.layout.span),(i=e.call(this,u,r)||this).discriminator=a,i.usesPrefixDiscriminator=o,i.defaultLayout=n,i.registry={};var f=i.defaultGetSourceVariant.bind(i);return i.getSourceVariant=function(e){return f(e)},i.configGetSourceVariant=function(e){f=e.bind(this)},i}return r(t,e),t.prototype.getSpan=function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)},t.prototype.defaultGetSourceVariant=function(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;if((n=this.registry[e[this.discriminator.property]])&&(!n.layout||n.property&&Object.prototype.hasOwnProperty.call(e,n.property)))return n}else for(var t in this.registry){var n;if((n=this.registry[t]).property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw new Error("unable to infer src variant")},t.prototype.decode=function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,a=r.decode(e,t),i=this.registry[a];if(void 0===i){var o=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=r.layout.span),(n=this.makeDestinationObject())[r.property]=a,n[o.property]=o.decode(e,t+s)}else n=i.decode(e,t);return n},t.prototype.encode=function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var a=this.discriminator,i=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=a.layout.span),a.encode(e[a.property],t,n),o+i.encode(e[i.property],t,n+o)}return r.encode(e,t,n)},t.prototype.addVariant=function(e,t,n){var r=new I(this,e,t,n);return this.registry[e]=r,r},t.prototype.getVariant=function(e,t){var n;return e instanceof Uint8Array?(void 0===t&&(t=0),n=this.discriminator.decode(e,t)):n=e,this.registry[n]},t}(s);t.Union=j;var I=function(e){function t(t,n,r,a){var i=this;if(!(t instanceof j))throw new TypeError("union must be a Union");if(!Number.isInteger(n)||0>n)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof r&&void 0===a&&(a=r,r=null),r){if(!(r instanceof s))throw new TypeError("layout must be a Layout");if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof a)throw new TypeError("variant must have a String property")}var o=t.span;return 0>t.span&&0<=(o=r?r.span:0)&&t.usesPrefixDiscriminator&&(o+=t.discriminator.layout.span),(i=e.call(this,o,a)||this).union=t,i.variant=n,i.layout=r||null,i}return r(t,e),t.prototype.getSpan=function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);var r=0;return this.layout&&(r=this.layout.getSpan(e,t+n)),n+r},t.prototype.decode=function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);var a=this.property;return this.layout?n[a]=this.layout.decode(e,t+r):a?n[a]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n},t.prototype.encode=function(e,t,n){void 0===n&&(n=0);var r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);var a=this.property;if(this.layout&&!Object.prototype.hasOwnProperty.call(e,a))throw new TypeError("variant lacks property "+a);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[a],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i},t.prototype.fromArray=function(e){if(this.layout)return this.layout.fromArray(e)},t}(s);function C(e){return 0>e&&(e+=4294967296),e}t.VariantLayout=I;var R=function(e){function t(t,n,r){var a=this;if(!(t instanceof l||t instanceof p))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof n&&void 0===r&&(r=n,n=!1),4=t)throw new TypeError("bits must be positive integer");var r=8*e.span,a=e.fields.reduce((function(e,t){return e+t.bits}),0);if(t+a>r)throw new Error("bits too long for span remainder ("+(r-a)+" of "+r+" remain)");this.container=e,this.bits=t,this.valueMask=(1<>>this.start},e.prototype.encode=function(e){if(!Number.isInteger(e)||e!==C(e&this.valueMask))throw new TypeError(u("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=C(e<n&&(n=this.length.decode(e,t)),n},t.prototype.decode=function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),o(e).slice(t,t+n)},t.prototype.encode=function(e,t,n){var r=this.length;if(this.length instanceof c&&(r=e.length),!(e instanceof Uint8Array&&r===e.length))throw new TypeError(u("Blob.encode",this)+" requires (length "+r+") Uint8Array as src");if(n+r>t.length)throw new RangeError("encoding overruns Uint8Array");var a=o(e);return o(t).write(a.toString("hex"),n,r,"hex"),this.length instanceof c&&this.length.encode(r,t,n),r},t}(s);t.Blob=B;var U=function(e){function t(t){return e.call(this,-1,t)||this}return r(t,e),t.prototype.getSpan=function(e,t){i(e),void 0===t&&(t=0);for(var n=t;nt.length)throw new RangeError("encoding overruns Buffer");var s=o(t);return r.copy(s,n),s[n+i]=0,i+1},t}(s);t.CString=U;var L=function(e){function t(t,n){var r=this;if("string"===typeof t&&void 0===n&&(n=t,t=void 0),void 0===t)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");return(r=e.call(this,-1,n)||this).maxSpan=t,r}return r(t,e),t.prototype.getSpan=function(e,t){return i(e),void 0===t&&(t=0),e.length-t},t.prototype.decode=function(e,t){void 0===t&&(t=0);var n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(o(t),n),i},t}(s);t.UTF8=L;var z=function(e){function t(t,n){var r=e.call(this,0,n)||this;return r.value=t,r}return r(t,e),t.prototype.decode=function(e,t){return this.value},t.prototype.encode=function(e,t,n){return 0},t}(s);t.Constant=z,t.greedy=function(e,t){return new f(e,t)},t.offset=function(e,t,n){return new d(e,t,n)},t.u8=function(e){return new l(1,e)},t.u16=function(e){return new l(2,e)},t.u24=function(e){return new l(3,e)},t.u32=function(e){return new l(4,e)},t.u40=function(e){return new l(5,e)},t.u48=function(e){return new l(6,e)},t.nu64=function(e){return new g(e)},t.u16be=function(e){return new p(2,e)},t.u24be=function(e){return new p(3,e)},t.u32be=function(e){return new p(4,e)},t.u40be=function(e){return new p(5,e)},t.u48be=function(e){return new p(6,e)},t.nu64be=function(e){return new w(e)},t.s8=function(e){return new b(1,e)},t.s16=function(e){return new b(2,e)},t.s24=function(e){return new b(3,e)},t.s32=function(e){return new b(4,e)},t.s40=function(e){return new b(5,e)},t.s48=function(e){return new b(6,e)},t.ns64=function(e){return new T(e)},t.s16be=function(e){return new h(2,e)},t.s24be=function(e){return new h(3,e)},t.s32be=function(e){return new h(4,e)},t.s40be=function(e){return new h(5,e)},t.s48be=function(e){return new h(6,e)},t.ns64be=function(e){return new k(e)},t.f32=function(e){return new _(e)},t.f32be=function(e){return new O(e)},t.f64=function(e){return new S(e)},t.f64be=function(e){return new x(e)},t.struct=function(e,t,n){return new M(e,t,n)},t.bits=function(e,t,n){return new R(e,t,n)},t.seq=function(e,t,n){return new A(e,t,n)},t.union=function(e,t,n){return new j(e,t,n)},t.unionLayoutDiscriminator=function(e,t){return new P(e,t)},t.blob=function(e,t){return new B(e,t)},t.cstr=function(e){return new U(e)},t.utf8=function(e,t){return new L(e,t)},t.constant=function(e,t){return new z(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return S})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return P})),n.d(t,"e",(function(){return j})),n.d(t,"f",(function(){return D})),n.d(t,"g",(function(){return r})),n.d(t,"h",(function(){return U})),n.d(t,"i",(function(){return L})),n.d(t,"j",(function(){return J})),n.d(t,"k",(function(){return R}));var r,a,i=n(4),o=n.n(i),s=n(17),u=n(400),c=n.n(u),f=n(260),d=n.n(f),l=n(224),p=n.n(l),b=n(31);!function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(r||(r={})),function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(a||(a={}));var h,y,m=o.a.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function v(e,t){for(var n=0;n0||Object(s.a)(!1),T.set({precision:e+1,rounding:_[n]});var r=new T(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return r.toFormat(r.decimalPlaces(),t)},t.toFixed=function(e,t,n){return void 0===t&&(t={groupSeparator:""}),void 0===n&&(n=a.ROUND_HALF_UP),Number.isInteger(e)||Object(s.a)(!1),e>=0||Object(s.a)(!1),k.DP=e,k.RM=O[n],new k(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)},g(e,[{key:"quotient",get:function(){return o.a.divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new e(o.a.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new e(this.numerator,this.denominator)}}]),e}(),x=p()(d.a),A=function(e){function t(t,n,r){var a;return a=e.call(this,n,r)||this,o.a.lessThanOrEqual(a.quotient,m)||Object(s.a)(!1),a.currency=t,a.decimalScale=o.a.exponentiate(o.a.BigInt(10),o.a.BigInt(t.decimals)),a}w(t,e),t.fromRawAmount=function(e,n){return new t(e,n)},t.fromFractionalAmount=function(e,n,r){return new t(e,n,r)};var n=t.prototype;return n.add=function(n){this.currency.equals(n.currency)||Object(s.a)(!1);var r=e.prototype.add.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.subtract=function(n){this.currency.equals(n.currency)||Object(s.a)(!1);var r=e.prototype.subtract.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.multiply=function(n){var r=e.prototype.multiply.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.divide=function(n){var r=e.prototype.divide.call(this,n);return t.fromFractionalAmount(this.currency,r.numerator,r.denominator)},n.toSignificant=function(t,n,r){return void 0===t&&(t=6),void 0===r&&(r=a.ROUND_DOWN),e.prototype.divide.call(this,this.decimalScale).toSignificant(t,n,r)},n.toFixed=function(t,n,r){return void 0===t&&(t=this.currency.decimals),void 0===r&&(r=a.ROUND_DOWN),t<=this.currency.decimals||Object(s.a)(!1),e.prototype.divide.call(this,this.decimalScale).toFixed(t,n,r)},n.toExact=function(e){return void 0===e&&(e={groupSeparator:""}),x.DP=this.currency.decimals,new x(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(e)},g(t,[{key:"wrapped",get:function(){return this.currency.isToken?this:t.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),t}(S),M=new S(o.a.BigInt(100));function E(e){return new P(e.numerator,e.denominator)}var P=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isPercent=!0,t}w(t,e);var n=t.prototype;return n.add=function(t){return E(e.prototype.add.call(this,t))},n.subtract=function(t){return E(e.prototype.subtract.call(this,t))},n.multiply=function(t){return E(e.prototype.multiply.call(this,t))},n.divide=function(t){return E(e.prototype.divide.call(this,t))},n.toSignificant=function(t,n,r){return void 0===t&&(t=5),e.prototype.multiply.call(this,M).toSignificant(t,n,r)},n.toFixed=function(t,n,r){return void 0===t&&(t=2),e.prototype.multiply.call(this,M).toFixed(t,n,r)},t}(S),j=function(e){function t(){for(var t,n,r,a,i,s=arguments.length,u=new Array(s),c=0;c=0&&t<255&&Number.isInteger(t)||Object(s.a)(!1),this.chainId=e,this.decimals=t,this.symbol=n,this.name=r},C=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isNative=!0,t.isToken=!1,t}return w(t,e),t}(I);function R(e){try{return Object(b.getAddress)(e)}catch(t){throw new Error(e+" is not a valid address.")}}var N,D=function(e){function t(t,n,r,a,i){var o;return(o=e.call(this,t,r,a,i)||this).isNative=!1,o.isToken=!0,o.address=R(n),o}w(t,e);var n=t.prototype;return n.equals=function(e){return e.isToken&&this.chainId===e.chainId&&this.address===e.address},n.sortsBefore=function(e){return this.chainId!==e.chainId&&Object(s.a)(!1),this.address===e.address&&Object(s.a)(!1),this.address.toLowerCase()0||Object(s.a)(!1),e.length<=n||Object(s.a)(!1),0===e.length)return e.push(t),null;var a=e.length===n;if(a&&r(e[e.length-1],t)<=0)return t;for(var i=0,o=e.length;i>>1;r(e[u],t)<=0?i=u+1:o=u}return e.splice(i,0,t),a?e.pop():null}(function(e){function t(t){return e.call(this,t,18,"ETH","Ether")||this}return w(t,e),t.onChain=function(e){var n;return null!=(n=this._etherCache[e])?n:this._etherCache[e]=new t(e)},t.prototype.equals=function(e){return e.isNative&&e.chainId===this.chainId},g(t,[{key:"wrapped",get:function(){var e=B[this.chainId];return e||Object(s.a)(!1),e}}]),t}(C))._etherCache={};var z=o.a.BigInt(Number.MAX_SAFE_INTEGER),F=o.a.BigInt(0),q=o.a.BigInt(1),H=o.a.BigInt(2);function J(e){if(o.a.greaterThanOrEqual(e,F)||Object(s.a)(!1),o.a.lessThan(e,z))return o.a.BigInt(Math.floor(Math.sqrt(o.a.toNumber(e))));var t,n;for(t=e,n=o.a.add(o.a.divide(e,H),q);o.a.lessThan(n,t);)t=n,n=o.a.divide(o.a.add(o.a.divide(e,n),n),H);return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(121);function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(49),a=n(212),i=n(110),o=n(27);function s(e,t){if(t&&("object"===Object(i.a)(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Object(o.a)(e)}function u(e){var t=Object(a.a)();return function(){var n,a=Object(r.a)(e);if(t){var i=Object(r.a)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return s(this,n)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r="Invariant failed";function a(e,t){if(!e)throw new Error(r)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(120);function a(e,t){if(null==e)return{};var n,a,i=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";e.exports=n(700)},function(e,t,n){"use strict";e.exports=n(479)},function(e,t,n){"use strict";(function(e){var r=n(445),a=n(446),i=n(277);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function b(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 F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function h(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 P(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return E(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,a){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=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,a);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,a){var i,o=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;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var f=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var d=!0,l=0;la&&(r=a):r=a;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o>8,a=n%256,i.push(a),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function x(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a239?4:c>223?3:c>191?2:1;if(a+d<=n)switch(d){case 1:c<128&&(f=c);break;case 2:128===(192&(i=e[a+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=e[a+1],o=e[a+2],128===(192&i)&&128===(192&o)&&(u=(15&c)<<12|(63&i)<<6|63&o)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128===(192&i)&&128===(192&o)&&128===(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),a+=d}return function(e){var t=e.length;if(t<=A)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,a){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===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(i,o),c=this.slice(r,a),f=e.slice(t,n),d=0;da)&&(n=a),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 g(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return T(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(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)}};var A=4096;function M(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;ar)&&(n=r);for(var a="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,n,r,a,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-n,2);a>>8*(r?a:1-a)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-n,4);a>>8*(r?a:3-a)&255}function D(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,i){return i||D(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||D(e,0,n,8),a.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&&(a*=256);)r+=this[e+--t]*a;return r},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(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||I(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||I(e,t,this.length);for(var r=this[e],a=1,i=0;++i=(a*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(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||I(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||I(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||I(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||I(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||C(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||C(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||C(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||C(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||C(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 a=Math.pow(2,8*n-1);C(this,e,t,n,a-1,-a)}var i=0,o=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 a=Math.pow(2,8*n-1);C(this,e,t,n,a-1,-a)}var i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||C(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||C(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||C(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||C(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 B(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(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;--a)e[a+t]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=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 q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function H(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n(35))},function(e,t,n){"use strict";function r(e){var t,n,a="";if("string"===typeof e||"number"===typeof e)a+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t>>=0)&&e<256)&&(r=o[e])?r:(n=c(e,(0|e)<0?-1:0,!0),a&&(o[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(r=i[e])?r:(n=c(e,e<0?-1:0,!1),a&&(i[e]=n),n)}function u(e,t){if(isNaN(e))return t?v:m;if(t){if(e<0)return v;if(e>=b)return _}else{if(e<=-h)return O;if(e+1>=h)return k}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 f=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 m;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 a=u(f(n,8)),i=m,o=0;o>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=s).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},S.isOdd=function(){return 1===(1&this.low)},S.isEven=function(){return 0===(1&this.low)},S.equals=function(e){return a(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(a(e)||(e=l(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},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(g)},S.neg=S.negate,S.add=function(e){a(e)||(e=l(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,o=e.high>>>16,s=65535&e.high,u=e.low>>>16,f=0,d=0,p=0,b=0;return p+=(b+=i+(65535&e.low))>>>16,d+=(p+=r+u)>>>16,f+=(d+=n+s)>>>16,f+=t+o,c((p&=65535)<<16|(b&=65535),(f&=65535)<<16|(d&=65535),this.unsigned)},S.subtract=function(e){return a(e)||(e=l(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return m;if(a(e)||(e=l(e)),n)return c(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return m;if(this.eq(O))return e.isOdd()?O:m;if(e.eq(O))return this.isOdd()?O:m;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(y)&&e.lt(y))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,f=65535&e.high,d=e.low>>>16,p=65535&e.low,b=0,h=0,v=0,g=0;return v+=(g+=o*p)>>>16,h+=(v+=i*p)>>>16,v&=65535,h+=(v+=o*d)>>>16,b+=(h+=r*p)>>>16,h&=65535,b+=(h+=i*d)>>>16,h&=65535,b+=(h+=o*f)>>>16,b+=t*p+r*d+i*f+o*s,c((v&=65535)<<16|(g&=65535),(b&=65535)<<16|(h&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(a(e)||(e=l(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?v:m;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return w;i=v}else{if(this.eq(O))return e.eq(g)||e.eq(T)?O:e.eq(O)?g:(t=this.shr(1).div(e).shl(1)).eq(m)?e.isNegative()?g:T:(r=this.sub(e.mul(t)),i=t.add(r.div(e)));if(e.eq(O))return this.unsigned?v:m;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=m}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),s=o<=48?1:f(2,o-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=g),i=i.add(d),r=r.sub(p)}return i},S.div=S.divide,S.modulo=function(e){return a(e)||(e=l(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))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return c(~this.low,~this.high,this.unsigned)},S.and=function(e){return a(e)||(e=l(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return a(e)||(e=l(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return a(e)||(e=l(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return a(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)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(a(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)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.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]},S.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){var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Any=t.protobufPackage=void 0;var i=a(n(24)),o=a(n(20));t.protobufPackage="google.protobuf";var s={typeUrl:""};t.Any={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.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 o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},s);for(a.value=new Uint8Array;n.pos>>3){case 1:a.typeUrl=n.string();break;case 2:a.value=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},s);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=c(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var i=t.defaultTheme,s=t.withTheme,l=void 0!==s&&s,p=t.name,b=Object(a.a)(t,["defaultTheme","withTheme","name"]);var h=p,y=Object(c.a)(e,Object(r.a)({defaultTheme:i,Component:n,name:p||n.displayName,classNamePrefix:h},b)),m=o.a.forwardRef((function(e,t){e.classes;var s,u=e.innerRef,c=Object(a.a)(e,["classes","innerRef"]),b=y(Object(r.a)({},n.defaultProps,e)),h=c;return("string"===typeof p||l)&&(s=Object(d.a)()||i,p&&(h=Object(f.a)({theme:s,name:p,props:c})),l&&!h.theme&&(h.theme=s)),o.a.createElement(n,Object(r.a)({ref:u||t,classes:b},h))}));return u()(m,n),m}},p=n(152);t.a=function(e,t){return l(e,Object(r.a)({defaultTheme:p.a},t))}},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(207);var a=n(122),i=n(208);function o(e,t){return Object(r.a)(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(u){s=!0,a=u}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return i}}(e,t)||Object(a.a)(e,t)||Object(i.a)()}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return p}));var r=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},a=function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]>1]>>4>=8&&(t[u]=t[u].toUpperCase()),(15&o[u>>1])>=8&&(t[u+1]=t[u+1].toUpperCase());return"0x"+t.join("")}for(var c={},f=0;f<10;f++)c[String(f)]=String(f);for(var d=0;d<26;d++)c[String.fromCharCode(65+d)]=String(10+d);var l,p=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function b(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return c[e]})).join("");t.length>=p;){var n=t.substring(0,p);t=parseInt(n,10)%97+t.substring(n.length)}for(var r=String(98-parseInt(t,10)%97);r.length<2;)r="0"+r;return r}function h(e){var t=null;if("string"!==typeof e&&s.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&s.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==b(e)&&s.throwArgumentError("bad icap checksum","address",e),t=Object(a.c)(e.substring(4));t.length<40;)t="0"+t;t=u("0x"+t)}else s.throwArgumentError("invalid address","address",e);return t}function y(e){try{return h(e),!0}catch(t){}return!1}function m(e){for(var t=Object(a.b)(h(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+b("XE00"+t)+t}function v(e){var t=null;try{t=h(e.from)}catch(u){s.throwArgumentError("missing from address","transaction",e)}var n=Object(r.stripZeros)(Object(r.arrayify)(a.a.from(e.nonce).toHexString()));return h(Object(r.hexDataSlice)(Object(i.keccak256)(Object(o.encode)([t,n])),12))}function g(e,t,n){return 32!==Object(r.hexDataLength)(t)&&s.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(r.hexDataLength)(n)&&s.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),h(Object(r.hexDataSlice)(Object(i.keccak256)(Object(r.concat)(["0xff",h(e),t,n])),12))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(414);function a(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){var r=n(278);e.exports=function(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},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 o,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,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),a=n(80);function i(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(a.a)(e,n),Object(a.a)(t,n)}}),[e,t])}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(122);function a(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},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 o,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,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(433).Buffer}catch(S){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var a=0,i=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.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)a=u(e,t,r)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=t)r++;r--,a=a/t|0;for(var i=e.length-n,o=i%r,s=Math.min(i,i-o)+n,u=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var f=["","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"],d=[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],l=[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 p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,l=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=l;p++){var b=c-p|0;f+=(o=(a=0|e.words[b])*(i=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|f}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?f[6-u.length]+u+n:u+n,(a+=2)>=26&&(a-=26,o--)}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=d[e],p=l[e];n="";var b=this.clone();for(b.negative=0;!b.isZero();){var h=b.modn(p).toString(e);n=(b=b.idivn(p)).isZero()?h+n:f[c-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var a=this.byteLength(),i=n||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,c=new e(i),f=this.clone();if(u){for(s=0;!f.isZero();s++)o=f.andln(255),f.iushrn(8),c[s]=o;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},i.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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.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)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.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)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,a=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 a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,p=0|o[1],b=8191&p,h=p>>>13,y=0|o[2],m=8191&y,v=y>>>13,g=0|o[3],w=8191&g,T=g>>>13,k=0|o[4],_=8191&k,O=k>>>13,S=0|o[5],x=8191&S,A=S>>>13,M=0|o[6],E=8191&M,P=M>>>13,j=0|o[7],I=8191&j,C=j>>>13,R=0|o[8],N=8191&R,D=R>>>13,B=0|o[9],U=8191&B,L=B>>>13,z=0|s[0],F=8191&z,q=z>>>13,H=0|s[1],J=8191&H,V=H>>>13,W=0|s[2],K=8191&W,G=W>>>13,Z=0|s[3],X=8191&Z,Y=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ae=0|s[6],ie=8191&ae,oe=ae>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],be=8191&pe,he=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,F))|0)+((8191&(a=(a=Math.imul(d,q))+Math.imul(l,F)|0))<<13)|0;c=((i=Math.imul(l,q))+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(b,F),a=(a=Math.imul(b,q))+Math.imul(h,F)|0,i=Math.imul(h,q);var me=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,V)|0)+Math.imul(l,J)|0))<<13)|0;c=((i=i+Math.imul(l,V)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,F),a=(a=Math.imul(m,q))+Math.imul(v,F)|0,i=Math.imul(v,q),r=r+Math.imul(b,J)|0,a=(a=a+Math.imul(b,V)|0)+Math.imul(h,J)|0,i=i+Math.imul(h,V)|0;var ve=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(l,K)|0))<<13)|0;c=((i=i+Math.imul(l,G)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,F),a=(a=Math.imul(w,q))+Math.imul(T,F)|0,i=Math.imul(T,q),r=r+Math.imul(m,J)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(v,J)|0,i=i+Math.imul(v,V)|0,r=r+Math.imul(b,K)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(h,K)|0,i=i+Math.imul(h,G)|0;var ge=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(l,X)|0))<<13)|0;c=((i=i+Math.imul(l,Y)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(_,F),a=(a=Math.imul(_,q))+Math.imul(O,F)|0,i=Math.imul(O,q),r=r+Math.imul(w,J)|0,a=(a=a+Math.imul(w,V)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,V)|0,r=r+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(v,K)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(b,X)|0,a=(a=a+Math.imul(b,Y)|0)+Math.imul(h,X)|0,i=i+Math.imul(h,Y)|0;var we=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,Q)|0))<<13)|0;c=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,F),a=(a=Math.imul(x,q))+Math.imul(A,F)|0,i=Math.imul(A,q),r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,V)|0,r=r+Math.imul(w,K)|0,a=(a=a+Math.imul(w,G)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(m,X)|0,a=(a=a+Math.imul(m,Y)|0)+Math.imul(v,X)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var Te=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(a=(a=a+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;c=((i=i+Math.imul(l,re)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(E,F),a=(a=Math.imul(E,q))+Math.imul(P,F)|0,i=Math.imul(P,q),r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,V)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(O,K)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(w,X)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(m,Q)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(b,ne)|0,a=(a=a+Math.imul(b,re)|0)+Math.imul(h,ne)|0,i=i+Math.imul(h,re)|0;var ke=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;c=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,F),a=(a=Math.imul(I,q))+Math.imul(C,F)|0,i=Math.imul(C,q),r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,V)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,G)|0,r=r+Math.imul(_,X)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(O,X)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(m,ne)|0,a=(a=a+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(h,ie)|0,i=i+Math.imul(h,oe)|0;var _e=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(a=(a=a+Math.imul(d,ce)|0)+Math.imul(l,ue)|0))<<13)|0;c=((i=i+Math.imul(l,ce)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,F),a=(a=Math.imul(N,q))+Math.imul(D,F)|0,i=Math.imul(D,q),r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,V)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(E,K)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,r=r+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,Y)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,r=r+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,re)|0)+Math.imul(T,ne)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,oe)|0,r=r+Math.imul(b,ue)|0,a=(a=a+Math.imul(b,ce)|0)+Math.imul(h,ue)|0,i=i+Math.imul(h,ce)|0;var Oe=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;c=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,F),a=(a=Math.imul(U,q))+Math.imul(L,F)|0,i=Math.imul(L,q),r=r+Math.imul(N,J)|0,a=(a=a+Math.imul(N,V)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,r=r+Math.imul(E,X)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(_,ne)|0,a=(a=a+Math.imul(_,re)|0)+Math.imul(O,ne)|0,i=i+Math.imul(O,re)|0,r=r+Math.imul(w,ie)|0,a=(a=a+Math.imul(w,oe)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,oe)|0,r=r+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,r=r+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(h,de)|0,i=i+Math.imul(h,le)|0;var Se=(c+(r=r+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,he)|0)+Math.imul(l,be)|0))<<13)|0;c=((i=i+Math.imul(l,he)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(U,J),a=(a=Math.imul(U,V))+Math.imul(L,J)|0,i=Math.imul(L,V),r=r+Math.imul(N,K)|0,a=(a=a+Math.imul(N,G)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,G)|0,r=r+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(x,ne)|0,a=(a=a+Math.imul(x,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,oe)|0,r=r+Math.imul(w,ue)|0,a=(a=a+Math.imul(w,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,r=r+Math.imul(m,de)|0,a=(a=a+Math.imul(m,le)|0)+Math.imul(v,de)|0,i=i+Math.imul(v,le)|0;var xe=(c+(r=r+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,he)|0)+Math.imul(h,be)|0))<<13)|0;c=((i=i+Math.imul(h,he)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(L,K)|0,i=Math.imul(L,G),r=r+Math.imul(N,X)|0,a=(a=a+Math.imul(N,Y)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,Y)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(E,ne)|0,a=(a=a+Math.imul(E,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,r=r+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,ce)|0)+Math.imul(O,ue)|0,i=i+Math.imul(O,ce)|0,r=r+Math.imul(w,de)|0,a=(a=a+Math.imul(w,le)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,le)|0;var Ae=(c+(r=r+Math.imul(m,be)|0)|0)+((8191&(a=(a=a+Math.imul(m,he)|0)+Math.imul(v,be)|0))<<13)|0;c=((i=i+Math.imul(v,he)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(L,X)|0,i=Math.imul(L,Y),r=r+Math.imul(N,Q)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,r=r+Math.imul(_,de)|0,a=(a=a+Math.imul(_,le)|0)+Math.imul(O,de)|0,i=i+Math.imul(O,le)|0;var Me=(c+(r=r+Math.imul(w,be)|0)|0)+((8191&(a=(a=a+Math.imul(w,he)|0)+Math.imul(T,be)|0))<<13)|0;c=((i=i+Math.imul(T,he)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(L,Q)|0,i=Math.imul(L,ee),r=r+Math.imul(N,ne)|0,a=(a=a+Math.imul(N,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,r=r+Math.imul(E,ue)|0,a=(a=a+Math.imul(E,ce)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var Ee=(c+(r=r+Math.imul(_,be)|0)|0)+((8191&(a=(a=a+Math.imul(_,he)|0)+Math.imul(O,be)|0))<<13)|0;c=((i=i+Math.imul(O,he)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(U,ne),a=(a=Math.imul(U,re))+Math.imul(L,ne)|0,i=Math.imul(L,re),r=r+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,oe)|0,r=r+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,r=r+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Pe=(c+(r=r+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,he)|0)+Math.imul(A,be)|0))<<13)|0;c=((i=i+Math.imul(A,he)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(L,ie)|0,i=Math.imul(L,oe),r=r+Math.imul(N,ue)|0,a=(a=a+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,ce)|0,r=r+Math.imul(I,de)|0,a=(a=a+Math.imul(I,le)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,le)|0;var je=(c+(r=r+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,he)|0)+Math.imul(P,be)|0))<<13)|0;c=((i=i+Math.imul(P,he)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(U,ue),a=(a=Math.imul(U,ce))+Math.imul(L,ue)|0,i=Math.imul(L,ce),r=r+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(D,de)|0,i=i+Math.imul(D,le)|0;var Ie=(c+(r=r+Math.imul(I,be)|0)|0)+((8191&(a=(a=a+Math.imul(I,he)|0)+Math.imul(C,be)|0))<<13)|0;c=((i=i+Math.imul(C,he)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,de),a=(a=Math.imul(U,le))+Math.imul(L,de)|0,i=Math.imul(L,le);var Ce=(c+(r=r+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,he)|0)+Math.imul(D,be)|0))<<13)|0;c=((i=i+Math.imul(D,he)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Re=(c+(r=Math.imul(U,be))|0)+((8191&(a=(a=Math.imul(U,he))+Math.imul(L,be)|0))<<13)|0;return c=((i=Math.imul(L,he))+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=ge,u[4]=we,u[5]=Te,u[6]=ke,u[7]=_e,u[8]=Oe,u[9]=Se,u[10]=xe,u[11]=Ae,u[12]=Me,u[13]=Ee,u[14]=Pe,u[15]=je,u[16]=Ie,u[17]=Ce,u[18]=Re,0!==c&&(u[19]=c,n.length++),n};function h(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(b=p),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?b(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}n.words[i]=s,r=o,o=a}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):h(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,n[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=a/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>a}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,a=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,c=0;c=0&&(0!==f||c>=a);c--){var d=0|this.words[c];this.words[c]=f<<26-i|d>>>i,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,a=1<=0);var t=e%26,n=(e-t)/26;if(r(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 a=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},i.prototype.isubn=function(e){if(r("number"===typeof e),r(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[a+n]=67108863&i}for(;a>26,this.words[a+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,u=r.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.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),a=e.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,a=this.length-1;a>=0;a--)n=(t*n+(0|this.words[a]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var a=(0|this.words[n])+67108864*t;this.words[n]=a/e|0,t=a%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0===(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,h=1;0===(n.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(n.iushrn(b);b-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,l=1;0===(n.words[0]&l)&&d<26;++d,l<<=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),o.isub(s)):(n.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.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 a=t.cmp(n);if(a<0){var i=t;t=n,n=i}else if(0===a||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.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),r(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;n--){var r=0|this.words[n],a=0|e.words[n];if(r!==a){ra&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.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},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},a(g,v),g.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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]=a,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new w;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return m[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.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)},_.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},_.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)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),b=o;0!==p.cmp(s);){for(var h=p,y=0;0!==h.cmp(s);y++)h=h.redSqr();r(y=0;r--){for(var c=t.words[r],f=u-1;f>=0;f--){var d=c>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new O(e)},a(O,_),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.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),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(157)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return Kt})),n.d(t,"c",(function(){return Nn})),n.d(t,"d",(function(){return er})),n.d(t,"e",(function(){return Jr}));var r=n(117),a=n(135),i=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],o=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(i)},e.connect=function(e,t){return new a.b(e,i,t)},e.abi=i}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),s=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(o)},e.connect=function(e,t){return new a.b(e,o,t)},e.abi=o}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),u=[{inputs:[{internalType:"address",name:"beacon",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"payable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],c="0x608060405260405161098838038061098883398101604081905261002291610483565b61004d60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5161058e565b6000805160206109418339815191521461007757634e487b7160e01b600052600160045260246000fd5b6100838282600061008a565b50506105f3565b61009383610164565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100d45750805b1561015f5761015d836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561011557600080fd5b505afa158015610129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014d9190610469565b8361030460201b6100291760201c565b505b505050565b6101778161033060201b6100551760201c565b6101d65760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b610259816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561021257600080fd5b505afa158015610226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024a9190610469565b61033060201b6100551760201c565b6102be5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101cd565b806102e360008051602061094183398151915260001b61033a60201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061032983836040518060600160405280602781526020016109616027913961033d565b9392505050565b803b15155b919050565b90565b606061034884610330565b6103a35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101cd565b600080856001600160a01b0316856040516103be919061053f565b600060405180830381855af49150503d80600081146103f9576040519150601f19603f3d011682016040523d82523d6000602084013e6103fe565b606091505b50909250905061040f828286610419565b9695505050505050565b60608315610428575081610329565b8251156104385782518084602001fd5b8160405162461bcd60e51b81526004016101cd919061055b565b80516001600160a01b038116811461033557600080fd5b60006020828403121561047a578081fd5b61032982610452565b60008060408385031215610495578081fd5b61049e83610452565b60208401519092506001600160401b03808211156104ba578283fd5b818501915085601f8301126104cd578283fd5b8151818111156104df576104df6105dd565b604051601f8201601f19908116603f01168101908382118183101715610507576105076105dd565b8160405282815288602084870101111561051f578586fd5b6105308360208301602088016105b1565b80955050505050509250929050565b600082516105518184602087016105b1565b9190910192915050565b600060208252825180602084015261057a8160408501602087016105b1565b601f01601f19169190910160400192915050565b6000828210156105ac57634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105cc5781810151838201526020016105b4565b8381111561015d5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f806106026000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b600060208252825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cb996891e0e185f82d2c11ffc73eff0fcb823b001721fc4f725e35a9ed5dc4264736f6c63430008030033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",f=(function(e){function t(t){return e.call(this,u,c,t)||this}s(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(u)},t.connect=function(e,t){return new a.b(e,u,t)},t.bytecode=c,t.abi=u}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),d=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"WETH",outputs:[{internalType:"contract IWETH",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"outstandingBridged",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct BridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct BridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"attestToken",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint256",name:"arbiterFee",type:"uint256"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"wrapAndTransferETH",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint256",name:"arbiterFee",type:"uint256"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"transferTokens",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"updateWrapped",outputs:[{internalType:"address",name:"token",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"createWrapped",outputs:[{internalType:"address",name:"token",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransferAndUnwrapETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"uint8",name:"decimals",type:"uint8"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],internalType:"struct BridgeStructs.AssetMeta",name:"meta",type:"tuple"}],name:"encodeAssetMeta",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"},{internalType:"uint256",name:"fee",type:"uint256"}],internalType:"struct BridgeStructs.Transfer",name:"transfer",type:"tuple"}],name:"encodeTransfer",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseAssetMeta",outputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"uint8",name:"decimals",type:"uint8"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],internalType:"struct BridgeStructs.AssetMeta",name:"meta",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseTransfer",outputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"},{internalType:"uint256",name:"fee",type:"uint256"}],internalType:"struct BridgeStructs.Transfer",name:"transfer",type:"tuple"}],stateMutability:"pure",type:"function"}],l="0x608060405234801561001057600080fd5b50614c57806100206000396000f3fe608060405260043610620001df5760003560e01c8063aa4efa5b11620000ff578063c68785191162000095578063f768441f116200006c578063f768441f146200070c578063fbe3c2cd1462000731578063fbeeacd91462000752578063ff200cde14620007b257600080fd5b8063c68785191462000685578063d60b347f14620006aa578063e805981014620006e757600080fd5b8063b046223b11620000d6578063b046223b14620005f8578063b172b222146200061d578063b96c7e4d1462000634578063c48fa115146200066e57600080fd5b8063aa4efa5b1462000560578063ad5c46481462000594578063ad66a5f114620005b457600080fd5b80632c3c02a4116200017557806384acd1bb116200014c57806384acd1bb14620004da5780639981509f14620004fa5780639a8a05921462000511578063a5799f93146200053b57600080fd5b80632c3c02a414620004525780632f3a3d5d14620004865780635f85426614620004a657600080fd5b80631a2be4da11620001b65780631a2be4da14620003165780631ff1e28614620003645780632539464514620003a25780632b51137514620003c957600080fd5b806301f5325514620001ec57806307dfd8fb146200026a5780630f5287b014620002e657600080fd5b36620001e757005b600080fd5b348015620001f957600080fd5b50620002116200020b36600462003950565b620007d7565b604051620002619190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b3480156200027757600080fd5b506200028f6200028936600462003950565b620009e1565b604051620002619190600060c08201905060ff83511682526020830151602083015261ffff604084015116604083015260ff60608401511660608301526080830151608083015260a083015160a083015292915050565b620002fd620002f73660046200385b565b62000b70565b6040516001600160401b03909116815260200162000261565b3480156200032357600080fd5b5062000353620003353660046200383e565b6001600160a01b031660009081526009602052604090205460ff1690565b604051901515815260200162000261565b3480156200037157600080fd5b50620003896200038336600462003cec565b62000ffd565b6040516001600160a01b03909116815260200162000261565b348015620003af57600080fd5b50620003c7620003c136600462003950565b6200102c565b005b348015620003d657600080fd5b50620003ee620003e836600462003950565b62001110565b604051620002619190600060e08201905060ff83511682526020830151602083015260408301516040830152606083015161ffff8082166060850152608085015160808501528060a08601511660a0850152505060c083015160c083015292915050565b3480156200045f57600080fd5b5062000353620004713660046200391e565b60009081526005602052604090205460ff1690565b3480156200049357600080fd5b506001546001600160a01b031662000389565b348015620004b357600080fd5b50620004cb620004c536600462003a9a565b620012c5565b60405162000261919062003e49565b348015620004e757600080fd5b506000546001600160a01b031662000389565b620002fd6200050b36600462003d1a565b6200135a565b3480156200051e57600080fd5b5060025461ffff165b60405161ffff909116815260200162000261565b3480156200054857600080fd5b50620003c76200055a36600462003950565b620015e8565b3480156200056d57600080fd5b50620003536200057f3660046200391e565b60009081526006602052604090205460ff1690565b348015620005a157600080fd5b506004546001600160a01b031662000389565b348015620005c157600080fd5b50620005e9620005d336600462003cae565b61ffff166000908152600b602052604090205490565b60405190815260200162000261565b3480156200060557600080fd5b50620004cb6200061736600462003a00565b62001755565b3480156200062a57600080fd5b50600354620005e9565b3480156200064157600080fd5b50620005e9620006533660046200383e565b6001600160a01b03166000908152600a602052604090205490565b620002fd6200067f366004620038c6565b620017ce565b3480156200069257600080fd5b50620003c7620006a436600462003950565b62001ace565b348015620006b757600080fd5b5062000353620006c93660046200383e565b6001600160a01b031660009081526007602052604090205460ff1690565b348015620006f457600080fd5b50620003896200070636600462003950565b62001ade565b3480156200071957600080fd5b50620003896200072b36600462003950565b62001bfd565b3480156200073e57600080fd5b5060025462010000900461ffff1662000527565b3480156200075f57600080fd5b50620007776200077136600462003950565b62001d12565b6040516200026191908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b348015620007bf57600080fd5b50620003c7620007d136600462003950565b62001eed565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906200080e838262001efa565b82526200081d60208262004019565b82519091506a546f6b656e427269646765146200088d5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b62000899838262001f5c565b60ff166020830152620008ae60018262004019565b9050816020015160ff16600114620009155760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840162000884565b62000921838262001fbc565b61ffff1660408301526200093760028262004019565b905062000945838262001fbc565b61ffff1660608301526200095b60028262004019565b905062000969838262001efa565b60808301526200097b60208262004019565b905080835114620009db5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840162000884565b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529062000a1f838262001f5c565b60ff16825262000a3160018262004019565b9050816000015160ff1660021462000a805760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000884565b62000a8c838262001efa565b60208084019190915262000aa1908262004019565b905062000aaf838262001fbc565b61ffff16604083015262000ac560028262004019565b905062000ad3838262001f5c565b60ff16606083015262000ae860018262004019565b905062000af6838262001efa565b608083015262000b0860208262004019565b905062000b16838262001efa565b60a083015262000b2860208262004019565b905080835114620009db5760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000884565b600080600062000b98896001600160a01b031660009081526009602052604090205460ff1690565b1562000c9257886001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000bd857600080fd5b505afa15801562000bed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c13919062003ccd565b9150886001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c4f57600080fd5b505afa15801562000c64573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c8a919062003937565b905062000ca6565b505060025461ffff166001600160a01b0388165b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b038c169162000cea919062003dd2565b600060405180830381855afa9150503d806000811462000d27576040519150601f19603f3d011682016040523d82523d6000602084013e62000d2c565b606091505b5091505060008180602001905181019062000d48919062003d85565b905062000d6162000d5a8b836200201d565b826200205c565b995062000d7160025461ffff1690565b61ffff168461ffff16141562000f1f57604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17905290516000916001600160a01b038e169162000dd6919062003dd2565b600060405180830381855afa9150503d806000811462000e13576040519150601f19603f3d011682016040523d82523d6000602084013e62000e18565b606091505b5091505060008180602001905181019062000e34919062003937565b905062000e448d33308f62002091565b6040513060248201526000906001600160a01b038f16906370a0823160e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000ea7919062003dd2565b600060405180830381855afa9150503d806000811462000ee4576040519150601f19603f3d011682016040523d82523d6000602084013e62000ee9565b606091505b5091505060008180602001905181019062000f05919062003937565b905062000f1383826200417f565b9d505050505062000f90565b62000f2d8b33308d62002091565b604051632770a7eb60e21b8152306004820152602481018b90526001600160a01b038c1690639dc29fac90604401600060405180830381600087803b15801562000f7657600080fd5b505af115801562000f8b573d6000803e3d6000fd5b505050505b600062000f9e8b836200201d565b9050600062000fae89846200201d565b905062000fbe60025461ffff1690565b61ffff168661ffff16141562000fda5762000fda8d8362002104565b62000fec8686848e8e86348f620021d1565b9d9c50505050505050505050505050565b61ffff821660009081526008602090815260408083208484529091529020546001600160a01b03165b92915050565b60008060006200103c846200230f565b925092509250818190620010655760405162461bcd60e51b815260040162000884919062003e49565b506200108b8361014001516000908152600560205260409020805460ff19166001179055565b60006200109c8460e0015162001d12565b9050620010ac60025461ffff1690565b61ffff16816040015161ffff1614620010f95760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640162000884565b606081015162001109906200253e565b5050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081018290529062001155838262001f5c565b60ff1682526200116760018262004019565b9050816000015160ff16600114620011b55760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000884565b620011c1838262002675565b602080840191909152620011d6908262004019565b9050620011e4838262001efa565b6040830152620011f660208262004019565b905062001204838262001fbc565b61ffff1660608301526200121a60028262004019565b905062001228838262001efa565b60808301526200123a60208262004019565b905062001248838262001fbc565b61ffff1660a08301526200125e60028262004019565b90506200126c838262002675565b60c08301526200127e60208262004019565b905080835114620009db5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000884565b8051602080830151604080850151606080870151608088015160a089015160c08a0151955160f89990991b6001600160f81b031916978901979097526021880195909552604187019290925260f091821b6001600160f01b03199081166061880152606387019490945293901b909116608384015260858301529060a5015b6040516020818303038152906040529050919050565b600080620013706000546001600160a01b031690565b6001600160a01b0316631a90a2196040518163ffffffff1660e01b815260040160206040518083038186803b158015620013a957600080fd5b505afa158015620013be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013e4919062003937565b9050348110620014425760405162461bcd60e51b815260206004820152602260248201527f76616c756520697320736d616c6c6572207468616e20776f726d686f6c652066604482015261656560f01b606482015260840162000884565b60006200145082346200417f565b905080851115620014b95760405162461bcd60e51b815260206004820152602c60248201527f66656520697320626967676572207468616e20616d6f756e74206d696e75732060448201526b776f726d686f6c652066656560a01b606482015260840162000884565b6000620014c88260126200201d565b90506000620014d98760126200201d565b90506000620014ea8360126200205c565b620014f690856200417f565b905080156200152f57604051339082156108fc029083906000818181858888f193505050501580156200152d573d6000803e3d6000fd5b505b6004546001600160a01b031663d0e30db06200154c83876200417f565b6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156200157857600080fd5b505af11580156200158d573d6000803e3d6000fd5b5050505050620015b0620015a96004546001600160a01b031690565b8462002104565b620015da620015c260025461ffff1690565b6004546001600160a01b0316858d8d878b8e620021d1565b9a9950505050505050505050565b6000806000620015f8846200230f565b925092509250818190620016215760405162461bcd60e51b815260040162000884919062003e49565b50620016478361014001516000908152600560205260409020805460ff19166001179055565b6000620016588460e00151620007d7565b90506200166860025461ffff1690565b61ffff16816040015161ffff161480620016885750604081015161ffff16155b620016c95760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640162000884565b606081015161ffff166000908152600b602052604081205414620017305760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c726561647920726567697374657265640000000000000000604482015260640162000884565b620011098160600151826080015161ffff9091166000908152600b6020526040902055565b8051602080830151604080850151606080870151608088015160a0890151945160f898891b6001600160f81b031990811698820198909852602181019690965260f09390931b6001600160f01b031916604186015290951b90931660438301526044820192909252606481019190915260840162001344565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b179052905160009182916001600160a01b03861691620018139162003dd2565b600060405180830381855afa9150503d806000811462001850576040519150601f19603f3d011682016040523d82523d6000602084013e62001855565b606091505b5060408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b1790529051919350600092506001600160a01b038716916200189e919062003dd2565b600060405180830381855afa9150503d8060008114620018db576040519150601f19603f3d011682016040523d82523d6000602084013e620018e0565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b0388169162001929919062003dd2565b600060405180830381855afa9150503d806000811462001966576040519150601f19603f3d011682016040523d82523d6000602084013e6200196b565b606091505b5091505060008380602001905181019062001987919062003d85565b9050600083806020019051810190620019a19190620039ca565b9050600083806020019051810190620019bb9190620039ca565b9050600080602084015191506020830151905060006040518060c00160405280600260ff1681526020018d6001600160a01b031660001b815260200162001a0560025461ffff1690565b61ffff1681526020018760ff168152602001848152602001838152509050600062001a308262001755565b905062001a456000546001600160a01b031690565b6001600160a01b031663b19a437e348e84600f6040518563ffffffff1660e01b815260040162001a789392919062003f37565b6020604051808303818588803b15801562001a9257600080fd5b505af115801562001aa7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062000fec919062003d68565b62001adb816000620026ce565b50565b60008060008062001af76000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001b24919062003e49565b60006040518083038186803b15801562001b3d57600080fd5b505afa15801562001b52573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001b7c919081019062003b3f565b92509250925081819062001ba55760405162461bcd60e51b815260040162000884919062003e49565b5062001bb18362002da9565b62001bd05760405162461bcd60e51b8152600401620008849062003f0e565b600062001be18460e00151620009e1565b905062001bf3818560a0015162002de6565b9695505050505050565b60008060008062001c166000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001c43919062003e49565b60006040518083038186803b15801562001c5c57600080fd5b505afa15801562001c71573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001c9b919081019062003b3f565b92509250925081819062001cc45760405162461bcd60e51b815260040162000884919062003e49565b5062001cd08362002da9565b62001cef5760405162461bcd60e51b8152600401620008849062003f0e565b600062001d008460e00151620009e1565b905062001bf3818560a0015162003097565b60408051608081018252600080825260208201819052918101829052606081018290529062001d42838262001efa565b825262001d5160208262004019565b82519091506a546f6b656e4272696467651462001dbf5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840162000884565b62001dcb838262001f5c565b60ff16602083015262001de060018262004019565b9050816020015160ff1660021462001e495760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840162000884565b62001e55838262001fbc565b61ffff16604083015262001e6b60028262004019565b905062001e79838262001efa565b606083015262001e8b60208262004019565b905080835114620009db5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840162000884565b62001adb816001620026ce565b600062001f0982602062004019565b8351101562001f535760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640162000884565b50016020015190565b600062001f6b82600162004019565b8351101562001fb35760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640162000884565b50016001015190565b600062001fcb82600262004019565b83511015620020145760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640162000884565b50016002015190565b600060088260ff16111562002055576200203960088362004199565b6200204690600a6200409e565b62002052908462004034565b92505b5090919050565b600060088260ff16111562002055576200207860088362004199565b6200208590600a6200409e565b6200205290846200415d565b6040516001600160a01b0380851660248301528316604482015260648101829052620020fe9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262003192565b50505050565b6001600160a01b0382166000908152600a60205260409020546001600160401b0362002131838362004019565b11156200219f5760405162461bcd60e51b815260206004820152603560248201527f7472616e736665722065786365656473206d6178206f75747374616e64696e6760448201527408189c9a5919d959081d1bdad95b88185b5bdd5b9d605a1b606482015260840162000884565b620021cc83620021b0848462004019565b6001600160a01b039091166000908152600a6020526040902055565b505050565b6000868411156200221a5760405162461bcd60e51b815260206004820152601260248201527119995948195e18d959591cc8185b5bdd5b9d60721b604482015260640162000884565b6040805160e081018252600181526020810189905290810189905261ffff808b16606083015260808201879052871660a082015260c0810185905260006200226282620012c5565b9050620022776000546001600160a01b031690565b6001600160a01b031663b19a437e868684600f6040518563ffffffff1660e01b8152600401620022aa9392919062003f37565b6020604051808303818588803b158015620022c457600080fd5b505af1158015620022d9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002300919062003d68565b9b9a5050505050505050505050565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620023836000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620023b0919062003e49565b60006040518083038186803b158015620023c957600080fd5b505afa158015620023de573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002408919081019062003b3f565b9250925092508162002421579194509250905062002537565b60025462010000900461ffff1661ffff16836060015161ffff16146200247f5750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062002537565b600354836080015114620024d257505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062002537565b61014083015160009081526005602052604090205460ff16156200251c5782600060405180606001604052806022815260200162004c006022913995509550955050505062002537565b50506040805160208101909152600081529093506001925090505b9193909250565b6000620025727f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506200257f826200326b565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620025c49162003dd2565b600060405180830381855af49150503d806000811462002601576040519150601f19603f3d011682016040523d82523d6000602084013e62002606565b606091505b50915091508181906200262e5760405162461bcd60e51b815260040162000884919062003e49565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b60006200268482602062004019565b8351101562001f535760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b604482015260640162000884565b6000806000620026e66000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162002713919062003e49565b60006040518083038186803b1580156200272c57600080fd5b505afa15801562002741573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200276b919081019062003b3f565b925092509250818190620027945760405162461bcd60e51b815260040162000884919062003e49565b50620027a08362002da9565b620027bf5760405162461bcd60e51b8152600401620008849062003f0e565b6000620027d08460e0015162001110565b9050620027f184610140015160009081526006602052604090205460ff1690565b15620028405760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c65746564000000000000604482015260640162000884565b620028658461014001516000908152600660205260409020805460ff19166001179055565b60025461ffff1661ffff168160a0015161ffff1614620028bf5760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b604482015260640162000884565b6000620028cf60025461ffff1690565b61ffff16826060015161ffff16141562002901575060408101516020820151620028fb908290620032ad565b62002982565b6000620029178360600151846040015162000ffd565b90506001600160a01b0381166200297f5760405162461bcd60e51b815260206004820152602560248201527f6e6f207772617070657220666f72207468697320746f6b656e2063726561746560448201526419081e595d60da1b606482015260840162000884565b90505b8515806200299d57506004546001600160a01b038281169116145b620029f75760405162461bcd60e51b815260206004820152602360248201527f696e76616c696420746f6b656e2c2063616e206f6e6c7920756e77726170205760448201526208aa8960eb1b606482015260840162000884565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b0384169162002a3b919062003dd2565b600060405180830381855afa9150503d806000811462002a78576040519150601f19603f3d011682016040523d82523d6000602084013e62002a7d565b606091505b5091505060008180602001905181019062002a99919062003d85565b9050600062002aad8560200151836200205c565b9050600062002ac18660c00151846200205c565b9050801562002c50578181111562002b275760405162461bcd60e51b815260206004820152602260248201527f66656520686967686572207468616e207472616e7366657272656420616d6f756044820152611b9d60f21b606482015260840162000884565b891562002bc15760048054604051632e1a7d4d60e01b81529182018390526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002b7357600080fd5b505af115801562002b88573d6000803e3d6000fd5b505060405133925083156108fc02915083906000818181858888f1935050505015801562002bba573d6000803e3d6000fd5b5062002c50565b60025461ffff1661ffff16866060015161ffff161462002c43576040516340c10f1960e01b8152336004820152602481018290526001600160a01b038616906340c10f1990604401600060405180830381600087803b15801562002c2457600080fd5b505af115801562002c39573d6000803e3d6000fd5b5050505062002c50565b62002c50853383620032e3565b600062002c5e82846200417f565b60808801519091508b1562002d095760048054604051632e1a7d4d60e01b81529182018490526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002cb257600080fd5b505af115801562002cc7573d6000803e3d6000fd5b50506040516001600160a01b038416925084156108fc02915084906000818181858888f1935050505015801562002d02573d6000803e3d6000fd5b5062002d9a565b60025461ffff1661ffff16886060015161ffff161462002d8d576040516340c10f1960e01b81526001600160a01b038281166004830152602482018490528816906340c10f1990604401600060405180830381600087803b15801562002d6e57600080fd5b505af115801562002d83573d6000803e3d6000fd5b5050505062002d9a565b62002d9a878284620032e3565b50505050505050505050505050565b6000816080015162002dcf836060015161ffff166000908152600b602052604090205490565b141562002dde57506001919050565b506000919050565b600062002df660025461ffff1690565b61ffff16836040015161ffff16141562002e645760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b606482015260840162000884565b60006001600160a01b031662002e838460400151856020015162000ffd565b6001600160a01b03161462002edb5760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c72656164792065786973747300000000604482015260640162000884565b600063c71f461560e01b62002ef48560a0015162003315565b62002f03866080015162003315565b8660600151863089604001518a6020015160405160240162002f2c979695949392919062003ea1565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b0319909516949094179093525190925060009162002f7691309185910162003e23565b604051602081830303815290604052905060006040518060200162002f9b9062003682565b601f1982820381018352601f90910116604081905262002fc19190849060200162003df0565b60405160208183030381529060405290506000866040015187602001516040516020016200300892919060f09290921b6001600160f01b0319168252600282015260220190565b604051602081830303815290604052805190602001209050808251602084016000f59450843b6200303857600080fd5b6040808801516020808a015161ffff90921660009081526008825283812092815291815282822080546001600160a01b0319166001600160a01b038a1690811790915582526009905220805460ff191660011790555050505092915050565b600080620030ae8460400151856020015162000ffd565b90506001600160a01b038116620031085760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420617373657420646f6573206e6f7420657869737473000000604482015260640162000884565b806001600160a01b031663a18cd7c6620031268660a0015162003315565b62003135876080015162003315565b866040518463ffffffff1660e01b8152600401620031569392919062003e5e565b600060405180830381600087803b1580156200317157600080fd5b505af115801562003186573d6000803e3d6000fd5b50929695505050505050565b6000620031e9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620034509092919063ffffffff16565b805190915015620021cc57808060200190518101906200320a919062003901565b620021cc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000884565b62003276816200346b565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b620032df8282620032d3856001600160a01b03166000908152600a602052604090205490565b620021b091906200417f565b5050565b6040516001600160a01b038316602482015260448101829052620021cc90849063a9059cbb60e01b90606401620020c6565b606060005b6020811080156200335857508281602081106200334757634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b156200337357806200336a81620041ee565b9150506200331a565b6000816001600160401b038111156200339c57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015620033c7576020820181803683370190505b50905060005b828110156200344857848160208110620033f757634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200341c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350806200343f81620041ee565b915050620033cd565b509392505050565b606062003461848460008562003512565b90505b9392505050565b803b620034d15760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000884565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606082471015620035755760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000884565b843b620035c55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000884565b600080866001600160a01b03168587604051620035e3919062003dd2565b60006040518083038185875af1925050503d806000811462003622576040519150601f19603f3d011682016040523d82523d6000602084013e62003627565b606091505b50915091506200363982828662003644565b979650505050505050565b606083156200365557508162003464565b825115620036665782518084602001fd5b8160405162461bcd60e51b815260040162000884919062003e49565b610993806200426d83390190565b80356001600160a01b0381168114620036a857600080fd5b919050565b600082601f830112620036be578081fd5b815160206001600160401b03821115620036dc57620036dc62004222565b620036ec818360051b0162003fbc565b80838252828201915082860187848660071b89010111156200370c578586fd5b855b858110156200377c57608080838b03121562003728578788fd5b6200373262003f6b565b8351815286840151878201526040808501516200374f816200425c565b9082015260608481015162003764816200425c565b9082015285529385019391909101906001016200370e565b5090979650505050505050565b80518015158114620036a857600080fd5b600082601f830112620037ab578081fd5b8151620037c2620037bc8262003fef565b62003fbc565b818152846020838601011115620037d7578283fd5b620037ea826020830160208701620041bf565b949350505050565b8035620036a88162004238565b8051620036a88162004238565b8051620036a88162004249565b80516001600160401b0381168114620036a857600080fd5b8051620036a8816200425c565b60006020828403121562003850578081fd5b620034648262003690565b60008060008060008060c0878903121562003874578182fd5b6200387f8762003690565b9550602087013594506040870135620038988162004238565b9350606087013592506080870135915060a0870135620038b88162004249565b809150509295509295509295565b60008060408385031215620038d9578182fd5b620038e48362003690565b91506020830135620038f68162004249565b809150509250929050565b60006020828403121562003913578081fd5b620034648262003789565b60006020828403121562003930578081fd5b5035919050565b60006020828403121562003949578081fd5b5051919050565b60006020828403121562003962578081fd5b81356001600160401b0381111562003978578182fd5b8201601f8101841362003989578182fd5b80356200399a620037bc8262003fef565b818152856020838501011115620039af578384fd5b81602084016020830137908101602001929092525092915050565b600060208284031215620039dc578081fd5b81516001600160401b03811115620039f2578182fd5b620037ea848285016200379a565b600060c0828403121562003a12578081fd5b60405160c081018181106001600160401b038211171562003a375762003a3762004222565b604052823562003a47816200425c565b815260208381013590820152604083013562003a638162004238565b6040820152606083013562003a78816200425c565b60608201526080838101359082015260a0928301359281019290925250919050565b600060e0828403121562003aac578081fd5b60405160e081018181106001600160401b038211171562003ad15762003ad162004222565b604052823562003ae1816200425c565b808252506020830135602082015260408301356040820152606083013562003b098162004238565b60608201526080838101359082015262003b2660a08401620037f2565b60a082015260c083013560c08201528091505092915050565b60008060006060848603121562003b54578081fd5b83516001600160401b038082111562003b6b578283fd5b90850190610160828803121562003b80578283fd5b62003b8a62003f96565b62003b958362003831565b815262003ba5602084016200380c565b602082015262003bb8604084016200380c565b604082015262003bcb60608401620037ff565b60608201526080830151608082015262003be860a0840162003819565b60a082015262003bfb60c0840162003831565b60c082015260e08301518281111562003c12578485fd5b62003c20898286016200379a565b60e08301525061010062003c368185016200380c565b90820152610120838101518381111562003c4e578586fd5b62003c5c8a828701620036ad565b91830191909152506101408381015190820152945062003c7f6020870162003789565b9350604086015191508082111562003c95578283fd5b5062003ca4868287016200379a565b9150509250925092565b60006020828403121562003cc0578081fd5b8135620034648162004238565b60006020828403121562003cdf578081fd5b8151620034648162004238565b6000806040838503121562003cff578182fd5b823562003d0c8162004238565b946020939093013593505050565b6000806000806080858703121562003d30578182fd5b843562003d3d8162004238565b93506020850135925060408501359150606085013562003d5d8162004249565b939692955090935050565b60006020828403121562003d7a578081fd5b620034648262003819565b60006020828403121562003d97578081fd5b815162003464816200425c565b6000815180845262003dbe816020860160208601620041bf565b601f01601f19169290920160200192915050565b6000825162003de6818460208701620041bf565b9190910192915050565b6000835162003e04818460208801620041bf565b83519083019062003e1a818360208801620041bf565b01949350505050565b6001600160a01b0383168152604060208201819052600090620034619083018462003da4565b60208152600062003464602083018462003da4565b60608152600062003e73606083018662003da4565b828103602084015262003e87818662003da4565b9150506001600160401b0383166040830152949350505050565b60e08152600062003eb660e083018a62003da4565b828103602084015262003eca818a62003da4565b60ff98909816604084015250506001600160401b039490941660608501526001600160a01b0392909216608084015261ffff1660a083015260c09091015292915050565b6020808252600f908201526e34b73b30b634b21032b6b4ba3a32b960891b604082015260600190565b63ffffffff8416815260606020820152600062003f58606083018562003da4565b905060ff83166040830152949350505050565b604051608081016001600160401b038111828210171562003f905762003f9062004222565b60405290565b60405161016081016001600160401b038111828210171562003f905762003f9062004222565b604051601f8201601f191681016001600160401b038111828210171562003fe75762003fe762004222565b604052919050565b60006001600160401b038211156200400b576200400b62004222565b50601f01601f191660200190565b600082198211156200402f576200402f6200420c565b500190565b6000826200405057634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115620040965781600019048211156200407a576200407a6200420c565b808516156200408857918102915b93841c93908002906200405a565b509250929050565b60006200346460ff841683600082620040ba5750600162001026565b81620040c95750600062001026565b8160018114620040e25760028114620040ed576200410d565b600191505062001026565b60ff8411156200410157620041016200420c565b50506001821b62001026565b5060208310610133831016604e8410600b841016171562004132575081810a62001026565b6200413e838362004055565b80600019048211156200415557620041556200420c565b029392505050565b60008160001904831182151516156200417a576200417a6200420c565b500290565b6000828210156200419457620041946200420c565b500390565b600060ff821660ff841680821015620041b657620041b66200420c565b90039392505050565b60005b83811015620041dc578181015183820152602001620041c2565b83811115620020fe5750506000910152565b60006000198214156200420557620042056200420c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462001adb57600080fd5b63ffffffff8116811462001adb57600080fd5b60ff8116811462001adb57600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a264697066735822122059e176f1dd762c3e0e31070f4ed2d4b5cddbd1debc7238a2f5568bf5c60b490064736f6c63430008040033",p=function(e){function t(t){return e.call(this,d,l,t)||this}return f(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(d)},t.connect=function(e,t){return new a.b(e,d,t)},t.bytecode=l,t.abi=d,t}(a.c),b=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h=[{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"WETH",outputs:[{internalType:"contract IWETH",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"outstandingBridged",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],y="0x608060405234801561001057600080fd5b50610372806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063aa4efa5b1161008c578063b172b22211610066578063b172b2221461022d578063b96c7e4d14610235578063d60b347f1461025e578063fbe3c2cd1461028a57600080fd5b8063aa4efa5b146101c7578063ad5c4648146101ea578063ad66a5f1146101fb57600080fd5b80631a2be4da146100d45780631ff1e286146101155780632c3c02a4146101675780632f3a3d5d1461018a57806384acd1bb1461019b5780639a8a0592146101ac575b600080fd5b6101006100e23660046102b3565b6001600160a01b031660009081526009602052604090205460ff1690565b60405190151581526020015b60405180910390f35b61014f610123366004610313565b61ffff91909116600090815260086020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b03909116815260200161010c565b6101006101753660046102e1565b60009081526005602052604090205460ff1690565b6001546001600160a01b031661014f565b6000546001600160a01b031661014f565b60025461ffff165b60405161ffff909116815260200161010c565b6101006101d53660046102e1565b60009081526006602052604090205460ff1690565b6004546001600160a01b031661014f565b61021f6102093660046102f9565b61ffff166000908152600b602052604090205490565b60405190815260200161010c565b60035461021f565b61021f6102433660046102b3565b6001600160a01b03166000908152600a602052604090205490565b61010061026c3660046102b3565b6001600160a01b031660009081526007602052604090205460ff1690565b60025462010000900461ffff166101b4565b803561ffff811681146102ae57600080fd5b919050565b6000602082840312156102c4578081fd5b81356001600160a01b03811681146102da578182fd5b9392505050565b6000602082840312156102f2578081fd5b5035919050565b60006020828403121561030a578081fd5b6102da8261029c565b60008060408385031215610325578081fd5b61032e8361029c565b94602093909301359350505056fea26469706673582212200e8167a8bd25af5437d7bb9e32d5d47e4017c7654316991ea75c8591ce88787c64736f6c63430008040033",m=(function(e){function t(t){return e.call(this,h,y,t)||this}b(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(h)},t.connect=function(e,t){return new a.b(e,h,t)},t.bytecode=y,t.abi=h}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),v=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"WETH",outputs:[{internalType:"contract IWETH",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"outstandingBridged",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct BridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct BridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"}],g="0x608060405234801561001057600080fd5b50611485806100206000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063a5799f93116100a2578063b172b22211610071578063b172b222146102f7578063b96c7e4d146102ff578063d60b347f14610328578063fbe3c2cd14610354578063fbeeacd91461036657600080fd5b8063a5799f931461027e578063aa4efa5b14610291578063ad5c4648146102b4578063ad66a5f1146102c557600080fd5b80632c3c02a4116100de5780632c3c02a41461021e5780632f3a3d5d1461024157806384acd1bb146102525780639a8a05921461026357600080fd5b806301f53255146101105780631a2be4da1461017b5780631ff1e286146101b75780632539464514610209575b600080fd5b61012361011e3660046110a2565b6103b3565b6040516101729190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b6101a761018936600461105c565b6001600160a01b031660009081526009602052604090205460ff1690565b6040519015158152602001610172565b6101f16101c5366004611284565b61ffff91909116600090815260086020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b039091168152602001610172565b61021c6102173660046110a2565b6105a4565b005b6101a761022c36600461108a565b60009081526005602052604090205460ff1690565b6001546001600160a01b03166101f1565b6000546001600160a01b03166101f1565b60025461ffff165b60405161ffff9091168152602001610172565b61021c61028c3660046110a2565b61067b565b6101a761029f36600461108a565b60009081526006602052604090205460ff1690565b6004546001600160a01b03166101f1565b6102e96102d3366004611268565b61ffff166000908152600b602052604090205490565b604051908152602001610172565b6003546102e9565b6102e961030d36600461105c565b6001600160a01b03166000908152600a602052604090205490565b6101a761033636600461105c565b6001600160a01b031660009081526007602052604090205460ff1690565b60025462010000900461ffff1661026b565b6103796103743660046110a2565b6107d9565b60405161017291908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906103e8838261099e565b82526103f56020826113b0565b82519091506a546f6b656e427269646765146104645760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b61046e83826109fc565b60ff1660208301526104816001826113b0565b9050816020015160ff166001146104e65760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840161045b565b6104f08382610a58565b61ffff1660408301526105046002826113b0565b90506105108382610a58565b61ffff1660608301526105246002826113b0565b9050610530838261099e565b60808301526105406020826113b0565b90508083511461059e5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840161045b565b50919050565b60008060006105b284610ab5565b9250925092508181906105d85760405162461bcd60e51b815260040161045b91906112f7565b506105fd8361014001516000908152600560205260409020805460ff19166001179055565b600061060c8460e001516107d9565b905061061b60025461ffff1690565b61ffff16816040015161ffff16146106665760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640161045b565b606081015161067490610cd4565b5050505050565b600080600061068984610ab5565b9250925092508181906106af5760405162461bcd60e51b815260040161045b91906112f7565b506106d48361014001516000908152600560205260409020805460ff19166001179055565b60006106e38460e001516103b3565b90506106f260025461ffff1690565b61ffff16816040015161ffff1614806107115750604081015161ffff16155b6107505760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640161045b565b606081015161ffff166000908152600b6020526040812054146107b55760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c726561647920726567697374657265640000000000000000604482015260640161045b565b6106748160600151826080015161ffff9091166000908152600b6020526040902055565b604080516080810182526000808252602082018190529181018290526060810182905290610807838261099e565b82526108146020826113b0565b82519091506a546f6b656e427269646765146108805760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840161045b565b61088a83826109fc565b60ff16602083015261089d6001826113b0565b9050816020015160ff166002146109045760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840161045b565b61090e8382610a58565b61ffff1660408301526109226002826113b0565b905061092e838261099e565b606083015261093e6020826113b0565b90508083511461059e5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840161045b565b60006109ab8260206113b0565b835110156109f35760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640161045b565b50016020015190565b6000610a098260016113b0565b83511015610a4f5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640161045b565b50016001015190565b6000610a658260026113b0565b83511015610aac5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640161045b565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610b286000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610b5391906112f7565b60006040518083038186803b158015610b6b57600080fd5b505afa158015610b7f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ba79190810190611116565b92509250925081610bbe5791945092509050610ccd565b60025462010000900461ffff1661ffff16836060015161ffff1614610c1a5750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610ccd565b600354836080015114610c6b57505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610ccd565b61014083015160009081526005602052604090205460ff1615610cb25782600060405180606001604052806022815260200161142e60229139955095509550505050610ccd565b50506040805160208101909152600081529093506001925090505b9193909250565b6000610d077f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050610d1282610e01565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691610d55916112db565b600060405180830381855af49150503d8060008114610d90576040519150601f19603f3d011682016040523d82523d6000602084013e610d95565b606091505b5091509150818190610dba5760405162461bcd60e51b815260040161045b91906112f7565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b610e0a81610e41565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610ea55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161045b565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b600082601f830112610ef6578081fd5b8151602067ffffffffffffffff821115610f1257610f12611404565b610f20818360051b01611357565b80838252828201915082860187848660071b8901011115610f3f578586fd5b855b85811015610fa257608080838b031215610f59578788fd5b610f6161130a565b8351815286840151878201526040610f7a81860161104b565b908201526060610f8b85820161104b565b908201528552938501939190910190600101610f41565b5090979650505050505050565b80518015158114610fbf57600080fd5b919050565b600082601f830112610fd4578081fd5b8151610fe7610fe282611388565b611357565b818152846020838601011115610ffb578283fd5b61100c8260208301602087016113d4565b949350505050565b8051610fbf8161141a565b805163ffffffff81168114610fbf57600080fd5b805167ffffffffffffffff81168114610fbf57600080fd5b805160ff81168114610fbf57600080fd5b60006020828403121561106d578081fd5b81356001600160a01b0381168114611083578182fd5b9392505050565b60006020828403121561109b578081fd5b5035919050565b6000602082840312156110b3578081fd5b813567ffffffffffffffff8111156110c9578182fd5b8201601f810184136110d9578182fd5b80356110e7610fe282611388565b8181528560208385010111156110fb578384fd5b81602084016020830137908101602001929092525092915050565b60008060006060848603121561112a578182fd5b835167ffffffffffffffff80821115611141578384fd5b908501906101608288031215611155578384fd5b61115d611333565b6111668361104b565b81526111746020840161101f565b60208201526111856040840161101f565b604082015261119660608401611014565b6060820152608083015160808201526111b160a08401611033565b60a08201526111c260c0840161104b565b60c082015260e0830151828111156111d8578586fd5b6111e489828601610fc4565b60e0830152506101006111f881850161101f565b90820152610120838101518381111561120f578687fd5b61121b8a828701610ee6565b91830191909152506101408381015190820152945061123c60208701610faf565b93506040860151915080821115611251578283fd5b5061125e86828701610fc4565b9150509250925092565b600060208284031215611279578081fd5b81356110838161141a565b60008060408385031215611296578182fd5b82356112a18161141a565b946020939093013593505050565b600081518084526112c78160208601602086016113d4565b601f01601f19169290920160200192915050565b600082516112ed8184602087016113d4565b9190910192915050565b60208152600061108360208301846112af565b6040516080810167ffffffffffffffff8111828210171561132d5761132d611404565b60405290565b604051610160810167ffffffffffffffff8111828210171561132d5761132d611404565b604051601f8201601f1916810167ffffffffffffffff8111828210171561138057611380611404565b604052919050565b600067ffffffffffffffff8211156113a2576113a2611404565b50601f01601f191660200190565b600082198211156113cf57634e487b7160e01b81526011600452602481fd5b500190565b60005b838110156113ef5781810151838201526020016113d7565b838111156113fe576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff8116811461142a57600080fd5b5056fe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a26469706673582212205559f87e66119ef459f524781e1ad0229720aeb77eafeec52bc379386c821a2964736f6c63430008040033",w=(function(e){function t(t){return e.call(this,v,g,t)||this}m(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(v)},t.connect=function(e,t){return new a.b(e,v,t)},t.bytecode=g,t.abi=v}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),T=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"WETH",outputs:[{internalType:"contract IWETH",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"attestToken",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransferAndUnwrapETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"createWrapped",outputs:[{internalType:"address",name:"token",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"uint8",name:"decimals",type:"uint8"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],internalType:"struct BridgeStructs.AssetMeta",name:"meta",type:"tuple"}],name:"encodeAssetMeta",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"},{internalType:"uint256",name:"fee",type:"uint256"}],internalType:"struct BridgeStructs.Transfer",name:"transfer",type:"tuple"}],name:"encodeTransfer",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"outstandingBridged",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseAssetMeta",outputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"uint8",name:"decimals",type:"uint8"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],internalType:"struct BridgeStructs.AssetMeta",name:"meta",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct BridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseTransfer",outputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"},{internalType:"uint256",name:"fee",type:"uint256"}],internalType:"struct BridgeStructs.Transfer",name:"transfer",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct BridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint256",name:"arbiterFee",type:"uint256"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"transferTokens",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"updateWrapped",outputs:[{internalType:"address",name:"token",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint256",name:"arbiterFee",type:"uint256"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"wrapAndTransferETH",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"},{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"}],k="0x608060405234801561001057600080fd5b50614d80806100206000396000f3fe608060405260043610620001f75760003560e01c8063a5799f93116200010b578063c48fa11511620000a1578063f768441f116200006c578063f768441f1462000754578063fbe3c2cd1462000779578063fbeeacd9146200079a578063ff200cde14620007fa57600080fd5b8063c48fa11514620006b6578063c687851914620006cd578063d60b347f14620006f2578063e8059810146200072f57600080fd5b8063ad66a5f111620000e2578063ad66a5f114620005fc578063b046223b1462000640578063b172b2221462000665578063b96c7e4d146200067c57600080fd5b8063a5799f931462000583578063aa4efa5b14620005a8578063ad5c464814620005dc57600080fd5b80632c3c02a4116200018d5780638129fc1c11620001585780638129fc1c146200050a57806384acd1bb14620005225780639981509f14620005425780639a8a0592146200055957600080fd5b80632c3c02a4146200046a5780632f3a3d5d146200049e5780635c60da1b14620004be5780635f85426614620004d657600080fd5b80631a2be4da11620001ce5780631a2be4da146200032e5780631ff1e286146200037c5780632539464514620003ba5780632b51137514620003e157600080fd5b806301f53255146200020457806307dfd8fb14620002825780630f5287b014620002fe57600080fd5b36620001ff57005b600080fd5b3480156200021157600080fd5b50620002296200022336600462003a79565b6200081f565b604051620002799190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b3480156200028f57600080fd5b50620002a7620002a136600462003a79565b62000a29565b604051620002799190600060c08201905060ff83511682526020830151602083015261ffff604084015116604083015260ff60608401511660608301526080830151608083015260a083015160a083015292915050565b620003156200030f36600462003984565b62000bb8565b6040516001600160401b03909116815260200162000279565b3480156200033b57600080fd5b506200036b6200034d36600462003967565b6001600160a01b031660009081526009602052604090205460ff1690565b604051901515815260200162000279565b3480156200038957600080fd5b50620003a16200039b36600462003e15565b62001045565b6040516001600160a01b03909116815260200162000279565b348015620003c757600080fd5b50620003df620003d936600462003a79565b62001074565b005b348015620003ee57600080fd5b50620004066200040036600462003a79565b62001158565b604051620002799190600060e08201905060ff83511682526020830151602083015260408301516040830152606083015161ffff8082166060850152608085015160808501528060a08601511660a0850152505060c083015160c083015292915050565b3480156200047757600080fd5b506200036b6200048936600462003a47565b60009081526005602052604090205460ff1690565b348015620004ab57600080fd5b506001546001600160a01b0316620003a1565b348015620004cb57600080fd5b50620003a16200130d565b348015620004e357600080fd5b50620004fb620004f536600462003bc3565b62001327565b60405162000279919062003f72565b3480156200051757600080fd5b50620003df620013bc565b3480156200052f57600080fd5b506000546001600160a01b0316620003a1565b620003156200055336600462003e43565b62001486565b3480156200056657600080fd5b5060025461ffff165b60405161ffff909116815260200162000279565b3480156200059057600080fd5b50620003df620005a236600462003a79565b62001714565b348015620005b557600080fd5b506200036b620005c736600462003a47565b60009081526006602052604090205460ff1690565b348015620005e957600080fd5b506004546001600160a01b0316620003a1565b3480156200060957600080fd5b50620006316200061b36600462003dd7565b61ffff166000908152600b602052604090205490565b60405190815260200162000279565b3480156200064d57600080fd5b50620004fb6200065f36600462003b29565b62001881565b3480156200067257600080fd5b5060035462000631565b3480156200068957600080fd5b50620006316200069b36600462003967565b6001600160a01b03166000908152600a602052604090205490565b62000315620006c7366004620039ef565b620018fa565b348015620006da57600080fd5b50620003df620006ec36600462003a79565b62001bfa565b348015620006ff57600080fd5b506200036b6200071136600462003967565b6001600160a01b031660009081526007602052604090205460ff1690565b3480156200073c57600080fd5b50620003a16200074e36600462003a79565b62001c07565b3480156200076157600080fd5b50620003a16200077336600462003a79565b62001d26565b3480156200078657600080fd5b5060025462010000900461ffff166200056f565b348015620007a757600080fd5b50620007bf620007b936600462003a79565b62001e3b565b6040516200027991908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b3480156200080757600080fd5b50620003df6200081936600462003a79565b62002016565b6040805160a08101825260008082526020820181905291810182905260608101829052608081018290529062000856838262002023565b82526200086560208262004142565b82519091506a546f6b656e42726964676514620008d55760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b620008e1838262002085565b60ff166020830152620008f660018262004142565b9050816020015160ff166001146200095d5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b6064820152608401620008cc565b620009698382620020e5565b61ffff1660408301526200097f60028262004142565b90506200098d8382620020e5565b61ffff166060830152620009a360028262004142565b9050620009b1838262002023565b6080830152620009c360208262004142565b90508083511462000a235760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b6064820152608401620008cc565b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529062000a67838262002085565b60ff16825262000a7960018262004142565b9050816000015160ff1660021462000ac85760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b6044820152606401620008cc565b62000ad4838262002023565b60208084019190915262000ae9908262004142565b905062000af78382620020e5565b61ffff16604083015262000b0d60028262004142565b905062000b1b838262002085565b60ff16606083015262000b3060018262004142565b905062000b3e838262002023565b608083015262000b5060208262004142565b905062000b5e838262002023565b60a083015262000b7060208262004142565b90508083511462000a235760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b6044820152606401620008cc565b600080600062000be0896001600160a01b031660009081526009602052604090205460ff1690565b1562000cda57886001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c2057600080fd5b505afa15801562000c35573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c5b919062003df6565b9150886001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c9757600080fd5b505afa15801562000cac573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cd2919062003a60565b905062000cee565b505060025461ffff166001600160a01b0388165b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b038c169162000d32919062003efb565b600060405180830381855afa9150503d806000811462000d6f576040519150601f19603f3d011682016040523d82523d6000602084013e62000d74565b606091505b5091505060008180602001905181019062000d90919062003eae565b905062000da962000da28b8362002146565b8262002185565b995062000db960025461ffff1690565b61ffff168461ffff16141562000f6757604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17905290516000916001600160a01b038e169162000e1e919062003efb565b600060405180830381855afa9150503d806000811462000e5b576040519150601f19603f3d011682016040523d82523d6000602084013e62000e60565b606091505b5091505060008180602001905181019062000e7c919062003a60565b905062000e8c8d33308f620021ba565b6040513060248201526000906001600160a01b038f16906370a0823160e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000eef919062003efb565b600060405180830381855afa9150503d806000811462000f2c576040519150601f19603f3d011682016040523d82523d6000602084013e62000f31565b606091505b5091505060008180602001905181019062000f4d919062003a60565b905062000f5b8382620042a8565b9d505050505062000fd8565b62000f758b33308d620021ba565b604051632770a7eb60e21b8152306004820152602481018b90526001600160a01b038c1690639dc29fac90604401600060405180830381600087803b15801562000fbe57600080fd5b505af115801562000fd3573d6000803e3d6000fd5b505050505b600062000fe68b8362002146565b9050600062000ff6898462002146565b90506200100660025461ffff1690565b61ffff168661ffff1614156200102257620010228d836200222d565b620010348686848e8e86348f620022fa565b9d9c50505050505050505050505050565b61ffff821660009081526008602090815260408083208484529091529020546001600160a01b03165b92915050565b6000806000620010848462002438565b925092509250818190620010ad5760405162461bcd60e51b8152600401620008cc919062003f72565b50620010d38361014001516000908152600560205260409020805460ff19166001179055565b6000620010e48460e0015162001e3b565b9050620010f460025461ffff1690565b61ffff16816040015161ffff1614620011415760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401620008cc565b6060810151620011519062002667565b5050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101829052906200119d838262002085565b60ff168252620011af60018262004142565b9050816000015160ff16600114620011fd5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620008cc565b6200120983826200279e565b6020808401919091526200121e908262004142565b90506200122c838262002023565b60408301526200123e60208262004142565b90506200124c8382620020e5565b61ffff1660608301526200126260028262004142565b905062001270838262002023565b60808301526200128260208262004142565b9050620012908382620020e5565b61ffff1660a0830152620012a660028262004142565b9050620012b483826200279e565b60c0830152620012c660208262004142565b90508083511462000a235760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620008cc565b6000620013226001546001600160a01b031690565b905090565b8051602080830151604080850151606080870151608088015160a089015160c08a0151955160f89990991b6001600160f81b031916978901979097526021880195909552604187019290925260f091821b6001600160f01b03199081166061880152606387019490945293901b909116608384015260858301529060a5015b6040516020818303038152906040529050919050565b6000620013f07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001415816001600160a01b031660009081526007602052604090205460ff1690565b156200145a5760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401620008cc565b62001483816001600160a01b03166000908152600760205260409020805460ff19166001179055565b50565b6000806200149c6000546001600160a01b031690565b6001600160a01b0316631a90a2196040518163ffffffff1660e01b815260040160206040518083038186803b158015620014d557600080fd5b505afa158015620014ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001510919062003a60565b90503481106200156e5760405162461bcd60e51b815260206004820152602260248201527f76616c756520697320736d616c6c6572207468616e20776f726d686f6c652066604482015261656560f01b6064820152608401620008cc565b60006200157c8234620042a8565b905080851115620015e55760405162461bcd60e51b815260206004820152602c60248201527f66656520697320626967676572207468616e20616d6f756e74206d696e75732060448201526b776f726d686f6c652066656560a01b6064820152608401620008cc565b6000620015f482601262002146565b905060006200160587601262002146565b905060006200161683601262002185565b620016229085620042a8565b905080156200165b57604051339082156108fc029083906000818181858888f1935050505015801562001659573d6000803e3d6000fd5b505b6004546001600160a01b031663d0e30db0620016788387620042a8565b6040518263ffffffff1660e01b81526004016000604051808303818588803b158015620016a457600080fd5b505af1158015620016b9573d6000803e3d6000fd5b5050505050620016dc620016d56004546001600160a01b031690565b846200222d565b62001706620016ee60025461ffff1690565b6004546001600160a01b0316858d8d878b8e620022fa565b9a9950505050505050505050565b6000806000620017248462002438565b9250925092508181906200174d5760405162461bcd60e51b8152600401620008cc919062003f72565b50620017738361014001516000908152600560205260409020805460ff19166001179055565b6000620017848460e001516200081f565b90506200179460025461ffff1690565b61ffff16816040015161ffff161480620017b45750604081015161ffff16155b620017f55760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b6044820152606401620008cc565b606081015161ffff166000908152600b6020526040812054146200185c5760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c7265616479207265676973746572656400000000000000006044820152606401620008cc565b620011518160600151826080015161ffff9091166000908152600b6020526040902055565b8051602080830151604080850151606080870151608088015160a0890151945160f898891b6001600160f81b031990811698820198909852602181019690965260f09390931b6001600160f01b031916604186015290951b909316604383015260448201929092526064810191909152608401620013a6565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b179052905160009182916001600160a01b038616916200193f9162003efb565b600060405180830381855afa9150503d80600081146200197c576040519150601f19603f3d011682016040523d82523d6000602084013e62001981565b606091505b5060408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b1790529051919350600092506001600160a01b03871691620019ca919062003efb565b600060405180830381855afa9150503d806000811462001a07576040519150601f19603f3d011682016040523d82523d6000602084013e62001a0c565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b0388169162001a55919062003efb565b600060405180830381855afa9150503d806000811462001a92576040519150601f19603f3d011682016040523d82523d6000602084013e62001a97565b606091505b5091505060008380602001905181019062001ab3919062003eae565b905060008380602001905181019062001acd919062003af3565b905060008380602001905181019062001ae7919062003af3565b9050600080602084015191506020830151905060006040518060c00160405280600260ff1681526020018d6001600160a01b031660001b815260200162001b3160025461ffff1690565b61ffff1681526020018760ff168152602001848152602001838152509050600062001b5c8262001881565b905062001b716000546001600160a01b031690565b6001600160a01b031663b19a437e348e84600f6040518563ffffffff1660e01b815260040162001ba49392919062004060565b6020604051808303818588803b15801562001bbe57600080fd5b505af115801562001bd3573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062001034919062003e91565b62001483816000620027f7565b60008060008062001c206000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001c4d919062003f72565b60006040518083038186803b15801562001c6657600080fd5b505afa15801562001c7b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001ca5919081019062003c68565b92509250925081819062001cce5760405162461bcd60e51b8152600401620008cc919062003f72565b5062001cda8362002ed2565b62001cf95760405162461bcd60e51b8152600401620008cc9062004037565b600062001d0a8460e0015162000a29565b905062001d1c818560a0015162002f0f565b9695505050505050565b60008060008062001d3f6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001d6c919062003f72565b60006040518083038186803b15801562001d8557600080fd5b505afa15801562001d9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001dc4919081019062003c68565b92509250925081819062001ded5760405162461bcd60e51b8152600401620008cc919062003f72565b5062001df98362002ed2565b62001e185760405162461bcd60e51b8152600401620008cc9062004037565b600062001e298460e0015162000a29565b905062001d1c818560a00151620031c0565b60408051608081018252600080825260208201819052918101829052606081018290529062001e6b838262002023565b825262001e7a60208262004142565b82519091506a546f6b656e4272696467651462001ee85760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b6064820152608401620008cc565b62001ef4838262002085565b60ff16602083015262001f0960018262004142565b9050816020015160ff1660021462001f725760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b6064820152608401620008cc565b62001f7e8382620020e5565b61ffff16604083015262001f9460028262004142565b905062001fa2838262002023565b606083015262001fb460208262004142565b90508083511462000a235760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b6064820152608401620008cc565b62001483816001620027f7565b60006200203282602062004142565b835110156200207c5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401620008cc565b50016020015190565b60006200209482600162004142565b83511015620020dc5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401620008cc565b50016001015190565b6000620020f482600262004142565b835110156200213d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401620008cc565b50016002015190565b600060088260ff1611156200217e5762002162600883620042c2565b6200216f90600a620041c7565b6200217b90846200415d565b92505b5090919050565b600060088260ff1611156200217e57620021a1600883620042c2565b620021ae90600a620041c7565b6200217b908462004286565b6040516001600160a01b0380851660248301528316604482015260648101829052620022279085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152620032bb565b50505050565b6001600160a01b0382166000908152600a60205260409020546001600160401b036200225a838362004142565b1115620022c85760405162461bcd60e51b815260206004820152603560248201527f7472616e736665722065786365656473206d6178206f75747374616e64696e6760448201527408189c9a5919d959081d1bdad95b88185b5bdd5b9d605a1b6064820152608401620008cc565b620022f583620022d9848462004142565b6001600160a01b039091166000908152600a6020526040902055565b505050565b600086841115620023435760405162461bcd60e51b815260206004820152601260248201527119995948195e18d959591cc8185b5bdd5b9d60721b6044820152606401620008cc565b6040805160e081018252600181526020810189905290810189905261ffff808b16606083015260808201879052871660a082015260c0810185905260006200238b8262001327565b9050620023a06000546001600160a01b031690565b6001600160a01b031663b19a437e868684600f6040518563ffffffff1660e01b8152600401620023d39392919062004060565b6020604051808303818588803b158015620023ed57600080fd5b505af115801562002402573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002429919062003e91565b9b9a5050505050505050505050565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620024ac6000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620024d9919062003f72565b60006040518083038186803b158015620024f257600080fd5b505afa15801562002507573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002531919081019062003c68565b925092509250816200254a579194509250905062002660565b60025462010000900461ffff1661ffff16836060015161ffff1614620025a85750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062002660565b600354836080015114620025fb57505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062002660565b61014083015160009081526005602052604090205460ff1615620026455782600060405180606001604052806022815260200162004d296022913995509550955050505062002660565b50506040805160208101909152600081529093506001925090505b9193909250565b60006200269b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050620026a88262003394565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620026ed9162003efb565b600060405180830381855af49150503d80600081146200272a576040519150601f19603f3d011682016040523d82523d6000602084013e6200272f565b606091505b5091509150818190620027575760405162461bcd60e51b8152600401620008cc919062003f72565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b6000620027ad82602062004142565b835110156200207c5760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401620008cc565b60008060006200280f6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016200283c919062003f72565b60006040518083038186803b1580156200285557600080fd5b505afa1580156200286a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002894919081019062003c68565b925092509250818190620028bd5760405162461bcd60e51b8152600401620008cc919062003f72565b50620028c98362002ed2565b620028e85760405162461bcd60e51b8152600401620008cc9062004037565b6000620028f98460e0015162001158565b90506200291a84610140015160009081526006602052604090205460ff1690565b15620029695760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c657465640000000000006044820152606401620008cc565b6200298e8461014001516000908152600660205260409020805460ff19166001179055565b60025461ffff1661ffff168160a0015161ffff1614620029e85760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b6044820152606401620008cc565b6000620029f860025461ffff1690565b61ffff16826060015161ffff16141562002a2a57506040810151602082015162002a24908290620033d6565b62002aab565b600062002a408360600151846040015162001045565b90506001600160a01b03811662002aa85760405162461bcd60e51b815260206004820152602560248201527f6e6f207772617070657220666f72207468697320746f6b656e2063726561746560448201526419081e595d60da1b6064820152608401620008cc565b90505b85158062002ac657506004546001600160a01b038281169116145b62002b205760405162461bcd60e51b815260206004820152602360248201527f696e76616c696420746f6b656e2c2063616e206f6e6c7920756e77726170205760448201526208aa8960eb1b6064820152608401620008cc565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b0384169162002b64919062003efb565b600060405180830381855afa9150503d806000811462002ba1576040519150601f19603f3d011682016040523d82523d6000602084013e62002ba6565b606091505b5091505060008180602001905181019062002bc2919062003eae565b9050600062002bd685602001518362002185565b9050600062002bea8660c001518462002185565b9050801562002d79578181111562002c505760405162461bcd60e51b815260206004820152602260248201527f66656520686967686572207468616e207472616e7366657272656420616d6f756044820152611b9d60f21b6064820152608401620008cc565b891562002cea5760048054604051632e1a7d4d60e01b81529182018390526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002c9c57600080fd5b505af115801562002cb1573d6000803e3d6000fd5b505060405133925083156108fc02915083906000818181858888f1935050505015801562002ce3573d6000803e3d6000fd5b5062002d79565b60025461ffff1661ffff16866060015161ffff161462002d6c576040516340c10f1960e01b8152336004820152602481018290526001600160a01b038616906340c10f1990604401600060405180830381600087803b15801562002d4d57600080fd5b505af115801562002d62573d6000803e3d6000fd5b5050505062002d79565b62002d798533836200340c565b600062002d878284620042a8565b60808801519091508b1562002e325760048054604051632e1a7d4d60e01b81529182018490526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002ddb57600080fd5b505af115801562002df0573d6000803e3d6000fd5b50506040516001600160a01b038416925084156108fc02915084906000818181858888f1935050505015801562002e2b573d6000803e3d6000fd5b5062002ec3565b60025461ffff1661ffff16886060015161ffff161462002eb6576040516340c10f1960e01b81526001600160a01b038281166004830152602482018490528816906340c10f1990604401600060405180830381600087803b15801562002e9757600080fd5b505af115801562002eac573d6000803e3d6000fd5b5050505062002ec3565b62002ec38782846200340c565b50505050505050505050505050565b6000816080015162002ef8836060015161ffff166000908152600b602052604090205490565b141562002f0757506001919050565b506000919050565b600062002f1f60025461ffff1690565b61ffff16836040015161ffff16141562002f8d5760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b6064820152608401620008cc565b60006001600160a01b031662002fac8460400151856020015162001045565b6001600160a01b031614620030045760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c726561647920657869737473000000006044820152606401620008cc565b600063c71f461560e01b6200301d8560a001516200343e565b6200302c86608001516200343e565b8660600151863089604001518a6020015160405160240162003055979695949392919062003fca565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b031990951694909417909352519092506000916200309f91309185910162003f4c565b6040516020818303038152906040529050600060405180602001620030c490620037ab565b601f1982820381018352601f909101166040819052620030ea9190849060200162003f19565b60405160208183030381529060405290506000866040015187602001516040516020016200313192919060f09290921b6001600160f01b0319168252600282015260220190565b604051602081830303815290604052805190602001209050808251602084016000f59450843b6200316157600080fd5b6040808801516020808a015161ffff90921660009081526008825283812092815291815282822080546001600160a01b0319166001600160a01b038a1690811790915582526009905220805460ff191660011790555050505092915050565b600080620031d78460400151856020015162001045565b90506001600160a01b038116620032315760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420617373657420646f6573206e6f74206578697374730000006044820152606401620008cc565b806001600160a01b031663a18cd7c66200324f8660a001516200343e565b6200325e87608001516200343e565b866040518463ffffffff1660e01b81526004016200327f9392919062003f87565b600060405180830381600087803b1580156200329a57600080fd5b505af1158015620032af573d6000803e3d6000fd5b50929695505050505050565b600062003312826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620035799092919063ffffffff16565b805190915015620022f5578080602001905181019062003333919062003a2a565b620022f55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620008cc565b6200339f8162003594565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b620034088282620033fc856001600160a01b03166000908152600a602052604090205490565b620022d99190620042a8565b5050565b6040516001600160a01b038316602482015260448101829052620022f590849063a9059cbb60e01b90606401620021ef565b606060005b6020811080156200348157508281602081106200347057634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b156200349c5780620034938162004317565b91505062003443565b6000816001600160401b03811115620034c557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015620034f0576020820181803683370190505b50905060005b8281101562003571578481602081106200352057634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200354557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620035688162004317565b915050620034f6565b509392505050565b60606200358a84846000856200363b565b90505b9392505050565b803b620035fa5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620008cc565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060824710156200369e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620008cc565b843b620036ee5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620008cc565b600080866001600160a01b031685876040516200370c919062003efb565b60006040518083038185875af1925050503d80600081146200374b576040519150601f19603f3d011682016040523d82523d6000602084013e62003750565b606091505b5091509150620037628282866200376d565b979650505050505050565b606083156200377e5750816200358d565b8251156200378f5782518084602001fd5b8160405162461bcd60e51b8152600401620008cc919062003f72565b610993806200439683390190565b80356001600160a01b0381168114620037d157600080fd5b919050565b600082601f830112620037e7578081fd5b815160206001600160401b038211156200380557620038056200434b565b62003815818360051b01620040e5565b80838252828201915082860187848660071b890101111562003835578586fd5b855b85811015620038a557608080838b03121562003851578788fd5b6200385b62004094565b835181528684015187820152604080850151620038788162004385565b908201526060848101516200388d8162004385565b90820152855293850193919091019060010162003837565b5090979650505050505050565b80518015158114620037d157600080fd5b600082601f830112620038d4578081fd5b8151620038eb620038e58262004118565b620040e5565b81815284602083860101111562003900578283fd5b62003913826020830160208701620042e8565b949350505050565b8035620037d18162004361565b8051620037d18162004361565b8051620037d18162004372565b80516001600160401b0381168114620037d157600080fd5b8051620037d18162004385565b60006020828403121562003979578081fd5b6200358d82620037b9565b60008060008060008060c087890312156200399d578182fd5b620039a887620037b9565b9550602087013594506040870135620039c18162004361565b9350606087013592506080870135915060a0870135620039e18162004372565b809150509295509295509295565b6000806040838503121562003a02578182fd5b62003a0d83620037b9565b9150602083013562003a1f8162004372565b809150509250929050565b60006020828403121562003a3c578081fd5b6200358d82620038b2565b60006020828403121562003a59578081fd5b5035919050565b60006020828403121562003a72578081fd5b5051919050565b60006020828403121562003a8b578081fd5b81356001600160401b0381111562003aa1578182fd5b8201601f8101841362003ab2578182fd5b803562003ac3620038e58262004118565b81815285602083850101111562003ad8578384fd5b81602084016020830137908101602001929092525092915050565b60006020828403121562003b05578081fd5b81516001600160401b0381111562003b1b578182fd5b6200391384828501620038c3565b600060c0828403121562003b3b578081fd5b60405160c081018181106001600160401b038211171562003b605762003b606200434b565b604052823562003b708162004385565b815260208381013590820152604083013562003b8c8162004361565b6040820152606083013562003ba18162004385565b60608201526080838101359082015260a0928301359281019290925250919050565b600060e0828403121562003bd5578081fd5b60405160e081018181106001600160401b038211171562003bfa5762003bfa6200434b565b604052823562003c0a8162004385565b808252506020830135602082015260408301356040820152606083013562003c328162004361565b60608201526080838101359082015262003c4f60a084016200391b565b60a082015260c083013560c08201528091505092915050565b60008060006060848603121562003c7d578081fd5b83516001600160401b038082111562003c94578283fd5b90850190610160828803121562003ca9578283fd5b62003cb3620040bf565b62003cbe836200395a565b815262003cce6020840162003935565b602082015262003ce16040840162003935565b604082015262003cf46060840162003928565b60608201526080830151608082015262003d1160a0840162003942565b60a082015262003d2460c084016200395a565b60c082015260e08301518281111562003d3b578485fd5b62003d4989828601620038c3565b60e08301525061010062003d5f81850162003935565b90820152610120838101518381111562003d77578586fd5b62003d858a828701620037d6565b91830191909152506101408381015190820152945062003da860208701620038b2565b9350604086015191508082111562003dbe578283fd5b5062003dcd86828701620038c3565b9150509250925092565b60006020828403121562003de9578081fd5b81356200358d8162004361565b60006020828403121562003e08578081fd5b81516200358d8162004361565b6000806040838503121562003e28578182fd5b823562003e358162004361565b946020939093013593505050565b6000806000806080858703121562003e59578182fd5b843562003e668162004361565b93506020850135925060408501359150606085013562003e868162004372565b939692955090935050565b60006020828403121562003ea3578081fd5b6200358d8262003942565b60006020828403121562003ec0578081fd5b81516200358d8162004385565b6000815180845262003ee7816020860160208601620042e8565b601f01601f19169290920160200192915050565b6000825162003f0f818460208701620042e8565b9190910192915050565b6000835162003f2d818460208801620042e8565b83519083019062003f43818360208801620042e8565b01949350505050565b6001600160a01b03831681526040602082018190526000906200358a9083018462003ecd565b6020815260006200358d602083018462003ecd565b60608152600062003f9c606083018662003ecd565b828103602084015262003fb0818662003ecd565b9150506001600160401b0383166040830152949350505050565b60e08152600062003fdf60e083018a62003ecd565b828103602084015262003ff3818a62003ecd565b60ff98909816604084015250506001600160401b039490941660608501526001600160a01b0392909216608084015261ffff1660a083015260c09091015292915050565b6020808252600f908201526e34b73b30b634b21032b6b4ba3a32b960891b604082015260600190565b63ffffffff8416815260606020820152600062004081606083018562003ecd565b905060ff83166040830152949350505050565b604051608081016001600160401b0381118282101715620040b957620040b96200434b565b60405290565b60405161016081016001600160401b0381118282101715620040b957620040b96200434b565b604051601f8201601f191681016001600160401b03811182821017156200411057620041106200434b565b604052919050565b60006001600160401b038211156200413457620041346200434b565b50601f01601f191660200190565b6000821982111562004158576200415862004335565b500190565b6000826200417957634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115620041bf578160001904821115620041a357620041a362004335565b80851615620041b157918102915b93841c939080029062004183565b509250929050565b60006200358d60ff841683600082620041e3575060016200106e565b81620041f2575060006200106e565b81600181146200420b5760028114620042165762004236565b60019150506200106e565b60ff8411156200422a576200422a62004335565b50506001821b6200106e565b5060208310610133831016604e8410600b84101617156200425b575081810a6200106e565b6200426783836200417e565b80600019048211156200427e576200427e62004335565b029392505050565b6000816000190483118215151615620042a357620042a362004335565b500290565b600082821015620042bd57620042bd62004335565b500390565b600060ff821660ff841680821015620042df57620042df62004335565b90039392505050565b60005b8381101562004305578181015183820152602001620042eb565b83811115620022275750506000910152565b60006000198214156200432e576200432e62004335565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff811681146200148357600080fd5b63ffffffff811681146200148357600080fd5b60ff811681146200148357600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220be83f8bec2944555ac2f26c49d486b8ad5034a5c48edaef755a50336198b2af464736f6c63430008040033",_=(function(e){function t(t){return e.call(this,T,k,t)||this}w(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(T)},t.connect=function(e,t){return new a.b(e,T,t)},t.bytecode=k,t.abi=T}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),O=[{inputs:[{internalType:"address",name:"beacon",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],S="0x608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",x=(function(e){function t(t){return e.call(this,O,S,t)||this}_(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(O)},t.connect=function(e,t){return new a.b(e,O,t)},t.bytecode=S,t.abi=O}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),A=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"address",name:"wormhole",type:"address"},{internalType:"uint16",name:"governanceChainId",type:"uint16"},{internalType:"bytes32",name:"governanceContract",type:"bytes32"},{internalType:"address",name:"tokenImplementation",type:"address"},{internalType:"address",name:"WETH",type:"address"}],name:"setup",outputs:[],stateMutability:"nonpayable",type:"function"}],M="0x608060405234801561001057600080fd5b50610299806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633bfa063814610030575b600080fd5b61004361003e3660046101e5565b610045565b005b60028054600080546001600160a01b0389166001600160a01b031990911617905561ffff868116620100000263ffffffff19909216908916171790556003839055600180546001600160a01b0319166001600160a01b038416179055600480546001600160a01b0319166001600160a01b0383161790556100c5876100ce565b50505050505050565b6100d78161010e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6101765760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146101ce57600080fd5b919050565b803561ffff811681146101ce57600080fd5b600080600080600080600060e0888a0312156101ff578283fd5b610208886101b7565b9650610216602089016101d3565b9550610224604089016101b7565b9450610232606089016101d3565b93506080880135925061024760a089016101b7565b915061025560c089016101b7565b90509295989194975092955056fea26469706673582212209a7c4b81dc8885f571074127d92f516568ccd8ac5597e6f490bab77c9fc3b11664736f6c63430008040033",E=(function(e){function t(t){return e.call(this,A,M,t)||this}x(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(A)},t.connect=function(e,t){return new a.b(e,A,t)},t.bytecode=M,t.abi=A}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),P=[{inputs:[{internalType:"address",name:"beacon",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],j="0x608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",I=(function(e){function t(t){return e.call(this,P,j,t)||this}E(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(P)},t.connect=function(e,t){return new a.b(e,P,t)},t.bytecode=j,t.abi=P}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"payee",type:"address"},{indexed:!1,internalType:"uint256",name:"weiAmount",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"payee",type:"address"},{indexed:!1,internalType:"uint256",name:"weiAmount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[{internalType:"address",name:"payee",type:"address"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"payee",type:"address"}],name:"depositsOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"payee",type:"address"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"payee",type:"address"}],name:"withdrawalAllowed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),C=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(I)},e.connect=function(e,t){return new a.b(e,I,t)},e.abi=I}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),R=[{inputs:[{internalType:"string",name:"uri_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],N="0x60806040523480156200001157600080fd5b50604051620016b9380380620016b9833981016040819052620000349162000105565b6200003f8162000046565b506200022e565b80516200005b9060029060208401906200005f565b5050565b8280546200006d90620001db565b90600052602060002090601f016020900481019282620000915760008555620000dc565b82601f10620000ac57805160ff1916838001178555620000dc565b82800160010185558215620000dc579182015b82811115620000dc578251825591602001919060010190620000bf565b50620000ea929150620000ee565b5090565b5b80821115620000ea5760008155600101620000ef565b6000602080838503121562000118578182fd5b82516001600160401b03808211156200012f578384fd5b818501915085601f83011262000143578384fd5b81518181111562000158576200015862000218565b604051601f8201601f19908116603f0116810190838211818310171562000183576200018362000218565b8160405282815288868487010111156200019b578687fd5b8693505b82841015620001be57848401860151818501870152928501926200019f565b82841115620001cf57868684830101525b98975050505050505050565b600181811c90821680620001f057607f821691505b602082108114156200021257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61147b806200023e6000396000f3fe608060405234801561001057600080fd5b50600436106100875760003560e01c80634e1273f41161005b5780634e1273f41461010a578063a22cb4651461012a578063e985e9c51461013d578063f242432a1461017957610087565b8062fdd58e1461008c57806301ffc9a7146100b25780630e89341c146100d55780632eb2c2d6146100f5575b600080fd5b61009f61009a366004610efa565b61018c565b6040519081526020015b60405180910390f35b6100c56100c0366004610fee565b610223565b60405190151581526020016100a9565b6100e86100e336600461102d565b610277565b6040516100a991906111ae565b610108610103366004610db7565b61030b565b005b61011d610118366004610f23565b6103b4565b6040516100a9919061116d565b610108610138366004610ec0565b610516565b6100c561014b366004610d85565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610108610187366004610e5d565b61062a565b60006001600160a01b0383166101fd5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061025457506001600160e01b031982166303a24d0760e21b145b8061026f57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b606060028054610286906112d4565b80601f01602080910402602001604051908101604052809291908181526020018280546102b2906112d4565b80156102ff5780601f106102d4576101008083540402835291602001916102ff565b820191906000526020600020905b8154815290600101906020018083116102e257829003601f168201915b50505050509050919050565b6103136106c3565b6001600160a01b0316856001600160a01b0316148061033957506103398561014b6106c3565b6103a05760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016101f4565b6103ad85858585856106c8565b5050505050565b606081518351146104195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016101f4565b6000835167ffffffffffffffff81111561044357634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b50905060005b845181101561050e576104d385828151811061049e57634e487b7160e01b600052603260045260246000fd5b60200260200101518583815181106104c657634e487b7160e01b600052603260045260246000fd5b602002602001015161018c565b8282815181106104f357634e487b7160e01b600052603260045260246000fd5b60209081029190910101526105078161133c565b9050610472565b509392505050565b816001600160a01b03166105286106c3565b6001600160a01b031614156105915760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016101f4565b806001600061059e6106c3565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556105e26106c3565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161061e911515815260200190565b60405180910390a35050565b6106326106c3565b6001600160a01b0316856001600160a01b0316148061065857506106588561014b6106c3565b6106b65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016101f4565b6103ad85858585856108cc565b335b90565b815183511461072a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016101f4565b6001600160a01b0384166107505760405162461bcd60e51b81526004016101f490611209565b600061075a6106c3565b905060005b845181101561085e57600085828151811061078a57634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106107b657634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156108065760405162461bcd60e51b81526004016101f49061124e565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906108439084906112bc565b92505081905550505050806108579061133c565b905061075f565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516108ae929190611180565b60405180910390a46108c48187878787876109fd565b505050505050565b6001600160a01b0384166108f25760405162461bcd60e51b81526004016101f490611209565b60006108fc6106c3565b905061091681878761090d88610b68565b6103ad88610b68565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156109575760405162461bcd60e51b81526004016101f49061124e565b6000858152602081815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906109949084906112bc565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46109f4828888888888610bc1565b50505050505050565b6001600160a01b0384163b156108c45760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190610a4190899089908890889088906004016110ca565b602060405180830381600087803b158015610a5b57600080fd5b505af1925050508015610a8b575060408051601f3d908101601f19168201909252610a8891810190611011565b60015b610b3857610a97611383565b806308c379a01415610ad15750610aac61139a565b80610ab75750610ad3565b8060405162461bcd60e51b81526004016101f491906111ae565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016101f4565b6001600160e01b0319811663bc197c8160e01b146109f45760405162461bcd60e51b81526004016101f4906111c1565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110610bb057634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b156108c45760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190610c059089908990889088908890600401611128565b602060405180830381600087803b158015610c1f57600080fd5b505af1925050508015610c4f575060408051601f3d908101601f19168201909252610c4c91810190611011565b60015b610c5b57610a97611383565b6001600160e01b0319811663f23a6e6160e01b146109f45760405162461bcd60e51b81526004016101f4906111c1565b80356001600160a01b038116811461027257600080fd5b600082601f830112610cb2578081fd5b81356020610cbf82611298565b604051610ccc828261130f565b8381528281019150858301600585901b87018401881015610ceb578586fd5b855b85811015610d0957813584529284019290840190600101610ced565b5090979650505050505050565b600082601f830112610d26578081fd5b813567ffffffffffffffff811115610d4057610d4061136d565b604051610d57601f8301601f19166020018261130f565b818152846020838601011115610d6b578283fd5b816020850160208301379081016020019190915292915050565b60008060408385031215610d97578182fd5b610da083610c8b565b9150610dae60208401610c8b565b90509250929050565b600080600080600060a08688031215610dce578081fd5b610dd786610c8b565b9450610de560208701610c8b565b9350604086013567ffffffffffffffff80821115610e01578283fd5b610e0d89838a01610ca2565b94506060880135915080821115610e22578283fd5b610e2e89838a01610ca2565b93506080880135915080821115610e43578283fd5b50610e5088828901610d16565b9150509295509295909350565b600080600080600060a08688031215610e74578081fd5b610e7d86610c8b565b9450610e8b60208701610c8b565b93506040860135925060608601359150608086013567ffffffffffffffff811115610eb4578182fd5b610e5088828901610d16565b60008060408385031215610ed2578182fd5b610edb83610c8b565b915060208301358015158114610eef578182fd5b809150509250929050565b60008060408385031215610f0c578182fd5b610f1583610c8b565b946020939093013593505050565b60008060408385031215610f35578182fd5b823567ffffffffffffffff80821115610f4c578384fd5b818501915085601f830112610f5f578384fd5b81356020610f6c82611298565b604051610f79828261130f565b8381528281019150858301600585901b870184018b1015610f98578889fd5b8896505b84871015610fc157610fad81610c8b565b835260019690960195918301918301610f9c565b5096505086013592505080821115610fd7578283fd5b50610fe485828601610ca2565b9150509250929050565b600060208284031215610fff578081fd5b813561100a8161142c565b9392505050565b600060208284031215611022578081fd5b815161100a8161142c565b60006020828403121561103e578081fd5b5035919050565b6000815180845260208085019450808401835b8381101561107457815187529582019590820190600101611058565b509495945050505050565b60008151808452815b818110156110a457602081850181015186830182015201611088565b818111156110b55782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0386811682528516602082015260a0604082018190526000906110f690830186611045565b82810360608401526111088186611045565b9050828103608084015261111c818561107f565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906111629083018461107f565b979650505050505050565b60006020825261100a6020830184611045565b6000604082526111936040830185611045565b82810360208401526111a58185611045565b95945050505050565b60006020825261100a602083018461107f565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b600067ffffffffffffffff8211156112b2576112b261136d565b5060051b60200190565b600082198211156112cf576112cf611357565b500190565b600181811c908216806112e857607f821691505b6020821081141561130957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff811182821017156113355761133561136d565b6040525050565b600060001982141561135057611350611357565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156106c557600481823e5160e01c90565b600060443d10156113aa576106c5565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156113dc5750505050506106c5565b82850191508151818111156113f6575050505050506106c5565b843d8701016020828501011115611412575050505050506106c5565b6114216020828601018761130f565b509094505050505090565b6001600160e01b03198116811461144257600080fd5b5056fea26469706673582212205adf82880a09a85f7a1b95c8af419ce5cf77d06610ac0ffd5b99d7df48fdd51f64736f6c63430008030033",D=(function(e){function t(t){return e.call(this,R,N,t)||this}C(t,e),t.prototype.deploy=function(t,n){return e.prototype.deploy.call(this,t,n||{})},t.prototype.getDeployTransaction=function(t,n){return e.prototype.getDeployTransaction.call(this,t,n||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(R)},t.connect=function(e,t){return new a.b(e,R,t)},t.bytecode=N,t.abi=R}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]),B=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(D)},e.connect=function(e,t){return new a.b(e,D,t)},e.abi=D}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),U=[{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],L="0x608060405234801561001057600080fd5b506103b8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806301ffc9a714610046578063bc197c811461006e578063f23a6e61146100a6575b600080fd5b61005961005436600461030c565b6100c5565b60405190151581526020015b60405180910390f35b61008d61007c366004610203565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610065565b61008d6100b43660046102a9565b63f23a6e6160e01b95945050505050565b60006001600160e01b03198216630271189760e51b14806100f657506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b80356001600160a01b03811681146100f957600080fd5b600082601f830112610125578081fd5b8135602067ffffffffffffffff8211156101415761014161036c565b8160051b61015082820161033b565b83815282810190868401838801850189101561016a578687fd5b8693505b8584101561018c57803583526001939093019291840191840161016e565b50979650505050505050565b600082601f8301126101a8578081fd5b813567ffffffffffffffff8111156101c2576101c261036c565b6101d5601f8201601f191660200161033b565b8181528460208386010111156101e9578283fd5b816020850160208301379081016020019190915292915050565b600080600080600060a0868803121561021a578081fd5b610223866100fe565b9450610231602087016100fe565b9350604086013567ffffffffffffffff8082111561024d578283fd5b61025989838a01610115565b9450606088013591508082111561026e578283fd5b61027a89838a01610115565b9350608088013591508082111561028f578283fd5b5061029c88828901610198565b9150509295509295909350565b600080600080600060a086880312156102c0578081fd5b6102c9866100fe565b94506102d7602087016100fe565b93506040860135925060608601359150608086013567ffffffffffffffff811115610300578182fd5b61029c88828901610198565b60006020828403121561031d578081fd5b81356001600160e01b031981168114610334578182fd5b9392505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156103645761036461036c565b604052919050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220c7089a563675685ec683fd12db514d46eb711c3b0cdf61b0863c181eff8fdfde64736f6c63430008030033",z=(function(e){function t(t){return e.call(this,U,L,t)||this}B(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(U)},t.connect=function(e,t){return new a.b(e,U,t)},t.bytecode=L,t.abi=U}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]),F=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(z)},e.connect=function(e,t){return new a.b(e,z,t)},e.abi=z}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),q=[{inputs:[{internalType:"string",name:"uri",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],H="0x60806040523480156200001157600080fd5b5060405162002e4b38038062002e4b8339810160408190526200003491620002d8565b806200004081620000b8565b506005805460ff19169055620000596000335b620000d1565b620000857f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63362000053565b620000b17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3362000053565b5062000401565b8051620000cd90600490602084019062000232565b5050565b620000e882826200011460201b62000b791760201c565b60008281526001602090815260409091206200010f91839062000b8762000120821b17901c565b505050565b620000cd828262000140565b600062000137836001600160a01b038416620001e0565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000cd576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200019c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205462000229575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200013a565b5060006200013a565b8280546200024090620003ae565b90600052602060002090601f016020900481019282620002645760008555620002af565b82601f106200027f57805160ff1916838001178555620002af565b82800160010185558215620002af579182015b82811115620002af57825182559160200191906001019062000292565b50620002bd929150620002c1565b5090565b5b80821115620002bd5760008155600101620002c2565b60006020808385031215620002eb578182fd5b82516001600160401b038082111562000302578384fd5b818501915085601f83011262000316578384fd5b8151818111156200032b576200032b620003eb565b604051601f8201601f19908116603f01168101908382118183101715620003565762000356620003eb565b8160405282815288868487010111156200036e578687fd5b8693505b8284101562000391578484018601518185018701529285019262000372565b82841115620003a257868684830101525b98975050505050505050565b600181811c90821680620003c357607f821691505b60208210811415620003e557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b612a3a80620004116000396000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c8063731133e9116100de578063ca15c87311610097578063e63ab1e911610071578063e63ab1e914610355578063e985e9c51461037c578063f242432a146103b8578063f5298aca146103cb57610172565b8063ca15c87314610308578063d53913931461031b578063d547741f1461034257610172565b8063731133e9146102945780638456cb59146102a75780639010d07c146102af57806391d14854146102da578063a217fddf146102ed578063a22cb465146102f557610172565b80632f2ff15d116101305780632f2ff15d1461022b57806336568abe1461023e5780633f4ba83a146102515780634e1273f4146102595780635c975abb146102795780636b20c4541461028157610172565b8062fdd58e1461017757806301ffc9a71461019d5780630e89341c146101c05780631f7fdffa146101e0578063248a9ca3146101f55780632eb2c2d614610218575b600080fd5b61018a610185366004612173565b6103de565b6040519081526020015b60405180910390f35b6101b06101ab366004612347565b61047a565b6040519015158152602001610194565b6101d36101ce3660046122ec565b61048d565b604051610194919061253e565b6101f36101ee3660046120a4565b610521565b005b61018a6102033660046122ec565b60009081526020819052604090206001015490565b6101f3610226366004611f2a565b610579565b6101f3610239366004612304565b610610565b6101f361024c366004612304565b610637565b6101f3610659565b61026c610267366004612221565b6106ff565b60405161019491906124fd565b6101b0610861565b6101f361028f366004612033565b61086b565b6101f36102a23660046121ce565b6108ae565b6101f3610900565b6102c26102bd366004612326565b6109a4565b6040516001600160a01b039091168152602001610194565b6101b06102e8366004612304565b6109c3565b61018a600081565b6101f3610303366004612139565b6109ec565b61018a6103163660046122ec565b610ad0565b61018a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6101f3610350366004612304565b610ae7565b61018a7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101b061038a366004611ef8565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b6101f36103c6366004611fd0565b610af1565b6101f36103d936600461219c565b610b36565b60006001600160a01b03831661044f5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060008181526002602090815260408083206001600160a01b03861684529091529020545b92915050565b600061048582610b9c565b90505b919050565b60606004805461049c90612893565b80601f01602080910402602001604051908101604052809291908181526020018280546104c890612893565b80156105155780601f106104ea57610100808354040283529160200191610515565b820191906000526020600020905b8154815290600101906020018083116104f857829003601f168201915b50505050509050919050565b61054b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336102e8565b6105675760405162461bcd60e51b8152600401610446906126ae565b61057384848484610bdc565b50505050565b6001600160a01b0385163314806105955750610595853361038a565b6105fc5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610446565b6106098585858585610d53565b5050505050565b61061a8282610f1c565b60008281526001602052604090206106329082610b87565b505050565b6106418282610f43565b60008281526001602052604090206106329082610fbd565b6106837f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336102e8565b6106f55760405162461bcd60e51b815260206004820152603b60248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20756e706175736500000000006064820152608401610446565b6106fd610fd2565b565b606081518351146107645760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610446565b6000835167ffffffffffffffff81111561078e57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156107b7578160200160208202803683370190505b50905060005b84518110156108595761081e8582815181106107e957634e487b7160e01b600052603260045260246000fd5b602002602001015185838151811061081157634e487b7160e01b600052603260045260246000fd5b60200260200101516103de565b82828151811061083e57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610852816128fb565b90506107bd565b509392505050565b60055460ff165b90565b6001600160a01b0383163314806108875750610887833361038a565b6108a35760405162461bcd60e51b8152600401610446906125dd565b610632838383611067565b6108d87f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336102e8565b6108f45760405162461bcd60e51b8152600401610446906126ae565b61057384848484611214565b61092a7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336102e8565b61099c5760405162461bcd60e51b815260206004820152603960248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f207061757365000000000000006064820152608401610446565b6106fd6112ec565b60008281526001602052604081206109bc9083611369565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b0383161415610a575760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610446565b3360008181526003602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610ac4911515815260200190565b60405180910390a35050565b600081815260016020526040812061048590611375565b610641828261137f565b6001600160a01b038516331480610b0d5750610b0d853361038a565b610b295760405162461bcd60e51b8152600401610446906125dd565b61060985858585856113a5565b6001600160a01b038316331480610b525750610b52833361038a565b610b6e5760405162461bcd60e51b8152600401610446906125dd565b6106328383836114c6565b610b8382826115cb565b5050565b60006109bc836001600160a01b03841661164f565b60006001600160e01b03198216636cdb3d1360e11b1480610bcd57506001600160e01b031982166303a24d0760e21b145b8061048557506104858261169e565b6001600160a01b038416610c025760405162461bcd60e51b81526004016104469061279d565b8151835114610c235760405162461bcd60e51b815260040161044690612755565b33610c33816000878787876116c3565b60005b8451811015610ceb57838181518110610c5f57634e487b7160e01b600052603260045260246000fd5b602002602001015160026000878481518110610c8b57634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610cd39190612802565b90915550819050610ce3816128fb565b915050610c36565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610d3c929190612510565b60405180910390a4610609816000878787876116d1565b8151835114610d745760405162461bcd60e51b815260040161044690612755565b6001600160a01b038416610d9a5760405162461bcd60e51b815260040161044690612626565b33610da98187878787876116c3565b60005b8451811015610eae576000858281518110610dd757634e487b7160e01b600052603260045260246000fd5b602002602001015190506000858381518110610e0357634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610e545760405162461bcd60e51b81526004016104469061270b565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e93908490612802565b9250508190555050505080610ea7906128fb565b9050610dac565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610efe929190612510565b60405180910390a4610f148187878787876116d1565b505050505050565b600082815260208190526040902060010154610f3981335b61183c565b61063283836115cb565b6001600160a01b0381163314610fb35760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610446565b610b8382826118a0565b60006109bc836001600160a01b038416611905565b610fda610861565b61101d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610446565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b03831661108d5760405162461bcd60e51b81526004016104469061266b565b80518251146110ae5760405162461bcd60e51b815260040161044690612755565b60003390506110d1818560008686604051806020016040528060008152506116c3565b60005b83518110156111b55760008482815181106110ff57634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061112b57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038c16835290935291909120549091508181101561117c5760405162461bcd60e51b815260040161044690612599565b60009283526002602090815260408085206001600160a01b038b16865290915290922091039055806111ad816128fb565b9150506110d4565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611206929190612510565b60405180910390a450505050565b6001600160a01b03841661123a5760405162461bcd60e51b81526004016104469061279d565b3361125a8160008761124b88611a22565b61125488611a22565b876116c3565b60008481526002602090815260408083206001600160a01b03891684529091528120805485929061128c908490612802565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461060981600087878787611a7b565b6112f4610861565b156113345760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610446565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861104a3390565b60006109bc8383611b45565b6000610485825490565b60008281526020819052604090206001015461139b8133610f34565b61063283836118a0565b6001600160a01b0384166113cb5760405162461bcd60e51b815260040161044690612626565b336113db81878761124b88611a22565b60008481526002602090815260408083206001600160a01b038a1684529091529020548381101561141e5760405162461bcd60e51b81526004016104469061270b565b60008581526002602090815260408083206001600160a01b038b811685529252808320878503905590881682528120805486929061145d908490612802565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46114bd828888888888611a7b565b50505050505050565b6001600160a01b0383166114ec5760405162461bcd60e51b81526004016104469061266b565b3361151b818560006114fd87611a22565b61150687611a22565b604051806020016040528060008152506116c3565b60008381526002602090815260408083206001600160a01b03881684529091529020548281101561155e5760405162461bcd60e51b815260040161044690612599565b60008481526002602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6115d582826109c3565b610b83576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561160b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205461169657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610474565b506000610474565b60006001600160e01b03198216635a05180f60e01b1480610485575061048582611b7d565b610f14868686868686611bb2565b6001600160a01b0384163b15610f145760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611715908990899088908890889060040161245a565b602060405180830381600087803b15801561172f57600080fd5b505af192505050801561175f575060408051601f3d908101601f1916820190925261175c91810190612363565b60015b61180c5761176b612942565b806308c379a014156117a55750611780612959565b8061178b57506117a7565b8060405162461bcd60e51b8152600401610446919061253e565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610446565b6001600160e01b0319811663bc197c8160e01b146114bd5760405162461bcd60e51b815260040161044690612551565b61184682826109c3565b610b835761185e816001600160a01b03166014611c1c565b611869836020611c1c565b60405160200161187a9291906123e5565b60408051601f198184030181529082905262461bcd60e51b82526104469160040161253e565b6118aa82826109c3565b15610b83576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015611a18576000611929600183612839565b855490915060009061193d90600190612839565b90508181146119be57600086600001828154811061196b57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061199c57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b85548690806119dd57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610474565b6000915050610474565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611a6a57634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b15610f145760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611abf90899089908890889088906004016124b8565b602060405180830381600087803b158015611ad957600080fd5b505af1925050508015611b09575060408051601f3d908101601f19168201909252611b0691810190612363565b60015b611b155761176b612942565b6001600160e01b0319811663f23a6e6160e01b146114bd5760405162461bcd60e51b815260040161044690612551565b6000826000018281548110611b6a57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60006001600160e01b03198216637965db0b60e01b148061048557506301ffc9a760e01b6001600160e01b0319831614610485565b611bba610861565b15610f145760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201526b1dda1a5b19481c185d5cd95960a21b6064820152608401610446565b60606000611c2b83600261281a565b611c36906002612802565b67ffffffffffffffff811115611c5c57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611c86576020820181803683370190505b509050600360fc1b81600081518110611caf57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cec57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000611d1084600261281a565b611d1b906001612802565b90505b6001811115611daf576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d5d57634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110611d8157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93611da88161287c565b9050611d1e565b5083156109bc5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610446565b80356001600160a01b038116811461048857600080fd5b600082601f830112611e25578081fd5b81356020611e32826127de565b604051611e3f82826128ce565b8381528281019150858301600585901b87018401881015611e5e578586fd5b855b85811015611e7c57813584529284019290840190600101611e60565b5090979650505050505050565b600082601f830112611e99578081fd5b813567ffffffffffffffff811115611eb357611eb361292c565b604051611eca601f8301601f1916602001826128ce565b818152846020838601011115611ede578283fd5b816020850160208301379081016020019190915292915050565b60008060408385031215611f0a578182fd5b611f1383611dfe565b9150611f2160208401611dfe565b90509250929050565b600080600080600060a08688031215611f41578081fd5b611f4a86611dfe565b9450611f5860208701611dfe565b9350604086013567ffffffffffffffff80821115611f74578283fd5b611f8089838a01611e15565b94506060880135915080821115611f95578283fd5b611fa189838a01611e15565b93506080880135915080821115611fb6578283fd5b50611fc388828901611e89565b9150509295509295909350565b600080600080600060a08688031215611fe7578081fd5b611ff086611dfe565b9450611ffe60208701611dfe565b93506040860135925060608601359150608086013567ffffffffffffffff811115612027578182fd5b611fc388828901611e89565b600080600060608486031215612047578283fd5b61205084611dfe565b9250602084013567ffffffffffffffff8082111561206c578384fd5b61207887838801611e15565b9350604086013591508082111561208d578283fd5b5061209a86828701611e15565b9150509250925092565b600080600080608085870312156120b9578384fd5b6120c285611dfe565b9350602085013567ffffffffffffffff808211156120de578485fd5b6120ea88838901611e15565b945060408701359150808211156120ff578384fd5b61210b88838901611e15565b93506060870135915080821115612120578283fd5b5061212d87828801611e89565b91505092959194509250565b6000806040838503121561214b578182fd5b61215483611dfe565b915060208301358015158114612168578182fd5b809150509250929050565b60008060408385031215612185578182fd5b61218e83611dfe565b946020939093013593505050565b6000806000606084860312156121b0578081fd5b6121b984611dfe565b95602085013595506040909401359392505050565b600080600080608085870312156121e3578182fd5b6121ec85611dfe565b93506020850135925060408501359150606085013567ffffffffffffffff811115612215578182fd5b61212d87828801611e89565b60008060408385031215612233578182fd5b823567ffffffffffffffff8082111561224a578384fd5b818501915085601f83011261225d578384fd5b8135602061226a826127de565b60405161227782826128ce565b8381528281019150858301600585901b870184018b1015612296578889fd5b8896505b848710156122bf576122ab81611dfe565b83526001969096019591830191830161229a565b50965050860135925050808211156122d5578283fd5b506122e285828601611e15565b9150509250929050565b6000602082840312156122fd578081fd5b5035919050565b60008060408385031215612316578182fd5b82359150611f2160208401611dfe565b60008060408385031215612338578182fd5b50508035926020909101359150565b600060208284031215612358578081fd5b81356109bc816129eb565b600060208284031215612374578081fd5b81516109bc816129eb565b6000815180845260208085019450808401835b838110156123ae57815187529582019590820190600101612392565b509495945050505050565b600081518084526123d1816020860160208601612850565b601f01601f19169290920160200192915050565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161241d816017850160208801612850565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161244e816028840160208801612850565b01602801949350505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906124869083018661237f565b8281036060840152612498818661237f565b905082810360808401526124ac81856123b9565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906124f2908301846123b9565b979650505050505050565b6000602082526109bc602083018461237f565b600060408252612523604083018561237f565b8281036020840152612535818561237f565b95945050505050565b6000602082526109bc60208301846123b9565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526038908201527f455243313135355072657365744d696e7465725061757365723a206d7573742060408201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b600067ffffffffffffffff8211156127f8576127f861292c565b5060051b60200190565b6000821982111561281557612815612916565b500190565b600081600019048311821515161561283457612834612916565b500290565b60008282101561284b5761284b612916565b500390565b60005b8381101561286b578181015183820152602001612853565b838111156105735750506000910152565b60008161288b5761288b612916565b506000190190565b600181811c908216806128a757607f821691505b602082108114156128c857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff811182821017156128f4576128f461292c565b6040525050565b600060001982141561290f5761290f612916565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d111561086857600481823e5160e01c90565b600060443d101561296957610868565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561299b575050505050610868565b82850191508151818111156129b557505050505050610868565b843d87010160208285010111156129d157505050505050610868565b6129e0602082860101876128ce565b509094505050505090565b6001600160e01b031981168114612a0157600080fd5b5056fea2646970667358221220060dba8a5818696e0f5d911225cc590120dc203aec666c59c2a67d5b30ecb68464736f6c63430008030033",J=(function(e){function t(t){return e.call(this,q,H,t)||this}F(t,e),t.prototype.deploy=function(t,n){return e.prototype.deploy.call(this,t,n||{})},t.prototype.getDeployTransaction=function(t,n){return e.prototype.getDeployTransaction.call(this,t,n||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(q)},t.connect=function(e,t){return new a.b(e,q,t)},t.bytecode=H,t.abi=q}(a.c),[{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),V=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(J)},e.connect=function(e,t){return new a.b(e,J,t)},e.abi=J}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"exists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]),W=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(V)},e.connect=function(e,t){return new a.b(e,V,t)},e.abi=V}(),[{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),K=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(W)},e.connect=function(e,t){return new a.b(e,W,t)},e.abi=W}(),[{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),G=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(K)},e.connect=function(e,t){return new a.b(e,K,t)},e.abi=K}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Z=[{inputs:[{internalType:"bytes32",name:"interfaceHash",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"canImplementInterfaceForAddress",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"}],X="0x608060405234801561001057600080fd5b50610112806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460a4565b604e565b60405190815260200160405180910390f35b6000828152602081815260408083206001600160a01b038516845290915281205460ff16607b576000609d565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560b5578182fd5b8235915060208301356001600160a01b038116811460d1578182fd5b80915050925092905056fea26469706673582212204632c1ec3802d05d61ae8523ec72aef2d74c909d2807e5511841a201a52fc3b864736f6c63430008030033",Y=(function(e){function t(t){return e.call(this,Z,X,t)||this}G(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Z)},t.connect=function(e,t){return new a.b(e,Z,t)},t.bytecode=X,t.abi=Z}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),$=[{inputs:[{internalType:"address",name:"_logic",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],stateMutability:"payable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],Q="0x608060405260405161077e38038061077e83398101604081905261002291610303565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61041b565b6000805160206107378339815191521461007757634e487b7160e01b600052600160045260246000fd5b6100838282600061008a565b5050610480565b610093836100c0565b6000825111806100a05750805b156100bb576100b9838361010060201b6100291760201c565b505b505050565b6100c98161012c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101258383604051806060016040528060278152602001610757602791396101ec565b9392505050565b61013f816102c160201b6100551760201c565b6101a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101cb60008051602061073783398151915260001b6102c760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61024b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161019d565b600080856001600160a01b03168560405161026691906103cc565b600060405180830381855af49150503d80600081146102a1576040519150601f19603f3d011682016040523d82523d6000602084013e6102a6565b606091505b5090925090506102b78282866102ca565b9695505050505050565b3b151590565b90565b606083156102d9575081610125565b8251156102e95782518084602001fd5b8160405162461bcd60e51b815260040161019d91906103e8565b60008060408385031215610315578182fd5b82516001600160a01b038116811461032b578283fd5b60208401519092506001600160401b0380821115610347578283fd5b818501915085601f83011261035a578283fd5b81518181111561036c5761036c61046a565b604051601f8201601f19908116603f011681019083821181831017156103945761039461046a565b816040528281528860208487010111156103ac578586fd5b6103bd83602083016020880161043e565b80955050505050509250929050565b600082516103de81846020870161043e565b9190910192915050565b600060208252825180602084015261040781604085016020870161043e565b601f01601f19169190910160400192915050565b60008282101561043957634e487b7160e01b81526011600452602481fd5b500390565b60005b83811015610459578181015183820152602001610441565b838111156100b95750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a88061048f6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b600060208252825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122045a655e4377b466c772d0002c84619390141d500175e10ed25cf2bf57537dfc564736f6c63430008030033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",ee=(function(e){function t(t){return e.call(this,$,Q,t)||this}Y(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface($)},t.connect=function(e,t){return new a.b(e,$,t)},t.bytecode=Q,t.abi=$}(a.c),[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"}]),te=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ee)},e.connect=function(e,t){return new a.b(e,ee,t)},e.abi=ee}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ne=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],re="0x60806040523480156200001157600080fd5b5060405162000b4b38038062000b4b8339810160408190526200003491620001c1565b81516200004990600390602085019062000068565b5080516200005f90600490602084019062000068565b5050506200027b565b828054620000769062000228565b90600052602060002090601f0160209004810192826200009a5760008555620000e5565b82601f10620000b557805160ff1916838001178555620000e5565b82800160010185558215620000e5579182015b82811115620000e5578251825591602001919060010190620000c8565b50620000f3929150620000f7565b5090565b5b80821115620000f35760008155600101620000f8565b600082601f8301126200011f578081fd5b81516001600160401b03808211156200013c576200013c62000265565b604051601f8301601f19908116603f0116810190828211818310171562000167576200016762000265565b8160405283815260209250868385880101111562000183578485fd5b8491505b83821015620001a6578582018301518183018401529082019062000187565b83821115620001b757848385830101525b9695505050505050565b60008060408385031215620001d4578182fd5b82516001600160401b0380821115620001eb578384fd5b620001f9868387016200010e565b935060208501519150808211156200020f578283fd5b506200021e858286016200010e565b9150509250929050565b600181811c908216806200023d57607f821691505b602082108114156200025f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6108c0806200028b6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b4114610149578063a457c2d714610151578063a9059cbb14610164578063dd62ed3e14610177576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101b0565b6040516100c391906107d8565b60405180910390f35b6100df6100da3660046107af565b610242565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610774565b610258565b604051601281526020016100c3565b6100df6101313660046107af565b610307565b6100f3610144366004610721565b610343565b6100b6610362565b6100df61015f3660046107af565b610371565b6100df6101723660046107af565b61040a565b6100f3610185366004610742565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101bf9061084f565b80601f01602080910402602001604051908101604052809291908181526020018280546101eb9061084f565b80156102385780601f1061020d57610100808354040283529160200191610238565b820191906000526020600020905b81548152906001019060200180831161021b57829003601f168201915b5050505050905090565b600061024f338484610417565b50600192915050565b600061026584848461053b565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156102ef5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6102fc8533858403610417565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161024f91859061033e90869061082b565b610417565b6001600160a01b0381166000908152602081905260409020545b919050565b6060600480546101bf9061084f565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156103f35760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016102e6565b6104003385858403610417565b5060019392505050565b600061024f33848461053b565b6001600160a01b0383166104795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102e6565b6001600160a01b0382166104da5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102e6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661059f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102e6565b6001600160a01b0382166106015760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102e6565b6001600160a01b038316600090815260208190526040902054818110156106795760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102e6565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906106b090849061082b565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106fc91815260200190565b60405180910390a350505050565b80356001600160a01b038116811461035d57600080fd5b600060208284031215610732578081fd5b61073b8261070a565b9392505050565b60008060408385031215610754578081fd5b61075d8361070a565b915061076b6020840161070a565b90509250929050565b600080600060608486031215610788578081fd5b6107918461070a565b925061079f6020850161070a565b9150604084013590509250925092565b600080604083850312156107c1578182fd5b6107ca8361070a565b946020939093013593505050565b6000602080835283518082850152825b81811015610804578581018301518582016040015282016107e8565b818111156108155783604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561084a57634e487b7160e01b81526011600452602481fd5b500190565b600181811c9082168061086357607f821691505b6020821081141561088457634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220d5fe2a4e17ce9d022007f408350bf2342a192449074b95d77ad2ccae63966f1064736f6c63430008030033",ae=(function(e){function t(t){return e.call(this,ne,re,t)||this}te(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(ne)},t.connect=function(e,t){return new a.b(e,ne,t)},t.bytecode=re,t.abi=ne}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),ie=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ae)},e.connect=function(e,t){return new a.b(e,ae,t)},e.abi=ae}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"cap",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),oe=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ie)},e.connect=function(e,t){return new a.b(e,ie,t)},e.abi=ie}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"flashFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC3156FlashBorrower",name:"receiver",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"flashLoan",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"maxFlashLoan",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),se=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(oe)},e.connect=function(e,t){return new a.b(e,oe,t)},e.abi=oe}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),ue=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(se)},e.connect=function(e,t){return new a.b(e,se,t)},e.abi=se}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),ce=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ue)},e.connect=function(e,t){return new a.b(e,ue,t)},e.abi=ue}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),fe=[{inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],de="0x60806040523480156200001157600080fd5b5060405162000f0438038062000f048339810160408190526200003491620002c3565b8351849084906200004d9060039060208501906200016a565b508051620000639060049060208401906200016a565b5050506200007881836200008260201b60201c565b50505050620003cc565b6001600160a01b038216620000dd5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000f1919062000354565b90915550506001600160a01b038216600090815260208190526040812080548392906200012090849062000354565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620001789062000379565b90600052602060002090601f0160209004810192826200019c5760008555620001e7565b82601f10620001b757805160ff1916838001178555620001e7565b82800160010185558215620001e7579182015b82811115620001e7578251825591602001919060010190620001ca565b50620001f5929150620001f9565b5090565b5b80821115620001f55760008155600101620001fa565b600082601f83011262000221578081fd5b81516001600160401b03808211156200023e576200023e620003b6565b604051601f8301601f19908116603f01168101908282118183101715620002695762000269620003b6565b8160405283815260209250868385880101111562000285578485fd5b8491505b83821015620002a8578582018301518183018401529082019062000289565b83821115620002b957848385830101525b9695505050505050565b60008060008060808587031215620002d9578384fd5b84516001600160401b0380821115620002f0578586fd5b620002fe8883890162000210565b9550602087015191508082111562000314578485fd5b50620003238782880162000210565b60408701516060880151919550935090506001600160a01b038116811462000349578182fd5b939692955090935050565b600082198211156200037457634e487b7160e01b81526011600452602481fd5b500190565b600181811c908216806200038e57607f821691505b60208210811415620003b057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b610b2880620003dc6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b4114610197578063a457c2d71461019f578063a9059cbb146101b2578063dd62ed3e146101c5576100cf565b806342966c681461015c57806370a082311461017157806379cc679014610184576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461011557806323b872dd14610127578063313ce5671461013a5780633950935114610149575b600080fd5b6100dc6101fe565b6040516100e99190610a1f565b60405180910390f35b6101056101003660046109de565b610290565b60405190151581526020016100e9565b6002545b6040519081526020016100e9565b6101056101353660046109a3565b6102a6565b604051601281526020016100e9565b6101056101573660046109de565b610355565b61016f61016a366004610a07565b610391565b005b61011961017f366004610950565b61039e565b61016f6101923660046109de565b6103bd565b6100dc610443565b6101056101ad3660046109de565b610452565b6101056101c03660046109de565b6104eb565b6101196101d3366004610971565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461020d90610aa1565b80601f016020809104026020016040519081016040528092919081815260200182805461023990610aa1565b80156102865780601f1061025b57610100808354040283529160200191610286565b820191906000526020600020905b81548152906001019060200180831161026957829003601f168201915b5050505050905090565b600061029d3384846104f8565b50600192915050565b60006102b384848461061c565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561033d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61034a85338584036104f8565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161029d91859061038c908690610a72565b6104f8565b61039b33826107eb565b50565b6001600160a01b0381166000908152602081905260409020545b919050565b60006103c983336101d3565b9050818110156104275760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b6064820152608401610334565b61043483338484036104f8565b61043e83836107eb565b505050565b60606004805461020d90610aa1565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156104d45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610334565b6104e133858584036104f8565b5060019392505050565b600061029d33848461061c565b6001600160a01b03831661055a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610334565b6001600160a01b0382166105bb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610334565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166106805760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610334565b6001600160a01b0382166106e25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610334565b6001600160a01b0383166000908152602081905260409020548181101561075a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610334565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610791908490610a72565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107dd91815260200190565b60405180910390a350505050565b6001600160a01b03821661084b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610334565b6001600160a01b038216600090815260208190526040902054818110156108bf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610334565b6001600160a01b03831660009081526020819052604081208383039055600280548492906108ee908490610a8a565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a361043e565b80356001600160a01b03811681146103b857600080fd5b600060208284031215610961578081fd5b61096a82610939565b9392505050565b60008060408385031215610983578081fd5b61098c83610939565b915061099a60208401610939565b90509250929050565b6000806000606084860312156109b7578081fd5b6109c084610939565b92506109ce60208501610939565b9150604084013590509250925092565b600080604083850312156109f0578182fd5b6109f983610939565b946020939093013593505050565b600060208284031215610a18578081fd5b5035919050565b6000602080835283518082850152825b81811015610a4b57858101830151858201604001528201610a2f565b81811115610a5c5783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610a8557610a85610adc565b500190565b600082821015610a9c57610a9c610adc565b500390565b600181811c90821680610ab557607f821691505b60208210811415610ad657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea26469706673582212200c78bc7e539580fb43b4dda3de1c552a8b022d52444f540f93aaf59495067d5e64736f6c63430008030033",le=(function(e){function t(t){return e.call(this,fe,de,t)||this}ce(t,e),t.prototype.deploy=function(t,n,r,a,i){return e.prototype.deploy.call(this,t,n,r,a,i||{})},t.prototype.getDeployTransaction=function(t,n,r,a,i){return e.prototype.getDeployTransaction.call(this,t,n,r,a,i||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(fe)},t.connect=function(e,t){return new a.b(e,fe,t)},t.bytecode=de,t.abi=fe}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),pe=[{inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"}],be="0x60806040523480156200001157600080fd5b5060405162001e3938038062001e3983398101604081905262000034916200039c565b8151829082906200004d90600590602085019062000243565b5080516200006390600690602084019062000243565b50506007805460ff19169055506200007e6000335b620000de565b620000aa7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63362000078565b620000d67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3362000078565b505062000456565b620000f582826200012160201b620009ec1760201c565b60008281526001602090815260409091206200011c918390620009f662000131821b17901c565b505050565b6200012d828262000151565b5050565b600062000148836001600160a01b038416620001f1565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200012d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001ad3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546200023a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200014b565b5060006200014b565b828054620002519062000403565b90600052602060002090601f016020900481019282620002755760008555620002c0565b82601f106200029057805160ff1916838001178555620002c0565b82800160010185558215620002c0579182015b82811115620002c0578251825591602001919060010190620002a3565b50620002ce929150620002d2565b5090565b5b80821115620002ce5760008155600101620002d3565b600082601f830112620002fa578081fd5b81516001600160401b038082111562000317576200031762000440565b604051601f8301601f19908116603f0116810190828211818310171562000342576200034262000440565b816040528381526020925086838588010111156200035e578485fd5b8491505b8382101562000381578582018301518183018401529082019062000362565b838211156200039257848385830101525b9695505050505050565b60008060408385031215620003af578182fd5b82516001600160401b0380821115620003c6578384fd5b620003d486838701620002e9565b93506020850151915080821115620003ea578283fd5b50620003f985828601620002e9565b9150509250929050565b600181811c908216806200041857607f821691505b602082108114156200043a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6119d380620004666000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d5391393146103af578063d547741f146103d6578063dd62ed3e146103e9578063e63ab1e914610422576101c4565b8063a457c2d714610376578063a9059cbb14610389578063ca15c8731461039c576101c4565b80639010d07c116100d35780639010d07c1461032857806391d148541461035357806395d89b4114610366578063a217fddf1461036e576101c4565b806370a08231146102e457806379cc67901461030d5780638456cb5914610320576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a146102ab57806340c10f19146102b357806342966c68146102c65780635c975abb146102d9576101c4565b8063313ce5671461027657806336568abe146102855780633950935114610298576101c4565b806318160ddd116101a257806318160ddd1461021957806323b872dd1461022b578063248a9ca31461023e5780632f2ff15d14610261576101c4565b806301ffc9a7146101c957806306fdde03146101f1578063095ea7b314610206575b600080fd5b6101dc6101d73660046117eb565b610449565b60405190151581526020015b60405180910390f35b6101f9610476565b6040516101e89190611888565b6101dc610214366004611767565b610508565b6004545b6040519081526020016101e8565b6101dc61023936600461172c565b61051f565b61021d61024c366004611790565b60009081526020819052604090206001015490565b61027461026f3660046117a8565b6105ce565b005b604051601281526020016101e8565b6102746102933660046117a8565b6105f5565b6101dc6102a6366004611767565b610617565b610274610653565b6102746102c1366004611767565b6106f9565b6102746102d4366004611790565b61079c565b60075460ff166101dc565b61021d6102f23660046116e0565b6001600160a01b031660009081526002602052604090205490565b61027461031b366004611767565b6107a9565b61027461082a565b61033b6103363660046117ca565b6108ce565b6040516001600160a01b0390911681526020016101e8565b6101dc6103613660046117a8565b6108ed565b6101f9610916565b61021d600081565b6101dc610384366004611767565b610925565b6101dc610397366004611767565b6109be565b61021d6103aa366004611790565b6109cb565b61021d7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102746103e43660046117a8565b6109e2565b61021d6103f73660046116fa565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b61021d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60006001600160e01b03198216635a05180f60e01b148061046e575061046e82610a0b565b90505b919050565b6060600580546104859061194c565b80601f01602080910402602001604051908101604052809291908181526020018280546104b19061194c565b80156104fe5780601f106104d3576101008083540402835291602001916104fe565b820191906000526020600020905b8154815290600101906020018083116104e157829003601f168201915b5050505050905090565b6000610515338484610a40565b5060015b92915050565b600061052c848484610b64565b6001600160a01b0384166000908152600360209081526040808320338452909152902054828110156105b65760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6105c38533858403610a40565b506001949350505050565b6105d88282610d3f565b60008281526001602052604090206105f090826109f6565b505050565b6105ff8282610d66565b60008281526001602052604090206105f09082610de0565b3360008181526003602090815260408083206001600160a01b0387168452909152812054909161051591859061064e9086906118bb565b610a40565b61067d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610361565b6106ef5760405162461bcd60e51b815260206004820152603960248201527f45524332305072657365744d696e7465725061757365723a206d75737420686160448201527f76652070617573657220726f6c6520746f20756e70617573650000000000000060648201526084016105ad565b6106f7610df5565b565b6107237f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610361565b61078e5760405162461bcd60e51b815260206004820152603660248201527f45524332305072657365744d696e7465725061757365723a206d7573742068616044820152751d99481b5a5b9d195c881c9bdb19481d1bc81b5a5b9d60521b60648201526084016105ad565b6107988282610e88565b5050565b6107a63382610f74565b50565b60006107b583336103f7565b9050818110156108135760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b60648201526084016105ad565b6108208333848403610a40565b6105f08383610f74565b6108547f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610361565b6108c65760405162461bcd60e51b815260206004820152603760248201527f45524332305072657365744d696e7465725061757365723a206d75737420686160448201527f76652070617573657220726f6c6520746f20706175736500000000000000000060648201526084016105ad565b6106f76110ce565b60008281526001602052604081206108e69083611149565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600680546104859061194c565b3360009081526003602090815260408083206001600160a01b0386168452909152812054828110156109a75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105ad565b6109b43385858403610a40565b5060019392505050565b6000610515338484610b64565b600081815260016020526040812061046e90611155565b6105ff828261115f565b6107988282611185565b60006108e6836001600160a01b038416611209565b60006001600160e01b03198216637965db0b60e01b148061046e57506301ffc9a760e01b6001600160e01b031983161461046e565b6001600160a01b038316610aa25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ad565b6001600160a01b038216610b035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ad565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bc85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ad565b6001600160a01b038216610c2a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ad565b610c35838383611258565b6001600160a01b03831660009081526002602052604090205481811015610cad5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105ad565b6001600160a01b03808516600090815260026020526040808220858503905591851681529081208054849290610ce49084906118bb565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d3091815260200190565b60405180910390a35b50505050565b600082815260208190526040902060010154610d5c81335b611263565b6105f08383611185565b6001600160a01b0381163314610dd65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105ad565b61079882826112c7565b60006108e6836001600160a01b03841661132c565b60075460ff16610e3e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105ad565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216610ede5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105ad565b610eea60008383611258565b8060046000828254610efc91906118bb565b90915550506001600160a01b03821660009081526002602052604081208054839290610f299084906118bb565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3610798565b6001600160a01b038216610fd45760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105ad565b610fe082600083611258565b6001600160a01b038216600090815260026020526040902054818110156110545760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105ad565b6001600160a01b03831660009081526002602052604081208383039055600480548492906110839084906118f2565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36105f0565b60075460ff16156111145760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105ad565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e6b3390565b60006108e68383611449565b600061046e825490565b60008281526020819052604090206001015461117b8133610d57565b6105f083836112c7565b61118f82826108ed565b610798576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556111c53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205461125057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610519565b506000610519565b6105f0838383611481565b61126d82826108ed565b61079857611285816001600160a01b031660146114e7565b6112908360206114e7565b6040516020016112a1929190611813565b60408051601f198184030181529082905262461bcd60e51b82526105ad91600401611888565b6112d182826108ed565b15610798576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000818152600183016020526040812054801561143f5760006113506001836118f2565b8554909150600090611364906001906118f2565b90508181146113e557600086600001828154811061139257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050808760000184815481106113c357634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061140457634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610519565b6000915050610519565b600082600001828154811061146e57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60075460ff16156105f05760405162461bcd60e51b815260206004820152602a60248201527f45524332305061757361626c653a20746f6b656e207472616e736665722077686044820152691a5b19481c185d5cd95960b21b60648201526084016105ad565b606060006114f68360026118d3565b6115019060026118bb565b67ffffffffffffffff81111561152757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611551576020820181803683370190505b509050600360fc1b8160008151811061157a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106115b757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006115db8460026118d3565b6115e69060016118bb565b90505b600181111561167a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061162857634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061164c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361167381611935565b90506115e9565b5083156108e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105ad565b80356001600160a01b038116811461047157600080fd5b6000602082840312156116f1578081fd5b6108e6826116c9565b6000806040838503121561170c578081fd5b611715836116c9565b9150611723602084016116c9565b90509250929050565b600080600060608486031215611740578081fd5b611749846116c9565b9250611757602085016116c9565b9150604084013590509250925092565b60008060408385031215611779578182fd5b611782836116c9565b946020939093013593505050565b6000602082840312156117a1578081fd5b5035919050565b600080604083850312156117ba578182fd5b82359150611723602084016116c9565b600080604083850312156117dc578182fd5b50508035926020909101359150565b6000602082840312156117fc578081fd5b81356001600160e01b0319811681146108e6578182fd5b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161184b816017850160208801611909565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161187c816028840160208801611909565b01602801949350505050565b60006020825282518060208401526118a7816040850160208701611909565b601f01601f19169190910160400192915050565b600082198211156118ce576118ce611987565b500190565b60008160001904831182151516156118ed576118ed611987565b500290565b60008282101561190457611904611987565b500390565b60005b8381101561192457818101518382015260200161190c565b83811115610d395750506000910152565b60008161194457611944611987565b506000190190565b600181811c9082168061196057607f821691505b6020821081141561198157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220ae386b40d9bc06b6d5a7d9610f6825fc91bf0484da9d4a0f3bb5474557c2aa4864736f6c63430008030033",he=(function(e){function t(t){return e.call(this,pe,be,t)||this}le(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(pe)},t.connect=function(e,t){return new a.b(e,pe,t)},t.bytecode=be,t.abi=pe}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"id",type:"uint256"}],name:"Snapshot",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"snapshotId",type:"uint256"}],name:"balanceOfAt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"snapshotId",type:"uint256"}],name:"totalSupplyAt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),ye=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(he)},e.connect=function(e,t){return new a.b(e,he,t)},e.abi=he}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"fromDelegate",type:"address"},{indexed:!0,internalType:"address",name:"toDelegate",type:"address"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!1,internalType:"uint256",name:"previousBalance",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newBalance",type:"uint256"}],name:"DelegateVotesChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint32",name:"pos",type:"uint32"}],name:"checkpoints",outputs:[{components:[{internalType:"uint32",name:"fromBlock",type:"uint32"},{internalType:"uint224",name:"votes",type:"uint224"}],internalType:"struct ERC20Votes.Checkpoint",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"delegates",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getPastTotalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getPastVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"numCheckpoints",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),me=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ye)},e.connect=function(e,t){return new a.b(e,ye,t)},e.abi=ye}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"fromDelegate",type:"address"},{indexed:!0,internalType:"address",name:"toDelegate",type:"address"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!1,internalType:"uint256",name:"previousBalance",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newBalance",type:"uint256"}],name:"DelegateVotesChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint32",name:"pos",type:"uint32"}],name:"checkpoints",outputs:[{components:[{internalType:"uint32",name:"fromBlock",type:"uint32"},{internalType:"uint224",name:"votes",type:"uint224"}],internalType:"struct ERC20Votes.Checkpoint",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"delegates",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getCurrentVotes",outputs:[{internalType:"uint96",name:"",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getPastTotalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getPastVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getPriorVotes",outputs:[{internalType:"uint96",name:"",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"numCheckpoints",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),ve=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(me)},e.connect=function(e,t){return new a.b(e,me,t)},e.abi=me}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"depositFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"underlying",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawTo",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),ge=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ve)},e.connect=function(e,t){return new a.b(e,ve,t)},e.abi=ve}(),[{inputs:[{internalType:"address",name:"forwarder",type:"address"}],name:"isTrustedForwarder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),we=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ge)},e.connect=function(e,t){return new a.b(e,ge,t)},e.abi=ge}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Te=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],ke="0x60806040523480156200001157600080fd5b50604051620014d2380380620014d28339810160408190526200003491620001c1565b81516200004990600090602085019062000068565b5080516200005f90600190602084019062000068565b5050506200027b565b828054620000769062000228565b90600052602060002090601f0160209004810192826200009a5760008555620000e5565b82601f10620000b557805160ff1916838001178555620000e5565b82800160010185558215620000e5579182015b82811115620000e5578251825591602001919060010190620000c8565b50620000f3929150620000f7565b5090565b5b80821115620000f35760008155600101620000f8565b600082601f8301126200011f578081fd5b81516001600160401b03808211156200013c576200013c62000265565b604051601f8301601f19908116603f0116810190828211818310171562000167576200016762000265565b8160405283815260209250868385880101111562000183578485fd5b8491505b83821015620001a6578582018301518183018401529082019062000187565b83821115620001b757848385830101525b9695505050505050565b60008060408385031215620001d4578182fd5b82516001600160401b0380821115620001eb578384fd5b620001f9868387016200010e565b935060208501519150808211156200020f578283fd5b506200021e858286016200010e565b9150509250929050565b600181811c908216806200023d57607f821691505b602082108114156200025f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b611247806200028b6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80636352211e1161008c578063a22cb46511610066578063a22cb465146101b3578063b88d4fde146101c6578063c87b56dd146101d9578063e985e9c5146101ec576100cf565b80636352211e1461017757806370a082311461018a57806395d89b41146101ab576100cf565b806301ffc9a7146100d457806306fdde03146100fc578063081812fc14610111578063095ea7b31461013c57806323b872dd1461015157806342842e0e14610164575b600080fd5b6100e76100e2366004610f3f565b610228565b60405190151581526020015b60405180910390f35b61010461027c565b6040516100f39190611027565b61012461011f366004610f77565b61030e565b6040516001600160a01b0390911681526020016100f3565b61014f61014a366004610f16565b6103a8565b005b61014f61015f366004610dcc565b6104be565b61014f610172366004610dcc565b6104ef565b610124610185366004610f77565b61050a565b61019d610198366004610d80565b610581565b6040519081526020016100f3565b610104610608565b61014f6101c1366004610edc565b610617565b61014f6101d4366004610e07565b6106e9565b6101046101e7366004610f77565b610721565b6100e76101fa366004610d9a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b148061025957506001600160e01b03198216635b5e139f60e01b145b8061027457506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b60606000805461028b9061114c565b80601f01602080910402602001604051908101604052809291908181526020018280546102b79061114c565b80156103045780601f106102d957610100808354040283529160200191610304565b820191906000526020600020905b8154815290600101906020018083116102e757829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661038c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006103b38261050a565b9050806001600160a01b0316836001600160a01b031614156104215760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610383565b336001600160a01b038216148061043d575061043d81336101fa565b6104af5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610383565b6104b98383610809565b505050565b6104c83382610877565b6104e45760405162461bcd60e51b81526004016103839061108c565b6104b983838361096e565b6104b9838383604051806020016040528060008152506106e9565b6000818152600260205260408120546001600160a01b0316806102745760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610383565b60006001600160a01b0382166105ec5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610383565b506001600160a01b031660009081526003602052604090205490565b60606001805461028b9061114c565b6001600160a01b0382163314156106705760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610383565b3360008181526005602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516106dd911515815260200190565b60405180910390a35050565b6106f33383610877565b61070f5760405162461bcd60e51b81526004016103839061108c565b61071b84848484610b0e565b50505050565b6000818152600260205260409020546060906001600160a01b03166107a05760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610383565b60006107b760408051602081019091526000815290565b905060008151116107d75760405180602001604052806000815250610802565b806107e184610b41565b6040516020016107f2929190610fbb565b6040516020818303038152906040525b9392505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061083e8261050a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166108f05760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610383565b60006108fb8361050a565b9050806001600160a01b0316846001600160a01b031614806109365750836001600160a01b031661092b8461030e565b6001600160a01b0316145b8061096657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166109818261050a565b6001600160a01b0316146109e95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610383565b6001600160a01b038216610a4b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610383565b610a56600082610809565b6001600160a01b0383166000908152600360205260408120805460019290610a7f908490611109565b90915550506001600160a01b0382166000908152600360205260408120805460019290610aad9084906110dd565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610b1984848461096e565b610b2584848484610c5c565b61071b5760405162461bcd60e51b81526004016103839061103a565b606081610b6657506040805180820190915260018152600360fc1b6020820152610277565b8160005b8115610b905780610b7a81611187565b9150610b899050600a836110f5565b9150610b6a565b60008167ffffffffffffffff811115610bb957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610be3576020820181803683370190505b5090505b841561096657610bf8600183611109565b9150610c05600a866111a2565b610c109060306110dd565b60f81b818381518110610c3357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350610c55600a866110f5565b9450610be7565b60006001600160a01b0384163b15610d5e57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610ca0903390899088908890600401610fea565b602060405180830381600087803b158015610cba57600080fd5b505af1925050508015610cea575060408051601f3d908101601f19168201909252610ce791810190610f5b565b60015b610d44573d808015610d18576040519150601f19603f3d011682016040523d82523d6000602084013e610d1d565b606091505b508051610d3c5760405162461bcd60e51b81526004016103839061103a565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610966565b506001949350505050565b80356001600160a01b038116811461027757600080fd5b600060208284031215610d91578081fd5b61080282610d69565b60008060408385031215610dac578081fd5b610db583610d69565b9150610dc360208401610d69565b90509250929050565b600080600060608486031215610de0578081fd5b610de984610d69565b9250610df760208501610d69565b9150604084013590509250925092565b60008060008060808587031215610e1c578081fd5b610e2585610d69565b9350610e3360208601610d69565b925060408501359150606085013567ffffffffffffffff80821115610e56578283fd5b818701915087601f830112610e69578283fd5b813581811115610e7b57610e7b6111e2565b604051601f8201601f19908116603f01168101908382118183101715610ea357610ea36111e2565b816040528281528a6020848701011115610ebb578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060408385031215610eee578182fd5b610ef783610d69565b915060208301358015158114610f0b578182fd5b809150509250929050565b60008060408385031215610f28578182fd5b610f3183610d69565b946020939093013593505050565b600060208284031215610f50578081fd5b8135610802816111f8565b600060208284031215610f6c578081fd5b8151610802816111f8565b600060208284031215610f88578081fd5b5035919050565b60008151808452610fa7816020860160208601611120565b601f01601f19169290920160200192915050565b60008351610fcd818460208801611120565b835190830190610fe1818360208801611120565b01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061101d90830184610f8f565b9695505050505050565b6000602082526108026020830184610f8f565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156110f0576110f06111b6565b500190565b600082611104576111046111cc565b500490565b60008282101561111b5761111b6111b6565b500390565b60005b8381101561113b578181015183820152602001611123565b8381111561071b5750506000910152565b600181811c9082168061116057607f821691505b6020821081141561118157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561119b5761119b6111b6565b5060010190565b6000826111b1576111b16111cc565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461120e57600080fd5b5056fea26469706673582212202d938d3b28324cc89e6d2076ba56ed8ae7428805a112a58e80ba9ad3b13c770964736f6c63430008030033",_e=(function(e){function t(t){return e.call(this,Te,ke,t)||this}we(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Te)},t.connect=function(e,t){return new a.b(e,Te,t)},t.bytecode=ke,t.abi=Te}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]),Oe=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(_e)},e.connect=function(e,t){return new a.b(e,_e,t)},e.abi=_e}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]),Se=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Oe)},e.connect=function(e,t){return new a.b(e,Oe,t)},e.abi=Oe}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),xe=[{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}],Ae="0x608060405234801561001057600080fd5b506101a8806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063150b7a0214610030575b600080fd5b61004e61003e366004610087565b630a85bd0160e11b949350505050565b6040516001600160e01b0319909116815260200160405180910390f35b80356001600160a01b038116811461008257600080fd5b919050565b6000806000806080858703121561009c578384fd5b6100a58561006b565b93506100b36020860161006b565b925060408501359150606085013567ffffffffffffffff808211156100d6578283fd5b818701915087601f8301126100e9578283fd5b8135818111156100fb576100fb61015c565b604051601f8201601f19908116603f011681019083821181831017156101235761012361015c565b816040528281528a602084870101111561013b578586fd5b82602086016020830137918201602001949094529598949750929550505050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dc27e8fed018fdfacad30c665dc1bdf024b6ef66c2c22fbce4a02747ba89990064736f6c63430008030033",Me=(function(e){function t(t){return e.call(this,xe,Ae,t)||this}Se(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(xe)},t.connect=function(e,t){return new a.b(e,xe,t)},t.bytecode=Ae,t.abi=xe}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]),Ee=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Me)},e.connect=function(e,t){return new a.b(e,Me,t)},e.abi=Me}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Pe=[{inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"baseTokenURI",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"}],je="0x60806040523480156200001157600080fd5b5060405162002b1438038062002b148339810160408190526200003491620003b3565b8251839083906200004d9060029060208501906200025a565b508051620000639060039060208401906200025a565b5050600c805460ff191690555080516200008590600e9060208401906200025a565b50620000946000335b620000f5565b620000c07f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336200008e565b620000ec7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336200008e565b50505062000493565b6200010c82826200013860201b62000e901760201c565b60008281526001602090815260409091206200013391839062000e9e62000148821b17901c565b505050565b62000144828262000168565b5050565b60006200015f836001600160a01b03841662000208565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000144576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001c43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054620002515750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000162565b50600062000162565b828054620002689062000440565b90600052602060002090601f0160209004810192826200028c5760008555620002d7565b82601f10620002a757805160ff1916838001178555620002d7565b82800160010185558215620002d7579182015b82811115620002d7578251825591602001919060010190620002ba565b50620002e5929150620002e9565b5090565b5b80821115620002e55760008155600101620002ea565b600082601f83011262000311578081fd5b81516001600160401b03808211156200032e576200032e6200047d565b604051601f8301601f19908116603f011681019082821181831017156200035957620003596200047d565b8160405283815260209250868385880101111562000375578485fd5b8491505b8382101562000398578582018301518183018401529082019062000379565b83821115620003a957848385830101525b9695505050505050565b600080600060608486031215620003c8578283fd5b83516001600160401b0380821115620003df578485fd5b620003ed8783880162000300565b9450602086015191508082111562000403578384fd5b620004118783880162000300565b9350604086015191508082111562000427578283fd5b50620004368682870162000300565b9150509250925092565b600181811c908216806200045557607f821691505b602082108114156200047757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61267180620004a36000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80636352211e1161010f578063a22cb465116100a2578063d539139311610071578063d5391393146103f7578063d547741f1461041e578063e63ab1e914610431578063e985e9c514610458576101e5565b8063a22cb465146103ab578063b88d4fde146103be578063c87b56dd146103d1578063ca15c873146103e4576101e5565b80639010d07c116100de5780639010d07c1461037557806391d148541461038857806395d89b411461039b578063a217fddf146103a3576101e5565b80636352211e146103345780636a6278421461034757806370a082311461035a5780638456cb591461036d576101e5565b80632f2ff15d1161018757806342842e0e1161015657806342842e0e146102f057806342966c68146103035780634f6ccce7146103165780635c975abb14610329576101e5565b80632f2ff15d146102af5780632f745c59146102c257806336568abe146102d55780633f4ba83a146102e8576101e5565b8063095ea7b3116101c3578063095ea7b31461025257806318160ddd1461026757806323b872dd14610279578063248a9ca31461028c576101e5565b806301ffc9a7146101ea57806306fdde0314610212578063081812fc14610227575b600080fd5b6101fd6101f83660046122d9565b610494565b60405190151581526020015b60405180910390f35b61021a6104a7565b604051610209919061241e565b61023a61023536600461227e565b610539565b6040516001600160a01b039091168152602001610209565b610265610260366004612255565b6105d3565b005b600a545b604051908152602001610209565b61026561028736600461210b565b6106e9565b61026b61029a36600461227e565b60009081526020819052604090206001015490565b6102656102bd366004612296565b61071b565b61026b6102d0366004612255565b61073d565b6102656102e3366004612296565b6107d6565b6102656107f8565b6102656102fe36600461210b565b6108a0565b61026561031136600461227e565b6108bb565b61026b61032436600461227e565b610935565b600c5460ff166101fd565b61023a61034236600461227e565b6109d6565b6102656103553660046120bf565b610a4d565b61026b6103683660046120bf565b610b09565b610265610b90565b61023a6103833660046122b8565b610c34565b6101fd610396366004612296565b610c53565b61021a610c7c565b61026b600081565b6102656103b936600461221b565b610c8b565b6102656103cc366004612146565b610d5d565b61021a6103df36600461227e565b610d95565b61026b6103f236600461227e565b610e6f565b61026b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61026561042c366004612296565b610e86565b61026b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101fd6104663660046120d9565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b600061049f82610eb3565b90505b919050565b6060600280546104b690612579565b80601f01602080910402602001604051908101604052809291908181526020018280546104e290612579565b801561052f5780601f106105045761010080835404028352916020019161052f565b820191906000526020600020905b81548152906001019060200180831161051257829003601f168201915b5050505050905090565b6000818152600460205260408120546001600160a01b03166105b75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006105de826109d6565b9050806001600160a01b0316836001600160a01b0316141561064c5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016105ae565b336001600160a01b038216148061066857506106688133610466565b6106da5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016105ae565b6106e48383610ed8565b505050565b6106f4335b82610f46565b6107105760405162461bcd60e51b81526004016105ae90612483565b6106e483838361103d565b61072582826111e8565b60008281526001602052604090206106e49082610e9e565b600061074883610b09565b82106107aa5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016105ae565b506001600160a01b03821660009081526008602090815260408083208484529091529020545b92915050565b6107e0828261120f565b60008281526001602052604090206106e49082611289565b6108227f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610396565b610896576040805162461bcd60e51b81526020600482015260248101919091527f4552433732315072657365744d696e7465725061757365724175746f49643a2060448201527f6d75737420686176652070617573657220726f6c6520746f20756e706175736560648201526084016105ae565b61089e61129e565b565b6106e483838360405180602001604052806000815250610d5d565b6108c4336106ee565b6109295760405162461bcd60e51b815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201526f1b995c881b9bdc88185c1c1c9bdd995960821b60648201526084016105ae565b61093281611331565b50565b6000610940600a5490565b82106109a35760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016105ae565b600a82815481106109c457634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000818152600460205260408120546001600160a01b03168061049f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016105ae565b610a777f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610396565b610ae95760405162461bcd60e51b815260206004820152603d60248201527f4552433732315072657365744d696e7465725061757365724175746f49643a2060448201527f6d7573742068617665206d696e74657220726f6c6520746f206d696e7400000060648201526084016105ae565b610afb81610af6600d5490565b6113d8565b610932600d80546001019055565b60006001600160a01b038216610b745760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016105ae565b506001600160a01b031660009081526005602052604090205490565b610bba7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610396565b610c2c5760405162461bcd60e51b815260206004820152603e60248201527f4552433732315072657365744d696e7465725061757365724175746f49643a2060448201527f6d75737420686176652070617573657220726f6c6520746f207061757365000060648201526084016105ae565b61089e611526565b6000828152600160205260408120610c4c90836115a1565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600380546104b690612579565b6001600160a01b038216331415610ce45760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105ae565b3360008181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610d51911515815260200190565b60405180910390a35050565b610d673383610f46565b610d835760405162461bcd60e51b81526004016105ae90612483565b610d8f848484846115ad565b50505050565b6000818152600460205260409020546060906001600160a01b0316610e145760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016105ae565b6000610e1e6115e0565b90506000815111610e3e5760405180602001604052806000815250610c4c565b80610e48846115ef565b604051602001610e5992919061233d565b6040516020818303038152906040529392505050565b600081815260016020526040812061049f9061170a565b6107e08282611714565b610e9a828261173a565b5050565b6000610c4c836001600160a01b0384166117be565b60006001600160e01b0319821663780e9d6360e01b148061049f575061049f8261180d565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610f0d826109d6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600460205260408120546001600160a01b0316610fbf5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105ae565b6000610fca836109d6565b9050806001600160a01b0316846001600160a01b031614806110055750836001600160a01b0316610ffa84610539565b6001600160a01b0316145b8061103557506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611050826109d6565b6001600160a01b0316146110b85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016105ae565b6001600160a01b03821661111a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105ae565b61112583838361184d565b611130600082610ed8565b6001600160a01b038316600090815260056020526040812080546001929061115990849061251f565b90915550506001600160a01b03821660009081526005602052604081208054600192906111879084906124d4565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008281526020819052604090206001015461120581335b611858565b6106e4838361173a565b6001600160a01b038116331461127f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105ae565b610e9a82826118bc565b6000610c4c836001600160a01b038416611921565b600c5460ff166112e75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105ae565b600c805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600061133c826109d6565b905061134a8160008461184d565b611355600083610ed8565b6001600160a01b038116600090815260056020526040812080546001929061137e90849061251f565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b03821661142e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105ae565b6000818152600460205260409020546001600160a01b0316156114935760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105ae565b61149f6000838361184d565b6001600160a01b03821660009081526005602052604081208054600192906114c89084906124d4565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600c5460ff161561156c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105ae565b600c805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586113143390565b6000610c4c8383611a3e565b6115b884848461103d565b6115c484848484611a76565b610d8f5760405162461bcd60e51b81526004016105ae90612431565b6060600e80546104b690612579565b60608161161457506040805180820190915260018152600360fc1b60208201526104a2565b8160005b811561163e5780611628816125b4565b91506116379050600a836124ec565b9150611618565b60008167ffffffffffffffff81111561166757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611691576020820181803683370190505b5090505b8415611035576116a660018361251f565b91506116b3600a866125cf565b6116be9060306124d4565b60f81b8183815181106116e157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611703600a866124ec565b9450611695565b600061049f825490565b6000828152602081905260409020600101546117308133611200565b6106e483836118bc565b6117448282610c53565b610e9a576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561177a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054611805575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107d0565b5060006107d0565b60006001600160e01b031982166380ac58cd60e01b148061183e57506001600160e01b03198216635b5e139f60e01b145b8061049f575061049f82611b83565b6106e4838383611ba8565b6118628282610c53565b610e9a5761187a816001600160a01b03166014611c1a565b611885836020611c1a565b60405160200161189692919061236c565b60408051601f198184030181529082905262461bcd60e51b82526105ae9160040161241e565b6118c68282610c53565b15610e9a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015611a3457600061194560018361251f565b85549091506000906119599060019061251f565b90508181146119da57600086600001828154811061198757634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050808760000184815481106119b857634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b85548690806119f957634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107d0565b60009150506107d0565b6000826000018281548110611a6357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60006001600160a01b0384163b15611b7857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611aba9033908990889088906004016123e1565b602060405180830381600087803b158015611ad457600080fd5b505af1925050508015611b04575060408051601f3d908101601f19168201909252611b01918101906122f5565b60015b611b5e573d808015611b32576040519150601f19603f3d011682016040523d82523d6000602084013e611b37565b606091505b508051611b565760405162461bcd60e51b81526004016105ae90612431565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611035565b506001949350505050565b60006001600160e01b03198216635a05180f60e01b148061049f575061049f82611dfc565b611bb3838383611e31565b600c5460ff16156106e45760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b60648201526084016105ae565b60606000611c29836002612500565b611c349060026124d4565b67ffffffffffffffff811115611c5a57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611c84576020820181803683370190505b509050600360fc1b81600081518110611cad57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cea57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000611d0e846002612500565b611d199060016124d4565b90505b6001811115611dad576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d5b57634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110611d7f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93611da681612562565b9050611d1c565b508315610c4c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105ae565b60006001600160e01b03198216637965db0b60e01b148061049f57506301ffc9a760e01b6001600160e01b031983161461049f565b6001600160a01b038316611e8c57611e8781600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b611eaf565b816001600160a01b0316836001600160a01b031614611eaf57611eaf8382611eee565b6001600160a01b038216611ecb57611ec681611f8b565b6106e4565b826001600160a01b0316826001600160a01b0316146106e4576106e48282612064565b60006001611efb84610b09565b611f05919061251f565b600083815260096020526040902054909150808214611f58576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a54600090611f9d9060019061251f565b6000838152600b6020526040812054600a8054939450909284908110611fd357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600a838154811061200257634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a80548061204857634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061206f83610b09565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b80356001600160a01b03811681146104a257600080fd5b6000602082840312156120d0578081fd5b610c4c826120a8565b600080604083850312156120eb578081fd5b6120f4836120a8565b9150612102602084016120a8565b90509250929050565b60008060006060848603121561211f578081fd5b612128846120a8565b9250612136602085016120a8565b9150604084013590509250925092565b6000806000806080858703121561215b578081fd5b612164856120a8565b9350612172602086016120a8565b925060408501359150606085013567ffffffffffffffff80821115612195578283fd5b818701915087601f8301126121a8578283fd5b8135818111156121ba576121ba61260f565b604051601f8201601f19908116603f011681019083821181831017156121e2576121e261260f565b816040528281528a60208487010111156121fa578586fd5b82602086016020830137918201602001949094529598949750929550505050565b6000806040838503121561222d578182fd5b612236836120a8565b91506020830135801515811461224a578182fd5b809150509250929050565b60008060408385031215612267578182fd5b612270836120a8565b946020939093013593505050565b60006020828403121561228f578081fd5b5035919050565b600080604083850312156122a8578182fd5b82359150612102602084016120a8565b600080604083850312156122ca578182fd5b50508035926020909101359150565b6000602082840312156122ea578081fd5b8135610c4c81612625565b600060208284031215612306578081fd5b8151610c4c81612625565b60008151808452612329816020860160208601612536565b601f01601f19169290920160200192915050565b6000835161234f818460208801612536565b835190830190612363818360208801612536565b01949350505050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516123a4816017850160208801612536565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516123d5816028840160208801612536565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061241490830184612311565b9695505050505050565b600060208252610c4c6020830184612311565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156124e7576124e76125e3565b500190565b6000826124fb576124fb6125f9565b500490565b600081600019048311821515161561251a5761251a6125e3565b500290565b600082821015612531576125316125e3565b500390565b60005b83811015612551578181015183820152602001612539565b83811115610d8f5750506000910152565b600081612571576125716125e3565b506000190190565b600181811c9082168061258d57607f821691505b602082108114156125ae57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156125c8576125c86125e3565b5060010190565b6000826125de576125de6125f9565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461093257600080fdfea26469706673582212207c3140b8543572afa84e5729a8fa58be87a95dc18779058077802a524585368b64736f6c63430008030033",Ie=(function(e){function t(t){return e.call(this,Pe,je,t)||this}Ee(t,e),t.prototype.deploy=function(t,n,r,a){return e.prototype.deploy.call(this,t,n,r,a||{})},t.prototype.getDeployTransaction=function(t,n,r,a){return e.prototype.getDeployTransaction.call(this,t,n,r,a||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Pe)},t.connect=function(e,t){return new a.b(e,Pe,t)},t.bytecode=je,t.abi=Pe}(a.c),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]),Ce=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Ie)},e.connect=function(e,t){return new a.b(e,Ie,t)},e.abi=Ie}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Re=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"address[]",name:"defaultOperators_",type:"address[]"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"tokenHolder",type:"address"}],name:"AuthorizedOperator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Burned",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Minted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"tokenHolder",type:"address"}],name:"RevokedOperator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Sent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"holder",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"authorizeOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenHolder",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"pure",type:"function"},{inputs:[],name:"defaultOperators",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"granularity",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"tokenHolder",type:"address"}],name:"isOperatorFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"operatorBurn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"operatorSend",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"revokeOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"send",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"holder",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],Ne="0x60806040523480156200001157600080fd5b5060405162001d3b38038062001d3b8339810160408190526200003491620003b0565b82516200004990600290602086019062000221565b5081516200005f90600390602085019062000221565b50805162000075906004906020840190620002b0565b5060005b8151811015620000f157600160056000848481518110620000aa57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000e88162000535565b91505062000079565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200016c57600080fd5b505af115801562000181573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b158015620001ff57600080fd5b505af115801562000214573d6000803e3d6000fd5b5050505050505062000573565b8280546200022f90620004f8565b90600052602060002090601f0160209004810192826200025357600085556200029e565b82601f106200026e57805160ff19168380011785556200029e565b828001600101855582156200029e579182015b828111156200029e57825182559160200191906001019062000281565b50620002ac92915062000308565b5090565b8280548282559060005260206000209081019282156200029e579160200282015b828111156200029e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002d1565b5b80821115620002ac576000815560010162000309565b600082601f83011262000330578081fd5b81516001600160401b038111156200034c576200034c6200055d565b602062000362601f8301601f19168201620004c5565b828152858284870101111562000376578384fd5b835b838110156200039557858101830151828201840152820162000378565b83811115620003a657848385840101525b5095945050505050565b600080600060608486031215620003c5578283fd5b83516001600160401b0380821115620003dc578485fd5b620003ea878388016200031f565b945060209150818601518181111562000401578485fd5b6200040f888289016200031f565b94505060408601518181111562000424578384fd5b8601601f8101881362000435578384fd5b8051828111156200044a576200044a6200055d565b8060051b92506200045d848401620004c5565b8181528481019083860185850187018c101562000478578788fd5b8795505b83861015620004b457805194506001600160a01b03851685146200049e578788fd5b848352600195909501949186019186016200047c565b508096505050505050509250925092565b604051601f8201601f191681016001600160401b0381118282101715620004f057620004f06200055d565b604052919050565b600181811c908216806200050d57607f821691505b602082108114156200052f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156200055657634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b6117b880620005836000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063959b8c3f116100a2578063d95b637111610071578063d95b63711461022b578063dd62ed3e1461023e578063fad8b32a14610277578063fc673c4f1461028a578063fe9d93031461029d57610116565b8063959b8c3f146101ea57806395d89b41146101fd5780639bd9bbc614610205578063a9059cbb1461021857610116565b806323b872dd116100e957806323b872dd14610183578063313ce56714610196578063556f0dc7146101a557806362ad1b83146101ac57806370a08231146101c157610116565b806306e485381461011b57806306fdde0314610139578063095ea7b31461014e57806318160ddd14610171575b600080fd5b6101236102b0565b60405161013091906115af565b60405180910390f35b610141610312565b60405161013091906115fc565b61016161015c3660046113c6565b61039b565b6040519015158152602001610130565b6001545b604051908152602001610130565b6101616101913660046112f6565b6103b3565b60405160128152602001610130565b6001610175565b6101bf6101ba366004611336565b61057c565b005b6101756101cf366004611286565b6001600160a01b031660009081526020819052604090205490565b6101bf6101f8366004611286565b6105b8565b6101416106d6565b6101bf6102133660046113f1565b6106e5565b6101616102263660046113c6565b610708565b6101616102393660046112be565b6107bb565b61017561024c3660046112be565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6101bf610285366004611286565b61085d565b6101bf610298366004611448565b610979565b6101bf6102ab3660046114c5565b6109b1565b6060600480548060200260200160405190810160405280929190818152602001828054801561030857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116102ea575b5050505050905090565b60606002805461032190611703565b80601f016020809104026020016040519081016040528092919081815260200182805461034d90611703565b80156103085780601f1061036f57610100808354040283529160200191610308565b820191906000526020600020905b81548152906001019060200180831161037d57509395945050505050565b6000336103a98185856109d0565b5060019392505050565b60006001600160a01b0383166103e45760405162461bcd60e51b81526004016103db9061160f565b60405180910390fd5b6001600160a01b0384166104495760405162461bcd60e51b815260206004820152602660248201527f4552433737373a207472616e736665722066726f6d20746865207a65726f206160448201526564647265737360d01b60648201526084016103db565b600033905061047a818686866040518060200160405280600081525060405180602001604052806000815250610af7565b6104a6818686866040518060200160405280600081525060405180602001604052806000815250610c2e565b6001600160a01b038086166000908152600860209081526040808320938516835292905220548381101561052e5760405162461bcd60e51b815260206004820152602960248201527f4552433737373a207472616e7366657220616d6f756e74206578636565647320604482015268616c6c6f77616e636560b81b60648201526084016103db565b610542868361053d87856116ec565b6109d0565b6105708287878760405180602001604052806000815250604051806020016040528060008152506000610d94565b50600195945050505050565b61058633866107bb565b6105a25760405162461bcd60e51b81526004016103db90611653565b6105b185858585856001610f68565b5050505050565b336001600160a01b038216141561061d5760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff161561066e573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff1916905561069d565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461032190611703565b61070333848484604051806020016040528060008152506001610f68565b505050565b60006001600160a01b0383166107305760405162461bcd60e51b81526004016103db9061160f565b6000339050610761818286866040518060200160405280600081525060405180602001604052806000815250610af7565b61078d818286866040518060200160405280600081525060405180602001604052806000815250610c2e565b6103a98182868660405180602001604052806000815250604051806020016040528060008152506000610d94565b6000816001600160a01b0316836001600160a01b0316148061082657506001600160a01b03831660009081526005602052604090205460ff16801561082657506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b8061085657506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6001600160a01b0381163314156108c05760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff1615610914573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610940565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b61098333856107bb565b61099f5760405162461bcd60e51b81526004016103db90611653565b6109ab8484848461104b565b50505050565b6109cc3383836040518060200160405280600081525061104b565b5050565b6001600160a01b038316610a345760405162461bcd60e51b815260206004820152602560248201527f4552433737373a20617070726f76652066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103db565b6001600160a01b038216610a965760405162461bcd60e51b815260206004820152602360248201527f4552433737373a20617070726f766520746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103db565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610b7357600080fd5b505afa158015610b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bab91906112a2565b90506001600160a01b03811615610c2557604051633ad5cbc160e11b81526001600160a01b038216906375ab978290610bf2908a908a908a908a908a908a90600401611555565b600060405180830381600087803b158015610c0c57600080fd5b505af1158015610c20573d6000803e3d6000fd5b505050505b50505050505050565b6001600160a01b03851660009081526020819052604090205483811015610ca75760405162461bcd60e51b815260206004820152602760248201527f4552433737373a207472616e7366657220616d6f756e7420657863656564732060448201526662616c616e636560c81b60648201526084016103db565b6001600160a01b03808716600090815260208190526040808220878503905591871681529081208054869290610cde9084906116d4565b92505081905550846001600160a01b0316866001600160a01b0316886001600160a01b03167f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc82614677987878787604051610d369392919061169f565b60405180910390a4846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610d8391815260200190565b60405180910390a350505050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610e1057600080fd5b505afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4891906112a2565b90506001600160a01b03811615610ec4576040516223de2960e01b81526001600160a01b038216906223de2990610e8d908b908b908b908b908b908b90600401611555565b600060405180830381600087803b158015610ea757600080fd5b505af1158015610ebb573d6000803e3d6000fd5b50505050610f5e565b8115610f5e576001600160a01b0386163b15610f5e5760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a4016103db565b5050505050505050565b6001600160a01b038616610fc95760405162461bcd60e51b815260206004820152602260248201527f4552433737373a2073656e642066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b6001600160a01b03851661101f5760405162461bcd60e51b815260206004820181905260248201527f4552433737373a2073656e6420746f20746865207a65726f206164647265737360448201526064016103db565b3361102e818888888888610af7565b61103c818888888888610c2e565b610c2581888888888888610d94565b6001600160a01b0384166110ac5760405162461bcd60e51b815260206004820152602260248201527f4552433737373a206275726e2066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b336110bc81866000878787610af7565b6001600160a01b038516600090815260208190526040902054848110156111315760405162461bcd60e51b815260206004820152602360248201527f4552433737373a206275726e20616d6f756e7420657863656564732062616c616044820152626e636560e81b60648201526084016103db565b6001600160a01b03861660009081526020819052604081208683039055600180548792906111609084906116ec565b92505081905550856001600160a01b0316826001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988787876040516111ae9392919061169f565b60405180910390a36040518581526000906001600160a01b038816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050565b600082601f83011261120f578081fd5b813567ffffffffffffffff8082111561122a5761122a611754565b604051601f8301601f19908116603f0116810190828211818310171561125257611252611754565b8160405283815286602085880101111561126a578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215611297578081fd5b81356108568161176a565b6000602082840312156112b3578081fd5b81516108568161176a565b600080604083850312156112d0578081fd5b82356112db8161176a565b915060208301356112eb8161176a565b809150509250929050565b60008060006060848603121561130a578081fd5b83356113158161176a565b925060208401356113258161176a565b929592945050506040919091013590565b600080600080600060a0868803121561134d578081fd5b85356113588161176a565b945060208601356113688161176a565b935060408601359250606086013567ffffffffffffffff8082111561138b578283fd5b61139789838a016111ff565b935060808801359150808211156113ac578283fd5b506113b9888289016111ff565b9150509295509295909350565b600080604083850312156113d8578182fd5b82356113e38161176a565b946020939093013593505050565b600080600060608486031215611405578283fd5b83356114108161176a565b925060208401359150604084013567ffffffffffffffff811115611432578182fd5b61143e868287016111ff565b9150509250925092565b6000806000806080858703121561145d578384fd5b84356114688161176a565b935060208501359250604085013567ffffffffffffffff8082111561148b578384fd5b611497888389016111ff565b935060608701359150808211156114ac578283fd5b506114b9878288016111ff565b91505092959194509250565b600080604083850312156114d7578182fd5b82359150602083013567ffffffffffffffff8111156114f4578182fd5b611500858286016111ff565b9150509250929050565b60008151808452815b8181101561152f57602081850181015186830182015201611513565b818111156115405782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c0608082018190526000906115909083018561150a565b82810360a08401526115a2818561150a565b9998505050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156115f05783516001600160a01b0316835292840192918401916001016115cb565b50909695505050505050565b600060208252610856602083018461150a565b60208082526024908201527f4552433737373a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f60408201526b39103337b9103437b63232b960a11b606082015260800190565b6000848252606060208301526116b8606083018561150a565b82810360408401526116ca818561150a565b9695505050505050565b600082198211156116e7576116e761173e565b500190565b6000828210156116fe576116fe61173e565b500390565b600181811c9082168061171757607f821691505b6020821081141561173857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461177f57600080fd5b5056fea26469706673582212208c42e235847878fc7d8ada1e55ed07d1efdb2128f8d741cd4debfe867146b70b64736f6c63430008030033",De=(function(e){function t(t){return e.call(this,Re,Ne,t)||this}Ce(t,e),t.prototype.deploy=function(t,n,r,a){return e.prototype.deploy.call(this,t,n,r,a||{})},t.prototype.getDeployTransaction=function(t,n,r,a){return e.prototype.getDeployTransaction.call(this,t,n,r,a||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Re)},t.connect=function(e,t){return new a.b(e,Re,t)},t.bytecode=Ne,t.abi=Re}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Be=[{inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"address[]",name:"defaultOperators",type:"address[]"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"tokenHolder",type:"address"}],name:"AuthorizedOperator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Burned",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Minted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"tokenHolder",type:"address"}],name:"RevokedOperator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Sent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"holder",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"authorizeOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenHolder",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"pure",type:"function"},{inputs:[],name:"defaultOperators",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"granularity",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"tokenHolder",type:"address"}],name:"isOperatorFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"operatorBurn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"operatorSend",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"revokeOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"send",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"holder",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],Ue="0x60806040523480156200001157600080fd5b506040516200222f3803806200222f833981016040819052620000349162000775565b84848482600290805190602001906200004f929190620005c9565b50815162000065906003906020850190620005c9565b5080516200007b90600490602084019062000658565b5060005b8151811015620000f757600160056000848481518110620000b057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000ee8162000a17565b9150506200007f565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200017257600080fd5b505af115801562000187573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b1580156200020557600080fd5b505af11580156200021a573d6000803e3d6000fd5b5050505050505062000253818360405180602001604052806000815250604051806020016040528060008152506200025e60201b60201c565b505050505062000a61565b6200026e84848484600162000274565b50505050565b6001600160a01b038516620002d05760405162461bcd60e51b815260206004820181905260248201527f4552433737373a206d696e7420746f20746865207a65726f206164647265737360448201526064015b60405180910390fd5b60003390508460016000828254620002e9919062000990565b90915550506001600160a01b038616600090815260208190526040812080548792906200031890849062000990565b909155506200033090508160008888888888620003ca565b856001600160a01b0316816001600160a01b03167f2fe5be0146f74c5bce36c0b80911af6c7d86ff27e89d5cfa61fc681327954e5d878787604051620003799392919062000924565b60405180910390a36040518581526001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b1580156200044757600080fd5b505afa1580156200045c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000482919062000751565b90506001600160a01b0381161562000504576040516223de2960e01b81526001600160a01b038216906223de2990620004ca908b908b908b908b908b908b90600401620008c6565b600060405180830381600087803b158015620004e557600080fd5b505af1158015620004fa573d6000803e3d6000fd5b50505050620005b5565b8115620005b5576200052a866001600160a01b0316620005bf60201b620009d01760201c565b15620005b55760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a401620002c7565b5050505050505050565b803b15155b919050565b828054620005d790620009da565b90600052602060002090601f016020900481019282620005fb576000855562000646565b82601f106200061657805160ff191683800117855562000646565b8280016001018555821562000646579182015b828111156200064657825182559160200191906001019062000629565b5062000654929150620006b0565b5090565b82805482825590600052602060002090810192821562000646579160200282015b828111156200064657825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000679565b5b80821115620006545760008155600101620006b1565b80516001600160a01b0381168114620005c457600080fd5b600082601f830112620006f0578081fd5b81516001600160401b038111156200070c576200070c62000a4b565b62000721601f8201601f19166020016200095d565b81815284602083860101111562000736578283fd5b62000749826020830160208701620009ab565b949350505050565b60006020828403121562000763578081fd5b6200076e82620006c7565b9392505050565b600080600080600060a086880312156200078d578081fd5b85516001600160401b0380821115620007a4578283fd5b620007b289838a01620006df565b9650602091508188015181811115620007c9578384fd5b620007d78a828b01620006df565b965050604088015181811115620007ec578384fd5b8801601f81018a13620007fd578384fd5b80518281111562000812576200081262000a4b565b8060051b9250620008258484016200095d565b8181528481019083860185850187018e101562000840578788fd5b8795505b838610156200086d576200085881620006c7565b83526001959095019491860191860162000844565b50809850505050505050606086015191506200088c60808701620006c7565b90509295509295909350565b60008151808452620008b2816020860160208601620009ab565b601f01601f19169290920160200192915050565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c060808201819052600090620009039083018562000898565b82810360a084015262000917818562000898565b9998505050505050505050565b6000848252606060208301526200093f606083018562000898565b828103604084015262000953818562000898565b9695505050505050565b604051601f8201601f191681016001600160401b038111828210171562000988576200098862000a4b565b604052919050565b60008219821115620009a657620009a662000a35565b500190565b60005b83811015620009c8578181015183820152602001620009ae565b838111156200026e5750506000910152565b600181811c90821680620009ef57607f821691505b6020821081141562000a1157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141562000a2e5762000a2e62000a35565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6117be8062000a716000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063959b8c3f116100a2578063d95b637111610071578063d95b63711461022b578063dd62ed3e1461023e578063fad8b32a14610277578063fc673c4f1461028a578063fe9d93031461029d57610116565b8063959b8c3f146101ea57806395d89b41146101fd5780639bd9bbc614610205578063a9059cbb1461021857610116565b806323b872dd116100e957806323b872dd14610183578063313ce56714610196578063556f0dc7146101a557806362ad1b83146101ac57806370a08231146101c157610116565b806306e485381461011b57806306fdde0314610139578063095ea7b31461014e57806318160ddd14610171575b600080fd5b6101236102b0565b60405161013091906115b5565b60405180910390f35b610141610312565b6040516101309190611602565b61016161015c3660046113cc565b61039b565b6040519015158152602001610130565b6001545b604051908152602001610130565b6101616101913660046112fc565b6103b3565b60405160128152602001610130565b6001610175565b6101bf6101ba36600461133c565b61057c565b005b6101756101cf36600461128c565b6001600160a01b031660009081526020819052604090205490565b6101bf6101f836600461128c565b6105b8565b6101416106d6565b6101bf6102133660046113f7565b6106e5565b6101616102263660046113cc565b610708565b6101616102393660046112c4565b6107bb565b61017561024c3660046112c4565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6101bf61028536600461128c565b61085d565b6101bf61029836600461144e565b610979565b6101bf6102ab3660046114cb565b6109b1565b6060600480548060200260200160405190810160405280929190818152602001828054801561030857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116102ea575b5050505050905090565b60606002805461032190611709565b80601f016020809104026020016040519081016040528092919081815260200182805461034d90611709565b80156103085780601f1061036f57610100808354040283529160200191610308565b820191906000526020600020905b81548152906001019060200180831161037d57509395945050505050565b6000336103a98185856109d6565b5060019392505050565b60006001600160a01b0383166103e45760405162461bcd60e51b81526004016103db90611615565b60405180910390fd5b6001600160a01b0384166104495760405162461bcd60e51b815260206004820152602660248201527f4552433737373a207472616e736665722066726f6d20746865207a65726f206160448201526564647265737360d01b60648201526084016103db565b600033905061047a818686866040518060200160405280600081525060405180602001604052806000815250610afd565b6104a6818686866040518060200160405280600081525060405180602001604052806000815250610c34565b6001600160a01b038086166000908152600860209081526040808320938516835292905220548381101561052e5760405162461bcd60e51b815260206004820152602960248201527f4552433737373a207472616e7366657220616d6f756e74206578636565647320604482015268616c6c6f77616e636560b81b60648201526084016103db565b610542868361053d87856116f2565b6109d6565b6105708287878760405180602001604052806000815250604051806020016040528060008152506000610d9a565b50600195945050505050565b61058633866107bb565b6105a25760405162461bcd60e51b81526004016103db90611659565b6105b185858585856001610f6e565b5050505050565b336001600160a01b038216141561061d5760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff161561066e573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff1916905561069d565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461032190611709565b61070333848484604051806020016040528060008152506001610f6e565b505050565b60006001600160a01b0383166107305760405162461bcd60e51b81526004016103db90611615565b6000339050610761818286866040518060200160405280600081525060405180602001604052806000815250610afd565b61078d818286866040518060200160405280600081525060405180602001604052806000815250610c34565b6103a98182868660405180602001604052806000815250604051806020016040528060008152506000610d9a565b6000816001600160a01b0316836001600160a01b0316148061082657506001600160a01b03831660009081526005602052604090205460ff16801561082657506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b8061085657506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6001600160a01b0381163314156108c05760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff1615610914573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610940565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b61098333856107bb565b61099f5760405162461bcd60e51b81526004016103db90611659565b6109ab84848484611051565b50505050565b6109cc33838360405180602001604052806000815250611051565b5050565b3b151590565b6001600160a01b038316610a3a5760405162461bcd60e51b815260206004820152602560248201527f4552433737373a20617070726f76652066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103db565b6001600160a01b038216610a9c5760405162461bcd60e51b815260206004820152602360248201527f4552433737373a20617070726f766520746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103db565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610b7957600080fd5b505afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb191906112a8565b90506001600160a01b03811615610c2b57604051633ad5cbc160e11b81526001600160a01b038216906375ab978290610bf8908a908a908a908a908a908a9060040161155b565b600060405180830381600087803b158015610c1257600080fd5b505af1158015610c26573d6000803e3d6000fd5b505050505b50505050505050565b6001600160a01b03851660009081526020819052604090205483811015610cad5760405162461bcd60e51b815260206004820152602760248201527f4552433737373a207472616e7366657220616d6f756e7420657863656564732060448201526662616c616e636560c81b60648201526084016103db565b6001600160a01b03808716600090815260208190526040808220878503905591871681529081208054869290610ce49084906116da565b92505081905550846001600160a01b0316866001600160a01b0316886001600160a01b03167f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc82614677987878787604051610d3c939291906116a5565b60405180910390a4846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610d8991815260200190565b60405180910390a350505050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610e1657600080fd5b505afa158015610e2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4e91906112a8565b90506001600160a01b03811615610eca576040516223de2960e01b81526001600160a01b038216906223de2990610e93908b908b908b908b908b908b9060040161155b565b600060405180830381600087803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b50505050610f64565b8115610f64576001600160a01b0386163b15610f645760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a4016103db565b5050505050505050565b6001600160a01b038616610fcf5760405162461bcd60e51b815260206004820152602260248201527f4552433737373a2073656e642066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b6001600160a01b0385166110255760405162461bcd60e51b815260206004820181905260248201527f4552433737373a2073656e6420746f20746865207a65726f206164647265737360448201526064016103db565b33611034818888888888610afd565b611042818888888888610c34565b610c2b81888888888888610d9a565b6001600160a01b0384166110b25760405162461bcd60e51b815260206004820152602260248201527f4552433737373a206275726e2066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b336110c281866000878787610afd565b6001600160a01b038516600090815260208190526040902054848110156111375760405162461bcd60e51b815260206004820152602360248201527f4552433737373a206275726e20616d6f756e7420657863656564732062616c616044820152626e636560e81b60648201526084016103db565b6001600160a01b03861660009081526020819052604081208683039055600180548792906111669084906116f2565b92505081905550856001600160a01b0316826001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988787876040516111b4939291906116a5565b60405180910390a36040518581526000906001600160a01b038816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050565b600082601f830112611215578081fd5b813567ffffffffffffffff808211156112305761123061175a565b604051601f8301601f19908116603f011681019082821181831017156112585761125861175a565b81604052838152866020858801011115611270578485fd5b8360208701602083013792830160200193909352509392505050565b60006020828403121561129d578081fd5b813561085681611770565b6000602082840312156112b9578081fd5b815161085681611770565b600080604083850312156112d6578081fd5b82356112e181611770565b915060208301356112f181611770565b809150509250929050565b600080600060608486031215611310578081fd5b833561131b81611770565b9250602084013561132b81611770565b929592945050506040919091013590565b600080600080600060a08688031215611353578081fd5b853561135e81611770565b9450602086013561136e81611770565b935060408601359250606086013567ffffffffffffffff80821115611391578283fd5b61139d89838a01611205565b935060808801359150808211156113b2578283fd5b506113bf88828901611205565b9150509295509295909350565b600080604083850312156113de578182fd5b82356113e981611770565b946020939093013593505050565b60008060006060848603121561140b578283fd5b833561141681611770565b925060208401359150604084013567ffffffffffffffff811115611438578182fd5b61144486828701611205565b9150509250925092565b60008060008060808587031215611463578384fd5b843561146e81611770565b935060208501359250604085013567ffffffffffffffff80821115611491578384fd5b61149d88838901611205565b935060608701359150808211156114b2578283fd5b506114bf87828801611205565b91505092959194509250565b600080604083850312156114dd578182fd5b82359150602083013567ffffffffffffffff8111156114fa578182fd5b61150685828601611205565b9150509250929050565b60008151808452815b8181101561153557602081850181015186830182015201611519565b818111156115465782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c06080820181905260009061159690830185611510565b82810360a08401526115a88185611510565b9998505050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156115f65783516001600160a01b0316835292840192918401916001016115d1565b50909695505050505050565b6000602082526108566020830184611510565b60208082526024908201527f4552433737373a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f60408201526b39103337b9103437b63232b960a11b606082015260800190565b6000848252606060208301526116be6060830185611510565b82810360408401526116d08185611510565b9695505050505050565b600082198211156116ed576116ed611744565b500190565b60008282101561170457611704611744565b500390565b600181811c9082168061171d57607f821691505b6020821081141561173e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461178557600080fd5b5056fea2646970667358221220a087bebce295c54528d46a529b236de0c8206d5e357ef6a1a716cef58739474f64736f6c63430008030033",Le=(function(e){function t(t){return e.call(this,Be,Ue,t)||this}De(t,e),t.prototype.deploy=function(t,n,r,a,i,o){return e.prototype.deploy.call(this,t,n,r,a,i,o||{})},t.prototype.getDeployTransaction=function(t,n,r,a,i,o){return e.prototype.getDeployTransaction.call(this,t,n,r,a,i,o||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Be)},t.connect=function(e,t){return new a.b(e,Be,t)},t.bytecode=Ue,t.abi=Be}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ze=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"payee",type:"address"},{indexed:!1,internalType:"uint256",name:"weiAmount",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"payee",type:"address"},{indexed:!1,internalType:"uint256",name:"weiAmount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[{internalType:"address",name:"payee",type:"address"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"payee",type:"address"}],name:"depositsOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"payee",type:"address"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],Fe="0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105718061007e6000396000f3fe6080604052600436106100555760003560e01c806351cff8d91461005a578063715018a61461007c5780638da5cb5b14610091578063e3a9db1a146100be578063f2fde38b14610102578063f340fa0114610122575b600080fd5b34801561006657600080fd5b5061007a6100753660046104aa565b610135565b005b34801561008857600080fd5b5061007a6101d7565b34801561009d57600080fd5b506000546040516001600160a01b0390911681526020015b60405180910390f35b3480156100ca57600080fd5b506100f46100d93660046104aa565b6001600160a01b031660009081526001602052604090205490565b6040519081526020016100b5565b34801561010e57600080fd5b5061007a61011d3660046104aa565b61020d565b61007a6101303660046104aa565b6102a8565b6000546001600160a01b031633146101685760405162461bcd60e51b815260040161015f906104cd565b60405180910390fd5b6001600160a01b0381166000818152600160205260408120805491905590610190908261033c565b816001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516101cb91815260200190565b60405180910390a25050565b6000546001600160a01b031633146102015760405162461bcd60e51b815260040161015f906104cd565b61020b600061045a565b565b6000546001600160a01b031633146102375760405162461bcd60e51b815260040161015f906104cd565b6001600160a01b03811661029c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161015f565b6102a58161045a565b50565b6000546001600160a01b031633146102d25760405162461bcd60e51b815260040161015f906104cd565b6001600160a01b0381166000908152600160205260408120805434928392916102fc908490610502565b90915550506040518181526001600160a01b038316907f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4906020016101cb565b8047101561038c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161015f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146103d9576040519150601f19603f3d011682016040523d82523d6000602084013e6103de565b606091505b50509050806104555760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161015f565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104bb578081fd5b81356104c681610526565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561052157634e487b7160e01b81526011600452602481fd5b500190565b6001600160a01b03811681146102a557600080fdfea2646970667358221220fb80e6f61ed9d07b2715127957616df7a00a176f20e17aebd317ca95eeeb3bd364736f6c63430008030033",qe=(function(e){function t(t){return e.call(this,ze,Fe,t)||this}Le(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(ze)},t.connect=function(e,t){return new a.b(e,ze,t)},t.bytecode=Fe,t.abi=ze}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),He=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint32",name:"oldGuardianIndex",type:"uint32"},{indexed:!1,internalType:"uint32",name:"newGuardianIndex",type:"uint32"}],name:"LogGuardianSetChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"emitter_address",type:"address"},{indexed:!1,internalType:"uint32",name:"nonce",type:"uint32"},{indexed:!1,internalType:"bytes",name:"payload",type:"bytes"}],name:"LogMessagePublished",type:"event"}],Je="0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220b763ee65fd55402218232b20022bb7d672e3d87067b237b910132e2b7bdcdbaf64736f6c63430008040033",Ve=(function(e){function t(t){return e.call(this,He,Je,t)||this}qe(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(He)},t.connect=function(e,t){return new a.b(e,He,t)},t.bytecode=Je,t.abi=He}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),We=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"},{internalType:"uint64",name:"sequence_",type:"uint64"},{internalType:"address",name:"owner_",type:"address"},{internalType:"uint16",name:"chainId_",type:"uint16"},{internalType:"bytes32",name:"nativeContract_",type:"bytes32"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"nativeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"address",name:"spender_",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender_",type:"address"},{internalType:"address",name:"recipient_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"addedValue_",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"subtractedValue_",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint64",name:"sequence_",type:"uint64"}],name:"updateDetails",outputs:[],stateMutability:"nonpayable",type:"function"}],Ke="0x608060405234801561001057600080fd5b5061124a806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063a18cd7c611610071578063a18cd7c614610246578063a457c2d714610259578063a9059cbb1461026c578063c71f46151461027f578063dd62ed3e1461029257600080fd5b80638da5cb5b146101ef57806395d89b411461020a5780639a8a0592146102125780639dc29fac1461023357600080fd5b8063313ce567116100e9578063313ce5671461018157806339509351146101965780633d6c043b146101a957806340c10f19146101b157806370a08231146101c657600080fd5b806306fdde031461011b578063095ea7b31461013957806318160ddd1461015c57806323b872dd1461016e575b600080fd5b6101236102cb565b60405161013091906110b5565b60405180910390f35b61014c610147366004610ea7565b6102f4565b6040519015158152602001610130565b6003545b604051908152602001610130565b61014c61017c366004610e6c565b61030a565b60045460405160ff9091168152602001610130565b61014c6101a4366004610ea7565b6103c0565b600854610160565b6101c46101bf366004610ea7565b6103f7565b005b6101606101d4366004610e19565b6001600160a01b031660009081526005602052604090205490565b6007546040516001600160a01b039091168152602001610130565b61012361042f565b600754600160a81b900461ffff1660405161ffff9091168152602001610130565b6101c4610241366004610ea7565b6104c4565b6101c4610254366004610ed0565b6104f8565b61014c610267366004610ea7565b6105ce565b61014c61027a366004610ea7565b610669565b6101c461028d366004610f41565b610676565b6101606102a0366004610e3a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6040516060906102e090600090602001610fff565b604051602081830303815290604052905090565b6000610301338484610775565b50600192915050565b600061031784848461089a565b6001600160a01b0384166000908152600660209081526040808320338452909152902054828110156103a15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103b585336103b08685611196565b610775565b506001949350505050565b3360008181526006602090815260408083206001600160a01b038716845290915281205490916103019185906103b090869061113f565b6007546001600160a01b031633146104215760405162461bcd60e51b815260040161039890611108565b61042b8282610a94565b5050565b606060006001018054610441906111ad565b80601f016020809104026020016040519081016040528092919081815260200182805461046d906111ad565b80156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b5050505050905090565b6007546001600160a01b031633146104ee5760405162461bcd60e51b815260040161039890611108565b61042b8282610b76565b6007546001600160a01b031633146105225760405162461bcd60e51b815260040161039890611108565b60025467ffffffffffffffff8083169116106105805760405162461bcd60e51b815260206004820152601e60248201527f63757272656e74206d6574616461746120697320757020746f206461746500006044820152606401610398565b8251610593906000906020860190610cc5565b5081516105a7906001906020850190610cc5565b506002805467ffffffffffffffff191667ffffffffffffffff929092169190911790555050565b3360009081526006602090815260408083206001600160a01b0386168452909152812054828110156106505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610398565b61065f33856103b08685611196565b5060019392505050565b600061030133848461089a565b600754600160a01b900460ff16156106c65760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610398565b6007805460ff60a01b1916600160a01b17905586516106ec9060009060208a0190610cc5565b508551610700906001906020890190610cc5565b506004805460ff90961660ff19909616959095179094556002805467ffffffffffffffff90941667ffffffffffffffff19909416939093179092556007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b03909216919091179190911790556008555050565b6001600160a01b0383166107d75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610398565b6001600160a01b0382166108385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610398565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166108fe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610398565b6001600160a01b0382166109605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610398565b6001600160a01b038316600090815260056020526040902054818110156109d85760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610398565b6109e28282611196565b6001600160a01b038516600090815260056020526040902055600a610a08836009611177565b610a129190611157565b6001600160a01b03841660009081526005602052604081208054909190610a3a90849061113f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a8691815260200190565b60405180910390a350505050565b6001600160a01b038216610aea5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610398565b8060006003016000828254610aff919061113f565b90915550506001600160a01b03821660009081526005602052604081208054839290610b2c90849061113f565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610bd65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610398565b6001600160a01b03821660009081526005602052604090205481811015610c4a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610398565b610c548282611196565b6001600160a01b03841660009081526005602052604081209190915560038054849290610c82908490611196565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161088d565b828054610cd1906111ad565b90600052602060002090601f016020900481019282610cf35760008555610d39565b82601f10610d0c57805160ff1916838001178555610d39565b82800160010185558215610d39579182015b82811115610d39578251825591602001919060010190610d1e565b50610d45929150610d49565b5090565b5b80821115610d455760008155600101610d4a565b80356001600160a01b0381168114610d7557600080fd5b919050565b600082601f830112610d8a578081fd5b813567ffffffffffffffff80821115610da557610da56111fe565b604051601f8301601f19908116603f01168101908282118183101715610dcd57610dcd6111fe565b81604052838152866020858801011115610de5578485fd5b8360208701602083013792830160200193909352509392505050565b803567ffffffffffffffff81168114610d7557600080fd5b600060208284031215610e2a578081fd5b610e3382610d5e565b9392505050565b60008060408385031215610e4c578081fd5b610e5583610d5e565b9150610e6360208401610d5e565b90509250929050565b600080600060608486031215610e80578081fd5b610e8984610d5e565b9250610e9760208501610d5e565b9150604084013590509250925092565b60008060408385031215610eb9578182fd5b610ec283610d5e565b946020939093013593505050565b600080600060608486031215610ee4578283fd5b833567ffffffffffffffff80821115610efb578485fd5b610f0787838801610d7a565b94506020860135915080821115610f1c578384fd5b50610f2986828701610d7a565b925050610f3860408501610e01565b90509250925092565b600080600080600080600060e0888a031215610f5b578283fd5b873567ffffffffffffffff80821115610f72578485fd5b610f7e8b838c01610d7a565b985060208a0135915080821115610f93578485fd5b50610fa08a828b01610d7a565b965050604088013560ff81168114610fb6578384fd5b9450610fc460608901610e01565b9350610fd260808901610d5e565b925060a088013561ffff81168114610fe8578283fd5b8092505060c0880135905092959891949750929550565b600080835482600182811c91508083168061101b57607f831692505b602080841082141561103b57634e487b7160e01b87526022600452602487fd5b81801561104f57600181146110605761108c565b60ff1986168952848901965061108c565b60008a815260209020885b868110156110845781548b82015290850190830161106b565b505084890196505b5050505050506110ad816a2028576f726d686f6c652960a81b8152600b0190565b949350505050565b6000602080835283518082850152825b818110156110e1578581018301518582016040015282016110c5565b818111156110f25783604083870101525b50601f01601f1916929092016040019392505050565b60208082526017908201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604082015260600190565b60008219821115611152576111526111e8565b500190565b60008261117257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611191576111916111e8565b500290565b6000828210156111a8576111a86111e8565b500390565b600181811c908216806111c157607f821691505b602082108114156111e257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dd0475fec2dafd6e5c5998462772888228fbdd44f7ab4c369f5ffd5b3a43802664736f6c63430008040033",Ge=(function(e){function t(t){return e.call(this,We,Ke,t)||this}Ve(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(We)},t.connect=function(e,t){return new a.b(e,We,t)},t.bytecode=Ke,t.abi=We}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Ze=[{inputs:[{internalType:"uint32",name:"index",type:"uint32"}],name:"getGuardianSet",outputs:[{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentGuardianSetIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getGuardianSetExpiry",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"messageFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"emitter",type:"address"}],name:"nextSequence",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],Xe="0x608060405234801561001057600080fd5b50610399806100206000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b172b22211610066578063b172b22214610173578063d60b347f1461017b578063eb8d3f12146101a7578063f951975a146101bd578063fbe3c2cd146101dd57600080fd5b80631a90a219146100a35780631cfe7951146100ba5780632c3c02a4146100d95780634cf842b51461010c5780639a8a059214610158575b600080fd5b6007545b6040519081526020015b60405180910390f35b60035463ffffffff165b60405163ffffffff90911681526020016100b1565b6100fc6100e73660046102bc565b60009081526005602052604090205460ff1690565b60405190151581526020016100b1565b61013f61011a36600461028e565b6001600160a01b031660009081526004602052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff90911681526020016100b1565b60005461ffff165b60405161ffff90911681526020016100b1565b6001546100a7565b6100fc61018936600461028e565b6001600160a01b031660009081526006602052604090205460ff1690565b600354640100000000900463ffffffff166100c4565b6101d06101cb3660046102d4565b6101ef565b6040516100b191906102f8565b60005462010000900461ffff16610160565b60408051808201825260608082526000602080840182905263ffffffff8616825260028152908490208451815492830281018401865294850182815293949390928492849184018282801561026d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161024f575b50505091835250506001919091015463ffffffff1660209091015292915050565b60006020828403121561029f578081fd5b81356001600160a01b03811681146102b5578182fd5b9392505050565b6000602082840312156102cd578081fd5b5035919050565b6000602082840312156102e5578081fd5b813563ffffffff811681146102b5578182fd5b6020808252825160408383015280516060840181905260009291820190839060808601905b808310156103465783516001600160a01b0316825292840192600192909201919084019061031d565b5063ffffffff84880151166040870152809450505050509291505056fea2646970667358221220b37d7bc0de99a24c48e14d96b1f7a4843a7b9ebcd48bb4ab7001a65489744aa664736f6c63430008040033",Ye=(function(e){function t(t){return e.call(this,Ze,Xe,t)||this}Ge(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Ze)},t.connect=function(e,t){return new a.b(e,Ze,t)},t.bytecode=Xe,t.abi=Ze}(a.c),[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint32",name:"index",type:"uint32"}],name:"GuardianSetAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentGuardianSetIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32",name:"index",type:"uint32"}],name:"getGuardianSet",outputs:[{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getGuardianSetExpiry",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"messageFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"emitter",type:"address"}],name:"nextSequence",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseAndVerifyVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"},{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct GovernanceStructs.ContractUpgrade",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseGuardianSetUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"newGuardianSet",type:"tuple"},{internalType:"uint32",name:"newGuardianSetIndex",type:"uint32"}],internalType:"struct GovernanceStructs.GuardianSetUpgrade",name:"gsu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedSetMessageFee",type:"bytes"}],name:"parseSetMessageFee",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"messageFee",type:"uint256"}],internalType:"struct GovernanceStructs.SetMessageFee",name:"smf",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedTransferFees",type:"bytes"}],name:"parseTransferFees",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"recipient",type:"bytes32"}],internalType:"struct GovernanceStructs.TransferFees",name:"tf",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"guardianSet",type:"tuple"}],name:"verifySignatures",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyVM",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitContractUpgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitSetMessageFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitNewGuardianSet",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitTransferFees",outputs:[],stateMutability:"nonpayable",type:"function"}]),$e=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Ye)},e.connect=function(e,t){return new a.b(e,Ye,t)},e.abi=Ye}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Qe=[{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct GovernanceStructs.ContractUpgrade",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseGuardianSetUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"newGuardianSet",type:"tuple"},{internalType:"uint32",name:"newGuardianSetIndex",type:"uint32"}],internalType:"struct GovernanceStructs.GuardianSetUpgrade",name:"gsu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedSetMessageFee",type:"bytes"}],name:"parseSetMessageFee",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"messageFee",type:"uint256"}],internalType:"struct GovernanceStructs.SetMessageFee",name:"smf",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedTransferFees",type:"bytes"}],name:"parseTransferFees",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"recipient",type:"bytes32"}],internalType:"struct GovernanceStructs.TransferFees",name:"tf",type:"tuple"}],stateMutability:"pure",type:"function"}],et="0x608060405234801561001057600080fd5b50610bed806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630319e59c1461005157806304ca84cf146100b65780634fdc60fa146100d6578063515f32471461012c575b600080fd5b61006461005f3660046109fb565b610179565b6040516100ad9190600060a0820190508251825260ff602084015116602083015261ffff6040840151166040830152606083015160608301526080830151608083015292915050565b60405180910390f35b6100c96100c43660046109fb565b6102d4565b6040516100ad9190610aa5565b6100e96100e43660046109fb565b610508565b6040516100ad91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b61013f61013a3660046109fb565b610644565b6040516100ad91908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906101ae8382610773565b82526101bb602082610b58565b90506101c783826107d1565b60ff1660208301526101da600182610b58565b9050816020015160ff1660041461022f5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064015b60405180910390fd5b610239838261082d565b61ffff16604083015261024d600282610b58565b9050610259838261088a565b6060830152610269602082610b58565b90506102758382610773565b6080830152610285602082610b58565b9050808351146102ce5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b6044820152606401610226565b50919050565b6102dc6109a1565b60006102e88382610773565b82526102f5602082610b58565b905061030183826107d1565b60ff166020830152610314600182610b58565b9050816020015160ff1660021461036d5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e536574557067726164650000000000006044820152606401610226565b610377838261082d565b61ffff16604083015261038b600282610b58565b905061039783826108df565b63ffffffff1660808301526103ad600482610b58565b905060006103bb84836107d1565b90506103c8600183610b58565b915060405180604001604052808260ff1667ffffffffffffffff8111156103ff57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610428578160200160208202803683370190505b5081526000602090910181905260608501919091525b8160ff168110156104b057610453858461093c565b60608501515180518390811061047957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015261049c601484610b58565b9250806104a881610b70565b91505061043e565b50818451146105015760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e536574557067726164650000000000006044820152606401610226565b5050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906105368382610773565b8252610543602082610b58565b905061054f83826107d1565b60ff166020830152610562600182610b58565b9050816020015160ff166001146105b55760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b6044820152606401610226565b6105bf838261082d565b61ffff1660408301526105d3600282610b58565b90506105df8382610773565b6001600160a01b031660608301526105f8602082610b58565b9050808351146102ce5760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b6044820152606401610226565b6040805160808101825260008082526020820181905291810182905260608101829052906106728382610773565b825261067f602082610b58565b905061068b83826107d1565b60ff16602083015261069e600182610b58565b9050816020015160ff166003146106ef5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b6044820152606401610226565b6106f9838261082d565b61ffff16604083015261070d600282610b58565b9050610719838261088a565b6060830152610729602082610b58565b9050808351146102ce5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b6044820152606401610226565b6000610780826020610b58565b835110156107c85760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401610226565b50016020015190565b60006107de826001610b58565b835110156108245760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401610226565b50016001015190565b600061083a826002610b58565b835110156108815760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610226565b50016002015190565b6000610897826020610b58565b835110156107c85760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401610226565b60006108ec826004610b58565b835110156109335760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b6044820152606401610226565b50016004015190565b6000610949826014610b58565b835110156109915760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610226565b500160200151600160601b900490565b6040518060a0016040528060008019168152602001600060ff168152602001600061ffff1681526020016109ee604051806040016040528060608152602001600063ffffffff1681525090565b8152600060209091015290565b600060208284031215610a0c578081fd5b813567ffffffffffffffff80821115610a23578283fd5b818401915084601f830112610a36578283fd5b813581811115610a4857610a48610ba1565b604051601f8201601f19908116603f01168101908382118183101715610a7057610a70610ba1565b81604052828152876020848701011115610a88578586fd5b826020860160208301379182016020019490945295945050505050565b6000602080835283518184015260ff8185015116604084015261ffff6040850151166060840152606084015160a0608085015261010084018151604060c08701528181518084526101208801915085830193508692505b80831015610b255783516001600160a01b03168252928501926001929092019190850190610afc565b509383015163ffffffff1660e0870152608087015193610b4d60a088018663ffffffff169052565b979650505050505050565b60008219821115610b6b57610b6b610b8b565b500190565b6000600019821415610b8457610b84610b8b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea264697066735822122040001b882371cab99e7ec08da6584ea4d110a78c5cdab234ddd9f351bbea2b5e64736f6c63430008040033",tt=(function(e){function t(t){return e.call(this,Qe,et,t)||this}$e(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Qe)},t.connect=function(e,t){return new a.b(e,Qe,t)},t.bytecode=et,t.abi=Qe}(a.c),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),nt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(tt)},e.connect=function(e,t){return new a.b(e,tt,t)},e.abi=tt}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"eta",type:"uint256"}],name:"ProposalQueued",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"cancel",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"getActions",outputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"string[]",name:"signatures",type:"string[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"voter",type:"address"}],name:"getReceipt",outputs:[{components:[{internalType:"bool",name:"hasVoted",type:"bool"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint96",name:"votes",type:"uint96"}],internalType:"struct IGovernorCompatibilityBravo.Receipt",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalEta",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"proposalThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposals",outputs:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"address",name:"proposer",type:"address"},{internalType:"uint256",name:"eta",type:"uint256"},{internalType:"uint256",name:"startBlock",type:"uint256"},{internalType:"uint256",name:"endBlock",type:"uint256"},{internalType:"uint256",name:"forVotes",type:"uint256"},{internalType:"uint256",name:"againstVotes",type:"uint256"},{internalType:"uint256",name:"abstainVotes",type:"uint256"},{internalType:"bool",name:"canceled",type:"bool"},{internalType:"bool",name:"executed",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"string[]",name:"signatures",type:"string[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"queue",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"queue",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"quorumVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"timelock",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),rt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(nt)},e.connect=function(e,t){return new a.b(e,nt,t)},e.abi=nt}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalVotes",outputs:[{internalType:"uint256",name:"againstVotes",type:"uint256"},{internalType:"uint256",name:"forVotes",type:"uint256"},{internalType:"uint256",name:"abstainVotes",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),at=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(rt)},e.connect=function(e,t){return new a.b(e,rt,t)},e.abi=rt}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"proposalThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),it=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(at)},e.connect=function(e,t){return new a.b(e,at,t)},e.abi=at}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"eta",type:"uint256"}],name:"ProposalQueued",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldTimelock",type:"address"},{indexed:!1,internalType:"address",name:"newTimelock",type:"address"}],name:"TimelockChange",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[],name:"__acceptAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalEta",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"queue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"timelock",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract ICompoundTimelock",name:"newTimelock",type:"address"}],name:"updateTimelock",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),ot=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(it)},e.connect=function(e,t){return new a.b(e,it,t)},e.abi=it}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"eta",type:"uint256"}],name:"ProposalQueued",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldTimelock",type:"address"},{indexed:!1,internalType:"address",name:"newTimelock",type:"address"}],name:"TimelockChange",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalEta",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"queue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"timelock",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract TimelockController",name:"newTimelock",type:"address"}],name:"updateTimelock",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),st=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ot)},e.connect=function(e,t){return new a.b(e,ot,t)},e.abi=ot}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract ERC20Votes",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),ut=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(st)},e.connect=function(e,t){return new a.b(e,st,t)},e.abi=st}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract ERC20VotesComp",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),ct=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ut)},e.connect=function(e,t){return new a.b(e,ut,t)},e.abi=ut}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldQuorumNumerator",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newQuorumNumerator",type:"uint256"}],name:"QuorumNumeratorUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"BALLOT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"quorumDenominator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"quorumNumerator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract ERC20Votes",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"newQuorumNumerator",type:"uint256"}],name:"updateQuorumNumerator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),ft=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ct)},e.connect=function(e,t){return new a.b(e,ct,t)},e.abi=ct}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"}]),dt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ft)},e.connect=function(e,t){return new a.b(e,ft,t)},e.abi=ft}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"}]),lt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(dt)},e.connect=function(e,t){return new a.b(e,dt,t)},e.abi=dt}(),[{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"}]),pt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(lt)},e.connect=function(e,t){return new a.b(e,lt,t)},e.abi=lt}(),[{inputs:[],name:"GRACE_PERIOD",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAXIMUM_DELAY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINIMUM_DELAY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"acceptAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"admin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"string",name:"signature",type:"string"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"uint256",name:"eta",type:"uint256"}],name:"cancelTransaction",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"delay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"string",name:"signature",type:"string"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"uint256",name:"eta",type:"uint256"}],name:"executeTransaction",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[],name:"pendingAdmin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"string",name:"signature",type:"string"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"uint256",name:"eta",type:"uint256"}],name:"queueTransaction",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"queuedTransactions",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"setDelay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"setPendingAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]),bt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(pt)},e.connect=function(e,t){return new a.b(e,pt,t)},e.abi=pt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),ht=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(bt)},e.connect=function(e,t){return new a.b(e,bt,t)},e.abi=bt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]),yt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(ht)},e.connect=function(e,t){return new a.b(e,ht,t)},e.abi=ht}(),[{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),mt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(yt)},e.connect=function(e,t){return new a.b(e,yt,t)},e.abi=yt}(),[{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"}]),vt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(mt)},e.connect=function(e,t){return new a.b(e,mt,t)},e.abi=mt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approveAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"approveAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"transferAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"transferFromAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFromAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),gt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(vt)},e.connect=function(e,t){return new a.b(e,vt,t)},e.abi=vt}(),[{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onTransferReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}]),wt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(gt)},e.connect=function(e,t){return new a.b(e,gt,t)},e.abi=gt}(),[{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onApprovalReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}]),Tt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(wt)},e.connect=function(e,t){return new a.b(e,wt,t)},e.abi=wt}(),[{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),kt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Tt)},e.connect=function(e,t){return new a.b(e,Tt,t)},e.abi=Tt}(),[{inputs:[{internalType:"bytes32",name:"interfaceHash",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"canImplementInterfaceForAddress",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"}]),_t=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(kt)},e.connect=function(e,t){return new a.b(e,kt,t)},e.abi=kt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"bytes32",name:"interfaceHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceImplementerSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"newManager",type:"address"}],name:"ManagerChanged",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"bytes32",name:"_interfaceHash",type:"bytes32"}],name:"getInterfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getManager",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"implementsERC165Interface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"implementsERC165InterfaceNoCache",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"interfaceName",type:"string"}],name:"interfaceHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"bytes32",name:"_interfaceHash",type:"bytes32"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterfaceImplementer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"newManager",type:"address"}],name:"setManager",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"updateERC165Cache",outputs:[],stateMutability:"nonpayable",type:"function"}]),Ot=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(_t)},e.connect=function(e,t){return new a.b(e,_t,t)},e.abi=_t}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),St=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Ot)},e.connect=function(e,t){return new a.b(e,Ot,t)},e.abi=Ot}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]),xt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(St)},e.connect=function(e,t){return new a.b(e,St,t)},e.abi=St}(),[{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"}]),At=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(xt)},e.connect=function(e,t){return new a.b(e,xt,t)},e.abi=xt}(),[{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"}]),Mt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(At)},e.connect=function(e,t){return new a.b(e,At,t)},e.abi=At}(),[{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"royaltyAmount",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),Et=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Mt)},e.connect=function(e,t){return new a.b(e,Mt,t)},e.abi=Mt}(),[{inputs:[{internalType:"address",name:"initiator",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onFlashLoan",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"}]),Pt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Et)},e.connect=function(e,t){return new a.b(e,Et,t)},e.abi=Et}(),[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"flashFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC3156FlashBorrower",name:"receiver",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"flashLoan",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"maxFlashLoan",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),jt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Pt)},e.connect=function(e,t){return new a.b(e,Pt,t)},e.abi=Pt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"operator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]),It=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(jt)},e.connect=function(e,t){return new a.b(e,jt,t)},e.abi=jt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"operator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]),Ct=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(It)},e.connect=function(e,t){return new a.b(e,It,t)},e.abi=It}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"operator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]),Rt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Ct)},e.connect=function(e,t){return new a.b(e,Ct,t)},e.abi=Ct}(),[{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}]),Nt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Rt)},e.connect=function(e,t){return new a.b(e,Rt,t)},e.abi=Rt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"tokenHolder",type:"address"}],name:"AuthorizedOperator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Burned",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Minted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"tokenHolder",type:"address"}],name:"RevokedOperator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"operatorData",type:"bytes"}],name:"Sent",type:"event"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"authorizeOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"defaultOperators",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"granularity",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"tokenHolder",type:"address"}],name:"isOperatorFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"operatorBurn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"operatorSend",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"revokeOperator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"send",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),Dt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Nt)},e.connect=function(e,t){return new a.b(e,Nt,t)},e.abi=Nt}(),[{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"userData",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"tokensReceived",outputs:[],stateMutability:"nonpayable",type:"function"}]),Bt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Dt)},e.connect=function(e,t){return new a.b(e,Dt,t)},e.abi=Dt}(),[{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"userData",type:"bytes"},{internalType:"bytes",name:"operatorData",type:"bytes"}],name:"tokensToSend",outputs:[],stateMutability:"nonpayable",type:"function"}]),Ut=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Bt)},e.connect=function(e,t){return new a.b(e,Bt,t)},e.abi=Bt}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),Lt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Ut)},e.connect=function(e,t){return new a.b(e,Ut,t)},e.abi=Ut}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"cancel",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"getActions",outputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"string[]",name:"signatures",type:"string[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"voter",type:"address"}],name:"getReceipt",outputs:[{components:[{internalType:"bool",name:"hasVoted",type:"bool"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint96",name:"votes",type:"uint96"}],internalType:"struct IGovernorCompatibilityBravo.Receipt",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"proposalThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"proposals",outputs:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"address",name:"proposer",type:"address"},{internalType:"uint256",name:"eta",type:"uint256"},{internalType:"uint256",name:"startBlock",type:"uint256"},{internalType:"uint256",name:"endBlock",type:"uint256"},{internalType:"uint256",name:"forVotes",type:"uint256"},{internalType:"uint256",name:"againstVotes",type:"uint256"},{internalType:"uint256",name:"abstainVotes",type:"uint256"},{internalType:"bool",name:"canceled",type:"bool"},{internalType:"bool",name:"executed",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"string[]",name:"signatures",type:"string[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"queue",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"quorumVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),zt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Lt)},e.connect=function(e,t){return new a.b(e,Lt,t)},e.abi=Lt}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"address[]",name:"targets",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"signatures",type:"string[]"},{indexed:!1,internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{indexed:!1,internalType:"uint256",name:"startBlock",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endBlock",type:"uint256"},{indexed:!1,internalType:"string",name:"description",type:"string"}],name:"ProposalCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"}],name:"ProposalExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"eta",type:"uint256"}],name:"ProposalQueued",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"voter",type:"address"},{indexed:!1,internalType:"uint256",name:"proposalId",type:"uint256"},{indexed:!1,internalType:"uint8",name:"support",type:"uint8"},{indexed:!1,internalType:"uint256",name:"weight",type:"uint256"},{indexed:!1,internalType:"string",name:"reason",type:"string"}],name:"VoteCast",type:"event"},{inputs:[],name:"COUNTING_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"}],name:"castVote",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"castVoteBySig",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"uint8",name:"support",type:"uint8"},{internalType:"string",name:"reason",type:"string"}],name:"castVoteWithReason",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"execute",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"},{internalType:"address",name:"account",type:"address"}],name:"hasVoted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"hashProposal",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalDeadline",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalEta",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"proposalSnapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"string",name:"description",type:"string"}],name:"propose",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"calldatas",type:"bytes[]"},{internalType:"bytes32",name:"descriptionHash",type:"bytes32"}],name:"queue",outputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"quorum",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"proposalId",type:"uint256"}],name:"state",outputs:[{internalType:"enum IGovernor.ProposalState",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"timelock",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPeriod",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),Ft=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(zt)},e.connect=function(e,t){return new a.b(e,zt,t)},e.abi=zt}(),[{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransferWithPayload",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"",type:"tuple"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"}]),qt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Ft)},e.connect=function(e,t){return new a.b(e,Ft,t)},e.abi=Ft}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}]),Ht=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(qt)},e.connect=function(e,t){return new a.b(e,qt,t)},e.abi=qt}(),[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint64",name:"sequence",type:"uint64"},{indexed:!1,internalType:"uint32",name:"nonce",type:"uint32"},{indexed:!1,internalType:"bytes",name:"payload",type:"bytes"},{indexed:!1,internalType:"uint8",name:"consistencyLevel",type:"uint8"}],name:"LogMessagePublished",type:"event"},{inputs:[{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"}],name:"publishMessage",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseAndVerifyVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"},{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyVM",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"guardianSet",type:"tuple"}],name:"verifySignatures",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint32",name:"index",type:"uint32"}],name:"getGuardianSet",outputs:[{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentGuardianSetIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getGuardianSetExpiry",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"messageFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}]),Jt=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Ht)},e.connect=function(e,t){return new a.b(e,Ht,t)},e.abi=Ht}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Vt=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint32",name:"index",type:"uint32"}],name:"GuardianSetAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint64",name:"sequence",type:"uint64"},{indexed:!1,internalType:"uint32",name:"nonce",type:"uint32"},{indexed:!1,internalType:"bytes",name:"payload",type:"bytes"},{indexed:!1,internalType:"uint8",name:"consistencyLevel",type:"uint8"}],name:"LogMessagePublished",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentGuardianSetIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32",name:"index",type:"uint32"}],name:"getGuardianSet",outputs:[{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getGuardianSetExpiry",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"messageFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"emitter",type:"address"}],name:"nextSequence",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseAndVerifyVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"},{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct GovernanceStructs.ContractUpgrade",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseGuardianSetUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"newGuardianSet",type:"tuple"},{internalType:"uint32",name:"newGuardianSetIndex",type:"uint32"}],internalType:"struct GovernanceStructs.GuardianSetUpgrade",name:"gsu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedSetMessageFee",type:"bytes"}],name:"parseSetMessageFee",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"messageFee",type:"uint256"}],internalType:"struct GovernanceStructs.SetMessageFee",name:"smf",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedTransferFees",type:"bytes"}],name:"parseTransferFees",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"recipient",type:"bytes32"}],internalType:"struct GovernanceStructs.TransferFees",name:"tf",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitContractUpgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitNewGuardianSet",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitSetMessageFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitTransferFees",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"guardianSet",type:"tuple"}],name:"verifySignatures",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyVM",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"},{inputs:[{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"}],name:"publishMessage",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"}],Wt="0x608060405234801561001057600080fd5b50612eb1806100206000396000f3fe6080604052600436106101445760003560e01c806393df337e116100b6578063c0fd8bde1161006f578063c0fd8bde1461054c578063d60b347f1461057b578063eb8d3f12146105b4578063f42bc641146105d7578063f951975a146105f7578063fbe3c2cd14610624576101ab565b806393df337e1461048f5780639a8a0592146104af578063a0cce1b3146104d7578063a9e11893146104f7578063b172b22214610524578063b19a437e14610539576101ab565b80634cf842b5116101085780634cf842b51461030b5780634fdc60fa14610362578063515f3247146103c55780635cb8cae21461041f5780636606b4e014610441578063875be02a14610461576101ab565b80630319e59c146101e157806304ca84cf146102535780631a90a219146102805780631cfe79511461029f5780632c3c02a4146102cb576101ab565b366101ab5760405162461bcd60e51b815260206004820152602c60248201527f74686520576f726d686f6c6520636f6e747261637420646f6573206e6f74206160448201526b63636570742061737365747360a01b60648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152600b60248201526a1d5b9cdd5c1c1bdc9d195960aa1b60448201526064016101a2565b3480156101ed57600080fd5b506102016101fc366004612731565b610643565b60405161024a9190600060a0820190508251825260ff602084015116602083015261ffff6040840151166040830152606083015160608301526080830151608083015292915050565b60405180910390f35b34801561025f57600080fd5b5061027361026e366004612731565b610799565b60405161024a9190612b27565b34801561028c57600080fd5b506007545b60405190815260200161024a565b3480156102ab57600080fd5b5060035463ffffffff165b60405163ffffffff909116815260200161024a565b3480156102d757600080fd5b506102fb6102e63660046125a6565b60009081526005602052604090205460ff1690565b604051901515815260200161024a565b34801561031757600080fd5b5061034a610326366004612585565b6001600160a01b03166000908152600460205260409020546001600160401b031690565b6040516001600160401b03909116815260200161024a565b34801561036e57600080fd5b5061038261037d366004612731565b6109cc565b60405161024a91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b3480156103d157600080fd5b506103e56103e0366004612731565b610b08565b60405161024a91908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b34801561042b57600080fd5b5061043f61043a366004612731565b610c37565b005b34801561044d57600080fd5b5061043f61045c366004612731565b610d3f565b34801561046d57600080fd5b5061048161047c36600461276b565b610f5f565b60405161024a929190612af9565b34801561049b57600080fd5b5061043f6104aa366004612731565b6110f3565b3480156104bb57600080fd5b5060005461ffff165b60405161ffff909116815260200161024a565b3480156104e357600080fd5b506104816104f23660046125be565b61123f565b34801561050357600080fd5b50610517610512366004612731565b61141c565b60405161024a9190612b97565b34801561053057600080fd5b50600154610291565b61034a6105473660046128a4565b6117fa565b34801561055857600080fd5b5061056c6105673660046126c5565b61189a565b60405161024a93929190612baa565b34801561058757600080fd5b506102fb610596366004612585565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156105c057600080fd5b50600354640100000000900463ffffffff166102b6565b3480156105e357600080fd5b5061043f6105f2366004612731565b6118fc565b34801561060357600080fd5b5061061761061236600461288a565b6119fd565b60405161024a9190612b84565b34801561063057600080fd5b5060005462010000900461ffff166104c4565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906106788382611a9c565b8252610685602082612ce3565b90506106918382611afa565b60ff1660208301526106a4600182612ce3565b9050816020015160ff166004146106f45760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101a2565b6106fe8382611b56565b61ffff166040830152610712600282612ce3565b905061071e8382611bb3565b606083015261072e602082612ce3565b905061073a8382611a9c565b608083015261074a602082612ce3565b9050808351146107935760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101a2565b50919050565b6107a16122d3565b60006107ad8382611a9c565b82526107ba602082612ce3565b90506107c68382611afa565b60ff1660208301526107d9600182612ce3565b9050816020015160ff166002146108325760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101a2565b61083c8382611b56565b61ffff166040830152610850600282612ce3565b905061085c8382611c08565b63ffffffff166080830152610872600482612ce3565b905060006108808483611afa565b905061088d600183612ce3565b915060405180604001604052808260ff166001600160401b038111156108c357634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156108ec578160200160208202803683370190505b5081526000602090910181905260608501919091525b8160ff16811015610974576109178584611c65565b60608501515180518390811061093d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0390921660209283029190910190910152610960601484612ce3565b92508061096c81612df0565b915050610902565b50818451146109c55760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101a2565b5050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906109fa8382611a9c565b8252610a07602082612ce3565b9050610a138382611afa565b60ff166020830152610a26600182612ce3565b9050816020015160ff16600114610a795760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101a2565b610a838382611b56565b61ffff166040830152610a97600282612ce3565b9050610aa38382611a9c565b6001600160a01b03166060830152610abc602082612ce3565b9050808351146107935760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101a2565b604080516080810182526000808252602082018190529181018290526060810182905290610b368382611a9c565b8252610b43602082612ce3565b9050610b4f8382611afa565b60ff166020830152610b62600182612ce3565b9050816020015160ff16600314610bb35760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101a2565b610bbd8382611b56565b61ffff166040830152610bd1600282612ce3565b9050610bdd8382611bb3565b6060830152610bed602082612ce3565b9050808351146107935760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101a2565b6000610c428261141c565b9050600080610c5083611cca565b91509150818190610c745760405162461bcd60e51b81526004016101a29190612b14565b506000610c848460e001516109cc565b805190915063436f726514610ccc5760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff1614610d1d5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101a2565b610d2b846101400151611e40565b610d388160600151611e5b565b5050505050565b6000610d4a8261141c565b9050600080610d5883611cca565b91509150818190610d7c5760405162461bcd60e51b81526004016101a29190612b14565b506000610d8c8460e00151610799565b805190915063436f726514610dd45760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff161480610dfa5750604081015161ffff16155b610e365760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101a2565b60608101515151610e895760405162461bcd60e51b815260206004820152601960248201527f6e657720677561726469616e2073657420697320656d7074790000000000000060448201526064016101a2565b60035463ffffffff16610e9d906001612cfb565b63ffffffff16816080015163ffffffff1614610f055760405162461bcd60e51b815260206004820152602160248201527f696e646578206d75737420696e63726561736520696e207374657073206f66206044820152603160f81b60648201526084016101a2565b610f13846101400151611e40565b610f2a610f2560035463ffffffff1690565b611f88565b610f3c81606001518260800151611fc0565b60808101516003805463ffffffff191663ffffffff909216919091179055610d38565b600060606000610f738461010001516119fd565b805151909150610fb6576000604051806040016040528060148152602001731a5b9d985b1a590819dd585c991a585b881cd95d60621b8152509250925050915091565b60035463ffffffff1663ffffffff1684610100015163ffffffff1614158015610fe8575042816020015163ffffffff16105b1561102f5760006040518060400160405280601881526020017f677561726469616e2073657420686173206578706972656400000000000000008152509250925050915091565b61012084015151815151600a906003906110499083612d8a565b6110539190612d6a565b61105e906002612d8a565b6110689190612d6a565b611073906001612ce3565b11156110a7576000604051806040016040528060098152602001686e6f2071756f72756d60b81b8152509250925050915091565b6000806110bf8661014001518761012001518561123f565b91509150816110d5576000969095509350505050565b60016040518060200160405280600081525094509450505050915091565b60006110fe8261141c565b905060008061110c83611cca565b915091508181906111305760405162461bcd60e51b81526004016101a29190612b14565b5060006111408460e00151610643565b805190915063436f7265146111885760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff1614806111ae5750604081015161ffff16155b6111ea5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101a2565b6111f8846101400151611e40565b608081015160608201516040516001600160a01b0383169180156108fc02916000818181858888f19350505050158015611236573d6000803e3d6000fd5b50505050505050565b600060606000805b85518110156113fb57600086828151811061127257634e487b7160e01b600052603260045260246000fd5b60200260200101519050816000148061129457508260ff16816060015160ff16115b6112ec5760405162461bcd60e51b815260206004820152602360248201527f7369676e617475726520696e6469636573206d75737420626520617363656e64604482015262696e6760e81b60648201526084016101a2565b6060810151865180519194509060ff851690811061131a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031660018983604001518460000151856020015160405160008152602001604052604051611373949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611395573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146113e8576000604051806040016040528060148152602001731593481cda59db985d1d5c99481a5b9d985b1a5960621b81525094509450505050611414565b50806113f381612df0565b915050611247565b5060016040518060200160405280600081525092509250505b935093915050565b61142461232d565b60006114308382611afa565b60ff168252611440600182612ce3565b9050816000015160ff166001146114995760405162461bcd60e51b815260206004820152601760248201527f564d2076657273696f6e20696e636f6d70617469626c6500000000000000000060448201526064016101a2565b6114a38382611c08565b63ffffffff166101008301526114ba600482612ce3565b905060006114c88483611afa565b60ff1690506114d8600183612ce3565b9150806001600160401b0381111561150057634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561155257816020015b60408051608081018252600080825260208083018290529282018190526060820152825260001990920191018161151e5790505b5061012084015260005b818110156116c15761156e8584611afa565b846101200151828151811061159357634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166060909101526115b4600184612ce3565b92506115c08584611a9c565b84610120015182815181106115e557634e487b7160e01b600052603260045260246000fd5b602002602001015160000181815250506020836116029190612ce3565b925061160e8584611a9c565b846101200151828151811061163357634e487b7160e01b600052603260045260246000fd5b602002602001015160200181815250506020836116509190612ce3565b925061165c8584611afa565b61166790601b612d45565b846101200151828151811061168c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166040909101526116ad600184612ce3565b9250806116b981612df0565b91505061155c565b5060006116dd838487516116d59190612da9565b879190612014565b905080805190602001206040516020016116f991815260200190565b60408051601f1981840301815291905280516020909101206101408501526117218584611c08565b63ffffffff166020850152611737600484612ce3565b92506117438584611c08565b63ffffffff166040850152611759600484612ce3565b92506117658584611b56565b61ffff166060850152611779600284612ce3565b92506117858584611a9c565b6080850152611795602084612ce3565b92506117a18584612121565b6001600160401b031660a08501526117ba600884612ce3565b92506117c68584611afa565b60ff1660c08501526117d9600184612ce3565b92506117ec838487516116d59190612da9565b60e085015250919392505050565b600061180560075490565b34146118415760405162461bcd60e51b815260206004820152600b60248201526a696e76616c69642066656560a81b60448201526064016101a2565b61184a3361217e565b9050336001600160a01b03167f6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b28286868660405161188b9493929190612be1565b60405180910390a29392505050565b6118a261232d565b600060606118e585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061141c92505050565b92506118f083610f5f565b93969095509293505050565b60006119078261141c565b905060008061191583611cca565b915091508181906119395760405162461bcd60e51b81526004016101a29190612b14565b5060006119498460e00151610b08565b805190915063436f7265146119915760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff16146119e25760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101a2565b6119f0846101400151611e40565b610d388160600151600755565b60408051808201825260608082526000602080840182905263ffffffff86168252600281529084902084518154928302810184018652948501828152939493909284928491840182828015611a7b57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611a5d575b50505091835250506001919091015463ffffffff1660209091015292915050565b6000611aa9826020612ce3565b83511015611af15760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016101a2565b50016020015190565b6000611b07826001612ce3565b83511015611b4d5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016101a2565b50016001015190565b6000611b63826002612ce3565b83511015611baa5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016101a2565b50016002015190565b6000611bc0826020612ce3565b83511015611af15760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b60448201526064016101a2565b6000611c15826004612ce3565b83511015611c5c5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016101a2565b50016004015190565b6000611c72826014612ce3565b83511015611cba5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016101a2565b500160200151600160601b900490565b60006060600080611cda85610f5f565b9150915081611cef5760009590945092505050565b60035463ffffffff1663ffffffff1685610100015163ffffffff1614611d35576000604051806060016040528060228152602001612e3860229139935093505050915091565b60005462010000900461ffff1661ffff16856060015161ffff1614611d90576000604051806040016040528060168152602001753bb937b7339033b7bb32b93730b731b29031b430b4b760511b815250935093505050915091565b600154856080015114611de05760006040518060400160405280601981526020017f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000815250935093505050915091565b61014085015160009081526005602052604090205460ff1615611e23576000604051806060016040528060228152602001612e5a60229139935093505050915091565b600160405180602001604052806000815250935093505050915091565b6000908152600560205260409020805460ff19166001179055565b6000611e8e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611e99826121ee565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611edc91612add565b600060405180830381855af49150503d8060008114611f17576040519150601f19603f3d011682016040523d82523d6000602084013e611f1c565b606091505b5091509150818190611f415760405162461bcd60e51b81526004016101a29190612b14565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b611f954262015180612cfb565b63ffffffff9182166000908152600260205260409020600101805463ffffffff191691909216179055565b63ffffffff81166000908152600260209081526040909120835180518593611fec928492910190612388565b50602091909101516001909101805463ffffffff191663ffffffff9092169190911790555050565b60608161202281601f612ce3565b10156120615760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016101a2565b61206b8284612ce3565b845110156120af5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016101a2565b6060821580156120ce5760405191506000825260208201604052612118565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156121075780518352602092830192016120ef565b5050858452601f01601f1916604052505b50949350505050565b600061212e826008612ce3565b835110156121755760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016101a2565b50016008015190565b6001600160a01b0381166000908152600460205260409020546001600160401b03166121e9826121af836001612d23565b6001600160a01b03919091166000908152600460205260409020805467ffffffffffffffff19166001600160401b03909216919091179055565b919050565b6121f78161222e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6122925760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016101a2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6040518060a0016040528060008019168152602001600060ff168152602001600061ffff168152602001612320604051806040016040528060608152602001600063ffffffff1681525090565b8152600060209091015290565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201819052610100820183905261012082015261014081019190915290565b8280548282559060005260206000209081019282156123dd579160200282015b828111156123dd57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906123a8565b506123e99291506123ed565b5090565b5b808211156123e957600081556001016123ee565b80356001600160a01b03811681146121e957600080fd5b600082601f830112612429578081fd5b8135602061243e61243983612cc0565b612c90565b80838252828201915082860187848660071b890101111561245d578586fd5b855b858110156124c057608080838b031215612477578788fd5b61247f612c23565b8335815286840135878201526040612498818601612574565b9082015260606124a9858201612574565b90820152855293850193919091019060010161245f565b5090979650505050505050565b600082601f8301126124dd578081fd5b81356001600160401b038111156124f6576124f6612e21565b612509601f8201601f1916602001612c90565b81815284602083860101111561251d578283fd5b816020850160208301379081016020019190915292915050565b803561ffff811681146121e957600080fd5b803563ffffffff811681146121e957600080fd5b80356001600160401b03811681146121e957600080fd5b803560ff811681146121e957600080fd5b600060208284031215612596578081fd5b61259f82612402565b9392505050565b6000602082840312156125b7578081fd5b5035919050565b6000806000606084860312156125d2578182fd5b833592506020808501356001600160401b03808211156125f0578485fd5b6125fc88838901612419565b94506040870135915080821115612611578384fd5b9086019060408289031215612624578384fd5b61262c612c4b565b82358281111561263a578586fd5b83019150601f8201891361264c578485fd5b813561265a61243982612cc0565b8082825286820191508685018c888560051b8801011115612679578889fd5b8895505b838610156126a25761268e81612402565b83526001959095019491870191870161267d565b508352506126b39050838501612549565b84820152809450505050509250925092565b600080602083850312156126d7578182fd5b82356001600160401b03808211156126ed578384fd5b818501915085601f830112612700578384fd5b81358181111561270e578485fd5b86602082850101111561271f578485fd5b60209290920196919550909350505050565b600060208284031215612742578081fd5b81356001600160401b03811115612757578182fd5b612763848285016124cd565b949350505050565b60006020828403121561277c578081fd5b81356001600160401b0380821115612792578283fd5b9083019061016082860312156127a6578283fd5b6127ae612c6d565b6127b783612574565b81526127c560208401612549565b60208201526127d660408401612549565b60408201526127e760608401612537565b60608201526080830135608082015261280260a0840161255d565b60a082015261281360c08401612574565b60c082015260e083013582811115612829578485fd5b612835878286016124cd565b60e083015250610100612849818501612549565b908201526101208381013583811115612860578586fd5b61286c88828701612419565b91830191909152506101409283013592810192909252509392505050565b60006020828403121561289b578081fd5b61259f82612549565b6000806000606084860312156128b8578081fd5b6128c184612549565b925060208401356001600160401b038111156128db578182fd5b6128e7868287016124cd565b9250506128f660408501612574565b90509250925092565b6000815180845260208085019450808401835b8381101561295757815180518852838101518489015260408082015160ff908116918a0191909152606091820151169088015260809096019590820190600101612912565b509495945050505050565b6000815180845261297a816020860160208601612dc0565b601f01601f19169290920160200192915050565b805160408084528151908401819052600091602091908201906060860190845b818110156129d35783516001600160a01b0316835292840192918401916001016129ae565b50509382015163ffffffff16949091019390935250919050565b805160ff16825260006101606020830151612a10602086018263ffffffff169052565b506040830151612a28604086018263ffffffff169052565b506060830151612a3e606086018261ffff169052565b506080830151608085015260a0830151612a6360a08601826001600160401b03169052565b5060c0830151612a7860c086018260ff169052565b5060e08301518160e0860152612a9082860182612962565b91505061010080840151612aab8287018263ffffffff169052565b50506101208084015185830382870152612ac583826128ff565b61014095860151969095019590955250919392505050565b60008251612aef818460208701612dc0565b9190910192915050565b82151581526040602082015260006127636040830184612962565b60208152600061259f6020830184612962565b602081528151602082015260ff602083015116604082015261ffff60408301511660608201526000606083015160a06080840152612b6860c084018261298e565b905063ffffffff60808501511660a08401528091505092915050565b60208152600061259f602083018461298e565b60208152600061259f60208301846129ed565b606081526000612bbd60608301866129ed565b84151560208401528281036040840152612bd78185612962565b9695505050505050565b6001600160401b038516815263ffffffff84166020820152608060408201526000612c0f6080830185612962565b905060ff8316606083015295945050505050565b604051608081016001600160401b0381118282101715612c4557612c45612e21565b60405290565b604080519081016001600160401b0381118282101715612c4557612c45612e21565b60405161016081016001600160401b0381118282101715612c4557612c45612e21565b604051601f8201601f191681016001600160401b0381118282101715612cb857612cb8612e21565b604052919050565b60006001600160401b03821115612cd957612cd9612e21565b5060051b60200190565b60008219821115612cf657612cf6612e0b565b500190565b600063ffffffff808316818516808303821115612d1a57612d1a612e0b565b01949350505050565b60006001600160401b03808316818516808303821115612d1a57612d1a612e0b565b600060ff821660ff84168060ff03821115612d6257612d62612e0b565b019392505050565b600082612d8557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612da457612da4612e0b565b500290565b600082821015612dbb57612dbb612e0b565b500390565b60005b83811015612ddb578181015183820152602001612dc3565b83811115612dea576000848401525b50505050565b6000600019821415612e0457612e04612e0b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfe6e6f74207369676e65642062792063757272656e7420677561726469616e20736574676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a264697066735822122042c40a33cbb5c7ae2dfd339b23293dd079cc42ced6a918d8a77b14d476f5a0b464736f6c63430008040033",Kt=function(e){function t(t){return e.call(this,Vt,Wt,t)||this}return Jt(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Vt)},t.connect=function(e,t){return new a.b(e,Vt,t)},t.bytecode=Wt,t.abi=Vt,t}(a.c),Gt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zt=[{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentGuardianSetIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32",name:"index",type:"uint32"}],name:"getGuardianSet",outputs:[{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getGuardianSetExpiry",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"messageFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"emitter",type:"address"}],name:"nextSequence",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseAndVerifyVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"},{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyVM",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"guardianSet",type:"tuple"}],name:"verifySignatures",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],stateMutability:"pure",type:"function"}],Xt="0x608060405234801561001057600080fd5b50611722806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a9e118931161008c578063d60b347f11610066578063d60b347f1461023b578063eb8d3f1214610267578063f951975a1461027d578063fbe3c2cd1461029d57600080fd5b8063a9e11893146101f1578063b172b22214610211578063c0fd8bde1461021957600080fd5b80634cf842b5116100c85780634cf842b514610158578063875be02a146101a25780639a8a0592146101c3578063a0cce1b3146101de57600080fd5b80631a90a219146100ef5780631cfe7951146101065780632c3c02a414610125575b600080fd5b6007545b6040519081526020015b60405180910390f35b60035463ffffffff165b60405163ffffffff90911681526020016100fd565b610148610133366004610fe6565b60009081526005602052604090205460ff1690565b60405190151581526020016100fd565b61018a610166366004610fc5565b6001600160a01b03166000908152600460205260409020546001600160401b031690565b6040516001600160401b0390911681526020016100fd565b6101b56101b03660046111ab565b6102af565b6040516100fd929190611482565b60005461ffff165b60405161ffff90911681526020016100fd565b6101b56101ec366004610ffe565b610443565b6102046101ff366004611171565b610625565b6040516100fd9190611508565b6001546100f3565b61022c610227366004611105565b610a03565b6040516100fd9392919061151b565b610148610249366004610fc5565b6001600160a01b031660009081526006602052604090205460ff1690565b600354640100000000900463ffffffff16610110565b61029061028b3660046112ca565b610a65565b6040516100fd919061149d565b60005462010000900461ffff166101cb565b6000606060006102c3846101000151610a65565b805151909150610306576000604051806040016040528060148152602001731a5b9d985b1a590819dd585c991a585b881cd95d60621b8152509250925050915091565b60035463ffffffff1663ffffffff1684610100015163ffffffff1614158015610338575042816020015163ffffffff16105b1561037f5760006040518060400160405280601881526020017f677561726469616e2073657420686173206578706972656400000000000000008152509250925050915091565b61012084015151815151600a90600390610399908361166f565b6103a3919061164f565b6103ae90600261166f565b6103b8919061164f565b6103c3906001611612565b11156103f7576000604051806040016040528060098152602001686e6f2071756f72756d60b81b8152509250925050915091565b60008061040f86610140015187610120015185610443565b9150915081610425576000969095509350505050565b60016040518060200160405280600081525094509450505050915091565b600060606000805b855181101561060457600086828151811061047657634e487b7160e01b600052603260045260246000fd5b60200260200101519050816000148061049857508260ff16816060015160ff16115b6104f55760405162461bcd60e51b815260206004820152602360248201527f7369676e617475726520696e6469636573206d75737420626520617363656e64604482015262696e6760e81b60648201526084015b60405180910390fd5b6060810151865180519194509060ff851690811061052357634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001898360400151846000015185602001516040516000815260200160405260405161057c949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa15801561059e573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146105f1576000604051806040016040528060148152602001731593481cda59db985d1d5c99481a5b9d985b1a5960621b8152509450945050505061061d565b50806105fc816116a5565b91505061044b565b5060016040518060200160405280600081525092509250505b935093915050565b61062d610de2565b60006106398382610b04565b60ff168252610649600182611612565b9050816000015160ff166001146106a25760405162461bcd60e51b815260206004820152601760248201527f564d2076657273696f6e20696e636f6d70617469626c6500000000000000000060448201526064016104ec565b6106ac8382610b60565b63ffffffff166101008301526106c3600482611612565b905060006106d18483610b04565b60ff1690506106e1600183611612565b9150806001600160401b0381111561070957634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561075b57816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816107275790505b5061012084015260005b818110156108ca576107778584610b04565b846101200151828151811061079c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166060909101526107bd600184611612565b92506107c98584610bbd565b84610120015182815181106107ee57634e487b7160e01b600052603260045260246000fd5b6020026020010151600001818152505060208361080b9190611612565b92506108178584610bbd565b846101200151828151811061083c57634e487b7160e01b600052603260045260246000fd5b602002602001015160200181815250506020836108599190611612565b92506108658584610b04565b61087090601b61162a565b846101200151828151811061089557634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166040909101526108b6600184611612565b9250806108c2816116a5565b915050610765565b5060006108e6838487516108de919061168e565b879190610c1b565b9050808051906020012060405160200161090291815260200190565b60408051601f19818403018152919052805160209091012061014085015261092a8584610b60565b63ffffffff166020850152610940600484611612565b925061094c8584610b60565b63ffffffff166040850152610962600484611612565b925061096e8584610d28565b61ffff166060850152610982600284611612565b925061098e8584610bbd565b608085015261099e602084611612565b92506109aa8584610d85565b6001600160401b031660a08501526109c3600884611612565b92506109cf8584610b04565b60ff1660c08501526109e2600184611612565b92506109f5838487516108de919061168e565b60e085015250919392505050565b610a0b610de2565b60006060610a4e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062592505050565b9250610a59836102af565b93969095509293505050565b60408051808201825260608082526000602080840182905263ffffffff86168252600281529084902084518154928302810184018652948501828152939493909284928491840182828015610ae357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac5575b50505091835250506001919091015463ffffffff1660209091015292915050565b6000610b11826001611612565b83511015610b575760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016104ec565b50016001015190565b6000610b6d826004611612565b83511015610bb45760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016104ec565b50016004015190565b6000610bca826020611612565b83511015610c125760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016104ec565b50016020015190565b606081610c2981601f611612565b1015610c685760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016104ec565b610c728284611612565b84511015610cb65760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016104ec565b606082158015610cd55760405191506000825260208201604052610d1f565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015610d0e578051835260209283019201610cf6565b5050858452601f01601f1916604052505b50949350505050565b6000610d35826002611612565b83511015610d7c5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016104ec565b50016002015190565b6000610d92826008611612565b83511015610dd95760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016104ec565b50016008015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201819052610100820183905261012082015261014081019190915290565b80356001600160a01b0381168114610e5457600080fd5b919050565b600082601f830112610e69578081fd5b81356020610e7e610e79836115ef565b6115bf565b80838252828201915082860187848660071b8901011115610e9d578586fd5b855b85811015610f0057608080838b031215610eb7578788fd5b610ebf611552565b8335815286840135878201526040610ed8818601610fb4565b908201526060610ee9858201610fb4565b908201528552938501939190910190600101610e9f565b5090979650505050505050565b600082601f830112610f1d578081fd5b81356001600160401b03811115610f3657610f366116d6565b610f49601f8201601f19166020016115bf565b818152846020838601011115610f5d578283fd5b816020850160208301379081016020019190915292915050565b803561ffff81168114610e5457600080fd5b803563ffffffff81168114610e5457600080fd5b80356001600160401b0381168114610e5457600080fd5b803560ff81168114610e5457600080fd5b600060208284031215610fd6578081fd5b610fdf82610e3d565b9392505050565b600060208284031215610ff7578081fd5b5035919050565b600080600060608486031215611012578182fd5b833592506020808501356001600160401b0380821115611030578485fd5b61103c88838901610e59565b94506040870135915080821115611051578384fd5b9086019060408289031215611064578384fd5b61106c61157a565b82358281111561107a578586fd5b83019150601f8201891361108c578485fd5b813561109a610e79826115ef565b8082825286820191508685018c888560051b88010111156110b9578889fd5b8895505b838610156110e2576110ce81610e3d565b8352600195909501949187019187016110bd565b508352506110f39050838501610f89565b84820152809450505050509250925092565b60008060208385031215611117578182fd5b82356001600160401b038082111561112d578384fd5b818501915085601f830112611140578384fd5b81358181111561114e578485fd5b86602082850101111561115f578485fd5b60209290920196919550909350505050565b600060208284031215611182578081fd5b81356001600160401b03811115611197578182fd5b6111a384828501610f0d565b949350505050565b6000602082840312156111bc578081fd5b81356001600160401b03808211156111d2578283fd5b9083019061016082860312156111e6578283fd5b6111ee61159c565b6111f783610fb4565b815261120560208401610f89565b602082015261121660408401610f89565b604082015261122760608401610f77565b60608201526080830135608082015261124260a08401610f9d565b60a082015261125360c08401610fb4565b60c082015260e083013582811115611269578485fd5b61127587828601610f0d565b60e083015250610100611289818501610f89565b9082015261012083810135838111156112a0578586fd5b6112ac88828701610e59565b91830191909152506101409283013592810192909252509392505050565b6000602082840312156112db578081fd5b610fdf82610f89565b6000815180845260208085019450808401835b8381101561133c57815180518852838101518489015260408082015160ff908116918a01919091526060918201511690880152608090960195908201906001016112f7565b509495945050505050565b60008151808452815b8181101561136c57602081850181015186830182015201611350565b8181111561137d5782602083870101525b50601f01601f19169290920160200192915050565b805160ff168252600061016060208301516113b5602086018263ffffffff169052565b5060408301516113cd604086018263ffffffff169052565b5060608301516113e3606086018261ffff169052565b506080830151608085015260a083015161140860a08601826001600160401b03169052565b5060c083015161141d60c086018260ff169052565b5060e08301518160e086015261143582860182611347565b915050610100808401516114508287018263ffffffff169052565b5050610120808401518583038287015261146a83826112e4565b61014095860151969095019590955250919392505050565b82151581526040602082015260006111a36040830184611347565b6020808252825160408383015280516060840181905260009291820190839060808601905b808310156114eb5783516001600160a01b031682529284019260019290920191908401906114c2565b5063ffffffff848801511660408701528094505050505092915050565b602081526000610fdf6020830184611392565b60608152600061152e6060830186611392565b841515602084015282810360408401526115488185611347565b9695505050505050565b604051608081016001600160401b0381118282101715611574576115746116d6565b60405290565b604080519081016001600160401b0381118282101715611574576115746116d6565b60405161016081016001600160401b0381118282101715611574576115746116d6565b604051601f8201601f191681016001600160401b03811182821017156115e7576115e76116d6565b604052919050565b60006001600160401b03821115611608576116086116d6565b5060051b60200190565b60008219821115611625576116256116c0565b500190565b600060ff821660ff84168060ff03821115611647576116476116c0565b019392505050565b60008261166a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611689576116896116c0565b500290565b6000828210156116a0576116a06116c0565b500390565b60006000198214156116b9576116b96116c0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220863b3f073227824a01a091ff721a6cca3a68dcbc45c1aab0f0b47231bf68fc0d64736f6c63430008040033",Yt=(function(e){function t(t){return e.call(this,Zt,Xt,t)||this}Gt(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Zt)},t.connect=function(e,t){return new a.b(e,Zt,t)},t.bytecode=Xt,t.abi=Zt}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),$t=[{inputs:[],name:"last_completed_migration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"completed",type:"uint256"}],name:"setCompleted",outputs:[],stateMutability:"nonpayable",type:"function"}],Qt="0x6080604052600080546001600160a01b0319163317905534801561002257600080fd5b5061016f806100326000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610062578063fdacd5761461008d575b600080fd5b61004f60015481565b6040519081526020015b60405180910390f35b600054610075906001600160a01b031681565b6040516001600160a01b039091168152602001610059565b6100a061009b366004610121565b6100a2565b005b6000546001600160a01b0316331461011c5760405162461bcd60e51b815260206004820152603360248201527f546869732066756e6374696f6e206973207265737472696374656420746f207460448201527234329031b7b73a3930b1ba13b99037bbb732b960691b606482015260840160405180910390fd5b600155565b600060208284031215610132578081fd5b503591905056fea26469706673582212207b2f9522f0d055c7392478410b29558c7e466717fefd7b3fb26bef10badc57c564736f6c63430008040033",en=(function(e){function t(t){return e.call(this,$t,Qt,t)||this}Yt(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface($t)},t.connect=function(e,t){return new a.b(e,$t,t)},t.bytecode=Qt,t.abi=$t}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),tn=[{inputs:[{internalType:"address",name:"_fromAsset",type:"address"},{internalType:"address",name:"_toAsset",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"fromAsset",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"fromDecimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"toAsset",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"toDecimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"add",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"remove",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"claim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"migrate",outputs:[],stateMutability:"nonpayable",type:"function"}],nn="0x60806040523480156200001157600080fd5b50604051620014f8380380620014f88339810160408190526200003491620002a6565b604080518082018252601481527f546f6b656e204d6967726174696f6e20506f6f6c00000000000000000000000060208083019182528351808501909452600b84526a04d69677261746f722d4c560ac1b9084015281519192916200009c91600391620001e3565b508051620000b2906004906020840190620001e3565b5050600580546001600160a01b038086166001600160a01b0319928316811790935560068054918616919092161790556040805163313ce56760e01b8152905191925063313ce567916004808301926020929190829003018186803b1580156200011b57600080fd5b505afa15801562000130573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001569190620002dd565b60ff16600781905550806001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200019957600080fd5b505afa158015620001ae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001d49190620002dd565b60ff1660085550620003449050565b828054620001f19062000307565b90600052602060002090601f01602090048101928262000215576000855562000260565b82601f106200023057805160ff191683800117855562000260565b8280016001018555821562000260579182015b828111156200026057825182559160200191906001019062000243565b506200026e92915062000272565b5090565b5b808211156200026e576000815560010162000273565b80516001600160a01b0381168114620002a157600080fd5b919050565b60008060408385031215620002b9578182fd5b620002c48362000289565b9150620002d46020840162000289565b90509250929050565b600060208284031215620002ef578081fd5b815160ff8116811462000300578182fd5b9392505050565b600181811c908216806200031c57607f821691505b602082108114156200033e57634e487b7160e01b600052602260045260246000fd5b50919050565b6111a480620003546000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80634cc82215116100ad57806395d89b411161007157806395d89b4114610262578063a457c2d71461026a578063a9059cbb1461027d578063dd62ed3e14610290578063f1354c08146102c957600080fd5b80634cc82215146101e95780634d92626a146101fc57806370a082311461020557806386e898431461022e57806392e404111461025957600080fd5b806323b872dd116100f457806323b872dd1461018e578063313ce567146101a1578063379607f5146101b057806339509351146101c3578063454b0608146101d657600080fd5b806306fdde0314610126578063095ea7b3146101445780631003e2d21461016757806318160ddd1461017c575b600080fd5b61012e6102dc565b60405161013b9190610f65565b60405180910390f35b610157610152366004610ee8565b61036e565b604051901515815260200161013b565b61017a610175366004610f31565b610385565b005b6002545b60405190815260200161013b565b61015761019c366004610ead565b6103aa565b6040516012815260200161013b565b61017a6101be366004610f31565b61045b565b6101576101d1366004610ee8565b61048e565b61017a6101e4366004610f31565b6104ca565b61017a6101f7366004610f31565b610506565b61018060075481565b610180610213366004610e61565b6001600160a01b031660009081526020819052604090205490565b600554610241906001600160a01b031681565b6040516001600160a01b03909116815260200161013b565b61018060085481565b61012e610527565b610157610278366004610ee8565b610536565b61015761028b366004610ee8565b6105cf565b61018061029e366004610e7b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600654610241906001600160a01b031681565b6060600380546102eb9061111d565b80601f01602080910402602001604051908101604052809291908181526020018280546103179061111d565b80156103645780601f1061033957610100808354040283529160200191610364565b820191906000526020600020905b81548152906001019060200180831161034757829003601f168201915b5050505050905090565b600061037b3384846105dc565b5060015b92915050565b60065461039d906001600160a01b0316333084610701565b6103a73382610772565b50565b60006103b7848484610851565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156104415760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61044e85338584036105dc565b60019150505b9392505050565b6104653382610a1f565b6005546008546007546103a7926001600160a01b0316913391610489919086610b6a565b610bcb565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161037b9185906104c5908690610f98565b6105dc565b6005546104e2906001600160a01b0316333084610701565b6006546007546008546103a7926001600160a01b0316913391610489919086610b6a565b6105103382610a1f565b6006546103a7906001600160a01b03163383610bcb565b6060600480546102eb9061111d565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156105b85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610438565b6105c533858584036105dc565b5060019392505050565b600061037b338484610851565b6001600160a01b03831661063e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610438565b6001600160a01b03821661069f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610438565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6040516001600160a01b038085166024830152831660448201526064810182905261076c9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610bfb565b50505050565b6001600160a01b0382166107c85760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610438565b80600260008282546107da9190610f98565b90915550506001600160a01b03821660009081526020819052604081208054839290610807908490610f98565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b0383166108b55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610438565b6001600160a01b0382166109175760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610438565b6001600160a01b0383166000908152602081905260409020548181101561098f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610438565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906109c6908490610f98565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a1291815260200190565b60405180910390a361076c565b6001600160a01b038216610a7f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610438565b6001600160a01b03821660009081526020819052604090205481811015610af35760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610438565b6001600160a01b0383166000908152602081905260408120838303905560028054849290610b229084906110da565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016106f4565b505050565b600082841115610b9a57610b7e83856110da565b610b8990600a611013565b610b939083610fb0565b9150610bc4565b82841015610bc457610bac84846110da565b610bb790600a611013565b610bc190836110bb565b91505b5092915050565b6040516001600160a01b038316602482015260448101829052610b6590849063a9059cbb60e01b90606401610735565b6000610c50826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610ccd9092919063ffffffff16565b805190915015610b655780806020019051810190610c6e9190610f11565b610b655760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610438565b6060610cdc8484600085610ce4565b949350505050565b606082471015610d455760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610438565b843b610d935760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610438565b600080866001600160a01b03168587604051610daf9190610f49565b60006040518083038185875af1925050503d8060008114610dec576040519150601f19603f3d011682016040523d82523d6000602084013e610df1565b606091505b5091509150610e01828286610e0c565b979650505050505050565b60608315610e1b575081610454565b825115610e2b5782518084602001fd5b8160405162461bcd60e51b81526004016104389190610f65565b80356001600160a01b0381168114610e5c57600080fd5b919050565b600060208284031215610e72578081fd5b61045482610e45565b60008060408385031215610e8d578081fd5b610e9683610e45565b9150610ea460208401610e45565b90509250929050565b600080600060608486031215610ec1578081fd5b610eca84610e45565b9250610ed860208501610e45565b9150604084013590509250925092565b60008060408385031215610efa578182fd5b610f0383610e45565b946020939093013593505050565b600060208284031215610f22578081fd5b81518015158114610454578182fd5b600060208284031215610f42578081fd5b5035919050565b60008251610f5b8184602087016110f1565b9190910192915050565b6020815260008251806020840152610f848160408501602087016110f1565b601f01601f19169190910160400192915050565b60008219821115610fab57610fab611158565b500190565b600082610fcb57634e487b7160e01b81526012600452602481fd5b500490565b600181815b8085111561100b578160001904821115610ff157610ff1611158565b80851615610ffe57918102915b93841c9390800290610fd5565b509250929050565b600061045483836000826110295750600161037f565b816110365750600061037f565b816001811461104c576002811461105657611072565b600191505061037f565b60ff84111561106757611067611158565b50506001821b61037f565b5060208310610133831016604e8410600b8410161715611095575081810a61037f565b61109f8383610fd0565b80600019048211156110b3576110b3611158565b029392505050565b60008160001904831182151516156110d5576110d5611158565b500290565b6000828210156110ec576110ec611158565b500390565b60005b8381101561110c5781810151838201526020016110f4565b8381111561076c5750506000910152565b600181811c9082168061113157607f821691505b6020821081141561115257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220d67982d65a0322ade3d9a38a36fb46dcea62d226886e73f6d270d2089a5c617f64736f6c63430008040033",rn=(function(e){function t(t){return e.call(this,tn,nn,t)||this}en(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(tn)},t.connect=function(e,t){return new a.b(e,tn,t)},t.bytecode=nn,t.abi=tn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),an=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"gas",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct MinimalForwarder.ForwardRequest",name:"req",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"execute",outputs:[{internalType:"bool",name:"",type:"bool"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"gas",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct MinimalForwarder.ForwardRequest",name:"req",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"verify",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],on="0x61012060405234801561001157600080fd5b50604080518082018252601081526f26b4b734b6b0b62337b93bb0b93232b960811b6020808301918252835180850185526005815264302e302e3160d81b908201529151902060c08181527fae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc19916381188560e08190524660a081815286517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818901969096526060810193909352608080840192909252308382015286518084039091018152919092019094528351939092019290922090526101005260805160a05160c05160e05161010051610b4461013360003960006104ce0152600061051d015260006104f80152600061047a015260006104a30152610b446000f3fe6080604052600436106100345760003560e01c80632d0335ab1461003957806347153f8214610082578063bf5d3bdb146100a3575b600080fd5b34801561004557600080fd5b5061006f6100543660046108fe565b6001600160a01b031660009081526020819052604090205490565b6040519081526020015b60405180910390f35b61009561009036600461092c565b6100d3565b604051610079929190610a19565b3480156100af57600080fd5b506100c36100be36600461092c565b610280565b6040519015158152602001610079565b600060606100e2858585610280565b61014e5760405162461bcd60e51b815260206004820152603260248201527f4d696e696d616c466f727761726465723a207369676e617475726520646f6573604482015271081b9bdd081b585d18da081c995c5d595cdd60721b60648201526084015b60405180910390fd5b61015d60808601356001610a9a565b60008061016d60208901896108fe565b6001600160a01b03166001600160a01b03168152602001908152602001600020819055506000808660200160208101906101a791906108fe565b6001600160a01b0316606088013560408901356101c760a08b018b610a55565b6101d460208d018d6108fe565b6040516020016101e6939291906109d4565b60408051601f1981840301815290829052610200916109fd565b600060405180830381858888f193505050503d806000811461023e576040519150601f19603f3d011682016040523d82523d6000602084013e610243565b606091505b509092509050610258603f6060890135610abe565b5a1161027457634e487b7160e01b600052600160045260246000fd5b90969095509350505050565b60008061039384848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061038d92507fdd8f4b70b0f4393e889bd39128a30628a78b61816a9eb8199759e7a349657e4891506102f0905060208a018a6108fe565b61030060408b0160208c016108fe565b60408b013560608c013560808d013561031c60a08f018f610a55565b60405161032a9291906109c4565b6040805191829003822060208301989098526001600160a01b0396871690820152949093166060850152608084019190915260a083015260c082015260e081019190915261010001604051602081830303815290604052805190602001206103fe565b90610452565b905060808501356000806103aa60208901896108fe565b6001600160a01b03166001600160a01b03168152602001908152602001600020541480156103f557506103e060208601866108fe565b6001600160a01b0316816001600160a01b0316145b95945050505050565b600061044c61040b610476565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b92915050565b6000806000610461858561056c565b9150915061046e816105dc565b509392505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614156104c757507f0000000000000000000000000000000000000000000000000000000000000000610569565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c090920190925280519101205b90565b6000808251604114156105a35760208301516040840151606085015160001a610597878285856107e2565b945094505050506105d5565b8251604014156105cd57602083015160408401516105c28683836108cf565b9350935050506105d5565b506000905060025b9250929050565b60008160048111156105fe57634e487b7160e01b600052602160045260246000fd5b1415610609576107df565b600181600481111561062b57634e487b7160e01b600052602160045260246000fd5b14156106795760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610145565b600281600481111561069b57634e487b7160e01b600052602160045260246000fd5b14156106e95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610145565b600381600481111561070b57634e487b7160e01b600052602160045260246000fd5b14156107645760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610145565b600481600481111561078657634e487b7160e01b600052602160045260246000fd5b14156107df5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610145565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561081957506000905060036108c6565b8460ff16601b1415801561083157508460ff16601c14155b1561084257506000905060046108c6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610896573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166108bf576000600192509250506108c6565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016108f0878288856107e2565b935093505050935093915050565b60006020828403121561090f578081fd5b81356001600160a01b0381168114610925578182fd5b9392505050565b600080600060408486031215610940578182fd5b833567ffffffffffffffff80821115610957578384fd5b9085019060c0828803121561096a578384fd5b9093506020850135908082111561097f578384fd5b818601915086601f830112610992578384fd5b8135818111156109a0578485fd5b8760208285010111156109b1578485fd5b6020830194508093505050509250925092565b6000828483379101908152919050565b6000838583375060609190911b6bffffffffffffffffffffffff19169101908152601401919050565b60008251610a0f818460208701610ade565b9190910192915050565b60008315158252604060208301528251806040840152610a40816060850160208701610ade565b601f01601f1916919091016060019392505050565b6000808335601e19843603018112610a6b578283fd5b83018035915067ffffffffffffffff821115610a85578283fd5b6020019150368190038213156105d557600080fd5b60008219821115610ab957634e487b7160e01b81526011600452602481fd5b500190565b600082610ad957634e487b7160e01b81526012600452602481fd5b500490565b60005b83811015610af9578181015183820152602001610ae1565b83811115610b08576000848401525b5050505056fea264697066735822122053d18eea9cfddf3496703497ba0711c4caff2d2220280bab4776f1f67731324c64736f6c63430008030033",sn=(function(e){function t(t){return e.call(this,an,on,t)||this}rn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(an)},t.connect=function(e,t){return new a.b(e,an,t)},t.bytecode=on,t.abi=an}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),un=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"WETH",outputs:[{internalType:"contract IWETH",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"attestToken",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransferAndUnwrapETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"createWrapped",outputs:[{internalType:"address",name:"token",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"uint8",name:"decimals",type:"uint8"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],internalType:"struct BridgeStructs.AssetMeta",name:"meta",type:"tuple"}],name:"encodeAssetMeta",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"},{internalType:"uint256",name:"fee",type:"uint256"}],internalType:"struct BridgeStructs.Transfer",name:"transfer",type:"tuple"}],name:"encodeTransfer",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"outstandingBridged",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseAssetMeta",outputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"uint8",name:"decimals",type:"uint8"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],internalType:"struct BridgeStructs.AssetMeta",name:"meta",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct BridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseTransfer",outputs:[{components:[{internalType:"uint8",name:"payloadID",type:"uint8"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"},{internalType:"uint256",name:"fee",type:"uint256"}],internalType:"struct BridgeStructs.Transfer",name:"transfer",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct BridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint256",name:"arbiterFee",type:"uint256"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"transferTokens",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"updateWrapped",outputs:[{internalType:"address",name:"token",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint256",name:"arbiterFee",type:"uint256"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"wrapAndTransferETH",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"},{inputs:[],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"testNewImplementationActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"WETH",type:"address"}],name:"testUpdateWETHAddress",outputs:[],stateMutability:"nonpayable",type:"function"}],cn="0x608060405234801561001057600080fd5b50614deb806100206000396000f3fe6080604052600436106200020f5760003560e01c8063a5799f931162000117578063c48fa11511620000a1578063f768441f116200006c578063f768441f14620007bf578063fbe3c2cd14620007e4578063fbeeacd91462000805578063ff200cde146200086557600080fd5b8063c48fa1151462000721578063c68785191462000738578063d60b347f146200075d578063e8059810146200079a57600080fd5b8063b046223b11620000e2578063b046223b146200066e578063b172b2221462000693578063b626814614620006aa578063b96c7e4d14620006e757600080fd5b8063a5799f9314620005b1578063aa4efa5b14620005d6578063ad5c4648146200060a578063ad66a5f1146200062a57600080fd5b80632c3c02a411620001995780638129fc1c11620001645780638129fc1c146200053857806384acd1bb14620005505780639981509f14620005705780639a8a0592146200058757600080fd5b80632c3c02a414620004985780632f3a3d5d14620004cc5780635c60da1b14620004ec5780635f854266146200050457600080fd5b80631f8cdb2b11620001da5780631f8cdb2b14620003945780631ff1e28614620003aa5780632539464514620003e85780632b511375146200040f57600080fd5b806301f53255146200021c57806307dfd8fb146200029a5780630f5287b014620003165780631a2be4da146200034657600080fd5b366200021757005b600080fd5b3480156200022957600080fd5b50620002416200023b36600462003ae4565b6200088a565b604051620002919190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620002a757600080fd5b50620002bf620002b936600462003ae4565b62000a94565b604051620002919190600060c08201905060ff83511682526020830151602083015261ffff604084015116604083015260ff60608401511660608301526080830151608083015260a083015160a083015292915050565b6200032d62000327366004620039ef565b62000c23565b6040516001600160401b03909116815260200162000291565b3480156200035357600080fd5b506200038362000365366004620039d2565b6001600160a01b031660009081526009602052604090205460ff1690565b604051901515815260200162000291565b348015620003a157600080fd5b50600162000383565b348015620003b757600080fd5b50620003cf620003c936600462003e80565b620010b0565b6040516001600160a01b03909116815260200162000291565b348015620003f557600080fd5b506200040d6200040736600462003ae4565b620010df565b005b3480156200041c57600080fd5b50620004346200042e36600462003ae4565b620011c3565b604051620002919190600060e08201905060ff83511682526020830151602083015260408301516040830152606083015161ffff8082166060850152608085015160808501528060a08601511660a0850152505060c083015160c083015292915050565b348015620004a557600080fd5b5062000383620004b736600462003ab2565b60009081526005602052604090205460ff1690565b348015620004d957600080fd5b506001546001600160a01b0316620003cf565b348015620004f957600080fd5b50620003cf62001378565b3480156200051157600080fd5b50620005296200052336600462003c2e565b62001392565b60405162000291919062003fdd565b3480156200054557600080fd5b506200040d62001427565b3480156200055d57600080fd5b506000546001600160a01b0316620003cf565b6200032d6200058136600462003eae565b620014f1565b3480156200059457600080fd5b5060025461ffff165b60405161ffff909116815260200162000291565b348015620005be57600080fd5b506200040d620005d036600462003ae4565b6200177f565b348015620005e357600080fd5b5062000383620005f536600462003ab2565b60009081526006602052604090205460ff1690565b3480156200061757600080fd5b506004546001600160a01b0316620003cf565b3480156200063757600080fd5b506200065f6200064936600462003e42565b61ffff166000908152600b602052604090205490565b60405190815260200162000291565b3480156200067b57600080fd5b50620005296200068d36600462003b94565b620018ec565b348015620006a057600080fd5b506003546200065f565b348015620006b757600080fd5b506200040d620006c9366004620039d2565b600480546001600160a01b0319166001600160a01b03831617905550565b348015620006f457600080fd5b506200065f62000706366004620039d2565b6001600160a01b03166000908152600a602052604090205490565b6200032d6200073236600462003a5a565b62001965565b3480156200074557600080fd5b506200040d6200075736600462003ae4565b62001c65565b3480156200076a57600080fd5b50620003836200077c366004620039d2565b6001600160a01b031660009081526007602052604090205460ff1690565b348015620007a757600080fd5b50620003cf620007b936600462003ae4565b62001c72565b348015620007cc57600080fd5b50620003cf620007de36600462003ae4565b62001d91565b348015620007f157600080fd5b5060025462010000900461ffff166200059d565b3480156200081257600080fd5b506200082a6200082436600462003ae4565b62001ea6565b6040516200029191908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b3480156200087257600080fd5b506200040d6200088436600462003ae4565b62002081565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290620008c183826200208e565b8252620008d0602082620041ad565b82519091506a546f6b656e42726964676514620009405760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b6200094c8382620020f0565b60ff16602083015262000961600182620041ad565b9050816020015160ff16600114620009c85760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840162000937565b620009d4838262002150565b61ffff166040830152620009ea600282620041ad565b9050620009f8838262002150565b61ffff16606083015262000a0e600282620041ad565b905062000a1c83826200208e565b608083015262000a2e602082620041ad565b90508083511462000a8e5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840162000937565b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529062000ad28382620020f0565b60ff16825262000ae4600182620041ad565b9050816000015160ff1660021462000b335760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000937565b62000b3f83826200208e565b60208084019190915262000b549082620041ad565b905062000b62838262002150565b61ffff16604083015262000b78600282620041ad565b905062000b868382620020f0565b60ff16606083015262000b9b600182620041ad565b905062000ba983826200208e565b608083015262000bbb602082620041ad565b905062000bc983826200208e565b60a083015262000bdb602082620041ad565b90508083511462000a8e5760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000937565b600080600062000c4b896001600160a01b031660009081526009602052604090205460ff1690565b1562000d4557886001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c8b57600080fd5b505afa15801562000ca0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cc6919062003e61565b9150886001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000d0257600080fd5b505afa15801562000d17573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d3d919062003acb565b905062000d59565b505060025461ffff166001600160a01b0388165b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b038c169162000d9d919062003f66565b600060405180830381855afa9150503d806000811462000dda576040519150601f19603f3d011682016040523d82523d6000602084013e62000ddf565b606091505b5091505060008180602001905181019062000dfb919062003f19565b905062000e1462000e0d8b83620021b1565b82620021f0565b995062000e2460025461ffff1690565b61ffff168461ffff16141562000fd257604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17905290516000916001600160a01b038e169162000e89919062003f66565b600060405180830381855afa9150503d806000811462000ec6576040519150601f19603f3d011682016040523d82523d6000602084013e62000ecb565b606091505b5091505060008180602001905181019062000ee7919062003acb565b905062000ef78d33308f62002225565b6040513060248201526000906001600160a01b038f16906370a0823160e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000f5a919062003f66565b600060405180830381855afa9150503d806000811462000f97576040519150601f19603f3d011682016040523d82523d6000602084013e62000f9c565b606091505b5091505060008180602001905181019062000fb8919062003acb565b905062000fc6838262004313565b9d505050505062001043565b62000fe08b33308d62002225565b604051632770a7eb60e21b8152306004820152602481018b90526001600160a01b038c1690639dc29fac90604401600060405180830381600087803b1580156200102957600080fd5b505af11580156200103e573d6000803e3d6000fd5b505050505b6000620010518b83620021b1565b90506000620010618984620021b1565b90506200107160025461ffff1690565b61ffff168661ffff1614156200108d576200108d8d8362002298565b6200109f8686848e8e86348f62002365565b9d9c50505050505050505050505050565b61ffff821660009081526008602090815260408083208484529091529020546001600160a01b03165b92915050565b6000806000620010ef84620024a3565b925092509250818190620011185760405162461bcd60e51b815260040162000937919062003fdd565b506200113e8361014001516000908152600560205260409020805460ff19166001179055565b60006200114f8460e0015162001ea6565b90506200115f60025461ffff1690565b61ffff16816040015161ffff1614620011ac5760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640162000937565b6060810151620011bc90620026d2565b5050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905290620012088382620020f0565b60ff1682526200121a600182620041ad565b9050816000015160ff16600114620012685760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000937565b62001274838262002809565b602080840191909152620012899082620041ad565b90506200129783826200208e565b6040830152620012a9602082620041ad565b9050620012b7838262002150565b61ffff166060830152620012cd600282620041ad565b9050620012db83826200208e565b6080830152620012ed602082620041ad565b9050620012fb838262002150565b61ffff1660a083015262001311600282620041ad565b90506200131f838262002809565b60c083015262001331602082620041ad565b90508083511462000a8e5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000937565b60006200138d6001546001600160a01b031690565b905090565b8051602080830151604080850151606080870151608088015160a089015160c08a0151955160f89990991b6001600160f81b031916978901979097526021880195909552604187019290925260f091821b6001600160f01b03199081166061880152606387019490945293901b909116608384015260858301529060a5015b6040516020818303038152906040529050919050565b60006200145b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001480816001600160a01b031660009081526007602052604090205460ff1690565b15620014c55760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640162000937565b620014ee816001600160a01b03166000908152600760205260409020805460ff19166001179055565b50565b600080620015076000546001600160a01b031690565b6001600160a01b0316631a90a2196040518163ffffffff1660e01b815260040160206040518083038186803b1580156200154057600080fd5b505afa15801562001555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200157b919062003acb565b9050348110620015d95760405162461bcd60e51b815260206004820152602260248201527f76616c756520697320736d616c6c6572207468616e20776f726d686f6c652066604482015261656560f01b606482015260840162000937565b6000620015e7823462004313565b905080851115620016505760405162461bcd60e51b815260206004820152602c60248201527f66656520697320626967676572207468616e20616d6f756e74206d696e75732060448201526b776f726d686f6c652066656560a01b606482015260840162000937565b60006200165f826012620021b1565b9050600062001670876012620021b1565b9050600062001681836012620021f0565b6200168d908562004313565b90508015620016c657604051339082156108fc029083906000818181858888f19350505050158015620016c4573d6000803e3d6000fd5b505b6004546001600160a01b031663d0e30db0620016e3838762004313565b6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156200170f57600080fd5b505af115801562001724573d6000803e3d6000fd5b505050505062001747620017406004546001600160a01b031690565b8462002298565b620017716200175960025461ffff1690565b6004546001600160a01b0316858d8d878b8e62002365565b9a9950505050505050505050565b60008060006200178f84620024a3565b925092509250818190620017b85760405162461bcd60e51b815260040162000937919062003fdd565b50620017de8361014001516000908152600560205260409020805460ff19166001179055565b6000620017ef8460e001516200088a565b9050620017ff60025461ffff1690565b61ffff16816040015161ffff1614806200181f5750604081015161ffff16155b620018605760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640162000937565b606081015161ffff166000908152600b602052604081205414620018c75760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c726561647920726567697374657265640000000000000000604482015260640162000937565b620011bc8160600151826080015161ffff9091166000908152600b6020526040902055565b8051602080830151604080850151606080870151608088015160a0890151945160f898891b6001600160f81b031990811698820198909852602181019690965260f09390931b6001600160f01b031916604186015290951b90931660438301526044820192909252606481019190915260840162001411565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b179052905160009182916001600160a01b03861691620019aa9162003f66565b600060405180830381855afa9150503d8060008114620019e7576040519150601f19603f3d011682016040523d82523d6000602084013e620019ec565b606091505b5060408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b1790529051919350600092506001600160a01b0387169162001a35919062003f66565b600060405180830381855afa9150503d806000811462001a72576040519150601f19603f3d011682016040523d82523d6000602084013e62001a77565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b0388169162001ac0919062003f66565b600060405180830381855afa9150503d806000811462001afd576040519150601f19603f3d011682016040523d82523d6000602084013e62001b02565b606091505b5091505060008380602001905181019062001b1e919062003f19565b905060008380602001905181019062001b38919062003b5e565b905060008380602001905181019062001b52919062003b5e565b9050600080602084015191506020830151905060006040518060c00160405280600260ff1681526020018d6001600160a01b031660001b815260200162001b9c60025461ffff1690565b61ffff1681526020018760ff168152602001848152602001838152509050600062001bc782620018ec565b905062001bdc6000546001600160a01b031690565b6001600160a01b031663b19a437e348e84600f6040518563ffffffff1660e01b815260040162001c0f93929190620040cb565b6020604051808303818588803b15801562001c2957600080fd5b505af115801562001c3e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906200109f919062003efc565b620014ee81600062002862565b60008060008062001c8b6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001cb8919062003fdd565b60006040518083038186803b15801562001cd157600080fd5b505afa15801562001ce6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001d10919081019062003cd3565b92509250925081819062001d395760405162461bcd60e51b815260040162000937919062003fdd565b5062001d458362002f3d565b62001d645760405162461bcd60e51b81526004016200093790620040a2565b600062001d758460e0015162000a94565b905062001d87818560a0015162002f7a565b9695505050505050565b60008060008062001daa6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001dd7919062003fdd565b60006040518083038186803b15801562001df057600080fd5b505afa15801562001e05573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001e2f919081019062003cd3565b92509250925081819062001e585760405162461bcd60e51b815260040162000937919062003fdd565b5062001e648362002f3d565b62001e835760405162461bcd60e51b81526004016200093790620040a2565b600062001e948460e0015162000a94565b905062001d87818560a001516200322b565b60408051608081018252600080825260208201819052918101829052606081018290529062001ed683826200208e565b825262001ee5602082620041ad565b82519091506a546f6b656e4272696467651462001f535760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840162000937565b62001f5f8382620020f0565b60ff16602083015262001f74600182620041ad565b9050816020015160ff1660021462001fdd5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840162000937565b62001fe9838262002150565b61ffff16604083015262001fff600282620041ad565b90506200200d83826200208e565b60608301526200201f602082620041ad565b90508083511462000a8e5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840162000937565b620014ee81600162002862565b60006200209d826020620041ad565b83511015620020e75760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640162000937565b50016020015190565b6000620020ff826001620041ad565b83511015620021475760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640162000937565b50016001015190565b60006200215f826002620041ad565b83511015620021a85760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640162000937565b50016002015190565b600060088260ff161115620021e957620021cd6008836200432d565b620021da90600a62004232565b620021e69084620041c8565b92505b5090919050565b600060088260ff161115620021e9576200220c6008836200432d565b6200221990600a62004232565b620021e69084620042f1565b6040516001600160a01b0380851660248301528316604482015260648101829052620022929085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262003326565b50505050565b6001600160a01b0382166000908152600a60205260409020546001600160401b03620022c58383620041ad565b1115620023335760405162461bcd60e51b815260206004820152603560248201527f7472616e736665722065786365656473206d6178206f75747374616e64696e6760448201527408189c9a5919d959081d1bdad95b88185b5bdd5b9d605a1b606482015260840162000937565b6200236083620023448484620041ad565b6001600160a01b039091166000908152600a6020526040902055565b505050565b600086841115620023ae5760405162461bcd60e51b815260206004820152601260248201527119995948195e18d959591cc8185b5bdd5b9d60721b604482015260640162000937565b6040805160e081018252600181526020810189905290810189905261ffff808b16606083015260808201879052871660a082015260c081018590526000620023f68262001392565b90506200240b6000546001600160a01b031690565b6001600160a01b031663b19a437e868684600f6040518563ffffffff1660e01b81526004016200243e93929190620040cb565b6020604051808303818588803b1580156200245857600080fd5b505af11580156200246d573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002494919062003efc565b9b9a5050505050505050505050565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620025176000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b815260040162002544919062003fdd565b60006040518083038186803b1580156200255d57600080fd5b505afa15801562002572573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200259c919081019062003cd3565b92509250925081620025b55791945092509050620026cb565b60025462010000900461ffff1661ffff16836060015161ffff1614620026135750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050620026cb565b6003548360800151146200266657505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050620026cb565b61014083015160009081526005602052604090205460ff1615620026b05782600060405180606001604052806022815260200162004d9460229139955095509550505050620026cb565b50506040805160208101909152600081529093506001925090505b9193909250565b6000620027067f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506200271382620033ff565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620027589162003f66565b600060405180830381855af49150503d806000811462002795576040519150601f19603f3d011682016040523d82523d6000602084013e6200279a565b606091505b5091509150818190620027c25760405162461bcd60e51b815260040162000937919062003fdd565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062002818826020620041ad565b83511015620020e75760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b604482015260640162000937565b60008060006200287a6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b8152600401620028a7919062003fdd565b60006040518083038186803b158015620028c057600080fd5b505afa158015620028d5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620028ff919081019062003cd3565b925092509250818190620029285760405162461bcd60e51b815260040162000937919062003fdd565b50620029348362002f3d565b620029535760405162461bcd60e51b81526004016200093790620040a2565b6000620029648460e00151620011c3565b90506200298584610140015160009081526006602052604090205460ff1690565b15620029d45760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c65746564000000000000604482015260640162000937565b620029f98461014001516000908152600660205260409020805460ff19166001179055565b60025461ffff1661ffff168160a0015161ffff161462002a535760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b604482015260640162000937565b600062002a6360025461ffff1690565b61ffff16826060015161ffff16141562002a9557506040810151602082015162002a8f90829062003441565b62002b16565b600062002aab83606001518460400151620010b0565b90506001600160a01b03811662002b135760405162461bcd60e51b815260206004820152602560248201527f6e6f207772617070657220666f72207468697320746f6b656e2063726561746560448201526419081e595d60da1b606482015260840162000937565b90505b85158062002b3157506004546001600160a01b038281169116145b62002b8b5760405162461bcd60e51b815260206004820152602360248201527f696e76616c696420746f6b656e2c2063616e206f6e6c7920756e77726170205760448201526208aa8960eb1b606482015260840162000937565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b0384169162002bcf919062003f66565b600060405180830381855afa9150503d806000811462002c0c576040519150601f19603f3d011682016040523d82523d6000602084013e62002c11565b606091505b5091505060008180602001905181019062002c2d919062003f19565b9050600062002c41856020015183620021f0565b9050600062002c558660c0015184620021f0565b9050801562002de4578181111562002cbb5760405162461bcd60e51b815260206004820152602260248201527f66656520686967686572207468616e207472616e7366657272656420616d6f756044820152611b9d60f21b606482015260840162000937565b891562002d555760048054604051632e1a7d4d60e01b81529182018390526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002d0757600080fd5b505af115801562002d1c573d6000803e3d6000fd5b505060405133925083156108fc02915083906000818181858888f1935050505015801562002d4e573d6000803e3d6000fd5b5062002de4565b60025461ffff1661ffff16866060015161ffff161462002dd7576040516340c10f1960e01b8152336004820152602481018290526001600160a01b038616906340c10f1990604401600060405180830381600087803b15801562002db857600080fd5b505af115801562002dcd573d6000803e3d6000fd5b5050505062002de4565b62002de485338362003477565b600062002df2828462004313565b60808801519091508b1562002e9d5760048054604051632e1a7d4d60e01b81529182018490526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002e4657600080fd5b505af115801562002e5b573d6000803e3d6000fd5b50506040516001600160a01b038416925084156108fc02915084906000818181858888f1935050505015801562002e96573d6000803e3d6000fd5b5062002f2e565b60025461ffff1661ffff16886060015161ffff161462002f21576040516340c10f1960e01b81526001600160a01b038281166004830152602482018490528816906340c10f1990604401600060405180830381600087803b15801562002f0257600080fd5b505af115801562002f17573d6000803e3d6000fd5b5050505062002f2e565b62002f2e87828462003477565b50505050505050505050505050565b6000816080015162002f63836060015161ffff166000908152600b602052604090205490565b141562002f7257506001919050565b506000919050565b600062002f8a60025461ffff1690565b61ffff16836040015161ffff16141562002ff85760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b606482015260840162000937565b60006001600160a01b03166200301784604001518560200151620010b0565b6001600160a01b0316146200306f5760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c72656164792065786973747300000000604482015260640162000937565b600063c71f461560e01b620030888560a00151620034a9565b620030978660800151620034a9565b8660600151863089604001518a60200151604051602401620030c0979695949392919062004035565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b031990951694909417909352519092506000916200310a91309185910162003fb7565b60405160208183030381529060405290506000604051806020016200312f9062003816565b601f1982820381018352601f909101166040819052620031559190849060200162003f84565b60405160208183030381529060405290506000866040015187602001516040516020016200319c92919060f09290921b6001600160f01b0319168252600282015260220190565b604051602081830303815290604052805190602001209050808251602084016000f59450843b620031cc57600080fd5b6040808801516020808a015161ffff90921660009081526008825283812092815291815282822080546001600160a01b0319166001600160a01b038a1690811790915582526009905220805460ff191660011790555050505092915050565b6000806200324284604001518560200151620010b0565b90506001600160a01b0381166200329c5760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420617373657420646f6573206e6f7420657869737473000000604482015260640162000937565b806001600160a01b031663a18cd7c6620032ba8660a00151620034a9565b620032c98760800151620034a9565b866040518463ffffffff1660e01b8152600401620032ea9392919062003ff2565b600060405180830381600087803b1580156200330557600080fd5b505af11580156200331a573d6000803e3d6000fd5b50929695505050505050565b60006200337d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620035e49092919063ffffffff16565b8051909150156200236057808060200190518101906200339e919062003a95565b620023605760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000937565b6200340a81620035ff565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b62003473828262003467856001600160a01b03166000908152600a602052604090205490565b62002344919062004313565b5050565b6040516001600160a01b0383166024820152604481018290526200236090849063a9059cbb60e01b906064016200225a565b606060005b602081108015620034ec5750828160208110620034db57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b15620035075780620034fe8162004382565b915050620034ae565b6000816001600160401b038111156200353057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156200355b576020820181803683370190505b50905060005b82811015620035dc578481602081106200358b57634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110620035b057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620035d38162004382565b91505062003561565b509392505050565b6060620035f58484600085620036a6565b90505b9392505050565b803b620036655760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000937565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606082471015620037095760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000937565b843b620037595760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000937565b600080866001600160a01b0316858760405162003777919062003f66565b60006040518083038185875af1925050503d8060008114620037b6576040519150601f19603f3d011682016040523d82523d6000602084013e620037bb565b606091505b5091509150620037cd828286620037d8565b979650505050505050565b60608315620037e9575081620035f8565b825115620037fa5782518084602001fd5b8160405162461bcd60e51b815260040162000937919062003fdd565b610993806200440183390190565b80356001600160a01b03811681146200383c57600080fd5b919050565b600082601f83011262003852578081fd5b815160206001600160401b03821115620038705762003870620043b6565b62003880818360051b0162004150565b80838252828201915082860187848660071b8901011115620038a0578586fd5b855b858110156200391057608080838b031215620038bc578788fd5b620038c6620040ff565b835181528684015187820152604080850151620038e381620043f0565b90820152606084810151620038f881620043f0565b908201528552938501939190910190600101620038a2565b5090979650505050505050565b805180151581146200383c57600080fd5b600082601f8301126200393f578081fd5b815162003956620039508262004183565b62004150565b8181528460208386010111156200396b578283fd5b6200397e82602083016020870162004353565b949350505050565b80356200383c81620043cc565b80516200383c81620043cc565b80516200383c81620043dd565b80516001600160401b03811681146200383c57600080fd5b80516200383c81620043f0565b600060208284031215620039e4578081fd5b620035f88262003824565b60008060008060008060c0878903121562003a08578182fd5b62003a138762003824565b955060208701359450604087013562003a2c81620043cc565b9350606087013592506080870135915060a087013562003a4c81620043dd565b809150509295509295509295565b6000806040838503121562003a6d578182fd5b62003a788362003824565b9150602083013562003a8a81620043dd565b809150509250929050565b60006020828403121562003aa7578081fd5b620035f8826200391d565b60006020828403121562003ac4578081fd5b5035919050565b60006020828403121562003add578081fd5b5051919050565b60006020828403121562003af6578081fd5b81356001600160401b0381111562003b0c578182fd5b8201601f8101841362003b1d578182fd5b803562003b2e620039508262004183565b81815285602083850101111562003b43578384fd5b81602084016020830137908101602001929092525092915050565b60006020828403121562003b70578081fd5b81516001600160401b0381111562003b86578182fd5b6200397e848285016200392e565b600060c0828403121562003ba6578081fd5b60405160c081018181106001600160401b038211171562003bcb5762003bcb620043b6565b604052823562003bdb81620043f0565b815260208381013590820152604083013562003bf781620043cc565b6040820152606083013562003c0c81620043f0565b60608201526080838101359082015260a0928301359281019290925250919050565b600060e0828403121562003c40578081fd5b60405160e081018181106001600160401b038211171562003c655762003c65620043b6565b604052823562003c7581620043f0565b808252506020830135602082015260408301356040820152606083013562003c9d81620043cc565b60608201526080838101359082015262003cba60a0840162003986565b60a082015260c083013560c08201528091505092915050565b60008060006060848603121562003ce8578081fd5b83516001600160401b038082111562003cff578283fd5b90850190610160828803121562003d14578283fd5b62003d1e6200412a565b62003d2983620039c5565b815262003d3960208401620039a0565b602082015262003d4c60408401620039a0565b604082015262003d5f6060840162003993565b60608201526080830151608082015262003d7c60a08401620039ad565b60a082015262003d8f60c08401620039c5565b60c082015260e08301518281111562003da6578485fd5b62003db4898286016200392e565b60e08301525061010062003dca818501620039a0565b90820152610120838101518381111562003de2578586fd5b62003df08a82870162003841565b91830191909152506101408381015190820152945062003e13602087016200391d565b9350604086015191508082111562003e29578283fd5b5062003e38868287016200392e565b9150509250925092565b60006020828403121562003e54578081fd5b8135620035f881620043cc565b60006020828403121562003e73578081fd5b8151620035f881620043cc565b6000806040838503121562003e93578182fd5b823562003ea081620043cc565b946020939093013593505050565b6000806000806080858703121562003ec4578182fd5b843562003ed181620043cc565b93506020850135925060408501359150606085013562003ef181620043dd565b939692955090935050565b60006020828403121562003f0e578081fd5b620035f882620039ad565b60006020828403121562003f2b578081fd5b8151620035f881620043f0565b6000815180845262003f5281602086016020860162004353565b601f01601f19169290920160200192915050565b6000825162003f7a81846020870162004353565b9190910192915050565b6000835162003f9881846020880162004353565b83519083019062003fae81836020880162004353565b01949350505050565b6001600160a01b0383168152604060208201819052600090620035f59083018462003f38565b602081526000620035f8602083018462003f38565b60608152600062004007606083018662003f38565b82810360208401526200401b818662003f38565b9150506001600160401b0383166040830152949350505050565b60e0815260006200404a60e083018a62003f38565b82810360208401526200405e818a62003f38565b60ff98909816604084015250506001600160401b039490941660608501526001600160a01b0392909216608084015261ffff1660a083015260c09091015292915050565b6020808252600f908201526e34b73b30b634b21032b6b4ba3a32b960891b604082015260600190565b63ffffffff84168152606060208201526000620040ec606083018562003f38565b905060ff83166040830152949350505050565b604051608081016001600160401b0381118282101715620041245762004124620043b6565b60405290565b60405161016081016001600160401b0381118282101715620041245762004124620043b6565b604051601f8201601f191681016001600160401b03811182821017156200417b576200417b620043b6565b604052919050565b60006001600160401b038211156200419f576200419f620043b6565b50601f01601f191660200190565b60008219821115620041c357620041c3620043a0565b500190565b600082620041e457634e487b7160e01b81526012600452602481fd5b500490565b600181815b808511156200422a5781600019048211156200420e576200420e620043a0565b808516156200421c57918102915b93841c9390800290620041ee565b509250929050565b6000620035f860ff8416836000826200424e57506001620010d9565b816200425d57506000620010d9565b81600181146200427657600281146200428157620042a1565b6001915050620010d9565b60ff841115620042955762004295620043a0565b50506001821b620010d9565b5060208310610133831016604e8410600b8410161715620042c6575081810a620010d9565b620042d28383620041e9565b8060001904821115620042e957620042e9620043a0565b029392505050565b60008160001904831182151516156200430e576200430e620043a0565b500290565b600082821015620043285762004328620043a0565b500390565b600060ff821660ff8416808210156200434a576200434a620043a0565b90039392505050565b60005b838110156200437057818101518382015260200162004356565b83811115620022925750506000910152565b6000600019821415620043995762004399620043a0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff81168114620014ee57600080fd5b63ffffffff81168114620014ee57600080fd5b60ff81168114620014ee57600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a264697066735822122039ec556fbe32839cf73a76e40bab4dae4f8d22cac8a8cd125be4ab6f3dc8b5b564736f6c63430008040033",fn=(function(e){function t(t){return e.call(this,un,cn,t)||this}sn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(un)},t.connect=function(e,t){return new a.b(e,un,t)},t.bytecode=cn,t.abi=un}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),dn=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint32",name:"index",type:"uint32"}],name:"GuardianSetAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint64",name:"sequence",type:"uint64"},{indexed:!1,internalType:"uint32",name:"nonce",type:"uint32"},{indexed:!1,internalType:"bytes",name:"payload",type:"bytes"},{indexed:!1,internalType:"uint8",name:"consistencyLevel",type:"uint8"}],name:"LogMessagePublished",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentGuardianSetIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32",name:"index",type:"uint32"}],name:"getGuardianSet",outputs:[{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getGuardianSetExpiry",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"messageFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"emitter",type:"address"}],name:"nextSequence",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseAndVerifyVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"},{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct GovernanceStructs.ContractUpgrade",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseGuardianSetUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"newGuardianSet",type:"tuple"},{internalType:"uint32",name:"newGuardianSetIndex",type:"uint32"}],internalType:"struct GovernanceStructs.GuardianSetUpgrade",name:"gsu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedSetMessageFee",type:"bytes"}],name:"parseSetMessageFee",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"messageFee",type:"uint256"}],internalType:"struct GovernanceStructs.SetMessageFee",name:"smf",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedTransferFees",type:"bytes"}],name:"parseTransferFees",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"recipient",type:"bytes32"}],internalType:"struct GovernanceStructs.TransferFees",name:"tf",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"parseVM",outputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"}],name:"publishMessage",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitContractUpgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitNewGuardianSet",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitSetMessageFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_vm",type:"bytes"}],name:"submitTransferFees",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{components:[{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"uint32",name:"expirationTime",type:"uint32"}],internalType:"struct Structs.GuardianSet",name:"guardianSet",type:"tuple"}],name:"verifySignatures",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyVM",outputs:[{internalType:"bool",name:"valid",type:"bool"},{internalType:"string",name:"reason",type:"string"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"},{inputs:[],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"testNewImplementationActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"}],ln="0x608060405234801561001057600080fd5b50612fc1806100206000396000f3fe60806040526004361061016a5760003560e01c8063875be02a116100d1578063b19a437e1161008a578063eb8d3f1211610064578063eb8d3f12146105ff578063f42bc64114610622578063f951975a14610642578063fbe3c2cd1461066f576101d1565b8063b19a437e14610584578063c0fd8bde14610597578063d60b347f146105c6576101d1565b8063875be02a146104ac57806393df337e146104da5780639a8a0592146104fa578063a0cce1b314610522578063a9e1189314610542578063b172b2221461056f576101d1565b80634cf842b5116101235780634cf842b5146103415780634fdc60fa14610398578063515f3247146103fb5780635cb8cae2146104555780636606b4e0146104775780638129fc1c14610497576101d1565b80630319e59c1461020757806304ca84cf146102795780631a90a219146102a65780631cfe7951146102c55780631f8cdb2b146102f15780632c3c02a414610311576101d1565b366101d15760405162461bcd60e51b815260206004820152602c60248201527f74686520576f726d686f6c6520636f6e747261637420646f6573206e6f74206160448201526b63636570742061737365747360a01b60648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152600b60248201526a1d5b9cdd5c1c1bdc9d195960aa1b60448201526064016101c8565b34801561021357600080fd5b50610227610222366004612841565b61068e565b6040516102709190600060a0820190508251825260ff602084015116602083015261ffff6040840151166040830152606083015160608301526080830151608083015292915050565b60405180910390f35b34801561028557600080fd5b50610299610294366004612841565b6107e4565b6040516102709190612c37565b3480156102b257600080fd5b506007545b604051908152602001610270565b3480156102d157600080fd5b5060035463ffffffff165b60405163ffffffff9091168152602001610270565b3480156102fd57600080fd5b5060015b6040519015158152602001610270565b34801561031d57600080fd5b5061030161032c3660046126b6565b60009081526005602052604090205460ff1690565b34801561034d57600080fd5b5061038061035c366004612695565b6001600160a01b03166000908152600460205260409020546001600160401b031690565b6040516001600160401b039091168152602001610270565b3480156103a457600080fd5b506103b86103b3366004612841565b610a17565b60405161027091908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b34801561040757600080fd5b5061041b610416366004612841565b610b53565b60405161027091908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b34801561046157600080fd5b50610475610470366004612841565b610c82565b005b34801561048357600080fd5b50610475610492366004612841565b610d8a565b3480156104a357600080fd5b50610475610faa565b3480156104b857600080fd5b506104cc6104c736600461287b565b61106f565b604051610270929190612c09565b3480156104e657600080fd5b506104756104f5366004612841565b611203565b34801561050657600080fd5b5060005461ffff165b60405161ffff9091168152602001610270565b34801561052e57600080fd5b506104cc61053d3660046126ce565b61134f565b34801561054e57600080fd5b5061056261055d366004612841565b61152c565b6040516102709190612ca7565b34801561057b57600080fd5b506001546102b7565b6103806105923660046129b4565b61190a565b3480156105a357600080fd5b506105b76105b23660046127d5565b6119aa565b60405161027093929190612cba565b3480156105d257600080fd5b506103016105e1366004612695565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561060b57600080fd5b50600354640100000000900463ffffffff166102dc565b34801561062e57600080fd5b5061047561063d366004612841565b611a0c565b34801561064e57600080fd5b5061066261065d36600461299a565b611b0d565b6040516102709190612c94565b34801561067b57600080fd5b5060005462010000900461ffff1661050f565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906106c38382611bac565b82526106d0602082612df3565b90506106dc8382611c0a565b60ff1660208301526106ef600182612df3565b9050816020015160ff1660041461073f5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101c8565b6107498382611c66565b61ffff16604083015261075d600282612df3565b90506107698382611cc3565b6060830152610779602082612df3565b90506107858382611bac565b6080830152610795602082612df3565b9050808351146107de5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101c8565b50919050565b6107ec6123e3565b60006107f88382611bac565b8252610805602082612df3565b90506108118382611c0a565b60ff166020830152610824600182612df3565b9050816020015160ff1660021461087d5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101c8565b6108878382611c66565b61ffff16604083015261089b600282612df3565b90506108a78382611d18565b63ffffffff1660808301526108bd600482612df3565b905060006108cb8483611c0a565b90506108d8600183612df3565b915060405180604001604052808260ff166001600160401b0381111561090e57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610937578160200160208202803683370190505b5081526000602090910181905260608501919091525b8160ff168110156109bf576109628584611d75565b60608501515180518390811061098857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101526109ab601484612df3565b9250806109b781612f00565b91505061094d565b5081845114610a105760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101c8565b5050919050565b604080516080810182526000808252602082018190529181018290526060810182905290610a458382611bac565b8252610a52602082612df3565b9050610a5e8382611c0a565b60ff166020830152610a71600182612df3565b9050816020015160ff16600114610ac45760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101c8565b610ace8382611c66565b61ffff166040830152610ae2600282612df3565b9050610aee8382611bac565b6001600160a01b03166060830152610b07602082612df3565b9050808351146107de5760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101c8565b604080516080810182526000808252602082018190529181018290526060810182905290610b818382611bac565b8252610b8e602082612df3565b9050610b9a8382611c0a565b60ff166020830152610bad600182612df3565b9050816020015160ff16600314610bfe5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101c8565b610c088382611c66565b61ffff166040830152610c1c600282612df3565b9050610c288382611cc3565b6060830152610c38602082612df3565b9050808351146107de5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101c8565b6000610c8d8261152c565b9050600080610c9b83611dda565b91509150818190610cbf5760405162461bcd60e51b81526004016101c89190612c24565b506000610ccf8460e00151610a17565b805190915063436f726514610d175760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff1614610d685760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101c8565b610d76846101400151611f50565b610d838160600151611f6b565b5050505050565b6000610d958261152c565b9050600080610da383611dda565b91509150818190610dc75760405162461bcd60e51b81526004016101c89190612c24565b506000610dd78460e001516107e4565b805190915063436f726514610e1f5760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff161480610e455750604081015161ffff16155b610e815760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101c8565b60608101515151610ed45760405162461bcd60e51b815260206004820152601960248201527f6e657720677561726469616e2073657420697320656d7074790000000000000060448201526064016101c8565b60035463ffffffff16610ee8906001612e0b565b63ffffffff16816080015163ffffffff1614610f505760405162461bcd60e51b815260206004820152602160248201527f696e646578206d75737420696e63726561736520696e207374657073206f66206044820152603160f81b60648201526084016101c8565b610f5e846101400151611f50565b610f75610f7060035463ffffffff1690565b612098565b610f87816060015182608001516120d0565b60808101516003805463ffffffff191663ffffffff909216919091179055610d83565b6000610fdd7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611001816001600160a01b031660009081526006602052604090205460ff1690565b156110445760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064016101c8565b61106c816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b600060606000611083846101000151611b0d565b8051519091506110c6576000604051806040016040528060148152602001731a5b9d985b1a590819dd585c991a585b881cd95d60621b8152509250925050915091565b60035463ffffffff1663ffffffff1684610100015163ffffffff16141580156110f8575042816020015163ffffffff16105b1561113f5760006040518060400160405280601881526020017f677561726469616e2073657420686173206578706972656400000000000000008152509250925050915091565b61012084015151815151600a906003906111599083612e9a565b6111639190612e7a565b61116e906002612e9a565b6111789190612e7a565b611183906001612df3565b11156111b7576000604051806040016040528060098152602001686e6f2071756f72756d60b81b8152509250925050915091565b6000806111cf8661014001518761012001518561134f565b91509150816111e5576000969095509350505050565b60016040518060200160405280600081525094509450505050915091565b600061120e8261152c565b905060008061121c83611dda565b915091508181906112405760405162461bcd60e51b81526004016101c89190612c24565b5060006112508460e0015161068e565b805190915063436f7265146112985760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff1614806112be5750604081015161ffff16155b6112fa5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101c8565b611308846101400151611f50565b608081015160608201516040516001600160a01b0383169180156108fc02916000818181858888f19350505050158015611346573d6000803e3d6000fd5b50505050505050565b600060606000805b855181101561150b57600086828151811061138257634e487b7160e01b600052603260045260246000fd5b6020026020010151905081600014806113a457508260ff16816060015160ff16115b6113fc5760405162461bcd60e51b815260206004820152602360248201527f7369676e617475726520696e6469636573206d75737420626520617363656e64604482015262696e6760e81b60648201526084016101c8565b6060810151865180519194509060ff851690811061142a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031660018983604001518460000151856020015160405160008152602001604052604051611483949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa1580156114a5573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146114f8576000604051806040016040528060148152602001731593481cda59db985d1d5c99481a5b9d985b1a5960621b81525094509450505050611524565b508061150381612f00565b915050611357565b5060016040518060200160405280600081525092509250505b935093915050565b61153461243d565b60006115408382611c0a565b60ff168252611550600182612df3565b9050816000015160ff166001146115a95760405162461bcd60e51b815260206004820152601760248201527f564d2076657273696f6e20696e636f6d70617469626c6500000000000000000060448201526064016101c8565b6115b38382611d18565b63ffffffff166101008301526115ca600482612df3565b905060006115d88483611c0a565b60ff1690506115e8600183612df3565b9150806001600160401b0381111561161057634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561166257816020015b60408051608081018252600080825260208083018290529282018190526060820152825260001990920191018161162e5790505b5061012084015260005b818110156117d15761167e8584611c0a565b84610120015182815181106116a357634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166060909101526116c4600184612df3565b92506116d08584611bac565b84610120015182815181106116f557634e487b7160e01b600052603260045260246000fd5b602002602001015160000181815250506020836117129190612df3565b925061171e8584611bac565b846101200151828151811061174357634e487b7160e01b600052603260045260246000fd5b602002602001015160200181815250506020836117609190612df3565b925061176c8584611c0a565b61177790601b612e55565b846101200151828151811061179c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166040909101526117bd600184612df3565b9250806117c981612f00565b91505061166c565b5060006117ed838487516117e59190612eb9565b879190612124565b9050808051906020012060405160200161180991815260200190565b60408051601f1981840301815291905280516020909101206101408501526118318584611d18565b63ffffffff166020850152611847600484612df3565b92506118538584611d18565b63ffffffff166040850152611869600484612df3565b92506118758584611c66565b61ffff166060850152611889600284612df3565b92506118958584611bac565b60808501526118a5602084612df3565b92506118b18584612231565b6001600160401b031660a08501526118ca600884612df3565b92506118d68584611c0a565b60ff1660c08501526118e9600184612df3565b92506118fc838487516117e59190612eb9565b60e085015250919392505050565b600061191560075490565b34146119515760405162461bcd60e51b815260206004820152600b60248201526a696e76616c69642066656560a81b60448201526064016101c8565b61195a3361228e565b9050336001600160a01b03167f6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b28286868660405161199b9493929190612cf1565b60405180910390a29392505050565b6119b261243d565b600060606119f585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061152c92505050565b9250611a008361106f565b93969095509293505050565b6000611a178261152c565b9050600080611a2583611dda565b91509150818190611a495760405162461bcd60e51b81526004016101c89190612c24565b506000611a598460e00151610b53565b805190915063436f726514611aa15760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff1614611af25760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101c8565b611b00846101400151611f50565b610d838160600151600755565b60408051808201825260608082526000602080840182905263ffffffff86168252600281529084902084518154928302810184018652948501828152939493909284928491840182828015611b8b57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611b6d575b50505091835250506001919091015463ffffffff1660209091015292915050565b6000611bb9826020612df3565b83511015611c015760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016101c8565b50016020015190565b6000611c17826001612df3565b83511015611c5d5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016101c8565b50016001015190565b6000611c73826002612df3565b83511015611cba5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016101c8565b50016002015190565b6000611cd0826020612df3565b83511015611c015760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b60448201526064016101c8565b6000611d25826004612df3565b83511015611d6c5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016101c8565b50016004015190565b6000611d82826014612df3565b83511015611dca5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016101c8565b500160200151600160601b900490565b60006060600080611dea8561106f565b9150915081611dff5760009590945092505050565b60035463ffffffff1663ffffffff1685610100015163ffffffff1614611e45576000604051806060016040528060228152602001612f4860229139935093505050915091565b60005462010000900461ffff1661ffff16856060015161ffff1614611ea0576000604051806040016040528060168152602001753bb937b7339033b7bb32b93730b731b29031b430b4b760511b815250935093505050915091565b600154856080015114611ef05760006040518060400160405280601981526020017f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000815250935093505050915091565b61014085015160009081526005602052604090205460ff1615611f33576000604051806060016040528060228152602001612f6a60229139935093505050915091565b600160405180602001604052806000815250935093505050915091565b6000908152600560205260409020805460ff19166001179055565b6000611f9e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611fa9826122fe565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611fec91612bed565b600060405180830381855af49150503d8060008114612027576040519150601f19603f3d011682016040523d82523d6000602084013e61202c565b606091505b50915091508181906120515760405162461bcd60e51b81526004016101c89190612c24565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b6120a54262015180612e0b565b63ffffffff9182166000908152600260205260409020600101805463ffffffff191691909216179055565b63ffffffff811660009081526002602090815260409091208351805185936120fc928492910190612498565b50602091909101516001909101805463ffffffff191663ffffffff9092169190911790555050565b60608161213281601f612df3565b10156121715760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016101c8565b61217b8284612df3565b845110156121bf5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016101c8565b6060821580156121de5760405191506000825260208201604052612228565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156122175780518352602092830192016121ff565b5050858452601f01601f1916604052505b50949350505050565b600061223e826008612df3565b835110156122855760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016101c8565b50016008015190565b6001600160a01b0381166000908152600460205260409020546001600160401b03166122f9826122bf836001612e33565b6001600160a01b03919091166000908152600460205260409020805467ffffffffffffffff19166001600160401b03909216919091179055565b919050565b6123078161233e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6123a25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016101c8565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6040518060a0016040528060008019168152602001600060ff168152602001600061ffff168152602001612430604051806040016040528060608152602001600063ffffffff1681525090565b8152600060209091015290565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201819052610100820183905261012082015261014081019190915290565b8280548282559060005260206000209081019282156124ed579160200282015b828111156124ed57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906124b8565b506124f99291506124fd565b5090565b5b808211156124f957600081556001016124fe565b80356001600160a01b03811681146122f957600080fd5b600082601f830112612539578081fd5b8135602061254e61254983612dd0565b612da0565b80838252828201915082860187848660071b890101111561256d578586fd5b855b858110156125d057608080838b031215612587578788fd5b61258f612d33565b83358152868401358782015260406125a8818601612684565b9082015260606125b9858201612684565b90820152855293850193919091019060010161256f565b5090979650505050505050565b600082601f8301126125ed578081fd5b81356001600160401b0381111561260657612606612f31565b612619601f8201601f1916602001612da0565b81815284602083860101111561262d578283fd5b816020850160208301379081016020019190915292915050565b803561ffff811681146122f957600080fd5b803563ffffffff811681146122f957600080fd5b80356001600160401b03811681146122f957600080fd5b803560ff811681146122f957600080fd5b6000602082840312156126a6578081fd5b6126af82612512565b9392505050565b6000602082840312156126c7578081fd5b5035919050565b6000806000606084860312156126e2578182fd5b833592506020808501356001600160401b0380821115612700578485fd5b61270c88838901612529565b94506040870135915080821115612721578384fd5b9086019060408289031215612734578384fd5b61273c612d5b565b82358281111561274a578586fd5b83019150601f8201891361275c578485fd5b813561276a61254982612dd0565b8082825286820191508685018c888560051b8801011115612789578889fd5b8895505b838610156127b25761279e81612512565b83526001959095019491870191870161278d565b508352506127c39050838501612659565b84820152809450505050509250925092565b600080602083850312156127e7578182fd5b82356001600160401b03808211156127fd578384fd5b818501915085601f830112612810578384fd5b81358181111561281e578485fd5b86602082850101111561282f578485fd5b60209290920196919550909350505050565b600060208284031215612852578081fd5b81356001600160401b03811115612867578182fd5b612873848285016125dd565b949350505050565b60006020828403121561288c578081fd5b81356001600160401b03808211156128a2578283fd5b9083019061016082860312156128b6578283fd5b6128be612d7d565b6128c783612684565b81526128d560208401612659565b60208201526128e660408401612659565b60408201526128f760608401612647565b60608201526080830135608082015261291260a0840161266d565b60a082015261292360c08401612684565b60c082015260e083013582811115612939578485fd5b612945878286016125dd565b60e083015250610100612959818501612659565b908201526101208381013583811115612970578586fd5b61297c88828701612529565b91830191909152506101409283013592810192909252509392505050565b6000602082840312156129ab578081fd5b6126af82612659565b6000806000606084860312156129c8578081fd5b6129d184612659565b925060208401356001600160401b038111156129eb578182fd5b6129f7868287016125dd565b925050612a0660408501612684565b90509250925092565b6000815180845260208085019450808401835b83811015612a6757815180518852838101518489015260408082015160ff908116918a0191909152606091820151169088015260809096019590820190600101612a22565b509495945050505050565b60008151808452612a8a816020860160208601612ed0565b601f01601f19169290920160200192915050565b805160408084528151908401819052600091602091908201906060860190845b81811015612ae35783516001600160a01b031683529284019291840191600101612abe565b50509382015163ffffffff16949091019390935250919050565b805160ff16825260006101606020830151612b20602086018263ffffffff169052565b506040830151612b38604086018263ffffffff169052565b506060830151612b4e606086018261ffff169052565b506080830151608085015260a0830151612b7360a08601826001600160401b03169052565b5060c0830151612b8860c086018260ff169052565b5060e08301518160e0860152612ba082860182612a72565b91505061010080840151612bbb8287018263ffffffff169052565b50506101208084015185830382870152612bd58382612a0f565b61014095860151969095019590955250919392505050565b60008251612bff818460208701612ed0565b9190910192915050565b82151581526040602082015260006128736040830184612a72565b6020815260006126af6020830184612a72565b602081528151602082015260ff602083015116604082015261ffff60408301511660608201526000606083015160a06080840152612c7860c0840182612a9e565b905063ffffffff60808501511660a08401528091505092915050565b6020815260006126af6020830184612a9e565b6020815260006126af6020830184612afd565b606081526000612ccd6060830186612afd565b84151560208401528281036040840152612ce78185612a72565b9695505050505050565b6001600160401b038516815263ffffffff84166020820152608060408201526000612d1f6080830185612a72565b905060ff8316606083015295945050505050565b604051608081016001600160401b0381118282101715612d5557612d55612f31565b60405290565b604080519081016001600160401b0381118282101715612d5557612d55612f31565b60405161016081016001600160401b0381118282101715612d5557612d55612f31565b604051601f8201601f191681016001600160401b0381118282101715612dc857612dc8612f31565b604052919050565b60006001600160401b03821115612de957612de9612f31565b5060051b60200190565b60008219821115612e0657612e06612f1b565b500190565b600063ffffffff808316818516808303821115612e2a57612e2a612f1b565b01949350505050565b60006001600160401b03808316818516808303821115612e2a57612e2a612f1b565b600060ff821660ff84168060ff03821115612e7257612e72612f1b565b019392505050565b600082612e9557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612eb457612eb4612f1b565b500290565b600082821015612ecb57612ecb612f1b565b500390565b60005b83811015612eeb578181015183820152602001612ed3565b83811115612efa576000848401525b50505050565b6000600019821415612f1457612f14612f1b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfe6e6f74207369676e65642062792063757272656e7420677561726469616e20736574676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220c02c8068c96005b29d58ae98b32720b3ecf9bb0911966c19bff9382caf08a2d164736f6c63430008040033",pn=(function(e){function t(t){return e.call(this,dn,ln,t)||this}fn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(dn)},t.connect=function(e,t){return new a.b(e,dn,t)},t.bytecode=ln,t.abi=dn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),bn=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"string",name:"uri",type:"string"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"}],internalType:"struct NFTBridgeStructs.Transfer",name:"transfer",type:"tuple"}],name:"encodeTransfer",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct NFTBridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseTransfer",outputs:[{components:[{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"string",name:"uri",type:"string"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"}],internalType:"struct NFTBridgeStructs.Transfer",name:"transfer",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct NFTBridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"splCache",outputs:[{components:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes32",name:"symbol",type:"bytes32"}],internalType:"struct NFTBridgeStorage.SPLCache",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"transferNFT",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"testNewImplementationActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"}],hn="0x608060405234801561001057600080fd5b50613b94806100206000396000f3fe608060405260043610620001675760003560e01c806384acd1bb11620000c5578063c68785191162000078578063c68785191462000521578063c96616e11462000546578063d60b347f1462000576578063e6a853e014620005b3578063fbe3c2cd14620005e7578063fbeeacd9146200060857600080fd5b806384acd1bb14620004235780639a8a05921462000443578063a5799f93146200046d578063aa4efa5b1462000492578063ad66a5f114620004c6578063b172b222146200050a57600080fd5b80632b511375116200011e5780632b51137514620002f25780632c3c02a414620003265780632f3a3d5d146200035a5780633ca64826146200037a5780635c60da1b14620003f35780638129fc1c146200040b57600080fd5b806301f53255146200016c578063150b7a0214620001ea5780631a2be4da14620002295780631f8cdb2b14620002775780631ff1e286146200028d5780632539464514620002cb575b600080fd5b3480156200017957600080fd5b50620001916200018b36600462002a55565b62000668565b604051620001e19190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620001f757600080fd5b506200020f6200020936600462002905565b62000870565b6040516001600160e01b03199091168152602001620001e1565b3480156200023657600080fd5b506200026662000248366004620028e8565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001620001e1565b3480156200028457600080fd5b50600162000266565b3480156200029a57600080fd5b50620002b2620002ac36600462002d4b565b620008f4565b6040516001600160a01b039091168152602001620001e1565b348015620002d857600080fd5b50620002f0620002ea36600462002a55565b62000920565b005b348015620002ff57600080fd5b50620003176200031136600462002a55565b62000a04565b604051620001e1919062002f4d565b3480156200033357600080fd5b50620002666200034536600462002a23565b60009081526004602052604090205460ff1690565b3480156200036757600080fd5b506001546001600160a01b0316620002b2565b3480156200038757600080fd5b50620003d76200039936600462002a23565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201620001e1565b3480156200040057600080fd5b50620002b262000bda565b3480156200041857600080fd5b50620002f062000bf4565b3480156200043057600080fd5b506000546001600160a01b0316620002b2565b3480156200045057600080fd5b5060025461ffff165b60405161ffff9091168152602001620001e1565b3480156200047a57600080fd5b50620002f06200048c36600462002a55565b62000cbe565b3480156200049f57600080fd5b5062000266620004b136600462002a23565b60009081526005602052604090205460ff1690565b348015620004d357600080fd5b50620004fb620004e536600462002d0d565b61ffff1660009081526009602052604090205490565b604051908152602001620001e1565b3480156200051757600080fd5b50600354620004fb565b3480156200052e57600080fd5b50620002f06200054036600462002a55565b62000dc4565b6200055d62000557366004620029a3565b62000dcf565b6040516001600160401b039091168152602001620001e1565b3480156200058357600080fd5b506200026662000595366004620028e8565b6001600160a01b031660009081526006602052604090205460ff1690565b348015620005c057600080fd5b50620005d8620005d236600462002ad5565b6200148e565b604051620001e1919062002ee4565b348015620005f457600080fd5b5060025462010000900461ffff1662000459565b3480156200061557600080fd5b506200062d6200062736600462002a55565b6200154a565b604051620001e191908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906200069f838262001723565b8252620006ae602082620030d3565b8251909150684e4654427269646765146200071c5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b62000728838262001785565b60ff1660208301526200073d600182620030d3565b9050816020015160ff16600114620007a45760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840162000713565b620007b08382620017e5565b61ffff166040830152620007c6600282620030d3565b9050620007d48382620017e5565b61ffff166060830152620007ea600282620030d3565b9050620007f8838262001723565b60808301526200080a602082620030d3565b9050808351146200086a5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840162000713565b50919050565b60006001600160a01b0386163014620008e25760405162461bcd60e51b815260206004820152602d60248201527f63616e206f6e6c792062726964676520746f6b656e7320766961207472616e7360448201526c19995c939195081b595d1a1bd9609a1b606482015260840162000713565b50630a85bd0160e11b95945050505050565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6000806000620009308462001846565b925092509250818190620009595760405162461bcd60e51b815260040162000713919062002ee4565b506200097f8361014001516000908152600460205260409020805460ff19166001179055565b6000620009908460e001516200154a565b9050620009a060025461ffff1690565b61ffff16816040015161ffff1614620009ed5760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640162000713565b6060810151620009fd9062001a75565b5050505050565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082015260c0810182905260e08101829052908062000a51848262001785565b905062000a60600183620030d3565b91508060ff1660011462000aaa5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000713565b62000ab6848362001723565b835262000ac5602083620030d3565b915062000ad38483620017e5565b61ffff16602084015262000ae9600283620030d3565b915062000af7848362001723565b604084015262000b09602083620030d3565b915062000b17848362001723565b606084015262000b29602083620030d3565b915062000b37848362001bac565b608084015262000b49602083620030d3565b915062000b58600183620030d3565b915062000b8582602284875162000b709190620030ee565b62000b7c9190620030ee565b86919062001c05565b60a08401528351915062000b9b600283620030ee565b915062000ba98483620017e5565b61ffff1660e084015262000bbf602083620030ee565b915062000bcd848362001723565b60c0840152509092915050565b600062000bef6001546001600160a01b031690565b905090565b600062000c287f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062000c4d816001600160a01b031660009081526006602052604090205460ff1690565b1562000c925760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640162000713565b62000cbb816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b600080600062000cce8462001846565b92509250925081819062000cf75760405162461bcd60e51b815260040162000713919062002ee4565b5062000d1d8361014001516000908152600460205260409020805460ff19166001179055565b600062000d2e8460e0015162000668565b905062000d3e60025461ffff1690565b61ffff16816040015161ffff16148062000d5e5750604081015161ffff16155b62000d9f5760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640162000713565b620009fd8160600151826080015161ffff909116600090815260096020526040902055565b62000cbb8162001d1e565b600080600062000df7886001600160a01b031660009081526008602052604090205460ff1690565b1562000ef157876001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e3757600080fd5b505afa15801562000e4c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e72919062002d2c565b9150876001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000eae57600080fd5b505afa15801562000ec3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ee9919062002a3c565b9050620010bb565b60025461ffff166040516301ffc9a760e01b81526380ac58cd60e01b60048201529092506001600160a01b038916915081906301ffc9a79060240160206040518083038186803b15801562000f4557600080fd5b505afa15801562000f5a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f80919062002a06565b62000fd85760405162461bcd60e51b815260206004820152602160248201527f6d75737420737570706f7274207468652045524337323120696e7465726661636044820152606560f81b606482015260840162000713565b6040516301ffc9a760e01b8152635b5e139f60e01b60048201526001600160a01b038916906301ffc9a79060240160206040518083038186803b1580156200101f57600080fd5b505afa15801562001034573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200105a919062002a06565b620010bb5760405162461bcd60e51b815260206004820152602a60248201527f6d75737420737570706f727420746865204552433732312d4d657461646174616044820152691032bc3a32b739b4b7b760b11b606482015260840162000713565b60608060608461ffff16600114620012155760408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b17905290516000916001600160a01b038e169162001111919062002dc4565b600060405180830381855afa9150503d80600081146200114e576040519150601f19603f3d011682016040523d82523d6000602084013e62001153565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b038f16916200119c919062002dc4565b600060405180830381855afa9150503d8060008114620011d9576040519150601f19603f3d011682016040523d82523d6000602084013e620011de565b606091505b5091505081806020019051810190620011f8919062002a9f565b94508080602001905181019062001210919062002a9f565b935050505b60008b6001600160a01b03168b6040516024016200123591815260200190565b60408051601f198184030181529181526020820180516001600160e01b031663c87b56dd60e01b179052516200126c919062002dc4565b600060405180830381855afa9150503d8060008114620012a9576040519150601f19603f3d011682016040523d82523d6000602084013e620012ae565b606091505b5091505080806020019051810190620012c8919062002a9f565b9150506000808661ffff16600114156200134557604080518082018252600080825260209182018190528e8152600a825282812083518085019094528054845260010154918301919091529060208101518151909450925090506200133e8d6000908152600a6020526040812081815560010155565b5062001352565b5050602083810151908301515b60025461ffff88811691161415620013d257604051632142170760e11b8152336004820152306024820152604481018d90526001600160a01b038e16906342842e0e90606401600060405180830381600087803b158015620013b357600080fd5b505af1158015620013c8573d6000803e3d6000fd5b505050506200142f565b604051630852cd8d60e31b8152600481018d90526001600160a01b038e16906342966c6890602401600060405180830381600087803b1580156200141557600080fd5b505af11580156200142a573d6000803e3d6000fd5b505050505b6200147d6040518061010001604052808881526020018961ffff1681526020018481526020018381526020018e81526020018581526020018c81526020018d61ffff16815250348b62002102565b9d9c50505050505050505050505050565b606060c88260a00151511115620014f35760405162461bcd60e51b815260206004820152602260248201527f746f6b656e555249206d757374206e6f74206578636565642032303020627974604482015261657360f01b606482015260840162000713565b81516020808401516040808601516060870151608088015160a0890151805160c08b015160e08c01519651620015349a60019a909998939493910162002e15565b6040516020818303038152906040529050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906200157a838262001723565b825262001589602082620030d3565b8251909150684e465442726964676514620015f55760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840162000713565b62001601838262001785565b60ff16602083015262001616600182620030d3565b9050816020015160ff166002146200167f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840162000713565b6200168b8382620017e5565b61ffff166040830152620016a1600282620030d3565b9050620016af838262001723565b6060830152620016c1602082620030d3565b9050808351146200086a5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840162000713565b600062001732826020620030d3565b835110156200177c5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640162000713565b50016020015190565b600062001794826001620030d3565b83511015620017dc5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640162000713565b50016001015190565b6000620017f4826002620030d3565b835110156200183d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640162000713565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620018ba6000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620018e7919062002ee4565b60006040518083038186803b1580156200190057600080fd5b505afa15801562001915573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200193f919081019062002b9e565b9250925092508162001958579194509250905062001a6e565b60025462010000900461ffff1661ffff16836060015161ffff1614620019b65750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062001a6e565b60035483608001511462001a0957505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062001a6e565b61014083015160009081526004602052604090205460ff161562001a535782600060405180606001604052806022815260200162003b3d6022913995509550955050505062001a6e565b50506040805160208101909152600081529093506001925090505b9193909250565b600062001aa97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001ab682620021b7565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169162001afb9162002dc4565b600060405180830381855af49150503d806000811462001b38576040519150601f19603f3d011682016040523d82523d6000602084013e62001b3d565b606091505b509150915081819062001b655760405162461bcd60e51b815260040162000713919062002ee4565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062001bbb826020620030d3565b835110156200177c5760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b604482015260640162000713565b60608162001c1581601f620030d3565b101562001c565760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b604482015260640162000713565b62001c628284620030d3565b8451101562001ca85760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b604482015260640162000713565b60608215801562001cc9576040519150600082526020820160405262001d15565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101562001d0457805183526020928301920162001cea565b5050858452601f01601f1916604052505b50949350505050565b600080600062001d366000546001600160a01b031690565b6001600160a01b031663c0fd8bde856040518263ffffffff1660e01b815260040162001d63919062002ee4565b60006040518083038186803b15801562001d7c57600080fd5b505afa15801562001d91573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001dbb919081019062002b9e565b92509250925081819062001de45760405162461bcd60e51b815260040162000713919062002ee4565b5062001df083620021f9565b62001e305760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b604482015260640162000713565b600062001e418460e0015162000a04565b905062001e6284610140015160009081526005602052604090205460ff1690565b1562001eb15760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c65746564000000000000604482015260640162000713565b62001ed68461014001516000908152600560205260409020805460ff19166001179055565b60025461ffff1661ffff168160e0015161ffff161462001f305760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b604482015260640162000713565b600062001f4060025461ffff1690565b61ffff16826020015161ffff16141562001f5d5750805162001fa8565b600062001f7383602001518460000151620008f4565b90506001600160a01b03811662001fa55762001fa2836020015184600001518560600151866040015162002236565b90505b90505b60c082015160025461ffff1661ffff16836020015161ffff16146200208757826020015161ffff166001141562002013576080830151604080518082018252606086015181528186015160208083019182526000948552600a90529190922091518255516001909101555b608083015160a08401516040516334ff261960e21b81526001600160a01b0385169263d3fc9864926200204d928692919060040162002ebb565b600060405180830381600087803b1580156200206857600080fd5b505af11580156200207d573d6000803e3d6000fd5b50505050620020f9565b6080830151604051632142170760e11b81523060048201526001600160a01b0383811660248301526044820192909252908316906342842e0e90606401600060405180830381600087803b158015620020df57600080fd5b505af1158015620020f4573d6000803e3d6000fd5b505050505b50505050505050565b60008062002110856200148e565b9050620021256000546001600160a01b031690565b6001600160a01b031663b19a437e858584600f6040518563ffffffff1660e01b8152600401620021589392919062002fcb565b6020604051808303818588803b1580156200217257600080fd5b505af115801562002187573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190620021ae919062002d79565b95945050505050565b620021c281620024e3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600081608001516200221f836060015161ffff1660009081526009602052604090205490565b14156200222e57506001919050565b506000919050565b60006200224660025461ffff1690565b61ffff168561ffff161415620022b05760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b606482015260840162000713565b6000620022be8686620008f4565b6001600160a01b031614620023165760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c72656164792065786973747300000000604482015260640162000713565b8461ffff166001141562002358577f576f726d686f6c65204272696467656420536f6c616e612d4e4654000000000092506915d3d49354d41313919560b21b91505b6000627ce50b60e31b6200236c856200258a565b62002377856200258a565b3089896040516024016200239095949392919062002ef9565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b03199095169490941790935251909250600091620023da91309185910162002e95565b6040516020818303038152906040529050600060405180602001620023ff90620026c5565b601f1982820381018352601f909101166040819052620024259190849060200162002de2565b60408051601f19818403018152908290526001600160f01b031960f08b901b166020830152602282018990529150600090604201604051602081830303815290604052805190602001209050808251602084016000f59450843b6200248957600080fd5b61ffff891660009081526007602090815260408083208b8452825280832080546001600160a01b0319166001600160a01b038a16908117909155835260089091529020805460ff1916600117905550505050949350505050565b803b620025495760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000713565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606060005b602081108015620025cd5750828160208110620025bc57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b15620025e85780620025df816200313b565b9150506200258f565b6000816001600160401b038111156200261157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156200263c576020820181803683370190505b50905060005b82811015620026bd578481602081106200266c57634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200269157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620026b4816200313b565b91505062002642565b509392505050565b61099380620031aa83390190565b6000620026ea620026e484620030a9565b62003076565b9050828152838383011115620026ff57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146200272e57600080fd5b919050565b600082601f83011262002744578081fd5b815160206001600160401b038211156200276257620027626200316f565b62002772818360051b0162003076565b80838252828201915082860187848660071b890101111562002792578586fd5b855b85811015620027fe57608080838b031215620027ae578788fd5b620027b862002fff565b8351815286840151878201526040620027d3818601620028d6565b908201526060620027e6858201620028d6565b90820152855293850193919091019060010162002794565b5090979650505050505050565b805180151581146200272e57600080fd5b600082601f8301126200282d578081fd5b81516200283e620026e482620030a9565b81815284602083860101111562002853578283fd5b6200286682602083016020870162003108565b949350505050565b600082601f8301126200287f578081fd5b6200289083833560208501620026d3565b9392505050565b80356200272e8162003185565b80516200272e8162003185565b80516200272e8162003196565b80516001600160401b03811681146200272e57600080fd5b805160ff811681146200272e57600080fd5b600060208284031215620028fa578081fd5b620028908262002716565b6000806000806000608086880312156200291d578081fd5b620029288662002716565b9450620029386020870162002716565b93506040860135925060608601356001600160401b03808211156200295b578283fd5b818801915088601f8301126200296f578283fd5b8135818111156200297e578384fd5b89602082850101111562002990578384fd5b9699959850939650602001949392505050565b600080600080600060a08688031215620029bb578283fd5b620029c68662002716565b9450602086013593506040860135620029df8162003185565b9250606086013591506080860135620029f88162003196565b809150509295509295909350565b60006020828403121562002a18578081fd5b62002890826200280b565b60006020828403121562002a35578081fd5b5035919050565b60006020828403121562002a4e578081fd5b5051919050565b60006020828403121562002a67578081fd5b81356001600160401b0381111562002a7d578182fd5b8201601f8101841362002a8e578182fd5b6200286684823560208401620026d3565b60006020828403121562002ab1578081fd5b81516001600160401b0381111562002ac7578182fd5b62002866848285016200281c565b60006020828403121562002ae7578081fd5b81356001600160401b038082111562002afe578283fd5b90830190610100828603121562002b13578283fd5b62002b1d6200302a565b8235815262002b2f6020840162002897565b602082015260408301356040820152606083013560608201526080830135608082015260a08301358281111562002b64578485fd5b62002b72878286016200286e565b60a08301525060c083013560c082015262002b9060e0840162002897565b60e082015295945050505050565b60008060006060848603121562002bb3578081fd5b83516001600160401b038082111562002bca578283fd5b90850190610160828803121562002bdf578283fd5b62002be962003050565b62002bf483620028d6565b815262002c0460208401620028b1565b602082015262002c1760408401620028b1565b604082015262002c2a60608401620028a4565b60608201526080830151608082015262002c4760a08401620028be565b60a082015262002c5a60c08401620028d6565b60c082015260e08301518281111562002c71578485fd5b62002c7f898286016200281c565b60e08301525061010062002c95818501620028b1565b90820152610120838101518381111562002cad578586fd5b62002cbb8a82870162002733565b91830191909152506101408381015190820152945062002cde602087016200280b565b9350604086015191508082111562002cf4578283fd5b5062002d03868287016200281c565b9150509250925092565b60006020828403121562002d1f578081fd5b8135620028908162003185565b60006020828403121562002d3e578081fd5b8151620028908162003185565b6000806040838503121562002d5e578182fd5b823562002d6b8162003185565b946020939093013593505050565b60006020828403121562002d8b578081fd5b6200289082620028be565b6000815180845262002db081602086016020860162003108565b601f01601f19169290920160200192915050565b6000825162002dd881846020870162003108565b9190910192915050565b6000835162002df681846020880162003108565b83519083019062002e0c81836020880162003108565b01949350505050565b600060ff60f81b808d60f81b1683528b600184015261ffff60f01b808c60f01b1660218501528a6023850152896043850152886063850152818860f81b1660838501528651915062002e6f826084860160208a0162003108565b920160848101949094525060f09190911b1660a482015260a60198975050505050505050565b6001600160a01b0383168152604060208201819052600090620028669083018462002d96565b60018060a01b0384168152826020820152606060408201526000620021ae606083018462002d96565b60208152600062002890602083018462002d96565b60a08152600062002f0e60a083018862002d96565b828103602084015262002f22818862002d96565b6001600160a01b03969096166040840152505061ffff92909216606083015260809091015292915050565b60208152815160208201526000602083015161ffff80821660408501526040850151606085015260608501516080850152608085015160a085015260a085015191506101008060c086015262002fa861012086018462002d96565b925060c086015160e08601528160e0870151168186015250508091505092915050565b63ffffffff8416815260606020820152600062002fec606083018562002d96565b905060ff83166040830152949350505050565b604051608081016001600160401b03811182821017156200302457620030246200316f565b60405290565b60405161010081016001600160401b03811182821017156200302457620030246200316f565b60405161016081016001600160401b03811182821017156200302457620030246200316f565b604051601f8201601f191681016001600160401b0381118282101715620030a157620030a16200316f565b604052919050565b60006001600160401b03821115620030c557620030c56200316f565b50601f01601f191660200190565b60008219821115620030e957620030e962003159565b500190565b60008282101562003103576200310362003159565b500390565b60005b83811015620031255781810151838201526020016200310b565b8381111562003135576000848401525b50505050565b600060001982141562003152576200315262003159565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462000cbb57600080fd5b63ffffffff8116811462000cbb57600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220d2a684029c88acf93f33a810282bf99adc095daa9da1a2bf6344e706b7bbdb7d64736f6c63430008040033",yn=(function(e){function t(t){return e.call(this,bn,hn,t)||this}pn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(bn)},t.connect=function(e,t){return new a.b(e,bn,t)},t.bytecode=hn,t.abi=bn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),mn=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner_",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"address",name:"owner_",type:"address"},{internalType:"uint16",name:"chainId_",type:"uint16"},{internalType:"bytes32",name:"nativeContract_",type:"bytes32"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"nativeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"testNewImplementationActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"}],vn="0x608060405234801561001057600080fd5b506116dd806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80636352211e116100ad578063a22cb46511610071578063a22cb46514610273578063b88d4fde14610286578063c87b56dd14610299578063d3fc9864146102ac578063e985e9c5146102bf57600080fd5b80636352211e1461021357806370a08231146102265780638da5cb5b1461023957806395d89b411461024a5780639a8a05921461025257600080fd5b80631f8cdb2b116100f45780631f8cdb2b146101c157806323b872dd146101c85780633d6c043b146101db57806342842e0e146101ed57806342966c681461020057600080fd5b806301ffc9a71461013157806303e728581461015957806306fdde031461016e578063081812fc14610183578063095ea7b3146101ae575b600080fd5b61014461013f3660046113db565b6102fb565b60405190151581526020015b60405180910390f35b61016c610167366004611413565b61034d565b005b610176610418565b6040516101509190611545565b6101966101913660046114a5565b6104ac565b6040516001600160a01b039091168152602001610150565b61016c6101bc36600461135d565b610541565b6001610144565b61016c6101d636600461126f565b610657565b6008545b604051908152602001610150565b61016c6101fb36600461126f565b610688565b61016c61020e3660046114a5565b6106a3565b6101966102213660046114a5565b610703565b6101df610234366004611223565b61077a565b6007546001600160a01b0316610196565b610176610801565b600754600160a81b900461ffff1660405161ffff9091168152602001610150565b61016c610281366004611323565b610813565b61016c6102943660046112aa565b6108d8565b6101766102a73660046114a5565b610910565b61016c6102ba366004611386565b610a2d565b6101446102cd36600461123d565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b148061032c57506001600160e01b03198216635b5e139f60e01b145b8061034757506301ffc9a760e01b6001600160e01b03198316145b92915050565b600754600160a01b900460ff16156103a25760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b6007805460ff60a01b1916600160a01b17905584516103c89060009060208801906110d2565b5083516103dc9060019060208701906110d2565b506007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b0390941693909317919091179091556008555050565b60606000800180546104299061162a565b80601f01602080910402602001604051908101604052809291908181526020018280546104559061162a565b80156104a25780601f10610477576101008083540402835291602001916104a2565b820191906000526020600020905b81548152906001019060200180831161048557829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166105255760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610399565b506000908152600460205260409020546001600160a01b031690565b600061054c82610703565b9050806001600160a01b0316836001600160a01b031614156105ba5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610399565b336001600160a01b03821614806105d657506105d681336102cd565b6106485760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610399565b6106528383610a8c565b505050565b6106613382610afa565b61067d5760405162461bcd60e51b8152600401610399906115aa565b610652838383610bf1565b610652838383604051806020016040528060008152506108d8565b6007546001600160a01b031633146106f75760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610399565b61070081610d91565b50565b6000818152600260205260408120546001600160a01b0316806103475760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610399565b60006001600160a01b0382166107e55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610399565b506001600160a01b031660009081526003602052604090205490565b6060600060010180546104299061162a565b6001600160a01b03821633141561086c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610399565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6108e23383610afa565b6108fe5760405162461bcd60e51b8152600401610399906115aa565b61090a84848484610e2c565b50505050565b6000818152600260205260409020546060906001600160a01b031661098f5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610399565b600082815260056020526040902080546109a89061162a565b80601f01602080910402602001604051908101604052809291908181526020018280546109d49061162a565b8015610a215780601f106109f657610100808354040283529160200191610a21565b820191906000526020600020905b815481529060010190602001808311610a0457829003601f168201915b50505050509050919050565b6007546001600160a01b03163314610a815760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610399565b610652838383610e5f565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610ac182610703565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316610b735760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610399565b6000610b7e83610703565b9050806001600160a01b0316846001600160a01b03161480610bb95750836001600160a01b0316610bae846104ac565b6001600160a01b0316145b80610be957506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610c0482610703565b6001600160a01b031614610c6c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610399565b6001600160a01b038216610cce5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610399565b610cd9600082610a8c565b6001600160a01b0383166000908152600360205260408120805460019290610d02908490611613565b90915550506001600160a01b0382166000908152600360205260408120805460019290610d309084906115fb565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610d9c82610703565b9050610da9600083610a8c565b6001600160a01b0381166000908152600360205260408120805460019290610dd2908490611613565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610e37848484610bf1565b610e4384848484610fc5565b61090a5760405162461bcd60e51b815260040161039990611558565b6001600160a01b038316610eb55760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610399565b6000828152600260205260409020546001600160a01b031615610f1a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610399565b6001600160a01b0383166000908152600360205260408120805460019290610f439084906115fb565b9091555050600082815260026020908152604080832080546001600160a01b0319166001600160a01b038816179055600582529091208251610f87928401906110d2565b5060405182906001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b60006001600160a01b0384163b156110c757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611009903390899088908890600401611508565b602060405180830381600087803b15801561102357600080fd5b505af1925050508015611053575060408051601f3d908101601f19168201909252611050918101906113f7565b60015b6110ad573d808015611081576040519150601f19603f3d011682016040523d82523d6000602084013e611086565b606091505b5080516110a55760405162461bcd60e51b815260040161039990611558565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610be9565b506001949350505050565b8280546110de9061162a565b90600052602060002090601f0160209004810192826111005760008555611146565b82601f1061111957805160ff1916838001178555611146565b82800160010185558215611146579182015b8281111561114657825182559160200191906001019061112b565b50611152929150611156565b5090565b5b808211156111525760008155600101611157565b600067ffffffffffffffff808411156111865761118661167b565b604051601f8501601f19908116603f011681019082821181831017156111ae576111ae61167b565b816040528093508581528686860111156111c757600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146111f857600080fd5b919050565b600082601f83011261120d578081fd5b61121c8383356020850161116b565b9392505050565b600060208284031215611234578081fd5b61121c826111e1565b6000806040838503121561124f578081fd5b611258836111e1565b9150611266602084016111e1565b90509250929050565b600080600060608486031215611283578081fd5b61128c846111e1565b925061129a602085016111e1565b9150604084013590509250925092565b600080600080608085870312156112bf578081fd5b6112c8856111e1565b93506112d6602086016111e1565b925060408501359150606085013567ffffffffffffffff8111156112f8578182fd5b8501601f81018713611308578182fd5b6113178782356020840161116b565b91505092959194509250565b60008060408385031215611335578182fd5b61133e836111e1565b915060208301358015158114611352578182fd5b809150509250929050565b6000806040838503121561136f578182fd5b611378836111e1565b946020939093013593505050565b60008060006060848603121561139a578283fd5b6113a3846111e1565b925060208401359150604084013567ffffffffffffffff8111156113c5578182fd5b6113d1868287016111fd565b9150509250925092565b6000602082840312156113ec578081fd5b813561121c81611691565b600060208284031215611408578081fd5b815161121c81611691565b600080600080600060a0868803121561142a578081fd5b853567ffffffffffffffff80821115611441578283fd5b61144d89838a016111fd565b96506020880135915080821115611462578283fd5b5061146f888289016111fd565b94505061147e604087016111e1565b9250606086013561ffff81168114611494578182fd5b949793965091946080013592915050565b6000602082840312156114b6578081fd5b5035919050565b60008151808452815b818110156114e2576020818501810151868301820152016114c6565b818111156114f35782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061153b908301846114bd565b9695505050505050565b60208152600061121c60208301846114bd565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000821982111561160e5761160e611665565b500190565b60008282101561162557611625611665565b500390565b600181811c9082168061163e57607f821691505b6020821081141561165f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461070057600080fdfea264697066735822122053e675a795521297531732450a74100ca5d6a904df7cba45e128e39d6f4f416c64736f6c63430008040033",gn=(function(e){function t(t){return e.call(this,mn,vn,t)||this}yn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(mn)},t.connect=function(e,t){return new a.b(e,mn,t)},t.bytecode=vn,t.abi=mn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),wn=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"attestPrice",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"pa",type:"tuple"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"product",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"}],name:"latestAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"attestation",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct PythStructs.UpgradeContract",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedPriceAttestation",type:"bytes"}],name:"parsePriceAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"pa",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[],name:"pyth2WormholeChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"pyth2WormholeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyPythVM",outputs:[{internalType:"bool",name:"valid",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"testNewImplementationActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"}],Tn="0x608060405234801561001057600080fd5b50611e1b806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80638129fc1c11610097578063b172b22211610066578063b172b22214610251578063d60b347f14610259578063f0a0de0c14610285578063fbe3c2cd1461029857600080fd5b80638129fc1c1461020f57806384acd1bb14610217578063970994ab146102325780639a8a05921461024557600080fd5b80632d3b5b2b116100d35780632d3b5b2b1461016c5780633cb0031e1461018c57806343aac090146101a75780634fdc60fa146101b957600080fd5b806318e3ab1c146101055780631f8cdb2b1461012d57806325394645146101345780632c3c02a414610149575b600080fd5b610118610113366004611847565b6102aa565b60405190151581526020015b60405180910390f35b6001610118565b610147610142366004611815565b6102f0565b005b6101186101573660046117ce565b60009081526005602052604090205460ff1690565b61017f61017a366004611815565b61040d565b6040516101249190611b12565b60035461ffff165b60405161ffff9091168152602001610124565b6004545b604051908152602001610124565b6101cc6101c7366004611815565b610762565b60405161012491908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6101476108b0565b6000546040516001600160a01b039091168152602001610124565b61017f6102403660046117e6565b610975565b60015461ffff16610194565b6002546101ab565b6101186102673660046117a0565b6001600160a01b031660009081526006602052604090205460ff1690565b61017f610293366004611815565b610ada565b60015462010000900461ffff16610194565b60006102b960035461ffff1690565b61ffff16826060015161ffff16146102d357506000919050565b6004548260800151146102e857506000919050565b506001919050565b60008060006102fe84610e9d565b92509250925081819061032d5760405162461bcd60e51b81526004016103249190611aff565b60405180910390fd5b506103528361014001516000908152600560205260409020805460ff19166001179055565b60006103618460e00151610762565b80519091506350797468146103a75760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b6044820152606401610324565b60015461ffff1661ffff16816040015161ffff16146103f95760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401610324565b61040681606001516110bc565b5050505050565b61041561149f565b600080600061042c6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016104579190611aff565b60006040518083038186803b15801561046f57600080fd5b505afa158015610483573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104ab9190810190611966565b9250925092508181906104d15760405162461bcd60e51b81526004016103249190611aff565b506104db836102aa565b6105195760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b6044820152606401610324565b60006105288460e00151610ada565b9050600061053e82606001518360a00151610975565b9050806101a001516001600160401b0316826101a001516001600160401b031611156107585760608201805160a084018051600092835260076020818152604080862060ff948516875282529485902088518154838b0151888c0151871666010000000000000266ff0000000000001961ffff9092166401000000000265ffffffffffff1990931663ffffffff948516179290921716178255965160018201556080890151600282015593516003808601805460c08c015160e08d015190930b909916600160481b9081026cffffffff0000000000000000001993870b6001600160401b0390811661010090810268ffffffffffffffffff199d8e16978b1697909717969096179490941617909155918a0151805160048801805483870151938b0151880b8516600160801b90810267ffffffffffffffff60801b19958a0b8716600160401b9081026fffffffffffffffffffffffffffffffff19948516968c0b891696909617959095178616179092556101208e0151805160058c0180549983015192909d01518a0b871690930290890b86168402979091169190970b841617949094171693909317909555610140880151600690940180546101608a01516101808b01516101a08c01518616600160501b0267ffffffffffffffff60501b199188169099021671ffffffffffffffffff0000000000000000001991909616909302971694909216939093179490941791909116171790555b5095945050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061079083826111e9565b825261079d602082611d13565b90506107a98382611247565b60ff1660208301526107bc600182611d13565b9050816020015160ff166001146108155760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e7472616374557067726164652031000000000000006044820152606401610324565b61081f83826112a3565b61ffff166040830152610833600282611d13565b905061083f83826111e9565b6001600160a01b03166060830152610858602082611d13565b9050808351146108aa5760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e7472616374557067726164652032000000000000006044820152606401610324565b50919050565b60006108e37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050610907816001600160a01b031660009081526006602052604090205460ff1690565b1561094a5760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610324565b610972816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b61097d61149f565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152600160481b91829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252600160401b8082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b96810196909652610120810195909552600601546001600160401b038082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b610ae261149f565b6000610aee8382611300565b63ffffffff168252610b01600482611d13565b9050816000015163ffffffff16635032574814610b535760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b6044820152606401610324565b610b5d83826112a3565b61ffff166020830152610b71600282611d13565b9050816020015161ffff16600114610bbe5760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b6044820152606401610324565b610bc88382611247565b60ff166040830152610bdb600182611d13565b9050816040015160ff16600114610c2f5760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b6044820152606401610324565b610c3983826111e9565b6060830152610c49602082611d13565b9050610c5583826111e9565b6080830152610c65602082611d13565b9050610c718382611247565b60ff1660a0830152610c84600182611d13565b9050610c90838261135d565b600790810b900b60c0830152610ca7600882611d13565b9050610cb38382611300565b600390810b900b60e0830152610cca600482611d13565b9050610cd6838261135d565b610100830151600791820b90910b9052610cf1600882611d13565b9050610cfd838261135d565b610100830151600791820b90910b602090910152610d1c600882611d13565b9050610d28838261135d565b610100830151600791820b90910b604090910152610d47600882611d13565b9050610d53838261135d565b610120830151600791820b90910b9052610d6e600882611d13565b9050610d7a838261135d565b610120830151600791820b90910b602090910152610d99600882611d13565b9050610da5838261135d565b610120830151600791820b90910b604090910152610dc4600882611d13565b9050610dd0838261135d565b6001600160401b0316610140830152610dea600882611d13565b9050610df68382611247565b60ff16610160830152610e0a600182611d13565b9050610e168382611247565b60ff16610180830152610e2a600182611d13565b9050610e36838261135d565b6001600160401b03166101a0830152610e50600882611d13565b9050808351146108aa5760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b6044820152606401610324565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610f106000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610f3b9190611aff565b60006040518083038186803b158015610f5357600080fd5b505afa158015610f67573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f8f9190810190611966565b92509250925081610fa657919450925090506110b5565b60015462010000900461ffff1661ffff16836060015161ffff16146110025750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b60208201529093506000925090506110b5565b60025483608001511461105357505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e74726163740000000000000060208201529093506000925090506110b5565b61014083015160009081526005602052604090205460ff161561109a57826000604051806060016040528060228152602001611dc4602291399550955095505050506110b5565b50506040805160208101909152600081529093506001925090505b9193909250565b60006110ef7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506110fa826113ba565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169161113d91611ae3565b600060405180830381855af49150503d8060008114611178576040519150601f19603f3d011682016040523d82523d6000602084013e61117d565b606091505b50915091508181906111a25760405162461bcd60e51b81526004016103249190611aff565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b60006111f6826020611d13565b8351101561123e5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401610324565b50016020015190565b6000611254826001611d13565b8351101561129a5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401610324565b50016001015190565b60006112b0826002611d13565b835110156112f75760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610324565b50016002015190565b600061130d826004611d13565b835110156113545760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b6044820152606401610324565b50016004015190565b600061136a826008611d13565b835110156113b15760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b6044820152606401610324565b50016008015190565b6113c3816113fa565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b61145e5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610324565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b600082601f83011261154e578081fd5b8135602061156361155e83611cc9565b611c99565b80838252828201915082860187848660071b8901011115611582578586fd5b855b858110156115e957608080838b03121561159c578788fd5b6115a4611c4e565b8335815286840135878201526040808501356115bf81611db4565b908201526060848101356115d281611db4565b908201528552938501939190910190600101611584565b5090979650505050505050565b600082601f830112611606578081fd5b8151602061161661155e83611cc9565b80838252828201915082860187848660071b8901011115611635578586fd5b855b858110156115e957608080838b03121561164f578788fd5b611657611c4e565b83518152868401518782015260408085015161167281611db4565b9082015260608481015161168581611db4565b908201528552938501939190910190600101611637565b805180151581146116ac57600080fd5b919050565b600082601f8301126116c1578081fd5b81356116cf61155e82611cec565b8181528460208386010111156116e3578283fd5b816020850160208301379081016020019190915292915050565b600082601f83011261170d578081fd5b815161171b61155e82611cec565b81815284602083860101111561172f578283fd5b611740826020830160208701611d37565b949350505050565b80356116ac81611d7d565b80516116ac81611d7d565b80356116ac81611d8d565b80516116ac81611d8d565b80356116ac81611d9f565b80516116ac81611d9f565b80356116ac81611db4565b80516116ac81611db4565b6000602082840312156117b1578081fd5b81356001600160a01b03811681146117c7578182fd5b9392505050565b6000602082840312156117df578081fd5b5035919050565b600080604083850312156117f8578081fd5b82359150602083013561180a81611db4565b809150509250929050565b600060208284031215611826578081fd5b81356001600160401b0381111561183b578182fd5b611740848285016116b1565b600060208284031215611858578081fd5b81356001600160401b038082111561186e578283fd5b908301906101608286031215611882578283fd5b61188a611c76565b6118938361178a565b81526118a16020840161175e565b60208201526118b26040840161175e565b60408201526118c360608401611748565b6060820152608083013560808201526118de60a08401611774565b60a08201526118ef60c0840161178a565b60c082015260e083013582811115611905578485fd5b611911878286016116b1565b60e08301525061010061192581850161175e565b90820152610120838101358381111561193c578586fd5b6119488882870161153e565b91830191909152506101409283013592810192909252509392505050565b60008060006060848603121561197a578081fd5b83516001600160401b0380821115611990578283fd5b9085019061016082880312156119a4578283fd5b6119ac611c76565b6119b583611795565b81526119c360208401611769565b60208201526119d460408401611769565b60408201526119e560608401611753565b606082015260808301516080820152611a0060a0840161177f565b60a0820152611a1160c08401611795565b60c082015260e083015182811115611a27578485fd5b611a33898286016116fd565b60e083015250610100611a47818501611769565b908201526101208381015183811115611a5e578586fd5b611a6a8a8287016115f6565b918301919091525061014083810151908201529450611a8b6020870161169c565b93506040860151915080821115611aa0578283fd5b50611aad868287016116fd565b9150509250925092565b60008151808452611acf816020860160208601611d37565b601f01601f19169290920160200192915050565b60008251611af5818460208701611d37565b9190910192915050565b6020815260006117c76020830184611ab7565b815163ffffffff16815261024081016020830151611b36602084018261ffff169052565b506040830151611b4b604084018260ff169052565b50606083015160608301526080830151608083015260a0830151611b7460a084018260ff169052565b5060c0830151611b8960c084018260070b9052565b5060e0830151611b9e60e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b6101408501525050610120830151610160611c0281850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b6101408501516001600160401b039081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b604051608081016001600160401b0381118282101715611c7057611c70611d67565b60405290565b60405161016081016001600160401b0381118282101715611c7057611c70611d67565b604051601f8201601f191681016001600160401b0381118282101715611cc157611cc1611d67565b604052919050565b60006001600160401b03821115611ce257611ce2611d67565b5060051b60200190565b60006001600160401b03821115611d0557611d05611d67565b50601f01601f191660200190565b60008219821115611d3257634e487b7160e01b81526011600452602481fd5b500190565b60005b83811015611d52578181015183820152602001611d3a565b83811115611d61576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff8116811461097257600080fd5b63ffffffff8116811461097257600080fd5b6001600160401b038116811461097257600080fd5b60ff8116811461097257600080fdfe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a26469706673582212200117c9e690e88f20773bd2f5e60ac882a461f050459fde4859e0a534a819fc6e64736f6c63430008040033",kn=(function(e){function t(t){return e.call(this,wn,Tn,t)||this}gn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(wn)},t.connect=function(e,t){return new a.b(e,wn,t)},t.bytecode=Tn,t.abi=wn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),_n=[{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransferAndSwap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_tokenBridge",type:"address"}],name:"setup",outputs:[],stateMutability:"nonpayable",type:"function"}],On="0x608060405234801561001057600080fd5b50610ce9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806301c3ac6b1461003b57806366d3820314610050575b600080fd5b61004e610049366004610963565b610080565b005b61004e61005e36600461090b565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600061009a608483516100939190610c28565b8390610440565b905060006100b6606484516100af9190610c28565b849061049e565b905060006100cc6000546001600160a01b031690565b604051630ff8f14360e11b815261ffff84166004820152602481018590526001600160a01b039190911690631ff1e2869060440160206040518083038186803b15801561011857600080fd5b505afa15801561012c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101509190610927565b6040516370a0823160e01b815230600482015290915081906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561019757600080fd5b505afa1580156101ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cf9190610af7565b905060006101e56000546001600160a01b031690565b6001600160a01b031663c3f511c1886040518263ffffffff1660e01b81526004016102109190610b57565b600060405180830381600087803b15801561022a57600080fd5b505af115801561023e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261026691908101906109d7565b9050600061028260218360e0015161044090919063ffffffff16565b90508087146102f15760405162461bcd60e51b815260206004820152603060248201527f41646472657373207061727365642066726f6d2056414120616e64207061796c60448201526f0dec2c840c8de40dcdee840dac2e8c6d60831b60648201526084015b60405180910390fd5b60e082015160009061030490604161049e565b90508061ffff168761ffff16146103765760405162461bcd60e51b815260206004820152603060248201527f436861696e4964207061727365642066726f6d2056414120616e64207061796c60448201526f0dec2c840c8de40dcdee840dac2e8c6d60831b60648201526084016102e8565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b1580156103b857600080fd5b505afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f09190610af7565b905060006103fe8683610c28565b9050600061041a60858760e0015161044090919063ffffffff16565b9050806104316001600160a01b038a1682856104fb565b50505050505050505050505050565b600061044d826020610c10565b835110156104955760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016102e8565b50016020015190565b60006104ab826002610c10565b835110156104f25760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016102e8565b50016002015190565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261054d908490610552565b505050565b60006105a7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166106249092919063ffffffff16565b80519091501561054d57808060200190518101906105c59190610943565b61054d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102e8565b6060610633848460008561063d565b90505b9392505050565b60608247101561069e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102e8565b843b6106ec5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102e8565b600080866001600160a01b031685876040516107089190610b3b565b60006040518083038185875af1925050503d8060008114610745576040519150601f19603f3d011682016040523d82523d6000602084013e61074a565b606091505b509150915061075a828286610765565b979650505050505050565b60608315610774575081610636565b8251156107845782518084602001fd5b8160405162461bcd60e51b81526004016102e89190610b57565b600082601f8301126107ae578081fd5b8151602067ffffffffffffffff8211156107ca576107ca610c85565b6107d8818360051b01610bb7565b80838252828201915082860187848660071b89010111156107f7578586fd5b855b8581101561085a57608080838b031215610811578788fd5b610819610b6a565b83518152868401518782015260406108328186016108fa565b9082015260606108438582016108fa565b9082015285529385019391909101906001016107f9565b5090979650505050505050565b600082601f830112610877578081fd5b815161088a61088582610be8565b610bb7565b81815284602083860101111561089e578283fd5b6108af826020830160208701610c3f565b949350505050565b805161ffff811681146108c957600080fd5b919050565b805163ffffffff811681146108c957600080fd5b805167ffffffffffffffff811681146108c957600080fd5b805160ff811681146108c957600080fd5b60006020828403121561091c578081fd5b813561063681610c9b565b600060208284031215610938578081fd5b815161063681610c9b565b600060208284031215610954578081fd5b81518015158114610636578182fd5b600060208284031215610974578081fd5b813567ffffffffffffffff81111561098a578182fd5b8201601f8101841361099a578182fd5b80356109a861088582610be8565b8181528560208385010111156109bc578384fd5b81602084016020830137908101602001929092525092915050565b6000602082840312156109e8578081fd5b815167ffffffffffffffff808211156109ff578283fd5b908301906101608286031215610a13578283fd5b610a1b610b93565b610a24836108fa565b8152610a32602084016108ce565b6020820152610a43604084016108ce565b6040820152610a54606084016108b7565b606082015260808301516080820152610a6f60a084016108e2565b60a0820152610a8060c084016108fa565b60c082015260e083015182811115610a96578485fd5b610aa287828601610867565b60e083015250610100610ab68185016108ce565b908201526101208381015183811115610acd578586fd5b610ad98882870161079e565b91830191909152506101409283015192810192909252509392505050565b600060208284031215610b08578081fd5b5051919050565b60008151808452610b27816020860160208601610c3f565b601f01601f19169290920160200192915050565b60008251610b4d818460208701610c3f565b9190910192915050565b6020815260006106366020830184610b0f565b6040516080810167ffffffffffffffff81118282101715610b8d57610b8d610c85565b60405290565b604051610160810167ffffffffffffffff81118282101715610b8d57610b8d610c85565b604051601f8201601f1916810167ffffffffffffffff81118282101715610be057610be0610c85565b604052919050565b600067ffffffffffffffff821115610c0257610c02610c85565b50601f01601f191660200190565b60008219821115610c2357610c23610c6f565b500190565b600082821015610c3a57610c3a610c6f565b500390565b60005b83811015610c5a578181015183820152602001610c42565b83811115610c69576000848401525b50505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610cb057600080fd5b5056fea26469706673582212204b0dc1525c10e0aefe5eb46fb61065973685ddf07d5a7e84070f45b23261bb3964736f6c63430008040033",Sn=(function(e){function t(t){return e.call(this,_n,On,t)||this}kn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(_n)},t.connect=function(e,t){return new a.b(e,_n,t)},t.bytecode=On,t.abi=_n}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),xn=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"address",name:"spender_",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"subtractedValue_",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"addedValue_",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"},{internalType:"uint64",name:"sequence_",type:"uint64"},{internalType:"address",name:"owner_",type:"address"},{internalType:"uint16",name:"chainId_",type:"uint16"},{internalType:"bytes32",name:"nativeContract_",type:"bytes32"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"nativeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender_",type:"address"},{internalType:"address",name:"recipient_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint64",name:"sequence_",type:"uint64"}],name:"updateDetails",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"testNewImplementationActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"}],An="0x608060405234801561001057600080fd5b506111fb806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063a18cd7c611610071578063a18cd7c614610258578063a457c2d71461026b578063a9059cbb1461027e578063c71f461514610291578063dd62ed3e146102a457600080fd5b806370a08231146101d85780638da5cb5b1461020157806395d89b411461021c5780639a8a0592146102245780639dc29fac1461024557600080fd5b806323b872dd116100f457806323b872dd14610180578063313ce5671461019357806339509351146101a85780633d6c043b146101bb57806340c10f19146101c357600080fd5b806306fdde0314610126578063095ea7b31461014457806318160ddd146101675780631f8cdb2b14610179575b600080fd5b61012e6102dd565b60405161013b91906110a5565b60405180910390f35b610157610152366004610e97565b610306565b604051901515815260200161013b565b6003545b60405190815260200161013b565b6001610157565b61015761018e366004610e5c565b61031c565b60045460405160ff909116815260200161013b565b6101576101b6366004610e97565b6103d2565b60085461016b565b6101d66101d1366004610e97565b610409565b005b61016b6101e6366004610e09565b6001600160a01b031660009081526005602052604090205490565b6007546040516001600160a01b03909116815260200161013b565b61012e610441565b600754600160a81b900461ffff1660405161ffff909116815260200161013b565b6101d6610253366004610e97565b6104d6565b6101d6610266366004610ec0565b61050a565b610157610279366004610e97565b6105e0565b61015761028c366004610e97565b61067b565b6101d661029f366004610f31565b610688565b61016b6102b2366004610e2a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6040516060906102f290600090602001610fef565b604051602081830303815290604052905090565b6000610313338484610787565b50600192915050565b60006103298484846108ac565b6001600160a01b0384166000908152600660209081526040808320338452909152902054828110156103b35760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103c785336103c28685611147565b610787565b506001949350505050565b3360008181526006602090815260408083206001600160a01b038716845290915281205490916103139185906103c290869061112f565b6007546001600160a01b031633146104335760405162461bcd60e51b81526004016103aa906110f8565b61043d8282610a84565b5050565b6060600060010180546104539061115e565b80601f016020809104026020016040519081016040528092919081815260200182805461047f9061115e565b80156104cc5780601f106104a1576101008083540402835291602001916104cc565b820191906000526020600020905b8154815290600101906020018083116104af57829003601f168201915b5050505050905090565b6007546001600160a01b031633146105005760405162461bcd60e51b81526004016103aa906110f8565b61043d8282610b66565b6007546001600160a01b031633146105345760405162461bcd60e51b81526004016103aa906110f8565b60025467ffffffffffffffff8083169116106105925760405162461bcd60e51b815260206004820152601e60248201527f63757272656e74206d6574616461746120697320757020746f2064617465000060448201526064016103aa565b82516105a5906000906020860190610cb5565b5081516105b9906001906020850190610cb5565b506002805467ffffffffffffffff191667ffffffffffffffff929092169190911790555050565b3360009081526006602090815260408083206001600160a01b0386168452909152812054828110156106625760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103aa565b61067133856103c28685611147565b5060019392505050565b60006103133384846108ac565b600754600160a01b900460ff16156106d85760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064016103aa565b6007805460ff60a01b1916600160a01b17905586516106fe9060009060208a0190610cb5565b508551610712906001906020890190610cb5565b506004805460ff90961660ff19909616959095179094556002805467ffffffffffffffff90941667ffffffffffffffff19909416939093179092556007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b03909216919091179190911790556008555050565b6001600160a01b0383166107e95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103aa565b6001600160a01b03821661084a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103aa565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166109105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103aa565b6001600160a01b0382166109725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103aa565b6001600160a01b038316600090815260056020526040902054818110156109ea5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103aa565b6109f48282611147565b6001600160a01b038086166000908152600560205260408082209390935590851681529081208054849290610a2a90849061112f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a7691815260200190565b60405180910390a350505050565b6001600160a01b038216610ada5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103aa565b8060006003016000828254610aef919061112f565b90915550506001600160a01b03821660009081526005602052604081208054839290610b1c90849061112f565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610bc65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103aa565b6001600160a01b03821660009081526005602052604090205481811015610c3a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103aa565b610c448282611147565b6001600160a01b03841660009081526005602052604081209190915560038054849290610c72908490611147565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161089f565b828054610cc19061115e565b90600052602060002090601f016020900481019282610ce35760008555610d29565b82601f10610cfc57805160ff1916838001178555610d29565b82800160010185558215610d29579182015b82811115610d29578251825591602001919060010190610d0e565b50610d35929150610d39565b5090565b5b80821115610d355760008155600101610d3a565b80356001600160a01b0381168114610d6557600080fd5b919050565b600082601f830112610d7a578081fd5b813567ffffffffffffffff80821115610d9557610d956111af565b604051601f8301601f19908116603f01168101908282118183101715610dbd57610dbd6111af565b81604052838152866020858801011115610dd5578485fd5b8360208701602083013792830160200193909352509392505050565b803567ffffffffffffffff81168114610d6557600080fd5b600060208284031215610e1a578081fd5b610e2382610d4e565b9392505050565b60008060408385031215610e3c578081fd5b610e4583610d4e565b9150610e5360208401610d4e565b90509250929050565b600080600060608486031215610e70578081fd5b610e7984610d4e565b9250610e8760208501610d4e565b9150604084013590509250925092565b60008060408385031215610ea9578182fd5b610eb283610d4e565b946020939093013593505050565b600080600060608486031215610ed4578283fd5b833567ffffffffffffffff80821115610eeb578485fd5b610ef787838801610d6a565b94506020860135915080821115610f0c578384fd5b50610f1986828701610d6a565b925050610f2860408501610df1565b90509250925092565b600080600080600080600060e0888a031215610f4b578283fd5b873567ffffffffffffffff80821115610f62578485fd5b610f6e8b838c01610d6a565b985060208a0135915080821115610f83578485fd5b50610f908a828b01610d6a565b965050604088013560ff81168114610fa6578384fd5b9450610fb460608901610df1565b9350610fc260808901610d4e565b925060a088013561ffff81168114610fd8578283fd5b8092505060c0880135905092959891949750929550565b600080835482600182811c91508083168061100b57607f831692505b602080841082141561102b57634e487b7160e01b87526022600452602487fd5b81801561103f57600181146110505761107c565b60ff1986168952848901965061107c565b60008a815260209020885b868110156110745781548b82015290850190830161105b565b505084890196505b50505050505061109d816a2028576f726d686f6c652960a81b8152600b0190565b949350505050565b6000602080835283518082850152825b818110156110d1578581018301518582016040015282016110b5565b818111156110e25783604083870101525b50601f01601f1916929092016040019392505050565b60208082526017908201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604082015260600190565b6000821982111561114257611142611199565b500190565b60008282101561115957611159611199565b500390565b600181811c9082168061117257607f821691505b6020821081141561119357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220245c5f21ec2c446dcf8c00bc9781df538e807284c03eacdb4bca734cee373c2964736f6c63430008040033",Mn=(function(e){function t(t){return e.call(this,xn,An,t)||this}Sn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(xn)},t.connect=function(e,t){return new a.b(e,xn,t)},t.bytecode=An,t.abi=xn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),En=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"src",type:"address"},{indexed:!0,internalType:"address",name:"guy",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"dst",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"src",type:"address"},{indexed:!0,internalType:"address",name:"dst",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"src",type:"address"},{indexed:!1,internalType:"uint256",name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"},{inputs:[],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"wad",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"guy",type:"address"},{internalType:"uint256",name:"wad",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"dst",type:"address"},{internalType:"uint256",name:"wad",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"src",type:"address"},{internalType:"address",name:"dst",type:"address"},{internalType:"uint256",name:"wad",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],Pn="0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b5061014e565b82805461008690610113565b90600052602060002090601f0160209004810192826100a857600085556100ee565b82601f106100c157805160ff19168380011785556100ee565b828001600101855582156100ee579182015b828111156100ee5782518255916020019190600101906100d3565b506100fa9291506100fe565b5090565b5b808211156100fa57600081556001016100ff565b600181811c9082168061012757607f821691505b6020821081141561014857634e487b7160e01b600052602260045260246000fd5b50919050565b6107c28061015d6000396000f3fe6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461016f57806370a082311461019b57806395d89b41146101c8578063a9059cbb146101dd578063d0e30db0146100af578063dd62ed3e146101fd576100af565b806306fdde03146100b7578063095ea7b3146100e257806318160ddd1461011257806323b872dd1461012f5780632e1a7d4d1461014f576100af565b366100af576100ad610235565b005b6100ad610235565b3480156100c357600080fd5b506100cc610290565b6040516100d991906106b9565b60405180910390f35b3480156100ee57600080fd5b506101026100fd366004610678565b61031e565b60405190151581526020016100d9565b34801561011e57600080fd5b50475b6040519081526020016100d9565b34801561013b57600080fd5b5061010261014a36600461063d565b61038a565b34801561015b57600080fd5b506100ad61016a3660046106a1565b61050e565b34801561017b57600080fd5b506002546101899060ff1681565b60405160ff90911681526020016100d9565b3480156101a757600080fd5b506101216101b63660046105f1565b60036020526000908152604090205481565b3480156101d457600080fd5b506100cc6105b4565b3480156101e957600080fd5b506101026101f8366004610678565b6105c1565b34801561020957600080fd5b5061012161021836600461060b565b600460209081526000928352604080842090915290825290205481565b336000908152600360205260408120805434929061025490849061070c565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b6000805461029d9061073b565b80601f01602080910402602001604051908101604052809291908181526020018280546102c99061073b565b80156103165780601f106102eb57610100808354040283529160200191610316565b820191906000526020600020905b8154815290600101906020018083116102f957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103799086815260200190565b60405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156103af57600080fd5b6001600160a01b03841633148015906103ed57506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b1561045b576001600160a01b038416600090815260046020908152604080832033845290915290205482111561042257600080fd5b6001600160a01b038416600090815260046020908152604080832033845290915281208054849290610455908490610724565b90915550505b6001600160a01b03841660009081526003602052604081208054849290610483908490610724565b90915550506001600160a01b038316600090815260036020526040812080548492906104b090849061070c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104fc91815260200190565b60405180910390a35060019392505050565b3360009081526003602052604090205481111561052a57600080fd5b3360009081526003602052604081208054839290610549908490610724565b9091555050604051339082156108fc029083906000818181858888f1935050505015801561057b573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b6001805461029d9061073b565b60006105ce33848461038a565b9392505050565b80356001600160a01b03811681146105ec57600080fd5b919050565b600060208284031215610602578081fd5b6105ce826105d5565b6000806040838503121561061d578081fd5b610626836105d5565b9150610634602084016105d5565b90509250929050565b600080600060608486031215610651578081fd5b61065a846105d5565b9250610668602085016105d5565b9150604084013590509250925092565b6000806040838503121561068a578182fd5b610693836105d5565b946020939093013593505050565b6000602082840312156106b2578081fd5b5035919050565b6000602080835283518082850152825b818110156106e5578581018301518582016040015282016106c9565b818111156106f65783604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561071f5761071f610776565b500190565b60008282101561073657610736610776565b500390565b600181811c9082168061074f57607f821691505b6020821081141561077057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220cdda305249dfc988c440acc7f04cbd9b2fbb38999d839781f9b949fcd59468de64736f6c63430008040033",jn=(function(e){function t(t){return e.call(this,En,Pn,t)||this}Mn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(En)},t.connect=function(e,t){return new a.b(e,En,t)},t.bytecode=Pn,t.abi=En}(a.c),[{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"}]),In=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(jn)},e.connect=function(e,t){return new a.b(e,jn,t)},e.abi=jn}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Cn=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct NFTBridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct NFTBridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"splCache",outputs:[{components:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes32",name:"symbol",type:"bytes32"}],internalType:"struct NFTBridgeStorage.SPLCache",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"transferNFT",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"string",name:"uri",type:"string"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"}],internalType:"struct NFTBridgeStructs.Transfer",name:"transfer",type:"tuple"}],name:"encodeTransfer",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseTransfer",outputs:[{components:[{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"string",name:"uri",type:"string"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"}],internalType:"struct NFTBridgeStructs.Transfer",name:"transfer",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"}],Rn="0x608060405234801561001057600080fd5b50613a49806100206000396000f3fe608060405260043610620001435760003560e01c80639a8a059211620000b9578063c68785191162000078578063c687851914620004b7578063c96616e114620004dc578063d60b347f146200050c578063e6a853e01462000549578063fbe3c2cd146200057d578063fbeeacd9146200059e57600080fd5b80639a8a059214620003d9578063a5799f931462000403578063aa4efa5b1462000428578063ad66a5f1146200045c578063b172b22214620004a057600080fd5b80632b51137511620001065780632b51137514620002b85780632c3c02a414620002ec5780632f3a3d5d14620003205780633ca64826146200034057806384acd1bb14620003b957600080fd5b806301f532551462000148578063150b7a0214620001c65780631a2be4da14620002055780631ff1e2861462000253578063253946451462000291575b600080fd5b3480156200015557600080fd5b506200016d620001673660046200290a565b620005fe565b604051620001bd9190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620001d357600080fd5b50620001eb620001e5366004620027ba565b62000806565b6040516001600160e01b03199091168152602001620001bd565b3480156200021257600080fd5b5062000242620002243660046200279d565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001620001bd565b3480156200026057600080fd5b50620002786200027236600462002c00565b6200088a565b6040516001600160a01b039091168152602001620001bd565b3480156200029e57600080fd5b50620002b6620002b03660046200290a565b620008b6565b005b348015620002c557600080fd5b50620002dd620002d73660046200290a565b6200099a565b604051620001bd919062002e02565b348015620002f957600080fd5b50620002426200030b366004620028d8565b60009081526004602052604090205460ff1690565b3480156200032d57600080fd5b506001546001600160a01b031662000278565b3480156200034d57600080fd5b506200039d6200035f366004620028d8565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201620001bd565b348015620003c657600080fd5b506000546001600160a01b031662000278565b348015620003e657600080fd5b5060025461ffff165b60405161ffff9091168152602001620001bd565b3480156200041057600080fd5b50620002b6620004223660046200290a565b62000b70565b3480156200043557600080fd5b506200024262000447366004620028d8565b60009081526005602052604090205460ff1690565b3480156200046957600080fd5b50620004916200047b36600462002bc2565b61ffff1660009081526009602052604090205490565b604051908152602001620001bd565b348015620004ad57600080fd5b5060035462000491565b348015620004c457600080fd5b50620002b6620004d63660046200290a565b62000c76565b620004f3620004ed36600462002858565b62000c84565b6040516001600160401b039091168152602001620001bd565b3480156200051957600080fd5b50620002426200052b3660046200279d565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156200055657600080fd5b506200056e620005683660046200298a565b62001343565b604051620001bd919062002d99565b3480156200058a57600080fd5b5060025462010000900461ffff16620003ef565b348015620005ab57600080fd5b50620005c3620005bd3660046200290a565b620013ff565b604051620001bd91908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290620006358382620015d8565b82526200064460208262002f88565b8251909150684e465442726964676514620006b25760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b620006be83826200163a565b60ff166020830152620006d360018262002f88565b9050816020015160ff166001146200073a5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b6064820152608401620006a9565b6200074683826200169a565b61ffff1660408301526200075c60028262002f88565b90506200076a83826200169a565b61ffff1660608301526200078060028262002f88565b90506200078e8382620015d8565b6080830152620007a060208262002f88565b905080835114620008005760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b6064820152608401620006a9565b50919050565b60006001600160a01b0386163014620008785760405162461bcd60e51b815260206004820152602d60248201527f63616e206f6e6c792062726964676520746f6b656e7320766961207472616e7360448201526c19995c939195081b595d1a1bd9609a1b6064820152608401620006a9565b50630a85bd0160e11b95945050505050565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6000806000620008c684620016fb565b925092509250818190620008ef5760405162461bcd60e51b8152600401620006a9919062002d99565b50620009158361014001516000908152600460205260409020805460ff19166001179055565b6000620009268460e00151620013ff565b90506200093660025461ffff1690565b61ffff16816040015161ffff1614620009835760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401620006a9565b606081015162000993906200192a565b5050505050565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082015260c0810182905260e081018290529080620009e784826200163a565b9050620009f660018362002f88565b91508060ff1660011462000a405760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620006a9565b62000a4c8483620015d8565b835262000a5b60208362002f88565b915062000a6984836200169a565b61ffff16602084015262000a7f60028362002f88565b915062000a8d8483620015d8565b604084015262000a9f60208362002f88565b915062000aad8483620015d8565b606084015262000abf60208362002f88565b915062000acd848362001a61565b608084015262000adf60208362002f88565b915062000aee60018362002f88565b915062000b1b82602284875162000b06919062002fa3565b62000b12919062002fa3565b86919062001aba565b60a08401528351915062000b3160028362002fa3565b915062000b3f84836200169a565b61ffff1660e084015262000b5560208362002fa3565b915062000b638483620015d8565b60c0840152509092915050565b600080600062000b8084620016fb565b92509250925081819062000ba95760405162461bcd60e51b8152600401620006a9919062002d99565b5062000bcf8361014001516000908152600460205260409020805460ff19166001179055565b600062000be08460e00151620005fe565b905062000bf060025461ffff1690565b61ffff16816040015161ffff16148062000c105750604081015161ffff16155b62000c515760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b6044820152606401620006a9565b620009938160600151826080015161ffff909116600090815260096020526040902055565b62000c818162001bd3565b50565b600080600062000cac886001600160a01b031660009081526008602052604090205460ff1690565b1562000da657876001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000cec57600080fd5b505afa15801562000d01573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d27919062002be1565b9150876001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000d6357600080fd5b505afa15801562000d78573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d9e9190620028f1565b905062000f70565b60025461ffff166040516301ffc9a760e01b81526380ac58cd60e01b60048201529092506001600160a01b038916915081906301ffc9a79060240160206040518083038186803b15801562000dfa57600080fd5b505afa15801562000e0f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e359190620028bb565b62000e8d5760405162461bcd60e51b815260206004820152602160248201527f6d75737420737570706f7274207468652045524337323120696e7465726661636044820152606560f81b6064820152608401620006a9565b6040516301ffc9a760e01b8152635b5e139f60e01b60048201526001600160a01b038916906301ffc9a79060240160206040518083038186803b15801562000ed457600080fd5b505afa15801562000ee9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f0f9190620028bb565b62000f705760405162461bcd60e51b815260206004820152602a60248201527f6d75737420737570706f727420746865204552433732312d4d657461646174616044820152691032bc3a32b739b4b7b760b11b6064820152608401620006a9565b60608060608461ffff16600114620010ca5760408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b17905290516000916001600160a01b038e169162000fc6919062002c79565b600060405180830381855afa9150503d806000811462001003576040519150601f19603f3d011682016040523d82523d6000602084013e62001008565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b038f169162001051919062002c79565b600060405180830381855afa9150503d80600081146200108e576040519150601f19603f3d011682016040523d82523d6000602084013e62001093565b606091505b5091505081806020019051810190620010ad919062002954565b945080806020019051810190620010c5919062002954565b935050505b60008b6001600160a01b03168b604051602401620010ea91815260200190565b60408051601f198184030181529181526020820180516001600160e01b031663c87b56dd60e01b1790525162001121919062002c79565b600060405180830381855afa9150503d80600081146200115e576040519150601f19603f3d011682016040523d82523d6000602084013e62001163565b606091505b50915050808060200190518101906200117d919062002954565b9150506000808661ffff1660011415620011fa57604080518082018252600080825260209182018190528e8152600a82528281208351808501909452805484526001015491830191909152906020810151815190945092509050620011f38d6000908152600a6020526040812081815560010155565b5062001207565b5050602083810151908301515b60025461ffff888116911614156200128757604051632142170760e11b8152336004820152306024820152604481018d90526001600160a01b038e16906342842e0e90606401600060405180830381600087803b1580156200126857600080fd5b505af11580156200127d573d6000803e3d6000fd5b50505050620012e4565b604051630852cd8d60e31b8152600481018d90526001600160a01b038e16906342966c6890602401600060405180830381600087803b158015620012ca57600080fd5b505af1158015620012df573d6000803e3d6000fd5b505050505b620013326040518061010001604052808881526020018961ffff1681526020018481526020018381526020018e81526020018581526020018c81526020018d61ffff16815250348b62001fb7565b9d9c50505050505050505050505050565b606060c88260a00151511115620013a85760405162461bcd60e51b815260206004820152602260248201527f746f6b656e555249206d757374206e6f74206578636565642032303020627974604482015261657360f01b6064820152608401620006a9565b81516020808401516040808601516060870151608088015160a0890151805160c08b015160e08c01519651620013e99a60019a909998939493910162002cca565b6040516020818303038152906040529050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906200142f8382620015d8565b82526200143e60208262002f88565b8251909150684e465442726964676514620014aa5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b6064820152608401620006a9565b620014b683826200163a565b60ff166020830152620014cb60018262002f88565b9050816020015160ff16600214620015345760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b6064820152608401620006a9565b6200154083826200169a565b61ffff1660408301526200155660028262002f88565b9050620015648382620015d8565b60608301526200157660208262002f88565b905080835114620008005760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b6064820152608401620006a9565b6000620015e782602062002f88565b83511015620016315760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401620006a9565b50016020015190565b60006200164982600162002f88565b83511015620016915760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401620006a9565b50016001015190565b6000620016a982600262002f88565b83511015620016f25760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401620006a9565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820181905261010082018390526101208201526101408101919091526000606060008060006200176f6000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b81526004016200179c919062002d99565b60006040518083038186803b158015620017b557600080fd5b505afa158015620017ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620017f4919081019062002a53565b925092509250816200180d579194509250905062001923565b60025462010000900461ffff1661ffff16836060015161ffff16146200186b5750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062001923565b600354836080015114620018be57505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062001923565b61014083015160009081526004602052604090205460ff16156200190857826000604051806060016040528060228152602001620039f26022913995509550955050505062001923565b50506040805160208101909152600081529093506001925090505b9193909250565b60006200195e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506200196b826200206c565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620019b09162002c79565b600060405180830381855af49150503d8060008114620019ed576040519150601f19603f3d011682016040523d82523d6000602084013e620019f2565b606091505b509150915081819062001a1a5760405162461bcd60e51b8152600401620006a9919062002d99565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062001a7082602062002f88565b83511015620016315760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401620006a9565b60608162001aca81601f62002f88565b101562001b0b5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401620006a9565b62001b17828462002f88565b8451101562001b5d5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401620006a9565b60608215801562001b7e576040519150600082526020820160405262001bca565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101562001bb957805183526020928301920162001b9f565b5050858452601f01601f1916604052505b50949350505050565b600080600062001beb6000546001600160a01b031690565b6001600160a01b031663c0fd8bde856040518263ffffffff1660e01b815260040162001c18919062002d99565b60006040518083038186803b15801562001c3157600080fd5b505afa15801562001c46573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001c70919081019062002a53565b92509250925081819062001c995760405162461bcd60e51b8152600401620006a9919062002d99565b5062001ca583620020ae565b62001ce55760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b6044820152606401620006a9565b600062001cf68460e001516200099a565b905062001d1784610140015160009081526005602052604090205460ff1690565b1562001d665760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c657465640000000000006044820152606401620006a9565b62001d8b8461014001516000908152600560205260409020805460ff19166001179055565b60025461ffff1661ffff168160e0015161ffff161462001de55760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b6044820152606401620006a9565b600062001df560025461ffff1690565b61ffff16826020015161ffff16141562001e125750805162001e5d565b600062001e28836020015184600001516200088a565b90506001600160a01b03811662001e5a5762001e578360200151846000015185606001518660400151620020eb565b90505b90505b60c082015160025461ffff1661ffff16836020015161ffff161462001f3c57826020015161ffff166001141562001ec8576080830151604080518082018252606086015181528186015160208083019182526000948552600a90529190922091518255516001909101555b608083015160a08401516040516334ff261960e21b81526001600160a01b0385169263d3fc98649262001f02928692919060040162002d70565b600060405180830381600087803b15801562001f1d57600080fd5b505af115801562001f32573d6000803e3d6000fd5b5050505062001fae565b6080830151604051632142170760e11b81523060048201526001600160a01b0383811660248301526044820192909252908316906342842e0e90606401600060405180830381600087803b15801562001f9457600080fd5b505af115801562001fa9573d6000803e3d6000fd5b505050505b50505050505050565b60008062001fc58562001343565b905062001fda6000546001600160a01b031690565b6001600160a01b031663b19a437e858584600f6040518563ffffffff1660e01b81526004016200200d9392919062002e80565b6020604051808303818588803b1580156200202757600080fd5b505af11580156200203c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002063919062002c2e565b95945050505050565b620020778162002398565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60008160800151620020d4836060015161ffff1660009081526009602052604090205490565b1415620020e357506001919050565b506000919050565b6000620020fb60025461ffff1690565b61ffff168561ffff161415620021655760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b6064820152608401620006a9565b60006200217386866200088a565b6001600160a01b031614620021cb5760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c726561647920657869737473000000006044820152606401620006a9565b8461ffff16600114156200220d577f576f726d686f6c65204272696467656420536f6c616e612d4e4654000000000092506915d3d49354d41313919560b21b91505b6000627ce50b60e31b62002221856200243f565b6200222c856200243f565b3089896040516024016200224595949392919062002dae565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b031990951694909417909352519092506000916200228f91309185910162002d4a565b6040516020818303038152906040529050600060405180602001620022b4906200257a565b601f1982820381018352601f909101166040819052620022da9190849060200162002c97565b60408051601f19818403018152908290526001600160f01b031960f08b901b166020830152602282018990529150600090604201604051602081830303815290604052805190602001209050808251602084016000f59450843b6200233e57600080fd5b61ffff891660009081526007602090815260408083208b8452825280832080546001600160a01b0319166001600160a01b038a16908117909155835260089091529020805460ff1916600117905550505050949350505050565b803b620023fe5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620006a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606060005b6020811080156200248257508281602081106200247157634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b156200249d5780620024948162002ff0565b91505062002444565b6000816001600160401b03811115620024c657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015620024f1576020820181803683370190505b50905060005b8281101562002572578481602081106200252157634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200254657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620025698162002ff0565b915050620024f7565b509392505050565b610993806200305f83390190565b60006200259f620025998462002f5e565b62002f2b565b9050828152838383011115620025b457600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114620025e357600080fd5b919050565b600082601f830112620025f9578081fd5b815160206001600160401b0382111562002617576200261762003024565b62002627818360051b0162002f2b565b80838252828201915082860187848660071b890101111562002647578586fd5b855b85811015620026b357608080838b03121562002663578788fd5b6200266d62002eb4565b8351815286840151878201526040620026888186016200278b565b9082015260606200269b8582016200278b565b90820152855293850193919091019060010162002649565b5090979650505050505050565b80518015158114620025e357600080fd5b600082601f830112620026e2578081fd5b8151620026f3620025998262002f5e565b81815284602083860101111562002708578283fd5b6200271b82602083016020870162002fbd565b949350505050565b600082601f83011262002734578081fd5b620027458383356020850162002588565b9392505050565b8035620025e3816200303a565b8051620025e3816200303a565b8051620025e3816200304b565b80516001600160401b0381168114620025e357600080fd5b805160ff81168114620025e357600080fd5b600060208284031215620027af578081fd5b6200274582620025cb565b600080600080600060808688031215620027d2578081fd5b620027dd86620025cb565b9450620027ed60208701620025cb565b93506040860135925060608601356001600160401b038082111562002810578283fd5b818801915088601f83011262002824578283fd5b81358181111562002833578384fd5b89602082850101111562002845578384fd5b9699959850939650602001949392505050565b600080600080600060a0868803121562002870578283fd5b6200287b86620025cb565b945060208601359350604086013562002894816200303a565b9250606086013591506080860135620028ad816200304b565b809150509295509295909350565b600060208284031215620028cd578081fd5b6200274582620026c0565b600060208284031215620028ea578081fd5b5035919050565b60006020828403121562002903578081fd5b5051919050565b6000602082840312156200291c578081fd5b81356001600160401b0381111562002932578182fd5b8201601f8101841362002943578182fd5b6200271b8482356020840162002588565b60006020828403121562002966578081fd5b81516001600160401b038111156200297c578182fd5b6200271b84828501620026d1565b6000602082840312156200299c578081fd5b81356001600160401b0380821115620029b3578283fd5b908301906101008286031215620029c8578283fd5b620029d262002edf565b82358152620029e4602084016200274c565b602082015260408301356040820152606083013560608201526080830135608082015260a08301358281111562002a19578485fd5b62002a278782860162002723565b60a08301525060c083013560c082015262002a4560e084016200274c565b60e082015295945050505050565b60008060006060848603121562002a68578081fd5b83516001600160401b038082111562002a7f578283fd5b90850190610160828803121562002a94578283fd5b62002a9e62002f05565b62002aa9836200278b565b815262002ab96020840162002766565b602082015262002acc6040840162002766565b604082015262002adf6060840162002759565b60608201526080830151608082015262002afc60a0840162002773565b60a082015262002b0f60c084016200278b565b60c082015260e08301518281111562002b26578485fd5b62002b3489828601620026d1565b60e08301525061010062002b4a81850162002766565b90820152610120838101518381111562002b62578586fd5b62002b708a828701620025e8565b91830191909152506101408381015190820152945062002b9360208701620026c0565b9350604086015191508082111562002ba9578283fd5b5062002bb886828701620026d1565b9150509250925092565b60006020828403121562002bd4578081fd5b813562002745816200303a565b60006020828403121562002bf3578081fd5b815162002745816200303a565b6000806040838503121562002c13578182fd5b823562002c20816200303a565b946020939093013593505050565b60006020828403121562002c40578081fd5b620027458262002773565b6000815180845262002c6581602086016020860162002fbd565b601f01601f19169290920160200192915050565b6000825162002c8d81846020870162002fbd565b9190910192915050565b6000835162002cab81846020880162002fbd565b83519083019062002cc181836020880162002fbd565b01949350505050565b600060ff60f81b808d60f81b1683528b600184015261ffff60f01b808c60f01b1660218501528a6023850152896043850152886063850152818860f81b1660838501528651915062002d24826084860160208a0162002fbd565b920160848101949094525060f09190911b1660a482015260a60198975050505050505050565b6001600160a01b03831681526040602082018190526000906200271b9083018462002c4b565b60018060a01b038416815282602082015260606040820152600062002063606083018462002c4b565b60208152600062002745602083018462002c4b565b60a08152600062002dc360a083018862002c4b565b828103602084015262002dd7818862002c4b565b6001600160a01b03969096166040840152505061ffff92909216606083015260809091015292915050565b60208152815160208201526000602083015161ffff80821660408501526040850151606085015260608501516080850152608085015160a085015260a085015191506101008060c086015262002e5d61012086018462002c4b565b925060c086015160e08601528160e0870151168186015250508091505092915050565b63ffffffff8416815260606020820152600062002ea1606083018562002c4b565b905060ff83166040830152949350505050565b604051608081016001600160401b038111828210171562002ed95762002ed962003024565b60405290565b60405161010081016001600160401b038111828210171562002ed95762002ed962003024565b60405161016081016001600160401b038111828210171562002ed95762002ed962003024565b604051601f8201601f191681016001600160401b038111828210171562002f565762002f5662003024565b604052919050565b60006001600160401b0382111562002f7a5762002f7a62003024565b50601f01601f191660200190565b6000821982111562002f9e5762002f9e6200300e565b500190565b60008282101562002fb85762002fb86200300e565b500390565b60005b8381101562002fda57818101518382015260200162002fc0565b8381111562002fea576000848401525b50505050565b60006000198214156200300757620030076200300e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462000c8157600080fd5b63ffffffff8116811462000c8157600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220edbb83504df0192a37d3d17c6b0e90c1b1b370eb0b0ef4bcebc298f7ff73f8bb64736f6c63430008040033",Nn=function(e){function t(t){return e.call(this,Cn,Rn,t)||this}return In(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Cn)},t.connect=function(e,t){return new a.b(e,Cn,t)},t.bytecode=Rn,t.abi=Cn,t}(a.c),Dn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bn=[{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"bytes",name:"initData",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],Un="0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220fa72c28af80846ec0b7d8c02ad2f267d128c8f1fe45e0269edefa8a19ab2524564736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",Ln=(function(e){function t(t){return e.call(this,Bn,Un,t)||this}Dn(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Bn)},t.connect=function(e,t){return new a.b(e,Bn,t)},t.bytecode=Un,t.abi=Bn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),zn=[{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"splCache",outputs:[{components:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes32",name:"symbol",type:"bytes32"}],internalType:"struct NFTBridgeStorage.SPLCache",name:"",type:"tuple"}],stateMutability:"view",type:"function"}],Fn="0x608060405234801561001057600080fd5b50610384806100206000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80639a8a0592116100715780639a8a0592146101f8578063aa4efa5b14610213578063ad66a5f114610236578063b172b22214610268578063d60b347f14610270578063fbe3c2cd1461029c57600080fd5b80631a2be4da146100b95780631ff1e286146100fa5780632c3c02a41461014c5780632f3a3d5d1461016f5780633ca648261461018057806384acd1bb146101e7575b600080fd5b6100e56100c73660046102c5565b6001600160a01b031660009081526008602052604090205460ff1690565b60405190151581526020015b60405180910390f35b610134610108366004610325565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b0390911681526020016100f1565b6100e561015a3660046102f3565b60009081526004602052604090205460ff1690565b6001546001600160a01b0316610134565b6101cc61018e3660046102f3565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b604080518251815260209283015192810192909252016100f1565b6000546001600160a01b0316610134565b60025461ffff165b60405161ffff90911681526020016100f1565b6100e56102213660046102f3565b60009081526005602052604090205460ff1690565b61025a61024436600461030b565b61ffff1660009081526009602052604090205490565b6040519081526020016100f1565b60035461025a565b6100e561027e3660046102c5565b6001600160a01b031660009081526006602052604090205460ff1690565b60025462010000900461ffff16610200565b803561ffff811681146102c057600080fd5b919050565b6000602082840312156102d6578081fd5b81356001600160a01b03811681146102ec578182fd5b9392505050565b600060208284031215610304578081fd5b5035919050565b60006020828403121561031c578081fd5b6102ec826102ae565b60008060408385031215610337578081fd5b610340836102ae565b94602093909301359350505056fea2646970667358221220b572dc8ef622565026fb159c235320b9db8f2e2eb246e10a6438608b3883a02364736f6c63430008040033",qn=(function(e){function t(t){return e.call(this,zn,Fn,t)||this}Ln(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(zn)},t.connect=function(e,t){return new a.b(e,zn,t)},t.bytecode=Fn,t.abi=zn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Hn=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"splCache",outputs:[{components:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes32",name:"symbol",type:"bytes32"}],internalType:"struct NFTBridgeStorage.SPLCache",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct NFTBridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct NFTBridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"}],Jn="0x608060405234801561001057600080fd5b5061143e806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639a8a059211610097578063b172b22211610066578063b172b22214610342578063d60b347f1461034a578063fbe3c2cd14610376578063fbeeacd91461038857600080fd5b80639a8a0592146102bf578063a5799f93146102da578063aa4efa5b146102ed578063ad66a5f11461031057600080fd5b80632c3c02a4116100d35780632c3c02a4146102135780632f3a3d5d146102365780633ca648261461024757806384acd1bb146102ae57600080fd5b806301f53255146101055780631a2be4da146101705780631ff1e286146101ac57806325394645146101fe575b600080fd5b61011861011336600461105b565b6103d5565b6040516101679190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b61019c61017e366004611015565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001610167565b6101e66101ba36600461123d565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b039091168152602001610167565b61021161020c36600461105b565b6105c4565b005b61019c610221366004611043565b60009081526004602052604090205460ff1690565b6001546001600160a01b03166101e6565b610293610255366004611043565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201610167565b6000546001600160a01b03166101e6565b60025461ffff165b60405161ffff9091168152602001610167565b6102116102e836600461105b565b61069b565b61019c6102fb366004611043565b60009081526005602052604090205460ff1690565b61033461031e366004611221565b61ffff1660009081526009602052604090205490565b604051908152602001610167565b600354610334565b61019c610358366004611015565b6001600160a01b031660009081526006602052604090205460ff1690565b60025462010000900461ffff166102c7565b61039b61039636600461105b565b610794565b60405161016791908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a08101825260008082526020820181905291810182905260608101829052608081018290529061040a8382610957565b8252610417602082611369565b8251909150684e4654427269646765146104845760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b61048e83826109b5565b60ff1660208301526104a1600182611369565b9050816020015160ff166001146105065760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840161047b565b6105108382610a11565b61ffff166040830152610524600282611369565b90506105308382610a11565b61ffff166060830152610544600282611369565b90506105508382610957565b6080830152610560602082611369565b9050808351146105be5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840161047b565b50919050565b60008060006105d284610a6e565b9250925092508181906105f85760405162461bcd60e51b815260040161047b91906112b0565b5061061d8361014001516000908152600460205260409020805460ff19166001179055565b600061062c8460e00151610794565b905061063b60025461ffff1690565b61ffff16816040015161ffff16146106865760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640161047b565b606081015161069490610c8d565b5050505050565b60008060006106a984610a6e565b9250925092508181906106cf5760405162461bcd60e51b815260040161047b91906112b0565b506106f48361014001516000908152600460205260409020805460ff19166001179055565b60006107038460e001516103d5565b905061071260025461ffff1690565b61ffff16816040015161ffff1614806107315750604081015161ffff16155b6107705760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640161047b565b6106948160600151826080015161ffff909116600090815260096020526040902055565b6040805160808101825260008082526020820181905291810182905260608101829052906107c28382610957565b82526107cf602082611369565b8251909150684e4654427269646765146108395760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840161047b565b61084383826109b5565b60ff166020830152610856600182611369565b9050816020015160ff166002146108bd5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840161047b565b6108c78382610a11565b61ffff1660408301526108db600282611369565b90506108e78382610957565b60608301526108f7602082611369565b9050808351146105be5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840161047b565b6000610964826020611369565b835110156109ac5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640161047b565b50016020015190565b60006109c2826001611369565b83511015610a085760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640161047b565b50016001015190565b6000610a1e826002611369565b83511015610a655760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640161047b565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610ae16000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610b0c91906112b0565b60006040518083038186803b158015610b2457600080fd5b505afa158015610b38573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b6091908101906110cf565b92509250925081610b775791945092509050610c86565b60025462010000900461ffff1661ffff16836060015161ffff1614610bd35750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610c86565b600354836080015114610c2457505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610c86565b61014083015160009081526004602052604090205460ff1615610c6b578260006040518060600160405280602281526020016113e760229139955095509550505050610c86565b50506040805160208101909152600081529093506001925090505b9193909250565b6000610cc07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050610ccb82610dba565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691610d0e91611294565b600060405180830381855af49150503d8060008114610d49576040519150601f19603f3d011682016040523d82523d6000602084013e610d4e565b606091505b5091509150818190610d735760405162461bcd60e51b815260040161047b91906112b0565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b610dc381610dfa565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610e5e5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161047b565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b600082601f830112610eaf578081fd5b8151602067ffffffffffffffff821115610ecb57610ecb6113bd565b610ed9818360051b01611310565b80838252828201915082860187848660071b8901011115610ef8578586fd5b855b85811015610f5b57608080838b031215610f12578788fd5b610f1a6112c3565b8351815286840151878201526040610f33818601611004565b908201526060610f44858201611004565b908201528552938501939190910190600101610efa565b5090979650505050505050565b80518015158114610f7857600080fd5b919050565b600082601f830112610f8d578081fd5b8151610fa0610f9b82611341565b611310565b818152846020838601011115610fb4578283fd5b610fc582602083016020870161138d565b949350505050565b8051610f78816113d3565b805163ffffffff81168114610f7857600080fd5b805167ffffffffffffffff81168114610f7857600080fd5b805160ff81168114610f7857600080fd5b600060208284031215611026578081fd5b81356001600160a01b038116811461103c578182fd5b9392505050565b600060208284031215611054578081fd5b5035919050565b60006020828403121561106c578081fd5b813567ffffffffffffffff811115611082578182fd5b8201601f81018413611092578182fd5b80356110a0610f9b82611341565b8181528560208385010111156110b4578384fd5b81602084016020830137908101602001929092525092915050565b6000806000606084860312156110e3578182fd5b835167ffffffffffffffff808211156110fa578384fd5b90850190610160828803121561110e578384fd5b6111166112ec565b61111f83611004565b815261112d60208401610fd8565b602082015261113e60408401610fd8565b604082015261114f60608401610fcd565b60608201526080830151608082015261116a60a08401610fec565b60a082015261117b60c08401611004565b60c082015260e083015182811115611191578586fd5b61119d89828601610f7d565b60e0830152506101006111b1818501610fd8565b9082015261012083810151838111156111c8578687fd5b6111d48a828701610e9f565b9183019190915250610140838101519082015294506111f560208701610f68565b9350604086015191508082111561120a578283fd5b5061121786828701610f7d565b9150509250925092565b600060208284031215611232578081fd5b813561103c816113d3565b6000806040838503121561124f578182fd5b823561125a816113d3565b946020939093013593505050565b6000815180845261128081602086016020860161138d565b601f01601f19169290920160200192915050565b600082516112a681846020870161138d565b9190910192915050565b60208152600061103c6020830184611268565b6040516080810167ffffffffffffffff811182821017156112e6576112e66113bd565b60405290565b604051610160810167ffffffffffffffff811182821017156112e6576112e66113bd565b604051601f8201601f1916810167ffffffffffffffff81118282101715611339576113396113bd565b604052919050565b600067ffffffffffffffff82111561135b5761135b6113bd565b50601f01601f191660200190565b6000821982111561138857634e487b7160e01b81526011600452602481fd5b500190565b60005b838110156113a8578181015183820152602001611390565b838111156113b7576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff811681146113e357600080fd5b5056fe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220953e4ca64aaf1738f34834b1797570079f7ef37e5430dad5e283f07b1fb1ded264736f6c63430008040033",Vn=(function(e){function t(t){return e.call(this,Hn,Jn,t)||this}qn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Hn)},t.connect=function(e,t){return new a.b(e,Hn,t)},t.bytecode=Jn,t.abi=Hn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Wn=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"uint16",name:"chainId_",type:"uint16"}],name:"bridgeContracts",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"completeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"string",name:"uri",type:"string"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"}],internalType:"struct NFTBridgeStructs.Transfer",name:"transfer",type:"tuple"}],name:"encodeTransfer",outputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"isTransferCompleted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isWrappedAsset",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseRegisterChain",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"emitterChainID",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"}],internalType:"struct NFTBridgeStructs.RegisterChain",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseTransfer",outputs:[{components:[{internalType:"bytes32",name:"tokenAddress",type:"bytes32"},{internalType:"uint16",name:"tokenChain",type:"uint16"},{internalType:"bytes32",name:"symbol",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"string",name:"uri",type:"string"},{internalType:"bytes32",name:"to",type:"bytes32"},{internalType:"uint16",name:"toChain",type:"uint16"}],internalType:"struct NFTBridgeStructs.Transfer",name:"transfer",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encoded",type:"bytes"}],name:"parseUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"bytes32",name:"newContract",type:"bytes32"}],internalType:"struct NFTBridgeStructs.UpgradeContract",name:"chain",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"registerChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"splCache",outputs:[{components:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes32",name:"symbol",type:"bytes32"}],internalType:"struct NFTBridgeStorage.SPLCache",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"tokenImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"},{internalType:"uint16",name:"recipientChain",type:"uint16"},{internalType:"bytes32",name:"recipient",type:"bytes32"},{internalType:"uint32",name:"nonce",type:"uint32"}],name:"transferNFT",outputs:[{internalType:"uint64",name:"sequence",type:"uint64"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint16",name:"tokenChainId",type:"uint16"},{internalType:"bytes32",name:"tokenAddress",type:"bytes32"}],name:"wrappedAsset",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"}],Kn="0x608060405234801561001057600080fd5b50613b72806100206000396000f3fe6080604052600436106200015b5760003560e01c806384acd1bb11620000c5578063c68785191162000078578063c687851914620004ff578063c96616e11462000524578063d60b347f1462000554578063e6a853e01462000591578063fbe3c2cd14620005c5578063fbeeacd914620005e657600080fd5b806384acd1bb14620004015780639a8a05921462000421578063a5799f93146200044b578063aa4efa5b1462000470578063ad66a5f114620004a4578063b172b22214620004e857600080fd5b80632b511375116200011e5780632b51137514620002d05780632c3c02a414620003045780632f3a3d5d14620003385780633ca6482614620003585780635c60da1b14620003d15780638129fc1c14620003e957600080fd5b806301f532551462000160578063150b7a0214620001de5780631a2be4da146200021d5780631ff1e286146200026b5780632539464514620002a9575b600080fd5b3480156200016d57600080fd5b50620001856200017f36600462002a33565b62000646565b604051620001d59190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620001eb57600080fd5b5062000203620001fd366004620028e3565b6200084e565b6040516001600160e01b03199091168152602001620001d5565b3480156200022a57600080fd5b506200025a6200023c366004620028c6565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001620001d5565b3480156200027857600080fd5b50620002906200028a36600462002d29565b620008d2565b6040516001600160a01b039091168152602001620001d5565b348015620002b657600080fd5b50620002ce620002c836600462002a33565b620008fe565b005b348015620002dd57600080fd5b50620002f5620002ef36600462002a33565b620009e2565b604051620001d5919062002f2b565b3480156200031157600080fd5b506200025a6200032336600462002a01565b60009081526004602052604090205460ff1690565b3480156200034557600080fd5b506001546001600160a01b031662000290565b3480156200036557600080fd5b50620003b56200037736600462002a01565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201620001d5565b348015620003de57600080fd5b506200029062000bb8565b348015620003f657600080fd5b50620002ce62000bd2565b3480156200040e57600080fd5b506000546001600160a01b031662000290565b3480156200042e57600080fd5b5060025461ffff165b60405161ffff9091168152602001620001d5565b3480156200045857600080fd5b50620002ce6200046a36600462002a33565b62000c9c565b3480156200047d57600080fd5b506200025a6200048f36600462002a01565b60009081526005602052604090205460ff1690565b348015620004b157600080fd5b50620004d9620004c336600462002ceb565b61ffff1660009081526009602052604090205490565b604051908152602001620001d5565b348015620004f557600080fd5b50600354620004d9565b3480156200050c57600080fd5b50620002ce6200051e36600462002a33565b62000da2565b6200053b6200053536600462002981565b62000dad565b6040516001600160401b039091168152602001620001d5565b3480156200056157600080fd5b506200025a62000573366004620028c6565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156200059e57600080fd5b50620005b6620005b036600462002ab3565b6200146c565b604051620001d5919062002ec2565b348015620005d257600080fd5b5060025462010000900461ffff1662000437565b348015620005f357600080fd5b506200060b6200060536600462002a33565b62001528565b604051620001d591908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906200067d838262001701565b82526200068c602082620030b1565b8251909150684e465442726964676514620006fa5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b62000706838262001763565b60ff1660208301526200071b600182620030b1565b9050816020015160ff16600114620007825760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b6064820152608401620006f1565b6200078e8382620017c3565b61ffff166040830152620007a4600282620030b1565b9050620007b28382620017c3565b61ffff166060830152620007c8600282620030b1565b9050620007d6838262001701565b6080830152620007e8602082620030b1565b905080835114620008485760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b6064820152608401620006f1565b50919050565b60006001600160a01b0386163014620008c05760405162461bcd60e51b815260206004820152602d60248201527f63616e206f6e6c792062726964676520746f6b656e7320766961207472616e7360448201526c19995c939195081b595d1a1bd9609a1b6064820152608401620006f1565b50630a85bd0160e11b95945050505050565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b60008060006200090e8462001824565b925092509250818190620009375760405162461bcd60e51b8152600401620006f1919062002ec2565b506200095d8361014001516000908152600460205260409020805460ff19166001179055565b60006200096e8460e0015162001528565b90506200097e60025461ffff1690565b61ffff16816040015161ffff1614620009cb5760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401620006f1565b6060810151620009db9062001a53565b5050505050565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082015260c0810182905260e08101829052908062000a2f848262001763565b905062000a3e600183620030b1565b91508060ff1660011462000a885760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620006f1565b62000a94848362001701565b835262000aa3602083620030b1565b915062000ab18483620017c3565b61ffff16602084015262000ac7600283620030b1565b915062000ad5848362001701565b604084015262000ae7602083620030b1565b915062000af5848362001701565b606084015262000b07602083620030b1565b915062000b15848362001b8a565b608084015262000b27602083620030b1565b915062000b36600183620030b1565b915062000b6382602284875162000b4e9190620030cc565b62000b5a9190620030cc565b86919062001be3565b60a08401528351915062000b79600283620030cc565b915062000b878483620017c3565b61ffff1660e084015262000b9d602083620030cc565b915062000bab848362001701565b60c0840152509092915050565b600062000bcd6001546001600160a01b031690565b905090565b600062000c067f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062000c2b816001600160a01b031660009081526006602052604090205460ff1690565b1562000c705760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401620006f1565b62000c99816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b600080600062000cac8462001824565b92509250925081819062000cd55760405162461bcd60e51b8152600401620006f1919062002ec2565b5062000cfb8361014001516000908152600460205260409020805460ff19166001179055565b600062000d0c8460e0015162000646565b905062000d1c60025461ffff1690565b61ffff16816040015161ffff16148062000d3c5750604081015161ffff16155b62000d7d5760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b6044820152606401620006f1565b620009db8160600151826080015161ffff909116600090815260096020526040902055565b62000c998162001cfc565b600080600062000dd5886001600160a01b031660009081526008602052604090205460ff1690565b1562000ecf57876001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e1557600080fd5b505afa15801562000e2a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e50919062002d0a565b9150876001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e8c57600080fd5b505afa15801562000ea1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ec7919062002a1a565b905062001099565b60025461ffff166040516301ffc9a760e01b81526380ac58cd60e01b60048201529092506001600160a01b038916915081906301ffc9a79060240160206040518083038186803b15801562000f2357600080fd5b505afa15801562000f38573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f5e9190620029e4565b62000fb65760405162461bcd60e51b815260206004820152602160248201527f6d75737420737570706f7274207468652045524337323120696e7465726661636044820152606560f81b6064820152608401620006f1565b6040516301ffc9a760e01b8152635b5e139f60e01b60048201526001600160a01b038916906301ffc9a79060240160206040518083038186803b15801562000ffd57600080fd5b505afa15801562001012573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010389190620029e4565b620010995760405162461bcd60e51b815260206004820152602a60248201527f6d75737420737570706f727420746865204552433732312d4d657461646174616044820152691032bc3a32b739b4b7b760b11b6064820152608401620006f1565b60608060608461ffff16600114620011f35760408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b17905290516000916001600160a01b038e1691620010ef919062002da2565b600060405180830381855afa9150503d80600081146200112c576040519150601f19603f3d011682016040523d82523d6000602084013e62001131565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b038f16916200117a919062002da2565b600060405180830381855afa9150503d8060008114620011b7576040519150601f19603f3d011682016040523d82523d6000602084013e620011bc565b606091505b5091505081806020019051810190620011d6919062002a7d565b945080806020019051810190620011ee919062002a7d565b935050505b60008b6001600160a01b03168b6040516024016200121391815260200190565b60408051601f198184030181529181526020820180516001600160e01b031663c87b56dd60e01b179052516200124a919062002da2565b600060405180830381855afa9150503d806000811462001287576040519150601f19603f3d011682016040523d82523d6000602084013e6200128c565b606091505b5091505080806020019051810190620012a6919062002a7d565b9150506000808661ffff16600114156200132357604080518082018252600080825260209182018190528e8152600a825282812083518085019094528054845260010154918301919091529060208101518151909450925090506200131c8d6000908152600a6020526040812081815560010155565b5062001330565b5050602083810151908301515b60025461ffff88811691161415620013b057604051632142170760e11b8152336004820152306024820152604481018d90526001600160a01b038e16906342842e0e90606401600060405180830381600087803b1580156200139157600080fd5b505af1158015620013a6573d6000803e3d6000fd5b505050506200140d565b604051630852cd8d60e31b8152600481018d90526001600160a01b038e16906342966c6890602401600060405180830381600087803b158015620013f357600080fd5b505af115801562001408573d6000803e3d6000fd5b505050505b6200145b6040518061010001604052808881526020018961ffff1681526020018481526020018381526020018e81526020018581526020018c81526020018d61ffff16815250348b620020e0565b9d9c50505050505050505050505050565b606060c88260a00151511115620014d15760405162461bcd60e51b815260206004820152602260248201527f746f6b656e555249206d757374206e6f74206578636565642032303020627974604482015261657360f01b6064820152608401620006f1565b81516020808401516040808601516060870151608088015160a0890151805160c08b015160e08c01519651620015129a60019a909998939493910162002df3565b6040516020818303038152906040529050919050565b60408051608081018252600080825260208201819052918101829052606081018290529062001558838262001701565b825262001567602082620030b1565b8251909150684e465442726964676514620015d35760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b6064820152608401620006f1565b620015df838262001763565b60ff166020830152620015f4600182620030b1565b9050816020015160ff166002146200165d5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b6064820152608401620006f1565b620016698382620017c3565b61ffff1660408301526200167f600282620030b1565b90506200168d838262001701565b60608301526200169f602082620030b1565b905080835114620008485760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b6064820152608401620006f1565b600062001710826020620030b1565b835110156200175a5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401620006f1565b50016020015190565b600062001772826001620030b1565b83511015620017ba5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401620006f1565b50016001015190565b6000620017d2826002620030b1565b835110156200181b5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401620006f1565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620018986000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620018c5919062002ec2565b60006040518083038186803b158015620018de57600080fd5b505afa158015620018f3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200191d919081019062002b7c565b9250925092508162001936579194509250905062001a4c565b60025462010000900461ffff1661ffff16836060015161ffff1614620019945750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062001a4c565b600354836080015114620019e757505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062001a4c565b61014083015160009081526004602052604090205460ff161562001a315782600060405180606001604052806022815260200162003b1b6022913995509550955050505062001a4c565b50506040805160208101909152600081529093506001925090505b9193909250565b600062001a877f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001a948262002195565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169162001ad99162002da2565b600060405180830381855af49150503d806000811462001b16576040519150601f19603f3d011682016040523d82523d6000602084013e62001b1b565b606091505b509150915081819062001b435760405162461bcd60e51b8152600401620006f1919062002ec2565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062001b99826020620030b1565b835110156200175a5760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401620006f1565b60608162001bf381601f620030b1565b101562001c345760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401620006f1565b62001c408284620030b1565b8451101562001c865760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401620006f1565b60608215801562001ca7576040519150600082526020820160405262001cf3565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101562001ce257805183526020928301920162001cc8565b5050858452601f01601f1916604052505b50949350505050565b600080600062001d146000546001600160a01b031690565b6001600160a01b031663c0fd8bde856040518263ffffffff1660e01b815260040162001d41919062002ec2565b60006040518083038186803b15801562001d5a57600080fd5b505afa15801562001d6f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001d99919081019062002b7c565b92509250925081819062001dc25760405162461bcd60e51b8152600401620006f1919062002ec2565b5062001dce83620021d7565b62001e0e5760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b6044820152606401620006f1565b600062001e1f8460e00151620009e2565b905062001e4084610140015160009081526005602052604090205460ff1690565b1562001e8f5760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c657465640000000000006044820152606401620006f1565b62001eb48461014001516000908152600560205260409020805460ff19166001179055565b60025461ffff1661ffff168160e0015161ffff161462001f0e5760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b6044820152606401620006f1565b600062001f1e60025461ffff1690565b61ffff16826020015161ffff16141562001f3b5750805162001f86565b600062001f5183602001518460000151620008d2565b90506001600160a01b03811662001f835762001f80836020015184600001518560600151866040015162002214565b90505b90505b60c082015160025461ffff1661ffff16836020015161ffff16146200206557826020015161ffff166001141562001ff1576080830151604080518082018252606086015181528186015160208083019182526000948552600a90529190922091518255516001909101555b608083015160a08401516040516334ff261960e21b81526001600160a01b0385169263d3fc9864926200202b928692919060040162002e99565b600060405180830381600087803b1580156200204657600080fd5b505af11580156200205b573d6000803e3d6000fd5b50505050620020d7565b6080830151604051632142170760e11b81523060048201526001600160a01b0383811660248301526044820192909252908316906342842e0e90606401600060405180830381600087803b158015620020bd57600080fd5b505af1158015620020d2573d6000803e3d6000fd5b505050505b50505050505050565b600080620020ee856200146c565b9050620021036000546001600160a01b031690565b6001600160a01b031663b19a437e858584600f6040518563ffffffff1660e01b8152600401620021369392919062002fa9565b6020604051808303818588803b1580156200215057600080fd5b505af115801562002165573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906200218c919062002d57565b95945050505050565b620021a081620024c1565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60008160800151620021fd836060015161ffff1660009081526009602052604090205490565b14156200220c57506001919050565b506000919050565b60006200222460025461ffff1690565b61ffff168561ffff1614156200228e5760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b6064820152608401620006f1565b60006200229c8686620008d2565b6001600160a01b031614620022f45760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c726561647920657869737473000000006044820152606401620006f1565b8461ffff166001141562002336577f576f726d686f6c65204272696467656420536f6c616e612d4e4654000000000092506915d3d49354d41313919560b21b91505b6000627ce50b60e31b6200234a8562002568565b620023558562002568565b3089896040516024016200236e95949392919062002ed7565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b03199095169490941790935251909250600091620023b891309185910162002e73565b6040516020818303038152906040529050600060405180602001620023dd90620026a3565b601f1982820381018352601f909101166040819052620024039190849060200162002dc0565b60408051601f19818403018152908290526001600160f01b031960f08b901b166020830152602282018990529150600090604201604051602081830303815290604052805190602001209050808251602084016000f59450843b6200246757600080fd5b61ffff891660009081526007602090815260408083208b8452825280832080546001600160a01b0319166001600160a01b038a16908117909155835260089091529020805460ff1916600117905550505050949350505050565b803b620025275760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620006f1565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606060005b602081108015620025ab57508281602081106200259a57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b15620025c65780620025bd8162003119565b9150506200256d565b6000816001600160401b03811115620025ef57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156200261a576020820181803683370190505b50905060005b828110156200269b578481602081106200264a57634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200266f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620026928162003119565b91505062002620565b509392505050565b610993806200318883390190565b6000620026c8620026c28462003087565b62003054565b9050828152838383011115620026dd57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146200270c57600080fd5b919050565b600082601f83011262002722578081fd5b815160206001600160401b038211156200274057620027406200314d565b62002750818360051b0162003054565b80838252828201915082860187848660071b890101111562002770578586fd5b855b85811015620027dc57608080838b0312156200278c578788fd5b6200279662002fdd565b8351815286840151878201526040620027b1818601620028b4565b908201526060620027c4858201620028b4565b90820152855293850193919091019060010162002772565b5090979650505050505050565b805180151581146200270c57600080fd5b600082601f8301126200280b578081fd5b81516200281c620026c28262003087565b81815284602083860101111562002831578283fd5b62002844826020830160208701620030e6565b949350505050565b600082601f8301126200285d578081fd5b6200286e83833560208501620026b1565b9392505050565b80356200270c8162003163565b80516200270c8162003163565b80516200270c8162003174565b80516001600160401b03811681146200270c57600080fd5b805160ff811681146200270c57600080fd5b600060208284031215620028d8578081fd5b6200286e82620026f4565b600080600080600060808688031215620028fb578081fd5b6200290686620026f4565b94506200291660208701620026f4565b93506040860135925060608601356001600160401b038082111562002939578283fd5b818801915088601f8301126200294d578283fd5b8135818111156200295c578384fd5b8960208285010111156200296e578384fd5b9699959850939650602001949392505050565b600080600080600060a0868803121562002999578283fd5b620029a486620026f4565b9450602086013593506040860135620029bd8162003163565b9250606086013591506080860135620029d68162003174565b809150509295509295909350565b600060208284031215620029f6578081fd5b6200286e82620027e9565b60006020828403121562002a13578081fd5b5035919050565b60006020828403121562002a2c578081fd5b5051919050565b60006020828403121562002a45578081fd5b81356001600160401b0381111562002a5b578182fd5b8201601f8101841362002a6c578182fd5b6200284484823560208401620026b1565b60006020828403121562002a8f578081fd5b81516001600160401b0381111562002aa5578182fd5b6200284484828501620027fa565b60006020828403121562002ac5578081fd5b81356001600160401b038082111562002adc578283fd5b90830190610100828603121562002af1578283fd5b62002afb62003008565b8235815262002b0d6020840162002875565b602082015260408301356040820152606083013560608201526080830135608082015260a08301358281111562002b42578485fd5b62002b50878286016200284c565b60a08301525060c083013560c082015262002b6e60e0840162002875565b60e082015295945050505050565b60008060006060848603121562002b91578081fd5b83516001600160401b038082111562002ba8578283fd5b90850190610160828803121562002bbd578283fd5b62002bc76200302e565b62002bd283620028b4565b815262002be2602084016200288f565b602082015262002bf5604084016200288f565b604082015262002c086060840162002882565b60608201526080830151608082015262002c2560a084016200289c565b60a082015262002c3860c08401620028b4565b60c082015260e08301518281111562002c4f578485fd5b62002c5d89828601620027fa565b60e08301525061010062002c738185016200288f565b90820152610120838101518381111562002c8b578586fd5b62002c998a82870162002711565b91830191909152506101408381015190820152945062002cbc60208701620027e9565b9350604086015191508082111562002cd2578283fd5b5062002ce186828701620027fa565b9150509250925092565b60006020828403121562002cfd578081fd5b81356200286e8162003163565b60006020828403121562002d1c578081fd5b81516200286e8162003163565b6000806040838503121562002d3c578182fd5b823562002d498162003163565b946020939093013593505050565b60006020828403121562002d69578081fd5b6200286e826200289c565b6000815180845262002d8e816020860160208601620030e6565b601f01601f19169290920160200192915050565b6000825162002db6818460208701620030e6565b9190910192915050565b6000835162002dd4818460208801620030e6565b83519083019062002dea818360208801620030e6565b01949350505050565b600060ff60f81b808d60f81b1683528b600184015261ffff60f01b808c60f01b1660218501528a6023850152896043850152886063850152818860f81b1660838501528651915062002e4d826084860160208a01620030e6565b920160848101949094525060f09190911b1660a482015260a60198975050505050505050565b6001600160a01b0383168152604060208201819052600090620028449083018462002d74565b60018060a01b03841681528260208201526060604082015260006200218c606083018462002d74565b6020815260006200286e602083018462002d74565b60a08152600062002eec60a083018862002d74565b828103602084015262002f00818862002d74565b6001600160a01b03969096166040840152505061ffff92909216606083015260809091015292915050565b60208152815160208201526000602083015161ffff80821660408501526040850151606085015260608501516080850152608085015160a085015260a085015191506101008060c086015262002f8661012086018462002d74565b925060c086015160e08601528160e0870151168186015250508091505092915050565b63ffffffff8416815260606020820152600062002fca606083018562002d74565b905060ff83166040830152949350505050565b604051608081016001600160401b03811182821017156200300257620030026200314d565b60405290565b60405161010081016001600160401b03811182821017156200300257620030026200314d565b60405161016081016001600160401b03811182821017156200300257620030026200314d565b604051601f8201601f191681016001600160401b03811182821017156200307f576200307f6200314d565b604052919050565b60006001600160401b03821115620030a357620030a36200314d565b50601f01601f191660200190565b60008219821115620030c757620030c762003137565b500190565b600082821015620030e157620030e162003137565b500390565b60005b8381101562003103578181015183820152602001620030e9565b8381111562003113576000848401525b50505050565b600060001982141562003130576200313062003137565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462000c9957600080fd5b63ffffffff8116811462000c9957600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a26469706673582212200ebafc498d19e44a45471c07fba4c37909cb4590c32e480b30fa07623fa70a5b64736f6c63430008040033",Gn=(function(e){function t(t){return e.call(this,Wn,Kn,t)||this}Vn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Wn)},t.connect=function(e,t){return new a.b(e,Wn,t)},t.bytecode=Kn,t.abi=Wn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Zn=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"address",name:"wormhole",type:"address"},{internalType:"uint16",name:"governanceChainId",type:"uint16"},{internalType:"bytes32",name:"governanceContract",type:"bytes32"},{internalType:"address",name:"tokenImplementation",type:"address"}],name:"setup",outputs:[],stateMutability:"nonpayable",type:"function"}],Xn="0x608060405234801561001057600080fd5b5061026b806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80637e89644614610030575b600080fd5b61004361003e3660046101c9565b610045565b005b60028054600080546001600160a01b0388166001600160a01b031990911617905561ffff858116620100000263ffffffff19909216908816171790556003829055600180546001600160a01b0319166001600160a01b0383161790556100aa866100b2565b505050505050565b6100bb816100f2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b61015a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146101b257600080fd5b919050565b803561ffff811681146101b257600080fd5b60008060008060008060c087890312156101e1578182fd5b6101ea8761019b565b95506101f8602088016101b7565b94506102066040880161019b565b9350610214606088016101b7565b92506080870135915061022960a0880161019b565b9050929550929550929556fea26469706673582212206c5de73b33bd16db0a207bba6fd4066cd37fa1b5afe129c72e2dbd6a2b8daf1764736f6c63430008040033",Yn=(function(e){function t(t){return e.call(this,Zn,Xn,t)||this}Gn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Zn)},t.connect=function(e,t){return new a.b(e,Zn,t)},t.bytecode=Xn,t.abi=Zn}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),$n=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"address",name:"owner_",type:"address"},{internalType:"uint16",name:"chainId_",type:"uint16"},{internalType:"bytes32",name:"nativeContract_",type:"bytes32"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner_",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"nativeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"}],Qn="0x608060405234801561001057600080fd5b506116cb806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80636352211e116100ad578063a22cb46511610071578063a22cb46514610261578063b88d4fde14610274578063c87b56dd14610287578063d3fc98641461029a578063e985e9c5146102ad57600080fd5b80636352211e1461020157806370a08231146102145780638da5cb5b1461022757806395d89b41146102385780639a8a05921461024057600080fd5b8063095ea7b3116100f4578063095ea7b3146101a357806323b872dd146101b65780633d6c043b146101c957806342842e0e146101db57806342966c68146101ee57600080fd5b806301ffc9a71461012657806303e728581461014e57806306fdde0314610163578063081812fc14610178575b600080fd5b6101396101343660046113c9565b6102e9565b60405190151581526020015b60405180910390f35b61016161015c366004611401565b61033b565b005b61016b610406565b6040516101459190611533565b61018b610186366004611493565b61049a565b6040516001600160a01b039091168152602001610145565b6101616101b136600461134b565b61052f565b6101616101c436600461125d565b610645565b6008545b604051908152602001610145565b6101616101e936600461125d565b610676565b6101616101fc366004611493565b610691565b61018b61020f366004611493565b6106f1565b6101cd610222366004611211565b610768565b6007546001600160a01b031661018b565b61016b6107ef565b600754600160a81b900461ffff1660405161ffff9091168152602001610145565b61016161026f366004611311565b610801565b610161610282366004611298565b6108c6565b61016b610295366004611493565b6108fe565b6101616102a8366004611374565b610a1b565b6101396102bb36600461122b565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b148061031a57506001600160e01b03198216635b5e139f60e01b145b8061033557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600754600160a01b900460ff16156103905760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b6007805460ff60a01b1916600160a01b17905584516103b69060009060208801906110c0565b5083516103ca9060019060208701906110c0565b506007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b0390941693909317919091179091556008555050565b606060008001805461041790611618565b80601f016020809104026020016040519081016040528092919081815260200182805461044390611618565b80156104905780601f1061046557610100808354040283529160200191610490565b820191906000526020600020905b81548152906001019060200180831161047357829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166105135760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610387565b506000908152600460205260409020546001600160a01b031690565b600061053a826106f1565b9050806001600160a01b0316836001600160a01b031614156105a85760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610387565b336001600160a01b03821614806105c457506105c481336102bb565b6106365760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610387565b6106408383610a7a565b505050565b61064f3382610ae8565b61066b5760405162461bcd60e51b815260040161038790611598565b610640838383610bdf565b610640838383604051806020016040528060008152506108c6565b6007546001600160a01b031633146106e55760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610387565b6106ee81610d7f565b50565b6000818152600260205260408120546001600160a01b0316806103355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610387565b60006001600160a01b0382166107d35760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610387565b506001600160a01b031660009081526003602052604090205490565b60606000600101805461041790611618565b6001600160a01b03821633141561085a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610387565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6108d03383610ae8565b6108ec5760405162461bcd60e51b815260040161038790611598565b6108f884848484610e1a565b50505050565b6000818152600260205260409020546060906001600160a01b031661097d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610387565b6000828152600560205260409020805461099690611618565b80601f01602080910402602001604051908101604052809291908181526020018280546109c290611618565b8015610a0f5780601f106109e457610100808354040283529160200191610a0f565b820191906000526020600020905b8154815290600101906020018083116109f257829003601f168201915b50505050509050919050565b6007546001600160a01b03163314610a6f5760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610387565b610640838383610e4d565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610aaf826106f1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316610b615760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610387565b6000610b6c836106f1565b9050806001600160a01b0316846001600160a01b03161480610ba75750836001600160a01b0316610b9c8461049a565b6001600160a01b0316145b80610bd757506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610bf2826106f1565b6001600160a01b031614610c5a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610387565b6001600160a01b038216610cbc5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610387565b610cc7600082610a7a565b6001600160a01b0383166000908152600360205260408120805460019290610cf0908490611601565b90915550506001600160a01b0382166000908152600360205260408120805460019290610d1e9084906115e9565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610d8a826106f1565b9050610d97600083610a7a565b6001600160a01b0381166000908152600360205260408120805460019290610dc0908490611601565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610e25848484610bdf565b610e3184848484610fb3565b6108f85760405162461bcd60e51b815260040161038790611546565b6001600160a01b038316610ea35760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610387565b6000828152600260205260409020546001600160a01b031615610f085760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610387565b6001600160a01b0383166000908152600360205260408120805460019290610f319084906115e9565b9091555050600082815260026020908152604080832080546001600160a01b0319166001600160a01b038816179055600582529091208251610f75928401906110c0565b5060405182906001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b60006001600160a01b0384163b156110b557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610ff79033908990889088906004016114f6565b602060405180830381600087803b15801561101157600080fd5b505af1925050508015611041575060408051601f3d908101601f1916820190925261103e918101906113e5565b60015b61109b573d80801561106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b5080516110935760405162461bcd60e51b815260040161038790611546565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610bd7565b506001949350505050565b8280546110cc90611618565b90600052602060002090601f0160209004810192826110ee5760008555611134565b82601f1061110757805160ff1916838001178555611134565b82800160010185558215611134579182015b82811115611134578251825591602001919060010190611119565b50611140929150611144565b5090565b5b808211156111405760008155600101611145565b600067ffffffffffffffff8084111561117457611174611669565b604051601f8501601f19908116603f0116810190828211818310171561119c5761119c611669565b816040528093508581528686860111156111b557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146111e657600080fd5b919050565b600082601f8301126111fb578081fd5b61120a83833560208501611159565b9392505050565b600060208284031215611222578081fd5b61120a826111cf565b6000806040838503121561123d578081fd5b611246836111cf565b9150611254602084016111cf565b90509250929050565b600080600060608486031215611271578081fd5b61127a846111cf565b9250611288602085016111cf565b9150604084013590509250925092565b600080600080608085870312156112ad578081fd5b6112b6856111cf565b93506112c4602086016111cf565b925060408501359150606085013567ffffffffffffffff8111156112e6578182fd5b8501601f810187136112f6578182fd5b61130587823560208401611159565b91505092959194509250565b60008060408385031215611323578182fd5b61132c836111cf565b915060208301358015158114611340578182fd5b809150509250929050565b6000806040838503121561135d578182fd5b611366836111cf565b946020939093013593505050565b600080600060608486031215611388578283fd5b611391846111cf565b925060208401359150604084013567ffffffffffffffff8111156113b3578182fd5b6113bf868287016111eb565b9150509250925092565b6000602082840312156113da578081fd5b813561120a8161167f565b6000602082840312156113f6578081fd5b815161120a8161167f565b600080600080600060a08688031215611418578081fd5b853567ffffffffffffffff8082111561142f578283fd5b61143b89838a016111eb565b96506020880135915080821115611450578283fd5b5061145d888289016111eb565b94505061146c604087016111cf565b9250606086013561ffff81168114611482578182fd5b949793965091946080013592915050565b6000602082840312156114a4578081fd5b5035919050565b60008151808452815b818110156114d0576020818501810151868301820152016114b4565b818111156114e15782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611529908301846114ab565b9695505050505050565b60208152600061120a60208301846114ab565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156115fc576115fc611653565b500190565b60008282101561161357611613611653565b500390565b600181811c9082168061162c57607f821691505b6020821081141561164d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b0319811681146106ee57600080fdfea2646970667358221220402158da80c02b774b61211b9afa6342a1a5a9d20ac945ec30ddf0d040dc1c4164736f6c63430008040033",er=function(e){function t(t){return e.call(this,$n,Qn,t)||this}return Yn(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface($n)},t.connect=function(e,t){return new a.b(e,$n,t)},t.bytecode=Qn,t.abi=$n,t}(a.c),tr=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],nr=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(tr)},e.connect=function(e,t){return new a.b(e,tr,t)},e.abi=tr}(),[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}]),rr=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(nr)},e.connect=function(e,t){return new a.b(e,nr,t)},e.abi=nr}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ar=[{inputs:[{internalType:"address[]",name:"payees",type:"address[]"},{internalType:"uint256[]",name:"shares_",type:"uint256[]"}],stateMutability:"payable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"shares",type:"uint256"}],name:"PayeeAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"from",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"PaymentReceived",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"PaymentReleased",type:"event"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"payee",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address payable",name:"account",type:"address"}],name:"release",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"released",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"shares",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalReleased",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalShares",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],ir="0x608060405260405162000b6a38038062000b6a8339810160408190526200002691620003db565b8051825114620000985760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620000eb5760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f2070617965657300000000000060448201526064016200008f565b60005b82518110156200016f576200015a8382815181106200011d57634e487b7160e01b600052603260045260246000fd5b60200260200101518383815181106200014657634e487b7160e01b600052603260045260246000fd5b60200260200101516200017860201b60201c565b8062000166816200052c565b915050620000ee565b50505062000576565b6001600160a01b038216620001e55760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b60648201526084016200008f565b60008111620002375760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a2073686172657320617265203000000060448201526064016200008f565b6001600160a01b03821660009081526002602052604090205415620002b35760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b60648201526084016200008f565b60048054600181019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0384169081179091556000908152600260205260408120829055546200031b90829062000511565b600055604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b600082601f83011262000375578081fd5b815160206200038e6200038883620004eb565b620004b8565b80838252828201915082860187848660051b8901011115620003ae578586fd5b855b85811015620003ce57815184529284019290840190600101620003b0565b5090979650505050505050565b60008060408385031215620003ee578182fd5b82516001600160401b038082111562000405578384fd5b818501915085601f83011262000419578384fd5b815160206200042c6200038883620004eb565b8083825282820191508286018a848660051b89010111156200044c578889fd5b8896505b84871015620004855780516001600160a01b03811681146200047057898afd5b83526001969096019591830191830162000450565b50918801519196509093505050808211156200049f578283fd5b50620004ae8582860162000364565b9150509250929050565b604051601f8201601f191681016001600160401b0381118282101715620004e357620004e362000560565b604052919050565b60006001600160401b0382111562000507576200050762000560565b5060051b60200190565b600082198211156200052757620005276200054a565b500190565b60006000198214156200054357620005436200054a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6105e480620005866000396000f3fe6080604052600436106100595760003560e01c806319165587146100a75780633a98ef39146100c95780638b83209b146100ed5780639852595c14610125578063ce7c2ac21461015b578063e33b7de314610191576100a2565b366100a2577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156100b357600080fd5b506100c76100c23660046104d7565b6101a6565b005b3480156100d557600080fd5b506000545b6040519081526020015b60405180910390f35b3480156100f957600080fd5b5061010d6101083660046104fa565b61037b565b6040516001600160a01b0390911681526020016100e4565b34801561013157600080fd5b506100da6101403660046104d7565b6001600160a01b031660009081526003602052604090205490565b34801561016757600080fd5b506100da6101763660046104d7565b6001600160a01b031660009081526002602052604090205490565b34801561019d57600080fd5b506001546100da565b6001600160a01b03811660009081526002602052604090205461021f5760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201526573686172657360d01b60648201526084015b60405180910390fd5b60006001544761022f9190610512565b6001600160a01b03831660009081526003602090815260408083205483546002909352908320549394509192610265908561054a565b61026f919061052a565b6102799190610569565b9050806102dc5760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201526a191d59481c185e5b595b9d60aa1b6064820152608401610216565b6001600160a01b038316600090815260036020526040902054610300908290610512565b6001600160a01b038416600090815260036020526040902055600154610327908290610512565b60015561033483826103b9565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b60006004828154811061039e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031692915050565b804710156104095760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610216565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610456576040519150601f19603f3d011682016040523d82523d6000602084013e61045b565b606091505b50509050806104d25760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610216565b505050565b6000602082840312156104e8578081fd5b81356104f381610596565b9392505050565b60006020828403121561050b578081fd5b5035919050565b6000821982111561052557610525610580565b500190565b60008261054557634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561056457610564610580565b500290565b60008282101561057b5761057b610580565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105ab57600080fd5b5056fea2646970667358221220fd47b4c67cba81d391f2a7510b725d33aab03c0d4da3265f86bffb2017e1ec8c64736f6c63430008030033",or=(function(e){function t(t){return e.call(this,ar,ir,t)||this}rr(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(ar)},t.connect=function(e,t){return new a.b(e,ar,t)},t.bytecode=ir,t.abi=ar}(a.c),[{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}]),sr=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(or)},e.connect=function(e,t){return new a.b(e,or,t)},e.abi=or}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ur=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"contract TransparentUpgradeableProxy",name:"proxy",type:"address"},{internalType:"address",name:"newAdmin",type:"address"}],name:"changeProxyAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract TransparentUpgradeableProxy",name:"proxy",type:"address"}],name:"getProxyAdmin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract TransparentUpgradeableProxy",name:"proxy",type:"address"}],name:"getProxyImplementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract TransparentUpgradeableProxy",name:"proxy",type:"address"},{internalType:"address",name:"implementation",type:"address"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract TransparentUpgradeableProxy",name:"proxy",type:"address"},{internalType:"address",name:"implementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeAndCall",outputs:[],stateMutability:"payable",type:"function"}],cr="0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6107198061007e6000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead146101645761007b565b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104d8565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610517565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461054f565b6102de565b34801561013057600080fd5b506100d161013f366004610517565b61036f565b34801561015057600080fd5b506100d161015f3660046104d8565b6103c7565b34801561017057600080fd5b506100a061017f3660046104d8565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d91906104fb565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610683565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610683565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610683565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610620565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610683565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610683565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104e9578081fd5b81356104f4816106ce565b9392505050565b60006020828403121561050c578081fd5b81516104f4816106ce565b60008060408385031215610529578081fd5b8235610534816106ce565b91506020830135610544816106ce565b809150509250929050565b600080600060608486031215610563578081fd5b833561056e816106ce565b9250602084013561057e816106ce565b9150604084013567ffffffffffffffff8082111561059a578283fd5b818601915086601f8301126105ad578283fd5b8135818111156105bf576105bf6106b8565b604051601f8201601f19908116603f011681019083821181831017156105e7576105e76106b8565b816040528281528960208487010111156105ff578586fd5b82602086016020830137856020848301015280955050505050509250925092565b600060018060a01b038416825260206040818401528351806040850152825b8181101561065b5785810183015185820160600152820161063f565b8181111561066c5783606083870101525b50601f01601f191692909201606001949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461045f57600080fdfea264697066735822122055d89c2449fb1dbc93789ed0dbadfb30c56205789c038ea1f880e9dc7291281964736f6c63430008030033",fr=(function(e){function t(t){return e.call(this,ur,cr,t)||this}sr(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(ur)},t.connect=function(e,t){return new a.b(e,ur,t)},t.bytecode=cr,t.abi=ur}(a.c),[{inputs:[{internalType:"address",name:"dest",type:"address"}],name:"payments",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address payable",name:"payee",type:"address"}],name:"withdrawPayments",outputs:[],stateMutability:"nonpayable",type:"function"}]),dr=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(fr)},e.connect=function(e,t){return new a.b(e,fr,t)},e.abi=fr}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),lr=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"product",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"}],name:"latestAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"attestation",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct PythStructs.UpgradeContract",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[],name:"pyth2WormholeChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"pyth2WormholeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"attestPrice",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"pa",type:"tuple"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyPythVM",outputs:[{internalType:"bool",name:"valid",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedPriceAttestation",type:"bytes"}],name:"parsePriceAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"pa",type:"tuple"}],stateMutability:"pure",type:"function"}],pr="0x608060405234801561001057600080fd5b50611d34806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806384acd1bb1161008c578063b172b22211610066578063b172b2221461022c578063d60b347f14610234578063f0a0de0c14610260578063fbe3c2cd1461027357600080fd5b806384acd1bb146101f2578063970994ab1461020d5780639a8a05921461022057600080fd5b80632d3b5b2b116100c85780632d3b5b2b1461014f5780633cb0031e1461016f57806343aac0901461018a5780634fdc60fa1461019c57600080fd5b806318e3ab1c146100ef57806325394645146101175780632c3c02a41461012c575b600080fd5b6101026100fd36600461175d565b610285565b60405190151581526020015b60405180910390f35b61012a61012536600461172b565b6102cb565b005b61010261013a3660046116e4565b60009081526005602052604090205460ff1690565b61016261015d36600461172b565b6103e8565b60405161010e9190611a28565b60035461ffff165b60405161ffff909116815260200161010e565b6004545b60405190815260200161010e565b6101af6101aa36600461172b565b61073d565b60405161010e91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6000546040516001600160a01b03909116815260200161010e565b61016261021b3660046116fc565b61088b565b60015461ffff16610177565b60025461018e565b6101026102423660046116b6565b6001600160a01b031660009081526006602052604090205460ff1690565b61016261026e36600461172b565b6109f0565b60015462010000900461ffff16610177565b600061029460035461ffff1690565b61ffff16826060015161ffff16146102ae57506000919050565b6004548260800151146102c357506000919050565b506001919050565b60008060006102d984610db3565b9250925092508181906103085760405162461bcd60e51b81526004016102ff9190611a15565b60405180910390fd5b5061032d8361014001516000908152600560205260409020805460ff19166001179055565b600061033c8460e0015161073d565b80519091506350797468146103825760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b60448201526064016102ff565b60015461ffff1661ffff16816040015161ffff16146103d45760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b60448201526064016102ff565b6103e18160600151610fd2565b5050505050565b6103f06113b5565b60008060006104076000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016104329190611a15565b60006040518083038186803b15801561044a57600080fd5b505afa15801561045e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610486919081019061187c565b9250925092508181906104ac5760405162461bcd60e51b81526004016102ff9190611a15565b506104b683610285565b6104f45760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b60448201526064016102ff565b60006105038460e001516109f0565b9050600061051982606001518360a0015161088b565b9050806101a001516001600160401b0316826101a001516001600160401b031611156107335760608201805160a084018051600092835260076020818152604080862060ff948516875282529485902088518154838b0151888c0151871666010000000000000266ff0000000000001961ffff9092166401000000000265ffffffffffff1990931663ffffffff948516179290921716178255965160018201556080890151600282015593516003808601805460c08c015160e08d015190930b909916600160481b9081026cffffffff0000000000000000001993870b6001600160401b0390811661010090810268ffffffffffffffffff199d8e16978b1697909717969096179490941617909155918a0151805160048801805483870151938b0151880b8516600160801b90810267ffffffffffffffff60801b19958a0b8716600160401b9081026fffffffffffffffffffffffffffffffff19948516968c0b891696909617959095178616179092556101208e0151805160058c0180549983015192909d01518a0b871690930290890b86168402979091169190970b841617949094171693909317909555610140880151600690940180546101608a01516101808b01516101a08c01518616600160501b0267ffffffffffffffff60501b199188169099021671ffffffffffffffffff0000000000000000001991909616909302971694909216939093179490941791909116171790555b5095945050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061076b83826110ff565b8252610778602082611c29565b9050610784838261115d565b60ff166020830152610797600182611c29565b9050816020015160ff166001146107f05760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520310000000000000060448201526064016102ff565b6107fa83826111b9565b61ffff16604083015261080e600282611c29565b905061081a83826110ff565b6001600160a01b03166060830152610833602082611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520320000000000000060448201526064016102ff565b50919050565b6108936113b5565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152600160481b91829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252600160401b8082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b96810196909652610120810195909552600601546001600160401b038082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b6109f86113b5565b6000610a048382611216565b63ffffffff168252610a17600482611c29565b9050816000015163ffffffff16635032574814610a695760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610a7383826111b9565b61ffff166020830152610a87600282611c29565b9050816020015161ffff16600114610ad45760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610ade838261115d565b60ff166040830152610af1600182611c29565b9050816040015160ff16600114610b455760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b610b4f83826110ff565b6060830152610b5f602082611c29565b9050610b6b83826110ff565b6080830152610b7b602082611c29565b9050610b87838261115d565b60ff1660a0830152610b9a600182611c29565b9050610ba68382611273565b600790810b900b60c0830152610bbd600882611c29565b9050610bc98382611216565b600390810b900b60e0830152610be0600482611c29565b9050610bec8382611273565b610100830151600791820b90910b9052610c07600882611c29565b9050610c138382611273565b610100830151600791820b90910b602090910152610c32600882611c29565b9050610c3e8382611273565b610100830151600791820b90910b604090910152610c5d600882611c29565b9050610c698382611273565b610120830151600791820b90910b9052610c84600882611c29565b9050610c908382611273565b610120830151600791820b90910b602090910152610caf600882611c29565b9050610cbb8382611273565b610120830151600791820b90910b604090910152610cda600882611c29565b9050610ce68382611273565b6001600160401b0316610140830152610d00600882611c29565b9050610d0c838261115d565b60ff16610160830152610d20600182611c29565b9050610d2c838261115d565b60ff16610180830152610d40600182611c29565b9050610d4c8382611273565b6001600160401b03166101a0830152610d66600882611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610e266000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610e519190611a15565b60006040518083038186803b158015610e6957600080fd5b505afa158015610e7d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ea5919081019061187c565b92509250925081610ebc5791945092509050610fcb565b60015462010000900461ffff1661ffff16836060015161ffff1614610f185750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610fcb565b600254836080015114610f6957505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610fcb565b61014083015160009081526005602052604090205460ff1615610fb057826000604051806060016040528060228152602001611cdd60229139955095509550505050610fcb565b50506040805160208101909152600081529093506001925090505b9193909250565b60006110057f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611010826112d0565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611053916119f9565b600060405180830381855af49150503d806000811461108e576040519150601f19603f3d011682016040523d82523d6000602084013e611093565b606091505b50915091508181906110b85760405162461bcd60e51b81526004016102ff9190611a15565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600061110c826020611c29565b835110156111545760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016102ff565b50016020015190565b600061116a826001611c29565b835110156111b05760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016102ff565b50016001015190565b60006111c6826002611c29565b8351101561120d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016102ff565b50016002015190565b6000611223826004611c29565b8351101561126a5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016102ff565b50016004015190565b6000611280826008611c29565b835110156112c75760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016102ff565b50016008015190565b6112d981611310565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6113745760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102ff565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b600082601f830112611464578081fd5b8135602061147961147483611bdf565b611baf565b80838252828201915082860187848660071b8901011115611498578586fd5b855b858110156114ff57608080838b0312156114b2578788fd5b6114ba611b64565b8335815286840135878201526040808501356114d581611ccd565b908201526060848101356114e881611ccd565b90820152855293850193919091019060010161149a565b5090979650505050505050565b600082601f83011261151c578081fd5b8151602061152c61147483611bdf565b80838252828201915082860187848660071b890101111561154b578586fd5b855b858110156114ff57608080838b031215611565578788fd5b61156d611b64565b83518152868401518782015260408085015161158881611ccd565b9082015260608481015161159b81611ccd565b90820152855293850193919091019060010161154d565b805180151581146115c257600080fd5b919050565b600082601f8301126115d7578081fd5b81356115e561147482611c02565b8181528460208386010111156115f9578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112611623578081fd5b815161163161147482611c02565b818152846020838601011115611645578283fd5b611656826020830160208701611c4d565b949350505050565b80356115c281611c93565b80516115c281611c93565b80356115c281611ca6565b80516115c281611ca6565b80356115c281611cb8565b80516115c281611cb8565b80356115c281611ccd565b80516115c281611ccd565b6000602082840312156116c7578081fd5b81356001600160a01b03811681146116dd578182fd5b9392505050565b6000602082840312156116f5578081fd5b5035919050565b6000806040838503121561170e578081fd5b82359150602083013561172081611ccd565b809150509250929050565b60006020828403121561173c578081fd5b81356001600160401b03811115611751578182fd5b611656848285016115c7565b60006020828403121561176e578081fd5b81356001600160401b0380821115611784578283fd5b908301906101608286031215611798578283fd5b6117a0611b8c565b6117a9836116a0565b81526117b760208401611674565b60208201526117c860408401611674565b60408201526117d96060840161165e565b6060820152608083013560808201526117f460a0840161168a565b60a082015261180560c084016116a0565b60c082015260e08301358281111561181b578485fd5b611827878286016115c7565b60e08301525061010061183b818501611674565b908201526101208381013583811115611852578586fd5b61185e88828701611454565b91830191909152506101409283013592810192909252509392505050565b600080600060608486031215611890578081fd5b83516001600160401b03808211156118a6578283fd5b9085019061016082880312156118ba578283fd5b6118c2611b8c565b6118cb836116ab565b81526118d96020840161167f565b60208201526118ea6040840161167f565b60408201526118fb60608401611669565b60608201526080830151608082015261191660a08401611695565b60a082015261192760c084016116ab565b60c082015260e08301518281111561193d578485fd5b61194989828601611613565b60e08301525061010061195d81850161167f565b908201526101208381015183811115611974578586fd5b6119808a82870161150c565b9183019190915250610140838101519082015294506119a1602087016115b2565b935060408601519150808211156119b6578283fd5b506119c386828701611613565b9150509250925092565b600081518084526119e5816020860160208601611c4d565b601f01601f19169290920160200192915050565b60008251611a0b818460208701611c4d565b9190910192915050565b6020815260006116dd60208301846119cd565b815163ffffffff16815261024081016020830151611a4c602084018261ffff169052565b506040830151611a61604084018260ff169052565b50606083015160608301526080830151608083015260a0830151611a8a60a084018260ff169052565b5060c0830151611a9f60c084018260070b9052565b5060e0830151611ab460e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b6101408501525050610120830151610160611b1881850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b6101408501516001600160401b039081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b604051608081016001600160401b0381118282101715611b8657611b86611c7d565b60405290565b60405161016081016001600160401b0381118282101715611b8657611b86611c7d565b604051601f8201601f191681016001600160401b0381118282101715611bd757611bd7611c7d565b604052919050565b60006001600160401b03821115611bf857611bf8611c7d565b5060051b60200190565b60006001600160401b03821115611c1b57611c1b611c7d565b50601f01601f191660200190565b60008219821115611c4857634e487b7160e01b81526011600452602481fd5b500190565b60005b83811015611c68578181015183820152602001611c50565b83811115611c77576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff81168114611ca357600080fd5b50565b63ffffffff81168114611ca357600080fd5b6001600160401b0381168114611ca357600080fd5b60ff81168114611ca357600080fdfe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220bc3e79776b99f2c8176f773466b4cc3831615634837880168a40f25c759d0b9b64736f6c63430008040033",br=(function(e){function t(t){return e.call(this,lr,pr,t)||this}dr(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(lr)},t.connect=function(e,t){return new a.b(e,lr,t)},t.bytecode=pr,t.abi=lr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),hr=[{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"bytes",name:"initData",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],yr="0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122053fad7d73ac14ca89bd1b14cef0273109fd66529c0a6215e0cabdc255813dc5064736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",mr=(function(e){function t(t){return e.call(this,hr,yr,t)||this}br(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(hr)},t.connect=function(e,t){return new a.b(e,hr,t)},t.bytecode=yr,t.abi=hr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),vr=[{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"pyth2WormholeChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"pyth2WormholeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"product",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"}],name:"latestAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"attestation",type:"tuple"}],stateMutability:"view",type:"function"}],gr="0x608060405234801561001057600080fd5b50610582806100206000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063970994ab11610066578063970994ab146101185780639a8a059214610138578063b172b22214610144578063d60b347f1461014c578063fbe3c2cd1461017857600080fd5b80632c3c02a4146100985780633cb0031e146100d057806343aac090146100eb57806384acd1bb146100fd575b600080fd5b6100bb6100a63660046103c3565b60009081526005602052604090205460ff1690565b60405190151581526020015b60405180910390f35b60035461ffff165b60405161ffff90911681526020016100c7565b6004545b6040519081526020016100c7565b6000546040516001600160a01b0390911681526020016100c7565b61012b6101263660046103db565b61018a565b6040516100c7919061040f565b60015461ffff166100d8565b6002546100ef565b6100bb61015a366004610395565b6001600160a01b031660009081526006602052604090205460ff1690565b60015462010000900461ffff166100d8565b61022c604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152690100000000000000000091829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252680100000000000000008082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b968101969096526101208101959095526006015467ffffffffffffffff8082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b6000602082840312156103a6578081fd5b81356001600160a01b03811681146103bc578182fd5b9392505050565b6000602082840312156103d4578081fd5b5035919050565b600080604083850312156103ed578081fd5b82359150602083013560ff81168114610404578182fd5b809150509250929050565b815163ffffffff16815261024081016020830151610433602084018261ffff169052565b506040830151610448604084018260ff169052565b50606083015160608301526080830151608083015260a083015161047160a084018260ff169052565b5060c083015161048660c084018260070b9052565b5060e083015161049b60e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b61014085015250506101208301516101606104ff81850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b61014085015167ffffffffffffffff9081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a0909401519093166102209092019190915291905056fea2646970667358221220427410f6ce5dea2533daa2b7bcefb3c919f305057f6990b6b61c5296c4920f6364736f6c63430008040033",wr=(function(e){function t(t){return e.call(this,vr,gr,t)||this}mr(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(vr)},t.connect=function(e,t){return new a.b(e,vr,t)},t.bytecode=gr,t.abi=vr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Tr=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"product",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"}],name:"latestAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"attestation",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"pyth2WormholeChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"pyth2WormholeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct PythStructs.UpgradeContract",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"}],kr="0x608060405234801561001057600080fd5b50611291806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806384acd1bb1161007157806384acd1bb1461017e578063970994ab146101995780639a8a0592146101b9578063b172b222146101c5578063d60b347f146101cd578063fbe3c2cd146101f957600080fd5b806325394645146100ae5780632c3c02a4146100c35780633cb0031e146100fb57806343aac090146101165780634fdc60fa14610128575b600080fd5b6100c16100bc366004610db9565b61020b565b005b6100e66100d1366004610d72565b60009081526005602052604090205460ff1690565b60405190151581526020015b60405180910390f35b60035461ffff165b60405161ffff90911681526020016100f2565b6004545b6040519081526020016100f2565b61013b610136366004610db9565b610328565b6040516100f291908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6000546040516001600160a01b0390911681526020016100f2565b6101ac6101a7366004610d8a565b610476565b6040516100f29190610fda565b60015461ffff16610103565b60025461011a565b6100e66101db366004610d44565b6001600160a01b031660009081526006602052604090205460ff1690565b60015462010000900461ffff16610103565b600080600061021984610681565b9250925092508181906102485760405162461bcd60e51b815260040161023f9190610fc7565b60405180910390fd5b5061026d8361014001516000908152600560205260409020805460ff19166001179055565b600061027c8460e00151610328565b80519091506350797468146102c25760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b604482015260640161023f565b60015461ffff1661ffff16816040015161ffff16146103145760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640161023f565b61032181606001516108a0565b5050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061035683826109cd565b82526103636020826111bd565b905061036f8382610a2b565b60ff1660208301526103826001826111bd565b9050816020015160ff166001146103db5760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e747261637455706772616465203100000000000000604482015260640161023f565b6103e58382610a87565b61ffff1660408301526103f96002826111bd565b905061040583826109cd565b6001600160a01b0316606083015261041e6020826111bd565b9050808351146104705760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e747261637455706772616465203200000000000000604482015260640161023f565b50919050565b610518604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152690100000000000000000091829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252680100000000000000008082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b968101969096526101208101959095526006015467ffffffffffffffff8082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820181905261010082018390526101208201526101408101919091526000606060008060006106f46000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b815260040161071f9190610fc7565b60006040518083038186803b15801561073757600080fd5b505afa15801561074b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107739190810190610e2d565b9250925092508161078a5791945092509050610899565b60015462010000900461ffff1661ffff16836060015161ffff16146107e65750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610899565b60025483608001511461083757505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610899565b61014083015160009081526005602052604090205460ff161561087e5782600060405180606001604052806022815260200161123a60229139955095509550505050610899565b50506040805160208101909152600081529093506001925090505b9193909250565b60006108d37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506108de82610ae4565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169161092191610fab565b600060405180830381855af49150503d806000811461095c576040519150601f19603f3d011682016040523d82523d6000602084013e610961565b606091505b50915091508181906109865760405162461bcd60e51b815260040161023f9190610fc7565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b60006109da8260206111bd565b83511015610a225760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640161023f565b50016020015190565b6000610a388260016111bd565b83511015610a7e5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640161023f565b50016001015190565b6000610a948260026111bd565b83511015610adb5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640161023f565b50016002015190565b610aed81610b24565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610b885760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161023f565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b600082601f830112610bd9578081fd5b8151602067ffffffffffffffff821115610bf557610bf5611211565b610c03818360051b01611164565b80838252828201915082860187848660071b8901011115610c22578586fd5b855b85811015610c8957608080838b031215610c3c578788fd5b610c44611117565b835181528684015187820152604080850151610c5f81611227565b90820152606084810151610c7281611227565b908201528552938501939190910190600101610c24565b5090979650505050505050565b80518015158114610ca657600080fd5b919050565b600082601f830112610cbb578081fd5b8151610cce610cc982611195565b611164565b818152846020838601011115610ce2578283fd5b610cf38260208301602087016111e1565b949350505050565b805161ffff81168114610ca657600080fd5b805163ffffffff81168114610ca657600080fd5b805167ffffffffffffffff81168114610ca657600080fd5b8051610ca681611227565b600060208284031215610d55578081fd5b81356001600160a01b0381168114610d6b578182fd5b9392505050565b600060208284031215610d83578081fd5b5035919050565b60008060408385031215610d9c578081fd5b823591506020830135610dae81611227565b809150509250929050565b600060208284031215610dca578081fd5b813567ffffffffffffffff811115610de0578182fd5b8201601f81018413610df0578182fd5b8035610dfe610cc982611195565b818152856020838501011115610e12578384fd5b81602084016020830137908101602001929092525092915050565b600080600060608486031215610e41578081fd5b835167ffffffffffffffff80821115610e58578283fd5b908501906101608288031215610e6c578283fd5b610e74611140565b610e7d83610d39565b8152610e8b60208401610d0d565b6020820152610e9c60408401610d0d565b6040820152610ead60608401610cfb565b606082015260808301516080820152610ec860a08401610d21565b60a0820152610ed960c08401610d39565b60c082015260e083015182811115610eef578485fd5b610efb89828601610cab565b60e083015250610100610f0f818501610d0d565b908201526101208381015183811115610f26578586fd5b610f328a828701610bc9565b918301919091525061014083810151908201529450610f5360208701610c96565b93506040860151915080821115610f68578283fd5b50610f7586828701610cab565b9150509250925092565b60008151808452610f978160208601602086016111e1565b601f01601f19169290920160200192915050565b60008251610fbd8184602087016111e1565b9190910192915050565b602081526000610d6b6020830184610f7f565b815163ffffffff16815261024081016020830151610ffe602084018261ffff169052565b506040830151611013604084018260ff169052565b50606083015160608301526080830151608083015260a083015161103c60a084018260ff169052565b5060c083015161105160c084018260070b9052565b5060e083015161106660e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b61014085015250506101208301516101606110ca81850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b61014085015167ffffffffffffffff9081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b6040516080810167ffffffffffffffff8111828210171561113a5761113a611211565b60405290565b604051610160810167ffffffffffffffff8111828210171561113a5761113a611211565b604051601f8201601f1916810167ffffffffffffffff8111828210171561118d5761118d611211565b604052919050565b600067ffffffffffffffff8211156111af576111af611211565b50601f01601f191660200190565b600082198211156111dc57634e487b7160e01b81526011600452602481fd5b500190565b60005b838110156111fc5781810151838201526020016111e4565b8381111561120b576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b60ff8116811461123657600080fd5b5056fe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220898d65b7f1e50a3c7c8c6cd9bba77ff84fc9589eb5975b63f089e830cab5f7e264736f6c63430008040033",_r=(function(e){function t(t){return e.call(this,Tr,kr,t)||this}wr(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Tr)},t.connect=function(e,t){return new a.b(e,Tr,t)},t.bytecode=kr,t.abi=Tr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Or=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldContract",type:"address"},{indexed:!0,internalType:"address",name:"newContract",type:"address"}],name:"ContractUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"bytes",name:"encodedVm",type:"bytes"}],name:"attestPrice",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"pa",type:"tuple"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"governanceActionIsConsumed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"governanceContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"impl",type:"address"}],name:"isInitialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"product",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"}],name:"latestAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"attestation",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedUpgrade",type:"bytes"}],name:"parseContractUpgrade",outputs:[{components:[{internalType:"bytes32",name:"module",type:"bytes32"},{internalType:"uint8",name:"action",type:"uint8"},{internalType:"uint16",name:"chain",type:"uint16"},{internalType:"address",name:"newContract",type:"address"}],internalType:"struct PythStructs.UpgradeContract",name:"cu",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"encodedPriceAttestation",type:"bytes"}],name:"parsePriceAttestation",outputs:[{components:[{internalType:"uint32",name:"magic",type:"uint32"},{internalType:"uint16",name:"version",type:"uint16"},{internalType:"uint8",name:"payloadId",type:"uint8"},{internalType:"bytes32",name:"productId",type:"bytes32"},{internalType:"bytes32",name:"priceId",type:"bytes32"},{internalType:"uint8",name:"priceType",type:"uint8"},{internalType:"int64",name:"price",type:"int64"},{internalType:"int32",name:"exponent",type:"int32"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twap",type:"tuple"},{components:[{internalType:"int64",name:"value",type:"int64"},{internalType:"int64",name:"numerator",type:"int64"},{internalType:"int64",name:"denominator",type:"int64"}],internalType:"struct PythStructs.Ema",name:"twac",type:"tuple"},{internalType:"uint64",name:"confidenceInterval",type:"uint64"},{internalType:"uint8",name:"status",type:"uint8"},{internalType:"uint8",name:"corpAct",type:"uint8"},{internalType:"uint64",name:"timestamp",type:"uint64"}],internalType:"struct PythStructs.PriceAttestation",name:"pa",type:"tuple"}],stateMutability:"pure",type:"function"},{inputs:[],name:"pyth2WormholeChainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"pyth2WormholeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"encodedVM",type:"bytes"}],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint8",name:"version",type:"uint8"},{internalType:"uint32",name:"timestamp",type:"uint32"},{internalType:"uint32",name:"nonce",type:"uint32"},{internalType:"uint16",name:"emitterChainId",type:"uint16"},{internalType:"bytes32",name:"emitterAddress",type:"bytes32"},{internalType:"uint64",name:"sequence",type:"uint64"},{internalType:"uint8",name:"consistencyLevel",type:"uint8"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"uint32",name:"guardianSetIndex",type:"uint32"},{components:[{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"uint8",name:"guardianIndex",type:"uint8"}],internalType:"struct Structs.Signature[]",name:"signatures",type:"tuple[]"},{internalType:"bytes32",name:"hash",type:"bytes32"}],internalType:"struct Structs.VM",name:"vm",type:"tuple"}],name:"verifyPythVM",outputs:[{internalType:"bool",name:"valid",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"wormhole",outputs:[{internalType:"contract IWormhole",name:"",type:"address"}],stateMutability:"view",type:"function"}],Sr="0x608060405234801561001057600080fd5b50611d34806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806384acd1bb1161008c578063b172b22211610066578063b172b2221461022c578063d60b347f14610234578063f0a0de0c14610260578063fbe3c2cd1461027357600080fd5b806384acd1bb146101f2578063970994ab1461020d5780639a8a05921461022057600080fd5b80632d3b5b2b116100c85780632d3b5b2b1461014f5780633cb0031e1461016f57806343aac0901461018a5780634fdc60fa1461019c57600080fd5b806318e3ab1c146100ef57806325394645146101175780632c3c02a41461012c575b600080fd5b6101026100fd36600461175d565b610285565b60405190151581526020015b60405180910390f35b61012a61012536600461172b565b6102cb565b005b61010261013a3660046116e4565b60009081526005602052604090205460ff1690565b61016261015d36600461172b565b6103e8565b60405161010e9190611a28565b60035461ffff165b60405161ffff909116815260200161010e565b6004545b60405190815260200161010e565b6101af6101aa36600461172b565b61073d565b60405161010e91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6000546040516001600160a01b03909116815260200161010e565b61016261021b3660046116fc565b61088b565b60015461ffff16610177565b60025461018e565b6101026102423660046116b6565b6001600160a01b031660009081526006602052604090205460ff1690565b61016261026e36600461172b565b6109f0565b60015462010000900461ffff16610177565b600061029460035461ffff1690565b61ffff16826060015161ffff16146102ae57506000919050565b6004548260800151146102c357506000919050565b506001919050565b60008060006102d984610db3565b9250925092508181906103085760405162461bcd60e51b81526004016102ff9190611a15565b60405180910390fd5b5061032d8361014001516000908152600560205260409020805460ff19166001179055565b600061033c8460e0015161073d565b80519091506350797468146103825760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b60448201526064016102ff565b60015461ffff1661ffff16816040015161ffff16146103d45760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b60448201526064016102ff565b6103e18160600151610fd2565b5050505050565b6103f06113b5565b60008060006104076000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016104329190611a15565b60006040518083038186803b15801561044a57600080fd5b505afa15801561045e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610486919081019061187c565b9250925092508181906104ac5760405162461bcd60e51b81526004016102ff9190611a15565b506104b683610285565b6104f45760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b60448201526064016102ff565b60006105038460e001516109f0565b9050600061051982606001518360a0015161088b565b9050806101a001516001600160401b0316826101a001516001600160401b031611156107335760608201805160a084018051600092835260076020818152604080862060ff948516875282529485902088518154838b0151888c0151871666010000000000000266ff0000000000001961ffff9092166401000000000265ffffffffffff1990931663ffffffff948516179290921716178255965160018201556080890151600282015593516003808601805460c08c015160e08d015190930b909916600160481b9081026cffffffff0000000000000000001993870b6001600160401b0390811661010090810268ffffffffffffffffff199d8e16978b1697909717969096179490941617909155918a0151805160048801805483870151938b0151880b8516600160801b90810267ffffffffffffffff60801b19958a0b8716600160401b9081026fffffffffffffffffffffffffffffffff19948516968c0b891696909617959095178616179092556101208e0151805160058c0180549983015192909d01518a0b871690930290890b86168402979091169190970b841617949094171693909317909555610140880151600690940180546101608a01516101808b01516101a08c01518616600160501b0267ffffffffffffffff60501b199188169099021671ffffffffffffffffff0000000000000000001991909616909302971694909216939093179490941791909116171790555b5095945050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061076b83826110ff565b8252610778602082611c29565b9050610784838261115d565b60ff166020830152610797600182611c29565b9050816020015160ff166001146107f05760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520310000000000000060448201526064016102ff565b6107fa83826111b9565b61ffff16604083015261080e600282611c29565b905061081a83826110ff565b6001600160a01b03166060830152610833602082611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520320000000000000060448201526064016102ff565b50919050565b6108936113b5565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152600160481b91829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252600160401b8082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b96810196909652610120810195909552600601546001600160401b038082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b6109f86113b5565b6000610a048382611216565b63ffffffff168252610a17600482611c29565b9050816000015163ffffffff16635032574814610a695760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610a7383826111b9565b61ffff166020830152610a87600282611c29565b9050816020015161ffff16600114610ad45760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610ade838261115d565b60ff166040830152610af1600182611c29565b9050816040015160ff16600114610b455760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b610b4f83826110ff565b6060830152610b5f602082611c29565b9050610b6b83826110ff565b6080830152610b7b602082611c29565b9050610b87838261115d565b60ff1660a0830152610b9a600182611c29565b9050610ba68382611273565b600790810b900b60c0830152610bbd600882611c29565b9050610bc98382611216565b600390810b900b60e0830152610be0600482611c29565b9050610bec8382611273565b610100830151600791820b90910b9052610c07600882611c29565b9050610c138382611273565b610100830151600791820b90910b602090910152610c32600882611c29565b9050610c3e8382611273565b610100830151600791820b90910b604090910152610c5d600882611c29565b9050610c698382611273565b610120830151600791820b90910b9052610c84600882611c29565b9050610c908382611273565b610120830151600791820b90910b602090910152610caf600882611c29565b9050610cbb8382611273565b610120830151600791820b90910b604090910152610cda600882611c29565b9050610ce68382611273565b6001600160401b0316610140830152610d00600882611c29565b9050610d0c838261115d565b60ff16610160830152610d20600182611c29565b9050610d2c838261115d565b60ff16610180830152610d40600182611c29565b9050610d4c8382611273565b6001600160401b03166101a0830152610d66600882611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610e266000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610e519190611a15565b60006040518083038186803b158015610e6957600080fd5b505afa158015610e7d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ea5919081019061187c565b92509250925081610ebc5791945092509050610fcb565b60015462010000900461ffff1661ffff16836060015161ffff1614610f185750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610fcb565b600254836080015114610f6957505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610fcb565b61014083015160009081526005602052604090205460ff1615610fb057826000604051806060016040528060228152602001611cdd60229139955095509550505050610fcb565b50506040805160208101909152600081529093506001925090505b9193909250565b60006110057f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611010826112d0565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611053916119f9565b600060405180830381855af49150503d806000811461108e576040519150601f19603f3d011682016040523d82523d6000602084013e611093565b606091505b50915091508181906110b85760405162461bcd60e51b81526004016102ff9190611a15565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600061110c826020611c29565b835110156111545760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016102ff565b50016020015190565b600061116a826001611c29565b835110156111b05760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016102ff565b50016001015190565b60006111c6826002611c29565b8351101561120d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016102ff565b50016002015190565b6000611223826004611c29565b8351101561126a5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016102ff565b50016004015190565b6000611280826008611c29565b835110156112c75760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016102ff565b50016008015190565b6112d981611310565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6113745760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102ff565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b600082601f830112611464578081fd5b8135602061147961147483611bdf565b611baf565b80838252828201915082860187848660071b8901011115611498578586fd5b855b858110156114ff57608080838b0312156114b2578788fd5b6114ba611b64565b8335815286840135878201526040808501356114d581611ccd565b908201526060848101356114e881611ccd565b90820152855293850193919091019060010161149a565b5090979650505050505050565b600082601f83011261151c578081fd5b8151602061152c61147483611bdf565b80838252828201915082860187848660071b890101111561154b578586fd5b855b858110156114ff57608080838b031215611565578788fd5b61156d611b64565b83518152868401518782015260408085015161158881611ccd565b9082015260608481015161159b81611ccd565b90820152855293850193919091019060010161154d565b805180151581146115c257600080fd5b919050565b600082601f8301126115d7578081fd5b81356115e561147482611c02565b8181528460208386010111156115f9578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112611623578081fd5b815161163161147482611c02565b818152846020838601011115611645578283fd5b611656826020830160208701611c4d565b949350505050565b80356115c281611c93565b80516115c281611c93565b80356115c281611ca6565b80516115c281611ca6565b80356115c281611cb8565b80516115c281611cb8565b80356115c281611ccd565b80516115c281611ccd565b6000602082840312156116c7578081fd5b81356001600160a01b03811681146116dd578182fd5b9392505050565b6000602082840312156116f5578081fd5b5035919050565b6000806040838503121561170e578081fd5b82359150602083013561172081611ccd565b809150509250929050565b60006020828403121561173c578081fd5b81356001600160401b03811115611751578182fd5b611656848285016115c7565b60006020828403121561176e578081fd5b81356001600160401b0380821115611784578283fd5b908301906101608286031215611798578283fd5b6117a0611b8c565b6117a9836116a0565b81526117b760208401611674565b60208201526117c860408401611674565b60408201526117d96060840161165e565b6060820152608083013560808201526117f460a0840161168a565b60a082015261180560c084016116a0565b60c082015260e08301358281111561181b578485fd5b611827878286016115c7565b60e08301525061010061183b818501611674565b908201526101208381013583811115611852578586fd5b61185e88828701611454565b91830191909152506101409283013592810192909252509392505050565b600080600060608486031215611890578081fd5b83516001600160401b03808211156118a6578283fd5b9085019061016082880312156118ba578283fd5b6118c2611b8c565b6118cb836116ab565b81526118d96020840161167f565b60208201526118ea6040840161167f565b60408201526118fb60608401611669565b60608201526080830151608082015261191660a08401611695565b60a082015261192760c084016116ab565b60c082015260e08301518281111561193d578485fd5b61194989828601611613565b60e08301525061010061195d81850161167f565b908201526101208381015183811115611974578586fd5b6119808a82870161150c565b9183019190915250610140838101519082015294506119a1602087016115b2565b935060408601519150808211156119b6578283fd5b506119c386828701611613565b9150509250925092565b600081518084526119e5816020860160208601611c4d565b601f01601f19169290920160200192915050565b60008251611a0b818460208701611c4d565b9190910192915050565b6020815260006116dd60208301846119cd565b815163ffffffff16815261024081016020830151611a4c602084018261ffff169052565b506040830151611a61604084018260ff169052565b50606083015160608301526080830151608083015260a0830151611a8a60a084018260ff169052565b5060c0830151611a9f60c084018260070b9052565b5060e0830151611ab460e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b6101408501525050610120830151610160611b1881850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b6101408501516001600160401b039081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b604051608081016001600160401b0381118282101715611b8657611b86611c7d565b60405290565b60405161016081016001600160401b0381118282101715611b8657611b86611c7d565b604051601f8201601f191681016001600160401b0381118282101715611bd757611bd7611c7d565b604052919050565b60006001600160401b03821115611bf857611bf8611c7d565b5060051b60200190565b60006001600160401b03821115611c1b57611c1b611c7d565b50601f01601f191660200190565b60008219821115611c4857634e487b7160e01b81526011600452602481fd5b500190565b60005b83811015611c68578181015183820152602001611c50565b83811115611c77576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff81168114611ca357600080fd5b50565b63ffffffff81168114611ca357600080fd5b6001600160401b0381168114611ca357600080fd5b60ff81168114611ca357600080fdfe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220137b0e0f9e2c8b62b5cb38ca79b86a3c635c93ba31ee647e94a2f378a16f303364736f6c63430008040033",xr=(function(e){function t(t){return e.call(this,Or,Sr,t)||this}_r(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Or)},t.connect=function(e,t){return new a.b(e,Or,t)},t.bytecode=Sr,t.abi=Or}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Ar=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"address",name:"wormhole",type:"address"},{internalType:"uint16",name:"governanceChainId",type:"uint16"},{internalType:"bytes32",name:"governanceContract",type:"bytes32"},{internalType:"uint16",name:"pyth2WormholeChainId",type:"uint16"},{internalType:"bytes32",name:"pyth2WormholeContract",type:"bytes32"}],name:"setup",outputs:[],stateMutability:"nonpayable",type:"function"}],Mr="0x608060405234801561001057600080fd5b50610276806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063129acf8d14610030575b600080fd5b61004361003e3660046101c9565b610045565b005b60018054600080546001600160a01b0389166001600160a01b031990911617905561ffff868116620100000263ffffffff199092169089161717905560028390556003805461ffff191661ffff84161790556100a081600455565b6100a9876100b2565b50505050505050565b6100bb816100f2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b61015a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146101b257600080fd5b919050565b803561ffff811681146101b257600080fd5b600080600080600080600060e0888a0312156101e3578283fd5b6101ec8861019b565b96506101fa602089016101b7565b95506102086040890161019b565b9450610216606089016101b7565b93506080880135925061022b60a089016101b7565b915060c088013590509295989194975092955056fea2646970667358221220e87375c0b2c6f061ee0ec12dcca76ab0174d0ac62b0470eed5524f498e6348e964736f6c63430008040033",Er=(function(e){function t(t){return e.call(this,Ar,Mr,t)||this}xr(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Ar)},t.connect=function(e,t){return new a.b(e,Ar,t)},t.bytecode=Mr,t.abi=Ar}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Pr=[{inputs:[{internalType:"address payable",name:"beneficiary_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"payee",type:"address"},{indexed:!1,internalType:"uint256",name:"weiAmount",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"RefundsClosed",type:"event"},{anonymous:!1,inputs:[],name:"RefundsEnabled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"payee",type:"address"},{indexed:!1,internalType:"uint256",name:"weiAmount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[],name:"beneficiary",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"beneficiaryWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"close",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"refundee",type:"address"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"payee",type:"address"}],name:"depositsOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"enableRefunds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"state",outputs:[{internalType:"enum RefundEscrow.State",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"payee",type:"address"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"withdrawalAllowed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],jr="0x60a060405234801561001057600080fd5b50604051610c17380380610c1783398101604081905261002f91610117565b610038336100c7565b6001600160a01b0381166100a85760405162461bcd60e51b815260206004820152602d60248201527f526566756e64457363726f773a2062656e65666963696172792069732074686560448201526c207a65726f206164647265737360981b606482015260840160405180910390fd5b60601b6001600160601b0319166080526002805460ff19169055610145565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610128578081fd5b81516001600160a01b038116811461013e578182fd5b9392505050565b60805160601c610aae6101696000396000818160bb01526105cf0152610aae6000f3fe6080604052600436106100a75760003560e01c80638da5cb5b116100645780638da5cb5b146101895780639af6549a146101a7578063c19d93fb146101bc578063e3a9db1a146101dc578063f2fde38b14610220578063f340fa0114610240576100a7565b806338af3eed146100ac57806343d726d6146100f857806351cff8d91461010f578063685ca1941461012f578063715018a61461015f5780638c52dc4114610174575b600080fd5b3480156100b857600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b34801561010457600080fd5b5061010d610253565b005b34801561011b57600080fd5b5061010d61012a3660046109bf565b610349565b34801561013b57600080fd5b5061014f61014a3660046109bf565b6103c6565b60405190151581526020016100ef565b34801561016b57600080fd5b5061010d6103fc565b34801561018057600080fd5b5061010d610432565b34801561019557600080fd5b506000546001600160a01b03166100db565b3480156101b357600080fd5b5061010d610529565b3480156101c857600080fd5b5060025460ff166040516100ef91906109e2565b3480156101e857600080fd5b506102126101f73660046109bf565b6001600160a01b031660009081526001602052604090205490565b6040519081526020016100ef565b34801561022c57600080fd5b5061010d61023b3660046109bf565b6105f5565b61010d61024e3660046109bf565b61068d565b6000546001600160a01b031633146102865760405162461bcd60e51b815260040161027d90610a0a565b60405180910390fd5b600061029460025460ff1690565b60028111156102b357634e487b7160e01b600052602160045260246000fd5b146103125760405162461bcd60e51b815260206004820152602960248201527f526566756e64457363726f773a2063616e206f6e6c7920636c6f7365207768696044820152686c652061637469766560b81b606482015260840161027d565b6002805460ff1916811790556040517f088672c3a6e342f7cd94a65ba63b79df24a8973927b4d05d803c44bbf787d12f90600090a1565b610352816103c6565b6103ba5760405162461bcd60e51b815260206004820152603360248201527f436f6e646974696f6e616c457363726f773a207061796565206973206e6f7420604482015272616c6c6f77656420746f20776974686472617760681b606482015260840161027d565b6103c381610724565b50565b600060016103d660025460ff1690565b60028111156103f557634e487b7160e01b600052602160045260246000fd5b1492915050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161027d90610a0a565b61043060006107bd565b565b6000546001600160a01b0316331461045c5760405162461bcd60e51b815260040161027d90610a0a565b600061046a60025460ff1690565b600281111561048957634e487b7160e01b600052602160045260246000fd5b146104f15760405162461bcd60e51b815260206004820152603260248201527f526566756e64457363726f773a2063616e206f6e6c7920656e61626c6520726560448201527166756e6473207768696c652061637469766560701b606482015260840161027d565b6002805460ff191660011790556040517f599d8e5a83cffb867d051598c4d70e805d59802d8081c1c7d6dffc5b6aca2b8990600090a1565b6002805460ff16600281111561054f57634e487b7160e01b600052602160045260246000fd5b146105c25760405162461bcd60e51b815260206004820152603860248201527f526566756e64457363726f773a2062656e65666963696172792063616e206f6e60448201527f6c79207769746864726177207768696c6520636c6f7365640000000000000000606482015260840161027d565b6104306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000164761080d565b6000546001600160a01b0316331461061f5760405162461bcd60e51b815260040161027d90610a0a565b6001600160a01b0381166106845760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161027d565b6103c3816107bd565b600061069b60025460ff1690565b60028111156106ba57634e487b7160e01b600052602160045260246000fd5b1461071b5760405162461bcd60e51b815260206004820152602b60248201527f526566756e64457363726f773a2063616e206f6e6c79206465706f736974207760448201526a68696c652061637469766560a81b606482015260840161027d565b6103c38161092b565b6000546001600160a01b0316331461074e5760405162461bcd60e51b815260040161027d90610a0a565b6001600160a01b0381166000818152600160205260408120805491905590610776908261080d565b816001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516107b191815260200190565b60405180910390a25050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8047101561085d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161027d565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146108aa576040519150601f19603f3d011682016040523d82523d6000602084013e6108af565b606091505b50509050806109265760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161027d565b505050565b6000546001600160a01b031633146109555760405162461bcd60e51b815260040161027d90610a0a565b6001600160a01b03811660009081526001602052604081208054349283929161097f908490610a3f565b90915550506040518181526001600160a01b038316907f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4906020016107b1565b6000602082840312156109d0578081fd5b81356109db81610a63565b9392505050565b6020810160038310610a0457634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610a5e57634e487b7160e01b81526011600452602481fd5b500190565b6001600160a01b03811681146103c357600080fdfea2646970667358221220fcf0fd8037f372c1eae94dba60e7f9dc6b92aaa5db82e6051e33f045d837612c64736f6c63430008030033",Ir=(function(e){function t(t){return e.call(this,Pr,jr,t)||this}Er(t,e),t.prototype.deploy=function(t,n){return e.prototype.deploy.call(this,t,n||{})},t.prototype.getDeployTransaction=function(t,n){return e.prototype.getDeployTransaction.call(this,t,n||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Pr)},t.connect=function(e,t){return new a.b(e,Pr,t)},t.bytecode=jr,t.abi=Pr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Cr=[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"address[]",name:"initialGuardians",type:"address[]"},{internalType:"uint16",name:"chainId",type:"uint16"},{internalType:"uint16",name:"governanceChainId",type:"uint16"},{internalType:"bytes32",name:"governanceContract",type:"bytes32"}],name:"setup",outputs:[],stateMutability:"nonpayable",type:"function"}],Rr="0x608060405234801561001057600080fd5b5061041a806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806334a5fcd414610030575b600080fd5b61004361003e3660046102cb565b610045565b005b60008451116100945760405162461bcd60e51b81526020600482015260166024820152751b9bc819dd585c991a585b9cc81cdc1958da599a595960521b60448201526064015b60405180910390fd5b604080518082019091528481526000602082018190526100b59082906100ea565b6000805461ffff858116620100000263ffffffff199092169087161717905560018290556100e28661013e565b505050505050565b63ffffffff81166000908152600260209081526040909120835180518593610116928492910190610223565b50602091909101516001909101805463ffffffff191663ffffffff9092169190911790555050565b6101478161017e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6101e25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161008b565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b828054828255906000526020600020908101928215610278579160200282015b8281111561027857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610243565b50610284929150610288565b5090565b5b808211156102845760008155600101610289565b80356001600160a01b03811681146102b457600080fd5b919050565b803561ffff811681146102b457600080fd5b600080600080600060a086880312156102e2578081fd5b6102eb8661029d565b945060208087013567ffffffffffffffff80821115610308578384fd5b818901915089601f83011261031b578384fd5b81358181111561032d5761032d6103ce565b8060051b604051601f19603f83011681018181108582111715610352576103526103ce565b604052828152858101935084860182860187018e1015610370578788fd5b8795505b83861015610399576103858161029d565b855260019590950194938601938601610374565b508099505050505050506103af604087016102b9565b92506103bd606087016102b9565b949793965091946080013592915050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220fae4e6991bd977fb8425ad5da77dcfd9d5213f10e30e7773019e0bd6d579bf4b64736f6c63430008040033",Nr=(function(e){function t(t){return e.call(this,Cr,Rr,t)||this}Ir(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Cr)},t.connect=function(e,t){return new a.b(e,Cr,t)},t.bytecode=Rr,t.abi=Cr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Dr=[{inputs:[{internalType:"uint256",name:"minDelay",type:"uint256"},{internalType:"address[]",name:"proposers",type:"address[]"},{internalType:"address[]",name:"executors",type:"address[]"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"index",type:"uint256"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"CallExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"index",type:"uint256"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes32",name:"predecessor",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"delay",type:"uint256"}],name:"CallScheduled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"}],name:"Cancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldDuration",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newDuration",type:"uint256"}],name:"MinDelayChange",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"EXECUTOR_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PROPOSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TIMELOCK_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"cancel",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"datas",type:"bytes[]"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"getMinDelay",outputs:[{internalType:"uint256",name:"duration",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"getTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"hashOperation",outputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"datas",type:"bytes[]"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"hashOperationBatch",outputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperation",outputs:[{internalType:"bool",name:"pending",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperationDone",outputs:[{internalType:"bool",name:"done",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperationPending",outputs:[{internalType:"bool",name:"pending",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperationReady",outputs:[{internalType:"bool",name:"ready",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256",name:"delay",type:"uint256"}],name:"schedule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"datas",type:"bytes[]"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256",name:"delay",type:"uint256"}],name:"scheduleBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"newDelay",type:"uint256"}],name:"updateDelay",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],Br="0x60806040523480156200001157600080fd5b5060405162001e8238038062001e828339810160408190526200003491620003c6565b6200004f60008051602062001e2283398151915280620001e1565b6200007960008051602062001e4283398151915260008051602062001e22833981519152620001e1565b620000a360008051602062001e6283398151915260008051602062001e22833981519152620001e1565b620000be60008051602062001e228339815191523362000236565b620000d960008051602062001e228339815191523062000236565b60005b825181101562000142576200012f60008051602062001e428339815191528483815181106200011b57634e487b7160e01b600052603260045260246000fd5b60200260200101516200023660201b60201c565b6200013a8162000437565b9050620000dc565b5060005b815181101562000198576200018560008051602062001e628339815191528383815181106200011b57634e487b7160e01b600052603260045260246000fd5b620001908162000437565b905062000146565b5060028390556040805160008152602081018590527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a150505062000475565b6000620001ee8362000246565b600084815260208190526040808220600101859055519192508391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6200024282826200025e565b5050565b6000818152602081905260409020600101545b919050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000242576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002ba3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200025957600080fd5b600082601f83011262000327578081fd5b815160206001600160401b03808311156200034657620003466200045f565b8260051b604051601f19603f830116810181811084821117156200036e576200036e6200045f565b604052848152838101925086840182880185018910156200038d578687fd5b8692505b85831015620003ba57620003a581620002fe565b84529284019260019290920191840162000391565b50979650505050505050565b600080600060608486031215620003db578283fd5b835160208501519093506001600160401b0380821115620003fa578384fd5b620004088783880162000316565b935060408601519150808211156200041e578283fd5b506200042d8682870162000316565b9150509250925092565b60006000198214156200045857634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b61199d80620004856000396000f3fe60806040526004361061014f5760003560e01c806364d62353116100b6578063b1c5f4271161006f578063b1c5f427146103f3578063c4d252f514610413578063d45c443514610433578063d547741f14610460578063e38335e514610480578063f27a0c921461049357610156565b806364d623531461033c5780638065657f1461035c5780638f2a0bb01461037c5780638f61f4f51461039c57806391d14854146103be578063a217fddf146103de57610156565b8063248a9ca311610108578063248a9ca31461025b5780632ab0f5291461028b5780632f2ff15d146102bc57806331d50750146102dc57806336568abe146102fc578063584b153e1461031c57610156565b806301d5062a1461015b57806301ffc9a71461017d57806307bd0265146101b25780630d3cf6fc146101f4578063134008d31461022857806313bc9f201461023b57610156565b3661015657005b600080fd5b34801561016757600080fd5b5061017b610176366004611312565b6104a8565b005b34801561018957600080fd5b5061019d61019836600461151b565b61052d565b60405190151581526020015b60405180910390f35b3480156101be57600080fd5b506101e67fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6381565b6040519081526020016101a9565b34801561020057600080fd5b506101e67f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b61017b6102363660046112a8565b610566565b34801561024757600080fd5b5061019d6102563660046114d8565b6105de565b34801561026757600080fd5b506101e66102763660046114d8565b60009081526020819052604090206001015490565b34801561029757600080fd5b5061019d6102a63660046114d8565b6000908152600160208190526040909120541490565b3480156102c857600080fd5b5061017b6102d73660046114f0565b610604565b3480156102e857600080fd5b5061019d6102f73660046114d8565b61062f565b34801561030857600080fd5b5061017b6103173660046114f0565b610648565b34801561032857600080fd5b5061019d6103373660046114d8565b6106cb565b34801561034857600080fd5b5061017b6103573660046114d8565b6106e1565b34801561036857600080fd5b506101e66103773660046112a8565b610785565b34801561038857600080fd5b5061017b61039736600461142a565b6107c4565b3480156103a857600080fd5b506101e660008051602061194883398151915281565b3480156103ca57600080fd5b5061019d6103d93660046114f0565b61092f565b3480156103ea57600080fd5b506101e6600081565b3480156103ff57600080fd5b506101e661040e366004611385565b610958565b34801561041f57600080fd5b5061017b61042e3660046114d8565b61099d565b34801561043f57600080fd5b506101e661044e3660046114d8565b60009081526001602052604090205490565b34801561046c57600080fd5b5061017b61047b3660046114f0565b610a61565b61017b61048e366004611385565b610a87565b34801561049f57600080fd5b506002546101e6565b6000805160206119488339815191526104c281335b610be6565b60006104d2898989898989610785565b90506104de8184610c4a565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a60405161051a969594939291906116b1565b60405180910390a3505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061055e57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6361059281600061092f565b6105a0576105a081336104bd565b60006105b0888888888888610785565b90506105bc8185610d39565b6105cb8160008a8a8a8a610dd5565b6105d481610ee9565b5050505050505050565b6000818152600160205260408120546001811180156105fd5750428111155b9392505050565b60008281526020819052604090206001015461062081336104bd565b61062a8383610f22565b505050565b60008181526001602052604081205481905b1192915050565b6001600160a01b03811633146106bd5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106c78282610fa6565b5050565b6000818152600160208190526040822054610641565b3330146107445760405162461bcd60e51b815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201526a62652074696d656c6f636b60a81b60648201526084016106b4565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b60008686868686866040516020016107a2969594939291906116b1565b6040516020818303038152906040528051906020012090509695505050505050565b6000805160206119488339815191526107dd81336104bd565b8887146107fc5760405162461bcd60e51b81526004016106b4906117c6565b88851461081b5760405162461bcd60e51b81526004016106b4906117c6565b600061082d8b8b8b8b8b8b8b8b610958565b90506108398184610c4a565b60005b8a8110156109215780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e8581811061088757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061089c919061128e565b8d8d868181106108bc57634e487b7160e01b600052603260045260246000fd5b905060200201358c8c878181106108e357634e487b7160e01b600052603260045260246000fd5b90506020028101906108f59190611853565b8c8b604051610909969594939291906116b1565b60405180910390a361091a81611916565b905061083c565b505050505050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600088888888888888886040516020016109799897969594939291906116ee565b60405160208183030381529060405280519060200120905098975050505050505050565b6000805160206119488339815191526109b681336104bd565b6109bf826106cb565b610a255760405162461bcd60e51b815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e2063616044820152701b9b9bdd0818994818d85b98d95b1b1959607a1b60648201526084016106b4565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610a7d81336104bd565b61062a8383610fa6565b7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63610ab381600061092f565b610ac157610ac181336104bd565b878614610ae05760405162461bcd60e51b81526004016106b4906117c6565b878414610aff5760405162461bcd60e51b81526004016106b4906117c6565b6000610b118a8a8a8a8a8a8a8a610958565b9050610b1d8185610d39565b60005b89811015610bd057610bc082828d8d85818110610b4d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b62919061128e565b8c8c86818110610b8257634e487b7160e01b600052603260045260246000fd5b905060200201358b8b87818110610ba957634e487b7160e01b600052603260045260246000fd5b9050602002810190610bbb9190611853565b610dd5565b610bc981611916565b9050610b20565b50610bda81610ee9565b50505050505050505050565b610bf0828261092f565b6106c757610c08816001600160a01b0316601461100b565b610c1383602061100b565b604051602001610c2492919061160a565b60408051601f198184030181529082905262461bcd60e51b82526106b491600401611793565b610c538261062f565b15610cb85760405162461bcd60e51b815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201526e1c9958591e481cd8da19591d5b1959608a1b60648201526084016106b4565b600254811015610d195760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e746044820152652064656c617960d01b60648201526084016106b4565b610d238142611898565b6000928352600160205260409092209190915550565b610d42826105de565b610d5e5760405162461bcd60e51b81526004016106b490611809565b801580610d7a5750600081815260016020819052604090912054145b6106c75760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e6720646570656044820152656e64656e637960d01b60648201526084016106b4565b6000846001600160a01b0316848484604051610df29291906115fa565b60006040518083038185875af1925050503d8060008114610e2f576040519150601f19603f3d011682016040523d82523d6000602084013e610e34565b606091505b5050905080610ea15760405162461bcd60e51b815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e6720746044820152721c985b9cd858dd1a5bdb881c995d995c9d1959606a1b60648201526084016106b4565b85877fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b5887878787604051610ed8949392919061167f565b60405180910390a350505050505050565b610ef2816105de565b610f0e5760405162461bcd60e51b81526004016106b490611809565b600090815260016020819052604090912055565b610f2c828261092f565b6106c7576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610f623390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610fb0828261092f565b156106c7576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060600061101a8360026118b0565b611025906002611898565b67ffffffffffffffff81111561104b57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611075576020820181803683370190505b509050600360fc1b8160008151811061109e57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106110db57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006110ff8460026118b0565b61110a906001611898565b90505b600181111561119e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061114c57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061117057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93611197816118ff565b905061110d565b5083156105fd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106b4565b80356001600160a01b038116811461056157600080fd5b60008083601f840112611215578182fd5b50813567ffffffffffffffff81111561122c578182fd5b6020830191508360208260051b850101111561124757600080fd5b9250929050565b60008083601f84011261125f578182fd5b50813567ffffffffffffffff811115611276578182fd5b60208301915083602082850101111561124757600080fd5b60006020828403121561129f578081fd5b6105fd826111ed565b60008060008060008060a087890312156112c0578182fd5b6112c9876111ed565b955060208701359450604087013567ffffffffffffffff8111156112eb578283fd5b6112f789828a0161124e565b979a9699509760608101359660809091013595509350505050565b600080600080600080600060c0888a03121561132c578081fd5b611335886111ed565b965060208801359550604088013567ffffffffffffffff811115611357578182fd5b6113638a828b0161124e565b989b979a50986060810135976080820135975060a09091013595509350505050565b60008060008060008060008060a0898b0312156113a0578081fd5b883567ffffffffffffffff808211156113b7578283fd5b6113c38c838d01611204565b909a50985060208b01359150808211156113db578283fd5b6113e78c838d01611204565b909850965060408b01359150808211156113ff578283fd5b5061140c8b828c01611204565b999c989b509699959896976060870135966080013595509350505050565b600080600080600080600080600060c08a8c031215611447578081fd5b893567ffffffffffffffff8082111561145e578283fd5b61146a8d838e01611204565b909b50995060208c0135915080821115611482578283fd5b61148e8d838e01611204565b909950975060408c01359150808211156114a6578283fd5b506114b38c828d01611204565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b6000602082840312156114e9578081fd5b5035919050565b60008060408385031215611502578182fd5b82359150611512602084016111ed565b90509250929050565b60006020828403121561152c578081fd5b81356001600160e01b0319811681146105fd578182fd5b60008284526020808501808196508560051b8101915084845b878110156115c35782840389528135601e1988360301811261157c578687fd5b8701803567ffffffffffffffff811115611594578788fd5b8036038913156115a2578788fd5b6115af86828985016115d0565b9a87019a955050509084019060010161155c565b5091979650505050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6000828483379101908152919050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516116428160178501602088016118cf565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516116738160288401602088016118cf565b01602801949350505050565b600060018060a01b0386168252846020830152606060408301526116a76060830184866115d0565b9695505050505050565b600060018060a01b038816825286602083015260a060408301526116d960a0830186886115d0565b60608301949094525060800152949350505050565b60a0808252810188905260008960c08301825b8b81101561172f576001600160a01b0361171a846111ed565b16825260209283019290910190600101611701565b5083810360208501528881526001600160fb1b0389111561174e578283fd5b8860051b9150818a6020830137016020818101838152848303909101604085015261177a81888a611543565b6060850196909652505050608001529695505050505050565b60006020825282518060208401526117b28160408501602087016118cf565b601f01601f19169190910160400192915050565b60208082526023908201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d616040820152620e8c6d60eb1b606082015260800190565b6020808252602a908201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e206973604082015269206e6f7420726561647960b01b606082015260800190565b6000808335601e19843603018112611869578283fd5b83018035915067ffffffffffffffff821115611883578283fd5b60200191503681900382131561124757600080fd5b600082198211156118ab576118ab611931565b500190565b60008160001904831182151516156118ca576118ca611931565b500290565b60005b838110156118ea5781810151838201526020016118d2565b838111156118f9576000848401525b50505050565b60008161190e5761190e611931565b506000190190565b600060001982141561192a5761192a611931565b5060010190565b634e487b7160e01b600052601160045260246000fdfeb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1a2646970667358221220361a1d1e9106ffc77cb76ed529f6648bc4105a53ba3e6687320a78e96c57c24d64736f6c634300080300335f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1d8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63",Ur=(function(e){function t(t){return e.call(this,Dr,Br,t)||this}Nr(t,e),t.prototype.deploy=function(t,n,r,a){return e.prototype.deploy.call(this,t,n,r,a||{})},t.prototype.getDeployTransaction=function(t,n,r,a){return e.prototype.getDeployTransaction.call(this,t,n,r,a||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Dr)},t.connect=function(e,t){return new a.b(e,Dr,t)},t.bytecode=Br,t.abi=Dr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Lr=[{inputs:[{internalType:"address",name:"implementation",type:"address"},{internalType:"bytes",name:"initData",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],zr="0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201b49b5823aab14d5504be8d7e590628153258568864f5149e68e8bbfadf20e5a64736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",Fr=(function(e){function t(t){return e.call(this,Lr,zr,t)||this}Ur(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Lr)},t.connect=function(e,t){return new a.b(e,Lr,t)},t.bytecode=zr,t.abi=Lr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),qr=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"},{internalType:"uint64",name:"sequence_",type:"uint64"},{internalType:"address",name:"owner_",type:"address"},{internalType:"uint16",name:"chainId_",type:"uint16"},{internalType:"bytes32",name:"nativeContract_",type:"bytes32"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"chainId",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"nativeContract",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"address",name:"spender_",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender_",type:"address"},{internalType:"address",name:"recipient_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"addedValue_",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender_",type:"address"},{internalType:"uint256",name:"subtractedValue_",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account_",type:"address"},{internalType:"uint256",name:"amount_",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint64",name:"sequence_",type:"uint64"}],name:"updateDetails",outputs:[],stateMutability:"nonpayable",type:"function"}],Hr="0x608060405234801561001057600080fd5b506111e9806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063a18cd7c611610071578063a18cd7c614610246578063a457c2d714610259578063a9059cbb1461026c578063c71f46151461027f578063dd62ed3e1461029257600080fd5b80638da5cb5b146101ef57806395d89b411461020a5780639a8a0592146102125780639dc29fac1461023357600080fd5b8063313ce567116100e9578063313ce5671461018157806339509351146101965780633d6c043b146101a957806340c10f19146101b157806370a08231146101c657600080fd5b806306fdde031461011b578063095ea7b31461013957806318160ddd1461015c57806323b872dd1461016e575b600080fd5b6101236102cb565b6040516101309190611093565b60405180910390f35b61014c610147366004610e85565b6102f4565b6040519015158152602001610130565b6003545b604051908152602001610130565b61014c61017c366004610e4a565b61030a565b60045460405160ff9091168152602001610130565b61014c6101a4366004610e85565b6103c0565b600854610160565b6101c46101bf366004610e85565b6103f7565b005b6101606101d4366004610df7565b6001600160a01b031660009081526005602052604090205490565b6007546040516001600160a01b039091168152602001610130565b61012361042f565b600754600160a81b900461ffff1660405161ffff9091168152602001610130565b6101c4610241366004610e85565b6104c4565b6101c4610254366004610eae565b6104f8565b61014c610267366004610e85565b6105ce565b61014c61027a366004610e85565b610669565b6101c461028d366004610f1f565b610676565b6101606102a0366004610e18565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6040516060906102e090600090602001610fdd565b604051602081830303815290604052905090565b6000610301338484610775565b50600192915050565b600061031784848461089a565b6001600160a01b0384166000908152600660209081526040808320338452909152902054828110156103a15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103b585336103b08685611135565b610775565b506001949350505050565b3360008181526006602090815260408083206001600160a01b038716845290915281205490916103019185906103b090869061111d565b6007546001600160a01b031633146104215760405162461bcd60e51b8152600401610398906110e6565b61042b8282610a72565b5050565b6060600060010180546104419061114c565b80601f016020809104026020016040519081016040528092919081815260200182805461046d9061114c565b80156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b5050505050905090565b6007546001600160a01b031633146104ee5760405162461bcd60e51b8152600401610398906110e6565b61042b8282610b54565b6007546001600160a01b031633146105225760405162461bcd60e51b8152600401610398906110e6565b60025467ffffffffffffffff8083169116106105805760405162461bcd60e51b815260206004820152601e60248201527f63757272656e74206d6574616461746120697320757020746f206461746500006044820152606401610398565b8251610593906000906020860190610ca3565b5081516105a7906001906020850190610ca3565b506002805467ffffffffffffffff191667ffffffffffffffff929092169190911790555050565b3360009081526006602090815260408083206001600160a01b0386168452909152812054828110156106505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610398565b61065f33856103b08685611135565b5060019392505050565b600061030133848461089a565b600754600160a01b900460ff16156106c65760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610398565b6007805460ff60a01b1916600160a01b17905586516106ec9060009060208a0190610ca3565b508551610700906001906020890190610ca3565b506004805460ff90961660ff19909616959095179094556002805467ffffffffffffffff90941667ffffffffffffffff19909416939093179092556007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b03909216919091179190911790556008555050565b6001600160a01b0383166107d75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610398565b6001600160a01b0382166108385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610398565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166108fe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610398565b6001600160a01b0382166109605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610398565b6001600160a01b038316600090815260056020526040902054818110156109d85760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610398565b6109e28282611135565b6001600160a01b038086166000908152600560205260408082209390935590851681529081208054849290610a1890849061111d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a6491815260200190565b60405180910390a350505050565b6001600160a01b038216610ac85760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610398565b8060006003016000828254610add919061111d565b90915550506001600160a01b03821660009081526005602052604081208054839290610b0a90849061111d565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610bb45760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610398565b6001600160a01b03821660009081526005602052604090205481811015610c285760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610398565b610c328282611135565b6001600160a01b03841660009081526005602052604081209190915560038054849290610c60908490611135565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161088d565b828054610caf9061114c565b90600052602060002090601f016020900481019282610cd15760008555610d17565b82601f10610cea57805160ff1916838001178555610d17565b82800160010185558215610d17579182015b82811115610d17578251825591602001919060010190610cfc565b50610d23929150610d27565b5090565b5b80821115610d235760008155600101610d28565b80356001600160a01b0381168114610d5357600080fd5b919050565b600082601f830112610d68578081fd5b813567ffffffffffffffff80821115610d8357610d8361119d565b604051601f8301601f19908116603f01168101908282118183101715610dab57610dab61119d565b81604052838152866020858801011115610dc3578485fd5b8360208701602083013792830160200193909352509392505050565b803567ffffffffffffffff81168114610d5357600080fd5b600060208284031215610e08578081fd5b610e1182610d3c565b9392505050565b60008060408385031215610e2a578081fd5b610e3383610d3c565b9150610e4160208401610d3c565b90509250929050565b600080600060608486031215610e5e578081fd5b610e6784610d3c565b9250610e7560208501610d3c565b9150604084013590509250925092565b60008060408385031215610e97578182fd5b610ea083610d3c565b946020939093013593505050565b600080600060608486031215610ec2578283fd5b833567ffffffffffffffff80821115610ed9578485fd5b610ee587838801610d58565b94506020860135915080821115610efa578384fd5b50610f0786828701610d58565b925050610f1660408501610ddf565b90509250925092565b600080600080600080600060e0888a031215610f39578283fd5b873567ffffffffffffffff80821115610f50578485fd5b610f5c8b838c01610d58565b985060208a0135915080821115610f71578485fd5b50610f7e8a828b01610d58565b965050604088013560ff81168114610f94578384fd5b9450610fa260608901610ddf565b9350610fb060808901610d3c565b925060a088013561ffff81168114610fc6578283fd5b8092505060c0880135905092959891949750929550565b600080835482600182811c915080831680610ff957607f831692505b602080841082141561101957634e487b7160e01b87526022600452602487fd5b81801561102d576001811461103e5761106a565b60ff1986168952848901965061106a565b60008a815260209020885b868110156110625781548b820152908501908301611049565b505084890196505b50505050505061108b816a2028576f726d686f6c652960a81b8152600b0190565b949350505050565b6000602080835283518082850152825b818110156110bf578581018301518582016040015282016110a3565b818111156110d05783604083870101525b50601f01601f1916929092016040019392505050565b60208082526017908201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604082015260600190565b6000821982111561113057611130611187565b500190565b60008282101561114757611147611187565b500390565b600181811c9082168061116057607f821691505b6020821081141561118157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220b95441ce5c32d3a4f1e35bef3162f4248a97a9c7bfc685ef9090cd15fbc712fb64736f6c63430008040033",Jr=function(e){function t(t){return e.call(this,qr,Hr,t)||this}return Fr(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(qr)},t.connect=function(e,t){return new a.b(e,qr,t)},t.bytecode=Hr,t.abi=qr,t}(a.c),Vr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wr=[{inputs:[{internalType:"contract IERC20",name:"token_",type:"address"},{internalType:"address",name:"beneficiary_",type:"address"},{internalType:"uint256",name:"releaseTime_",type:"uint256"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"beneficiary",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"release",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"releaseTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"}],Kr="0x60e060405234801561001057600080fd5b506040516107c63803806107c683398101604081905261002f916100c0565b42811161009d5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2072656c656173652074696d65206973206260448201527165666f72652063757272656e742074696d6560701b606482015260840160405180910390fd5b6001600160601b0319606093841b81166080529190921b1660a05260c05261011a565b6000806000606084860312156100d4578283fd5b83516100df81610102565b60208501519093506100f081610102565b80925050604084015190509250925092565b6001600160a01b038116811461011757600080fd5b50565b60805160601c60a05160601c60c05161065f61016760003960008181609f015260f0015260008181605301526102a701526000818160ca015281816101820152610285015261065f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f14610090578063b91d40011461009a578063fc0c546a146100c8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b6100986100ee565b005b6040517f00000000000000000000000000000000000000000000000000000000000000008152602001610087565b7f0000000000000000000000000000000000000000000000000000000000000000610073565b7f000000000000000000000000000000000000000000000000000000000000000042101561017e5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260448201527165666f72652072656c656173652074696d6560701b60648201526084015b60405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b1580156101e257600080fd5b505afa1580156101f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021a9190610592565b9050600081116102785760405162461bcd60e51b815260206004820152602360248201527f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560448201526261736560e81b6064820152608401610175565b6102cc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000836102cf565b50565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610321908490610326565b505050565b600061037b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166103f89092919063ffffffff16565b80519091501561032157808060200190518101906103999190610572565b6103215760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610175565b60606104078484600085610411565b90505b9392505050565b6060824710156104725760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610175565b843b6104c05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610175565b600080866001600160a01b031685876040516104dc91906105aa565b60006040518083038185875af1925050503d8060008114610519576040519150601f19603f3d011682016040523d82523d6000602084013e61051e565b606091505b509150915061052e828286610539565b979650505050505050565b6060831561054857508161040a565b8251156105585782518084602001fd5b8160405162461bcd60e51b815260040161017591906105c6565b600060208284031215610583578081fd5b8151801515811461040a578182fd5b6000602082840312156105a3578081fd5b5051919050565b600082516105bc8184602087016105f9565b9190910192915050565b60006020825282518060208401526105e58160408501602087016105f9565b601f01601f19169190910160400192915050565b60005b838110156106145781810151838201526020016105fc565b83811115610623576000848401525b5050505056fea2646970667358221220a696bd4fbc0c665d610e6795ee54246e0b323242a27ba1351ea2095433e92cba64736f6c63430008030033",Gr=(function(e){function t(t){return e.call(this,Wr,Kr,t)||this}Vr(t,e),t.prototype.deploy=function(t,n,r,a){return e.prototype.deploy.call(this,t,n,r,a||{})},t.prototype.getDeployTransaction=function(t,n,r,a){return e.prototype.getDeployTransaction.call(this,t,n,r,a||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Wr)},t.connect=function(e,t){return new a.b(e,Wr,t)},t.bytecode=Kr,t.abi=Wr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Zr=[{inputs:[{internalType:"address",name:"_logic",type:"address"},{internalType:"address",name:"admin_",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],stateMutability:"payable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"admin",outputs:[{internalType:"address",name:"admin_",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newAdmin",type:"address"}],name:"changeAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"implementation_",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}],Xr="0x608060405260405162000f5a38038062000f5a8339810160408190526200002691620004e2565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd62000611565b60008051602062000f13833981519152146200008157634e487b7160e01b600052600160045260246000fd5b6200008f82826000620000ff565b50620000bf905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610462000611565b60008051602062000ef383398151915214620000eb57634e487b7160e01b600052600160045260246000fd5b620000f6826200013c565b5050506200067a565b6200010a8362000197565b600082511180620001185750805b156200013757620001358383620001d960201b6200026c1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200016762000208565b604080516001600160a01b03928316815291841660208301520160405180910390a1620001948162000241565b50565b620001a281620002f6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000201838360405180606001604052806027815260200162000f336027913962000399565b9392505050565b60006200023260008051602062000ef383398151915260001b6200047f60201b620002141760201c565b546001600160a01b0316905090565b6001600160a01b038116620002ac5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002d560008051602062000ef383398151915260001b6200047f60201b620002141760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6200030c816200048260201b620002981760201c565b620003705760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620002a3565b80620002d560008051602062000f1383398151915260001b6200047f60201b620002141760201c565b6060620003a68462000482565b620004035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620002a3565b600080856001600160a01b031685604051620004209190620005be565b600060405180830381855af49150503d80600081146200045d576040519150601f19603f3d011682016040523d82523d6000602084013e62000462565b606091505b509092509050620004758282866200048c565b9695505050505050565b90565b803b15155b919050565b606083156200049d57508162000201565b825115620004ae5782518084602001fd5b8160405162461bcd60e51b8152600401620002a39190620005dc565b80516001600160a01b03811681146200048757600080fd5b600080600060608486031215620004f7578283fd5b6200050284620004ca565b92506200051260208501620004ca565b60408501519092506001600160401b03808211156200052f578283fd5b818601915086601f83011262000543578283fd5b81518181111562000558576200055862000664565b604051601f8201601f19908116603f0116810190838211818310171562000583576200058362000664565b816040528281528960208487010111156200059c578586fd5b620005af83602083016020880162000635565b80955050505050509250925092565b60008251620005d281846020870162000635565b9190910192915050565b6000602082528251806020840152620005fd81604085016020870162000635565b601f01601f19169190910160400192915050565b6000828210156200063057634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156200065257818101518382015260200162000638565b83811115620001355750506000910152565b634e487b7160e01b600052604160045260246000fd5b610869806200068a6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106f9565b610118565b61005b610093366004610713565b610164565b3480156100a457600080fd5b506100ad6101da565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106f9565b610217565b3480156100f557600080fd5b506100ad610241565b6101066102a2565b610116610111610346565b610355565b565b610120610379565b6001600160a01b0316336001600160a01b0316141561015957610154816040518060200160405280600081525060006103ac565b610161565b6101616100fe565b50565b61016c610379565b6001600160a01b0316336001600160a01b031614156101cd576101c88383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103ac915050565b6101d5565b6101d56100fe565b505050565b60006101e4610379565b6001600160a01b0316336001600160a01b0316141561020c57610205610346565b9050610214565b6102146100fe565b90565b61021f610379565b6001600160a01b0316336001600160a01b0316141561015957610154816103d7565b600061024b610379565b6001600160a01b0316336001600160a01b0316141561020c57610205610379565b6060610291838360405180606001604052806027815260200161080d6027913961042b565b9392505050565b803b15155b919050565b6102aa610379565b6001600160a01b0316336001600160a01b031614156103415760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b610116565b6000610350610506565b905090565b3660008037600080366000845af43d6000803e808015610374573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316905090565b6103b58361052e565b6000825111806103c25750805b156101d5576103d1838361026c565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610400610379565b604080516001600160a01b03928316815291841660208301520160405180910390a16101618161056e565b606061043684610298565b6104915760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610338565b600080856001600160a01b0316856040516104ac9190610791565b600060405180830381855af49150503d80600081146104e7576040519150601f19603f3d011682016040523d82523d6000602084013e6104ec565b606091505b50915091506104fc828286610617565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61039d565b61053781610650565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152608401610338565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60608315610626575081610291565b8251156106365782518084602001fd5b8160405162461bcd60e51b815260040161033891906107ad565b61065981610298565b6106bb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610338565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105f6565b80356001600160a01b038116811461029d57600080fd5b60006020828403121561070a578081fd5b610291826106e2565b600080600060408486031215610727578182fd5b610730846106e2565b9250602084013567ffffffffffffffff8082111561074c578384fd5b818601915086601f83011261075f578384fd5b81358181111561076d578485fd5b87602082850101111561077e578485fd5b6020830194508093505050509250925092565b600082516107a38184602087016107e0565b9190910192915050565b60006020825282518060208401526107cc8160408501602087016107e0565b601f01601f19169190910160400192915050565b60005b838110156107fb5781810151838201526020016107e3565b838111156103d1575050600091015256fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220ddc0838f0b211b6b7e8eccfec1e8a5a9dd7934cff71defb09a0bae61e9135fe164736f6c63430008030033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564",Yr=(function(e){function t(t){return e.call(this,Zr,Xr,t)||this}Gr(t,e),t.prototype.deploy=function(t,n,r,a){return e.prototype.deploy.call(this,t,n,r,a||{})},t.prototype.getDeployTransaction=function(t,n,r,a){return e.prototype.getDeployTransaction.call(this,t,n,r,a||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Zr)},t.connect=function(e,t){return new a.b(e,Zr,t)},t.bytecode=Xr,t.abi=Zr}(a.c),[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"}]),$r=(function(){function e(){}e.createInterface=function(){return new r.utils.Interface(Yr)},e.connect=function(e,t){return new a.b(e,Yr,t)},e.abi=Yr}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Qr=[{inputs:[{internalType:"address",name:"implementation_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"}],ea="0x608060405234801561001057600080fd5b5060405161050a38038061050a83398101604081905261002f91610148565b61003833610047565b61004181610097565b50610176565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100aa8161014260201b61020a1760201c565b6101205760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3b151590565b600060208284031215610159578081fd5b81516001600160a01b038116811461016f578182fd5b9392505050565b610385806101856000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a3660046102ec565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f610139565b6000546001600160a01b031661007e565b61006f6100c13660046102ec565b61016f565b6000546001600160a01b031633146100f95760405162461bcd60e51b81526004016100f09061031a565b60405180910390fd5b61010281610210565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6000546001600160a01b031633146101635760405162461bcd60e51b81526004016100f09061031a565b61016d600061029c565b565b6000546001600160a01b031633146101995760405162461bcd60e51b81526004016100f09061031a565b6001600160a01b0381166101fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f0565b6102078161029c565b50565b3b151590565b803b61027a5760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b60648201526084016100f0565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156102fd578081fd5b81356001600160a01b0381168114610313578182fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220f45bbe0d068c96fcc0c4e81cd5b0324b02af392f0e4eb101c8be8a0bc2b35bbf64736f6c63430008030033",ta=(function(e){function t(t){return e.call(this,Qr,ea,t)||this}$r(t,e),t.prototype.deploy=function(t,n){return e.prototype.deploy.call(this,t,n||{})},t.prototype.getDeployTransaction=function(t,n){return e.prototype.getDeployTransaction.call(this,t,n||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(Qr)},t.connect=function(e,t){return new a.b(e,Qr,t)},t.bytecode=ea,t.abi=Qr}(a.c),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),na=[{inputs:[{internalType:"address",name:"setup",type:"address"},{internalType:"bytes",name:"initData",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],ra="0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212202cd71139025b84fb6f5d407d71cc99d5b83f17745ad316ca6f13cdf1b0ff6f7964736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564";!function(e){function t(t){return e.call(this,na,ra,t)||this}ta(t,e),t.prototype.deploy=function(t,n,r){return e.prototype.deploy.call(this,t,n,r||{})},t.prototype.getDeployTransaction=function(t,n,r){return e.prototype.getDeployTransaction.call(this,t,n,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new r.utils.Interface(na)},t.connect=function(e,t){return new a.b(e,na,t)},t.bytecode=ra,t.abi=na}(a.c)},function(e,t,n){"use strict";n.r(t),n.d(t,"keccak256",(function(){return o}));var r=n(172),a=n.n(r),i=n(3);function o(e){return"0x"+a.a.keccak_256(Object(i.arrayify)(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(171);var a=n(209),i=n(122);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(a.a)(e)||Object(i.a)(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(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(46);function a(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 i(e){for(var t=1;t0&&(10===arguments[0]?h||(h=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",u.Logger.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",u.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(l,m(t)):t.match(/^-?[0-9]+$/)?new e(l,m(new f(t))):d.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&w("underflow","BigNumber.from",t),(t>=p||t<=-p)&&w("overflow","BigNumber.from",t),e.from(String(t));var n=t;if("bigint"===typeof n)return e.from(n.toString());if(Object(s.isBytes)(n))return e.from(Object(s.hexlify)(n));if(n)if(n.toHexString){var r=n.toHexString();if("string"===typeof r)return e.from(r)}else{var a=n._hex;if(null==a&&"BigNumber"===n.type&&(a=n.hex),"string"===typeof a&&(Object(s.isHexString)(a)||"-"===a[0]&&Object(s.isHexString)(a.substring(1))))return e.from(a)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function m(e){if("string"!==typeof e)return m(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=m(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function v(e){return y.from(m(e))}function g(e){var t=y.from(e).toHexString();return"-"===t[0]?new f("-"+t.substring(3),16):new f(t.substring(2),16)}function w(e,t,n){var r={fault:e,operation:t};return null!=n&&(r.value=n),d.throwError(e,u.Logger.errors.NUMERIC_FAULT,r)}function T(e){return new f(e,36).toString(16)}function k(e){return new f(e,16).toString(36)}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(427)},function(e,t,n){"use strict";function r(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 r}))},function(e,t,n){"use strict";var r=n(90);n.d(t,"a",(function(){return r.c})),n.d(t,"b",(function(){return r.f})),n.d(t,"c",(function(){return r.g})),n.d(t,"d",(function(){return r.h})),n.d(t,"e",(function(){return r.i})),n.d(t,"f",(function(){return r.j})),n.d(t,"g",(function(){return r.k}));var a=n(169);n.d(t,"i",(function(){return a.a}));n(200);var i=n(201);n.d(t,"h",(function(){return i.a})),n.d(t,"j",(function(){return i.c})),n.d(t,"k",(function(){return i.d})),n.d(t,"l",(function(){return i.e})),n.d(t,"m",(function(){return i.f}))},function(e,t,n){"use strict";n.r(t),n.d(t,"TransactionTypes",(function(){return r})),n.d(t,"computeAddress",(function(){return v})),n.d(t,"recoverAddress",(function(){return g})),n.d(t,"accessListify",(function(){return k})),n.d(t,"serialize",(function(){return x})),n.d(t,"parse",(function(){return M}));var r,a=n(31),i=n(44),o=n(3),s=n(108),u=n(39),c=n(5),f=n(82),d=n(76),l=n(7),p=new l.Logger("transactions/5.5.0");function b(e){return"0x"===e?null:Object(a.getAddress)(e)}function h(e){return"0x"===e?s.h:i.a.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(r||(r={}));var y=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],m={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function v(e){var t=Object(d.computePublicKey)(e);return Object(a.getAddress)(Object(o.hexDataSlice)(Object(u.keccak256)(Object(o.hexDataSlice)(t,1)),12))}function g(e,t){return v(Object(d.recoverPublicKey)(Object(o.arrayify)(e),t))}function w(e,t){var n=Object(o.stripZeros)(i.a.from(e).toHexString());return n.length>32&&p.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function T(e,t){return{address:Object(a.getAddress)(e),storageKeys:(t||[]).map((function(t,n){return 32!==Object(o.hexDataLength)(t)&&p.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(n,"]"),t),t.toLowerCase()}))}}function k(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&p.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),T(e[0],e[1])):T(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var n=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return T(t,Object.keys(n).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function _(e){return k(e).map((function(e){return[e.address,e.storageKeys]}))}function O(e,t){if(null!=e.gasPrice){var n=i.a.from(e.gasPrice),r=i.a.from(e.maxFeePerGas||0);n.eq(r)||p.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:r})}var s=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?Object(a.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",_(e.accessList||[])];if(t){var u=Object(o.splitSignature)(t);s.push(w(u.recoveryParam,"recoveryParam")),s.push(Object(o.stripZeros)(u.r)),s.push(Object(o.stripZeros)(u.s))}return Object(o.hexConcat)(["0x02",f.encode(s)])}function S(e,t){var n=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?Object(a.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",_(e.accessList||[])];if(t){var r=Object(o.splitSignature)(t);n.push(w(r.recoveryParam,"recoveryParam")),n.push(Object(o.stripZeros)(r.r)),n.push(Object(o.stripZeros)(r.s))}return Object(o.hexConcat)(["0x01",f.encode(n)])}function x(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&p.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){Object(c.checkProperties)(e,m);var n=[];y.forEach((function(t){var r=e[t.name]||[],a={};t.numeric&&(a.hexPad="left"),r=Object(o.arrayify)(Object(o.hexlify)(r,a)),t.length&&r.length!==t.length&&r.length>0&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),t.maxLength&&(r=Object(o.stripZeros)(r)).length>t.maxLength&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),n.push(Object(o.hexlify)(r))}));var r=0;if(null!=e.chainId?"number"!==typeof(r=e.chainId)&&p.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(o.isBytesLike)(t)&&t.v>28&&(r=Math.floor((t.v-35)/2)),0!==r&&(n.push(Object(o.hexlify)(r)),n.push("0x"),n.push("0x")),!t)return f.encode(n);var a=Object(o.splitSignature)(t),i=27+a.recoveryParam;return 0!==r?(n.pop(),n.pop(),n.pop(),i+=2*r+8,a.v>28&&a.v!==i&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):a.v!==i&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),n.push(Object(o.hexlify)(i)),n.push(Object(o.stripZeros)(Object(o.arrayify)(a.r))),n.push(Object(o.stripZeros)(Object(o.arrayify)(a.s))),f.encode(n)}(e,t);switch(e.type){case 1:return S(e,t);case 2:return O(e,t)}return p.throwError("unsupported transaction type: ".concat(e.type),l.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function A(e,t,n){try{var r=h(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(i){p.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(o.hexZeroPad)(t[1],32),e.s=Object(o.hexZeroPad)(t[2],32);try{var a=Object(u.keccak256)(n(e));e.from=g(a,{r:e.r,s:e.s,recoveryParam:e.v})}catch(i){console.log(i)}}function M(e){var t=Object(o.arrayify)(e);if(t[0]>127)return function(e){var t=f.decode(e);9!==t.length&&6!==t.length&&p.throwArgumentError("invalid raw transaction","rawTransaction",e);var n={nonce:h(t[0]).toNumber(),gasPrice:h(t[1]),gasLimit:h(t[2]),to:b(t[3]),value:h(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=i.a.from(t[6]).toNumber()}catch(c){return console.log(c),n}if(n.r=Object(o.hexZeroPad)(t[7],32),n.s=Object(o.hexZeroPad)(t[8],32),i.a.from(n.r).isZero()&&i.a.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);var r=n.v-27,a=t.slice(0,6);0!==n.chainId&&(a.push(Object(o.hexlify)(n.chainId)),a.push("0x"),a.push("0x"),r-=2*n.chainId+8);var s=Object(u.keccak256)(f.encode(a));try{n.from=g(s,{r:Object(o.hexlify)(n.r),s:Object(o.hexlify)(n.s),recoveryParam:r})}catch(c){console.log(c)}n.hash=Object(u.keccak256)(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){var t=f.decode(e.slice(1));8!==t.length&&11!==t.length&&p.throwArgumentError("invalid component count for transaction type: 1","payload",Object(o.hexlify)(e));var n={type:1,chainId:h(t[0]).toNumber(),nonce:h(t[1]).toNumber(),gasPrice:h(t[2]),gasLimit:h(t[3]),to:b(t[4]),value:h(t[5]),data:t[6],accessList:k(t[7])};return 8===t.length||(n.hash=Object(u.keccak256)(e),A(n,t.slice(8),S)),n}(t);case 2:return function(e){var t=f.decode(e.slice(1));9!==t.length&&12!==t.length&&p.throwArgumentError("invalid component count for transaction type: 2","payload",Object(o.hexlify)(e));var n=h(t[2]),r=h(t[3]),a={type:2,chainId:h(t[0]).toNumber(),nonce:h(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:h(t[4]),to:b(t[5]),value:h(t[6]),data:t[7],accessList:k(t[8])};return 9===t.length||(a.hash=Object(u.keccak256)(e),A(a,t.slice(9),O)),a}(t)}return p.throwError("unsupported transaction type: ".concat(t[0]),l.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"d",(function(){return a.b})),n.d(t,"l",(function(){return a.d})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return d})),n.d(t,"c",(function(){return l.c})),n.d(t,"a",(function(){return l.a})),n.d(t,"b",(function(){return l.b})),n.d(t,"k",(function(){return l.k})),n.d(t,"o",(function(){return l.m})),n.d(t,"j",(function(){return l.j})),n.d(t,"m",(function(){return l.l})),n.d(t,"e",(function(){return l.h})),n.d(t,"f",(function(){return b.a})),n.d(t,"n",(function(){return g})),n.d(t,"g",(function(){return k}));var r=n(38),a=(n(54),n(94)),i=n(258),o=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},s=function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]o)throw p;return[3,6];case 6:return[3,1];case 7:return[2,d]}}))}))}var l=n(47),p=(n(11),n(30));var b=n(289),h=n(10),y=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},m=function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0?a-4:a;for(n=0;n>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===i&&(t=_[e.charCodeAt(n)]<<2|_[e.charCodeAt(n+1)]>>4,o[s++]=255&t);1===i&&(t=_[e.charCodeAt(n)]<<10|_[e.charCodeAt(n+1)]<<4|_[e.charCodeAt(n+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},fromByteArray:function(e){for(var t,n=e.length,r=n%3,a=[],i=16383,o=0,s=n-r;os?s:o+i));1===r?(t=e[n-1],a.push(k[t>>2]+k[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],a.push(k[t>>10]+k[t>>4&63]+k[t<<2&63]+"="));return a.join("")}},k=[],_=[],O="undefined"!==typeof Uint8Array?Uint8Array:Array,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x=0,A=S.length;x0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function E(e,t,n){for(var r,a,i=[],o=t;o>18&63]+k[a>>12&63]+k[a>>6&63]+k[63&a]);return i.join("")}_["-".charCodeAt(0)]=62,_["_".charCodeAt(0)]=63;var P={read:function(e,t,n,r,a){var i,o,s=8*a-r-1,u=(1<>1,f=-7,d=n?a-1:0,l=n?-1:1,p=e[t+d];for(d+=l,i=p&(1<<-f)-1,p>>=-f,f+=s;f>0;i=256*i+e[t+d],d+=l,f-=8);for(o=i&(1<<-f)-1,i>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=l,f-=8);if(0===i)i=1-c;else{if(i===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),i-=c}return(p?-1:1)*o*Math.pow(2,i-r)},write:function(e,t,n,r,a,i){var o,s,u,c=8*i-a-1,f=(1<>1,l=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,b=r?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?l/u:l*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,a),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),o=0));a>=8;e[n+p]=255&s,p+=b,s/=256,a-=8);for(o=o<0;e[n+p]=255&o,p+=b,o/=256,c-=8);e[n+p-b]|=128*h}};!function(e){var t=T,n=P,r="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},e.INSPECT_MAX_BYTES=50;var a=2147483647;function i(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return b(e)}return s(e,t,n)}function s(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|v(e,t),r=i(n),a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(ee(e,Uint8Array)){var t=new Uint8Array(e);return y(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ee(e,ArrayBuffer)||e&&ee(e.buffer,ArrayBuffer))return y(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(ee(e,SharedArrayBuffer)||e&&ee(e.buffer,SharedArrayBuffer)))return y(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,n);var a=function(e){if(o.isBuffer(e)){var t=0|m(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||te(e.length)?i(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(a)return a;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function p(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function b(e){return p(e),i(e<0?0:0|m(e))}function h(e){for(var t=e.length<0?0:0|m(e.length),n=i(t),r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function v(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ee(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(a)return r?-1:Y(e).length;t=(""+t).toLowerCase(),a=!0}}function g(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 N(this,t,n);case"utf8":case"utf-8":return j(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function k(e,t,n,r,a){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),te(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"===typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,a);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,a){var i,o=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;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var f=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var d=!0,l=0;la&&(r=a):r=a;var i,o=t.length;for(r>o/2&&(r=o/2),i=0;i>8,a=n%256,i.push(a),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function j(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a239?4:i>223?3:i>191?2:1;if(a+s<=n){var u=void 0,c=void 0,f=void 0,d=void 0;switch(s){case 1:i<128&&(o=i);break;case 2:128===(192&(u=e[a+1]))&&(d=(31&i)<<6|63&u)>127&&(o=d);break;case 3:u=e[a+1],c=e[a+2],128===(192&u)&&128===(192&c)&&(d=(15&i)<<12|(63&u)<<6|63&c)>2047&&(d<55296||d>57343)&&(o=d);break;case 4:u=e[a+1],c=e[a+2],f=e[a+3],128===(192&u)&&128===(192&c)&&128===(192&f)&&(d=(15&i)<<18|(63&u)<<12|(63&c)<<6|63&f)>65535&&d<1114112&&(o=d)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),a+=s}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?(o.isBuffer(i)||(i=o.from(i)),i.copy(r,a)):Uint8Array.prototype.set.call(r,i,a);else{if(!o.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,a)}a+=i.length}return r},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(t+=" ... "),""},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,a){if(ee(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(i,s),c=this.slice(r,a),f=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),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 O(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;ar)&&(n=r);for(var a="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,a,i){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r,a){K(t,r,a,e,n,7);var i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function z(e,t,n,r,a){K(t,r,a,e,n,7);var i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function F(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(e,t,r,a,i){return t=+t,r>>>=0,i||F(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function H(e,t,r,a,i){return t=+t,r>>>=0,i||F(e,0,r,8),n.write(e,t,r,a,52,8),r+8}o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e],a=1,i=0;++i>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=re((function(e){G(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),a=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+n*Math.pow(2,24);return BigInt(r)+(BigInt(a)<>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],a=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n;return(BigInt(r)<>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e],a=1,i=0;++i=(a*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=re((function(e){G(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(n<<24);return(BigInt(r)<>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(r)<>>=0,t||B(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return z(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var a=Math.pow(2,8*n-1);U(this,e,t,n,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var a=Math.pow(2,8*n-1);U(this,e,t,n,a-1,-a)}var i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return z(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,n){return q(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return q(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return H(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return H(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");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("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i=r+4;n-=3)t="_".concat(e.slice(n-3,n)).concat(t);return"".concat(e.slice(0,n)).concat(t)}function K(e,t,n,r,a,i){if(e>n||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(i+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(i+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(i+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(n).concat(s),new J.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Z(t,e.length-(n+1))}(r,a,i)}function G(e,t){if("number"!==typeof e)throw new J.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,n){if(Math.floor(e)!==e)throw G(e,n),new J.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new J.ERR_BUFFER_OUT_OF_BOUNDS;throw new J.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(t),e)}V("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),V("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),V("ERR_OUT_OF_RANGE",(function(e,t,n){var r='The value of "'.concat(e,'" is out of range.'),a=n;return Number.isInteger(n)&&Math.abs(n)>Math.pow(2,32)?a=W(String(n)):"bigint"===typeof n&&(a=String(n),(n>Math.pow(BigInt(2),BigInt(32))||n<-Math.pow(BigInt(2),BigInt(32)))&&(a=W(a)),a+="n"),r+=" It must be ".concat(t,". Received ").concat(a)}),RangeError);var X=/[^+/0-9A-Za-z-_]/g;function Y(e,t){var n;t=t||1/0;for(var r=e.length,a=null,i=[],o=0;o55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=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 $(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function Q(e,t,n,r){var a;for(a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function ee(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function te(e){return e!==e}var ne=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,a=0;a<16;++a)t[r+a]=e[n]+e[a];return t}();function re(e){return"undefined"===typeof BigInt?ae:e}function ae(){throw new Error("BigInt not supported")}}(w);var j="undefined"!==typeof e?e:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},I="function"===typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};function C(e,t){var n={seen:[],stylize:N};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),L(t)?n.showHidden=t:t&&X(n,t),q(n.showHidden)&&(n.showHidden=!1),q(n.depth)&&(n.depth=2),q(n.colors)&&(n.colors=!1),q(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=R),D(n,e,n.depth)}function R(e,t){var n=C.styles[t];return n?"\x1b["+C.colors[n][0]+"m"+e+"\x1b["+C.colors[n][1]+"m":e}function N(e,t){return e}function D(e,t,n){if(e.customInspect&&t&&K(t.inspect)&&t.inspect!==C&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return F(r)||(r=D(e,r,n)),r}var a=function(e,t){if(q(t))return e.stylize("undefined","undefined");if(F(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(r=t,"number"===typeof r)return e.stylize(""+t,"number");var r;if(L(t))return e.stylize(""+t,"boolean");if(z(t))return e.stylize("null","null")}(e,t);if(a)return a;var i=Object.keys(t),o=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),W(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return B(t);if(0===i.length){if(K(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(H(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(V(t))return e.stylize(Date.prototype.toString.call(t),"date");if(W(t))return B(t)}var u,c,f="",d=!1,l=["{","}"];(u=t,Array.isArray(u)&&(d=!0,l=["[","]"]),K(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return H(t)&&(f=" "+RegExp.prototype.toString.call(t)),V(t)&&(f=" "+Date.prototype.toUTCString.call(t)),W(t)&&(f=" "+B(t)),0!==i.length||d&&0!=t.length?n<0?H(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=d?function(e,t,n,r,a){for(var i=[],o=0,s=t.length;o60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,f,l)):l[0]+f+l[1]}function B(e){return"["+Error.prototype.toString.call(e)+"]"}function U(e,t,n,r,a,i){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),Y(r,a)||(o="["+a+"]"),s||(e.seen.indexOf(u.value)<0?(s=z(n)?D(e,u.value,null):D(e,u.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),q(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function L(e){return"boolean"===typeof e}function z(e){return null===e}function F(e){return"string"===typeof e}function q(e){return void 0===e}function H(e){return J(e)&&"[object RegExp]"===Z(e)}function J(e){return"object"===typeof e&&null!==e}function V(e){return J(e)&&"[object Date]"===Z(e)}function W(e){return J(e)&&("[object Error]"===Z(e)||e instanceof Error)}function K(e){return"function"===typeof e}function G(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e}function Z(e){return Object.prototype.toString.call(e)}function X(e,t){if(!t||!J(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function Y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,a=0,i=Math.min(n,r);a=0){var o=r.indexOf("\n",i+1);r=r.substring(o+1)}this.stack=r}}}function fe(e,t){return"string"===typeof e?e.length=0;s--)if(u[s]!==c[s])return!1;for(s=u.length-1;s>=0;s--)if(!be(e[o=u[s]],t[o],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function he(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function ye(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(n){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function me(e,t,n,r){var a;if("function"!==typeof t)throw new TypeError('"block" argument must be a function');"string"===typeof n&&(r=n,n=null),a=function(e){var t;try{e()}catch(n){t=n}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!a&&le(a,n,"Missing expected exception"+r);var i="string"===typeof r,o=!e&&a&&!n;if((!e&&W(a)&&i&&ye(a,n)||o)&&le(a,n,"Got unwanted exception"+r),e&&a&&n&&!ye(a,n)||!e&&a)throw a}oe.AssertionError=ce,I(ce,Error),oe.fail=le,oe.ok=pe,oe.equal=function e(t,n,r){t!=n&&le(t,n,r,"==",e)},oe.notEqual=function e(t,n,r){t==n&&le(t,n,r,"!=",e)},oe.deepEqual=function e(t,n,r){be(t,n,!1)||le(t,n,r,"deepEqual",e)},oe.deepStrictEqual=function e(t,n,r){be(t,n,!0)||le(t,n,r,"deepStrictEqual",e)},oe.notDeepEqual=function e(t,n,r){be(t,n,!1)&&le(t,n,r,"notDeepEqual",e)},oe.notDeepStrictEqual=function e(t,n,r){be(t,n,!0)&&le(t,n,r,"notDeepStrictEqual",e)},oe.strictEqual=function e(t,n,r){t!==n&&le(t,n,r,"===",e)},oe.notStrictEqual=function e(t,n,r){t===n&&le(t,n,r,"!==",e)},oe.throws=function(e,t,n){me(!0,e,t,n)},oe.doesNotThrow=function(e,t,n){me(!1,e,t,n)},oe.ifError=function(e){if(e)throw e};var ve={},ge=function(){function e(t,n){if(Object(u.a)(this,e),!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=n}return Object(c.a)(e,[{key:"makeDestinationObject",value:function(){return{}}},{key:"decode",value:function(e,t){throw new Error("Layout is abstract")}},{key:"encode",value:function(e,t,n){throw new Error("Layout is abstract")}},{key:"getSpan",value:function(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function we(e,t){return t.property?e+"["+t.property+"]":e}ve.Layout=ge,ve.nameWithProperty=we,ve.bindConstructorLayout=function(e,t){if("function"!==typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof ge))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Te=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(ge),ke=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;if(Object(u.a)(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(a=t.call(this,-1,r)).elementSpan=e,a}return Object(c.a)(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(Te),_e=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r,a){var i;if(Object(u.a)(this,n),!(e instanceof ge))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(i=t.call(this,e.span,a||e.property)).layout=e,i.offset=r,i}return Object(c.a)(n,[{key:"isCount",value:function(){return this.layout instanceof Oe||this.layout instanceof Se}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(Te),Oe=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;if(Object(u.a)(this,n),6<(a=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return a}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(ge),Se=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;if(Object(u.a)(this,n),6<(a=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return a}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(ge),xe=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;if(Object(u.a)(this,n),6<(a=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return a}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(ge),Ae=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;if(Object(u.a)(this,n),6<(a=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return a}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(ge),Me=Math.pow(2,32);function Ee(e){var t=Math.floor(e/Me);return{hi32:t,lo32:e-t*Me}}function Pe(e,t){return e*Me+t}var je=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,8,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Pe(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Ee(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(ge),Ie=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,8,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Pe(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Ee(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(ge),Ce=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,8,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Pe(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Ee(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(ge),Re=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,8,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Pe(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Ee(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(ge),Ne=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,4,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(ge),De=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,4,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(ge),Be=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,8,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(ge),Ue=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,8,e)}return Object(c.a)(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(ge),Le=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r,a){var i;if(Object(u.a)(this,n),!(e instanceof ge))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Te&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var o=-1;return!(r instanceof Te)&&0f.span&&void 0===f.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(l){c.e(l)}finally{c.f()}var d=-1;try{d=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(p){}return(i=t.call(this,d,r)).fields=e,i.decodePrefixes=!!a,i}return Object(c.a)(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var a=r.getSpan(e,t);return t+=a,n+a}),0)}catch(r){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),a=Object(s.a)(this.fields);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(void 0!==i.property&&(r[i.property]=i.decode(e,t)),t+=i.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(o){a.e(o)}finally{a.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,a=n,i=0,o=0,u=Object(s.a)(this.fields);try{for(u.s();!(r=u.n()).done;){var c=r.value,f=c.span;if(o=0f&&(f=c.getSpan(t,n)))}i=n,n+=f}}catch(l){u.e(l)}finally{u.f()}return i+o-a}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=Object(s.a)(this.fields);try{for(r.s();!(t=r.n()).done;){var a=t.value;void 0!==a.property&&0a.span?n=-1:0<=n&&(n+=a.span)}}catch(i){r.e(i)}finally{r.f()}}}]),n}(ge),Fe=function(){function e(t){Object(u.a)(this,e),this.property=t}return Object(c.a)(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),qe=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;if(Object(u.a)(this,n),!(e instanceof Te&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(a=t.call(this,r||e.property||"variant")).layout=e,a}return Object(c.a)(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(Fe),He=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r,a){var i;Object(u.a)(this,n);var o=e instanceof Oe||e instanceof Se;if(o)e=new qe(new _e(e));else if(e instanceof Te&&e.isCount())e=new qe(e);else if(!(e instanceof Fe))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===r&&(r=null),!(null===r||r instanceof ge))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&o&&(s+=e.layout.span),(i=t.call(this,s,a)).discriminator=e,i.usesPrefixDiscriminator=o,i.defaultLayout=r,i.registry={};var c=i.defaultGetSourceVariant.bind(Object(f.a)(i));return i.getSourceVariant=function(e){return c(e)},i.configGetSourceVariant=function(e){c=e.bind(this)},i}return Object(c.a)(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,a=r.decode(e,t),i=this.registry[a];if(void 0===i){var o=0;i=this.defaultLayout,this.usesPrefixDiscriminator&&(o=r.layout.span),(n=this.makeDestinationObject())[r.property]=a,n[i.property]=this.defaultLayout.decode(e,t+o)}else n=i.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var a=this.discriminator,i=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=a.layout.span),a.encode(e[a.property],t,n),o+i.encode(e[i.property],t,n+o)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new Je(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e,t){var n=e;return w.Buffer.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}]),n}(ge),Je=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r,a,i){var o;if(Object(u.a)(this,n),!(e instanceof He))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof a&&void 0===i&&(i=a,a=null),a){if(!(a instanceof ge))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=a.span&&a.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof i)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=a?a.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(o=t.call(this,s,i)).union=e,o.variant=r,o.layout=a||null,o}return Object(c.a)(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var a=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),a+=this.layout.getSpan(t,n+r),0<=this.union.span&&a>this.union.span))throw new Error("encoded variant overruns containing union");return a}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}(ge);function Ve(e){return 0>e&&(e+=4294967296),e}var We=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r,a){var i;if(Object(u.a)(this,n),!(e instanceof Oe||e instanceof Se))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof r&&void 0===a&&(a=r,r=void 0),4=n)throw new TypeError("bits must be positive integer");var a=8*t.span,i=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+i>a)throw new Error("bits too long for span remainder ("+(a-i)+" of "+a+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==Ve(e&this.valueMask))throw new TypeError(we("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=Ve(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Te&&(r=e.length),!w.Buffer.isBuffer(e)||r!==e.length)throw new TypeError(we("Blob.encode",this)+" requires (length "+r+") Buffer as src");if(n+r>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,r,"hex"),this.length instanceof Te&&this.length.encode(r,t,n),r}}]),n}(ge),Xe=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(u.a)(this,n),t.call(this,-1,e)}return Object(c.a)(n,[{key:"getSpan",value:function(e,t){if(!w.Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);for(var n=t;nt.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),t[n+a]=0,a+1}}]),n}(ge),Ye=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;if(Object(u.a)(this,n),"string"===typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(a=t.call(this,-1,r)).maxSpan=e,a}return Object(c.a)(n,[{key:"getSpan",value:function(e,t){if(!w.Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),a}}]),n}(ge),$e=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this,0,r)).value=e,a}return Object(c.a)(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}(ge);ve.ExternalLayout=Te,ve.GreedyCount=ke,ve.OffsetLayout=_e,ve.UInt=Oe,ve.UIntBE=Se,ve.Int=xe,ve.IntBE=Ae,ve.Float=Ne,ve.FloatBE=De,ve.Double=Be,ve.DoubleBE=Ue,ve.Sequence=Le,ve.Structure=ze,ve.UnionDiscriminator=Fe,ve.UnionLayoutDiscriminator=qe,ve.Union=He,ve.VariantLayout=Je,ve.BitStructure=We,ve.BitField=Ke,ve.Boolean=Ge,ve.Blob=Ze,ve.CString=Xe,ve.UTF8=Ye,ve.Constant=$e,ve.greedy=function(e,t){return new ke(e,t)},ve.offset=function(e,t,n){return new _e(e,t,n)};var Qe=ve.u8=function(e){return new Oe(1,e)};ve.u16=function(e){return new Oe(2,e)},ve.u24=function(e){return new Oe(3,e)};var et=ve.u32=function(e){return new Oe(4,e)};ve.u40=function(e){return new Oe(5,e)},ve.u48=function(e){return new Oe(6,e)},ve.nu64=function(e){return new je(e)},ve.u16be=function(e){return new Se(2,e)},ve.u24be=function(e){return new Se(3,e)},ve.u32be=function(e){return new Se(4,e)},ve.u40be=function(e){return new Se(5,e)},ve.u48be=function(e){return new Se(6,e)},ve.nu64be=function(e){return new Ie(e)},ve.s8=function(e){return new xe(1,e)},ve.s16=function(e){return new xe(2,e)},ve.s24=function(e){return new xe(3,e)},ve.s32=function(e){return new xe(4,e)},ve.s40=function(e){return new xe(5,e)},ve.s48=function(e){return new xe(6,e)},ve.ns64=function(e){return new Ce(e)},ve.s16be=function(e){return new Ae(2,e)},ve.s24be=function(e){return new Ae(3,e)},ve.s32be=function(e){return new Ae(4,e)},ve.s40be=function(e){return new Ae(5,e)},ve.s48be=function(e){return new Ae(6,e)},ve.ns64be=function(e){return new Re(e)},ve.f32=function(e){return new Ne(e)},ve.f32be=function(e){return new De(e)},ve.f64=function(e){return new Be(e)},ve.f64be=function(e){return new Ue(e)};var tt=ve.struct=function(e,t,n){return new ze(e,t,n)};ve.bits=function(e,t,n){return new We(e,t,n)},ve.seq=function(e,t,n){return new Le(e,t,n)},ve.union=function(e,t,n){return new He(e,t,n)},ve.unionLayoutDiscriminator=function(e,t){return new qe(e,t)};var nt=ve.blob=function(e,t){return new Ze(e,t)};ve.cstr=function(e){return new Xe(e)},ve.utf8=function(e,t){return new Ye(e,t)},ve.const=function(e,t){return new $e(e,t)};var rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return nt(32,e)},at=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"uint64";return nt(8,e)};function it(e,t,n){for(var r=arguments.length,a=new Array(r>3?r-3:0),i=3;i4&&void 0!==i[4]&&i[4]||g.b.isOnCurve(a.toBuffer())){e.next=3;break}throw new Error("Owner cannot sign: ".concat(a.toString()));case 3:return e.next=5,g.b.findProgramAddress([a.toBuffer(),n.toBuffer(),r.toBuffer()],t);case 5:return e.abrupt("return",e.sent[0]);case 6:case"end":return e.stop()}}),e)})));return function(t,n,r,a){return e.apply(this,arguments)}}()},{key:"createAssociatedTokenAccountInstruction",value:function(e,t,n,r,a,i){var o=w.Buffer.alloc(0),s=[{pubkey:i,isSigner:!0,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:a,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:g.d.programId,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:g.c,isSigner:!1,isWritable:!1}];return new g.f({keys:s,programId:e,data:o})}}]),e}()}).call(this,n(35))},function(e,t,n){"use strict";n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(9),a=n(8),i=n(3),o=n(44),s=n(5),u=n(7),c=n(102),f=new u.Logger(c.a);function d(e){var t=[];return function e(n,r){if(Array.isArray(r))for(var a in r){var i=n.slice();i.push(a);try{e(i,r[a])}catch(o){t.push({path:i,error:o})}}}([],e),t}var l=function(){function e(t,n,a,i){Object(r.a)(this,e),this.name=t,this.type=n,this.localName=a,this.dynamic=i}return Object(a.a)(e,[{key:"_throwError",value:function(e,t){f.throwArgumentError(e,this.localName,t)}}]),e}(),p=function(){function e(t){Object(r.a)(this,e),Object(s.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return Object(a.a)(e,[{key:"data",get:function(){return Object(i.hexConcat)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData(Object(i.concat)(e._data))}},{key:"writeBytes",value:function(e){var t=Object(i.arrayify)(e),n=t.length%this.wordSize;return n&&(t=Object(i.concat)([t,this._padding.slice(n)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=Object(i.arrayify)(o.a.from(e));return t.length>this.wordSize&&f.throwError("value out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(i.concat)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(n){e._data[t]=e._getValue(n)}}}]),e}(),b=function(){function e(t,n,a,o){Object(r.a)(this,e),Object(s.defineReadOnly)(this,"_data",Object(i.arrayify)(t)),Object(s.defineReadOnly)(this,"wordSize",n||32),Object(s.defineReadOnly)(this,"_coerceFunc",a),Object(s.defineReadOnly)(this,"allowLoose",o),this._offset=0}return Object(a.a)(e,[{key:"data",get:function(){return Object(i.hexlify)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,n){return this._coerceFunc?this._coerceFunc(t,n):e.coerce(t,n)}},{key:"_peekBytes",value:function(e,t,n){var r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:f.throwError("data out-of-bounds",u.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}},{key:"readValue",value:function(){return o.a.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u.a}));var r=n(11),a=n(30),i=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},o=function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]>6===2;s++)o++;return o}return e===a.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(r||(r={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(a||(a={}));var u=Object.freeze({error:function(e,t,n,r,a){return o.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",n)},ignore:s,replace:function(e,t,n,r,i){return e===a.OVERLONG?(r.push(i),0):(r.push(65533),s(e,t,n))}});function c(e,t){null==t&&(t=u.error),e=Object(i.arrayify)(e);for(var n=[],r=0;r>7!==0){var s=null,c=null;if(192===(224&o))s=1,c=127;else if(224===(240&o))s=2,c=2047;else{if(240!==(248&o)){r+=t(128===(192&o)?a.UNEXPECTED_CONTINUE:a.BAD_PREFIX,r-1,e,n);continue}s=3,c=65535}if(r-1+s>=e.length)r+=t(a.OVERRUN,r-1,e,n);else{for(var f=o&(1<<8-s-1)-1,d=0;d1114111?r+=t(a.OUT_OF_RANGE,r-1-s,e,n,f):f>=55296&&f<=57343?r+=t(a.UTF16_SURROGATE,r-1-s,e,n,f):f<=c?r+=t(a.OVERLONG,r-1-s,e,n,f):n.push(f))}}else n.push(o)}return n}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current;t!=r.current&&(o.checkNormalize(),e=e.normalize(t));for(var n=[],a=0;a>6|192),n.push(63&s|128);else if(55296==(64512&s)){a++;var u=e.charCodeAt(a);if(a>=e.length||56320!==(64512&u))throw new Error("invalid utf-8 string");var c=65536+((1023&s)<<10)+(1023&u);n.push(c>>18|240),n.push(c>>12&63|128),n.push(c>>6&63|128),n.push(63&c|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(63&s|128)}return Object(i.arrayify)(n)}function d(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function l(e,t){return'"'+c(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?d(e):d(55296+((e-=65536)>>10&1023))+d(56320+(1023&e))})).join("")+'"'}function p(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function b(e,t){return p(c(e,t))}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current;return c(f(e,t))}},function(e,t,n){"use strict";n.r(t),n.d(t,"defaultPath",(function(){return S})),n.d(t,"HDNode",(function(){return x})),n.d(t,"mnemonicToSeed",(function(){return A})),n.d(t,"mnemonicToEntropy",(function(){return M})),n.d(t,"entropyToMnemonic",(function(){return E})),n.d(t,"isValidMnemonic",(function(){return P})),n.d(t,"getAccountPath",(function(){return j}));var r=n(9),a=n(8),i=n(111),o=n(3),s=n(44),u=n(55),c=n(707),f=n(5),d=n(76),l=n(138),p=n(199),b=n(48),h=n(706),y=new(n(7).Logger)("hdnode/5.5.0"),m=s.a.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),v=Object(u.f)("Bitcoin seed"),g=2147483648;function w(e){return(1<=256)throw new Error("Depth too large!");return k(Object(o.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(o.hexlify)(this.depth),this.parentFingerprint,Object(o.hexZeroPad)(Object(o.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?Object(o.concat)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(O,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var n=this.path;n&&(n+="/"+(2147483647&t));var r=new Uint8Array(37);if(t&g){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Object(o.arrayify)(this.privateKey),1),n&&(n+="'")}else r.set(Object(o.arrayify)(this.publicKey));for(var a=24;a>=0;a-=8)r[33+(a>>3)]=t>>24-a&255;var i=Object(o.arrayify)(Object(l.a)(p.a.sha512,this.chainCode,r)),u=i.slice(0,32),c=i.slice(32),f=null,b=null;this.privateKey?f=T(s.a.from(u).add(this.privateKey).mod(m)):b=new d.SigningKey(Object(o.hexlify)(u))._addPoint(this.publicKey);var h=n,y=this.mnemonic;return y&&(h=Object.freeze({phrase:y.phrase,path:n,locale:y.locale||"en"})),new e(O,f,b,this.fingerprint,T(c),t,this.depth+1,h)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var n=this,r=0;r=g)throw new Error("invalid path index - "+a);n=n._derive(g+i)}else{if(!a.match(/^[0-9]+$/))throw new Error("invalid path component - "+a);var o=parseInt(a);if(o>=g)throw new Error("invalid path index - "+a);n=n._derive(o)}}return n}}],[{key:"_fromSeed",value:function(t,n){var r=Object(o.arrayify)(t);if(r.length<16||r.length>64)throw new Error("invalid seed");var a=Object(o.arrayify)(Object(l.a)(p.a.sha512,v,r));return new e(O,T(a.slice(0,32)),null,"0x00000000",T(a.slice(32)),0,0,n)}},{key:"fromMnemonic",value:function(t,n,r){return t=E(M(t,r=_(r)),r),e._fromSeed(A(t,n),{phrase:t,path:"m",locale:r.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var n=i.Base58.decode(t);82===n.length&&k(n.slice(0,78))===t||y.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var r=n[4],a=Object(o.hexlify)(n.slice(5,9)),s=parseInt(Object(o.hexlify)(n.slice(9,13)).substring(2),16),u=Object(o.hexlify)(n.slice(13,45)),c=n.slice(45,78);switch(Object(o.hexlify)(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(O,null,Object(o.hexlify)(c),a,u,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new e(O,Object(o.hexlify)(c.slice(1)),null,a,u,s,r,null)}return y.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function A(e,t){t||(t="");var n=Object(u.f)("mnemonic"+t,u.a.NFKD);return Object(c.a)(Object(u.f)(e,u.a.NFKD),n,2048,64,"sha512")}function M(e,t){t=_(t),y.checkNormalize();var n=t.split(e);if(n.length%3!==0)throw new Error("invalid mnemonic");for(var r=Object(o.arrayify)(new Uint8Array(Math.ceil(11*n.length/8))),a=0,i=0;i>3]|=1<<7-a%8),a++}var c=32*n.length/3,f=w(n.length/3);if((Object(o.arrayify)(Object(l.c)(r.slice(0,c/8)))[0]&f)!==(r[r.length-1]&f))throw new Error("invalid checksum");return Object(o.hexlify)(r.slice(0,c/8))}function E(e,t){if(t=_(t),(e=Object(o.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var n=[0],r=11,a=0;a8?(n[n.length-1]<<=8,n[n.length-1]|=e[a],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[a]>>8-r,n.push(e[a]&(1<<8-r)-1),r+=3);var i=e.length/4,s=Object(o.arrayify)(Object(l.c)(e))[0]&w(i);return n[n.length-1]<<=i,n[n.length-1]|=s>>8-i,t.join(n.map((function(e){return t.getWord(e)})))}function P(e,t){try{return M(e,t),!0}catch(n){}return!1}function j(e){return("number"!==typeof e||e<0||e>=g||e%1)&&y.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(49);function a(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}function i(){return i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=a(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},i.apply(this,arguments)}},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]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=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)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.parseBytes32String=void 0;var o=n(178);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return o.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return o.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return o.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return o.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return o.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return o.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return o.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return o.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return o.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return o.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return o.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return o.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return o.TransactionDescription}});var s=n(31);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return s.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}});var u=i(n(175));t.base64=u;var c=n(111);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return c.Base58}});var f=n(3);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return f.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return f.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return f.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return f.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return f.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return f.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return f.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return f.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return f.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return f.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return f.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return f.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return f.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return f.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return f.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return f.stripZeros}});var d=n(130);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return d._TypedDataEncoder}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return d.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return d.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return d.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return d.namehash}});var l=n(56);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return l.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return l.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return l.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return l.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return l.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return l.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return l.mnemonicToSeed}});var p=n(170);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return p.getJsonWalletAddress}});var b=n(39);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return b.keccak256}});var h=n(7);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return h.Logger}});var y=n(113);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return y.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return y.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return y.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return y.sha512}});var m=n(93);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return m.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return m.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return m.sha256}});var v=n(162);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return v.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return v.shuffled}});var g=n(5);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return g.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return g.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return g.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return g.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return g.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return g.shallowCopy}});var w=i(n(82));t.RLP=w;var T=n(76);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return T.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return T.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return T.SigningKey}});var k=n(74);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return k.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return k.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return k.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return k._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return k.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return k.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return k.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return k.Utf8ErrorFuncs}});var _=n(48);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var O=n(137);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return O.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return O.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return O.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return O.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return O.parseUnits}});var S=n(134);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var x=n(64);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return x._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return x.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return x.poll}});var A=n(113);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return A.SupportedAlgorithm}});var M=n(74);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return M.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return M.Utf8ErrorReason}})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"d",(function(){return m})),n.d(t,"g",(function(){return g})),n.d(t,"e",(function(){return T})),n.d(t,"c",(function(){return k})),n.d(t,"a",(function(){return x})),n.d(t,"f",(function(){return A})),n.d(t,"b",(function(){return E}));var r=n(15),a=n(16),i=n(9),o=n(8),s=n(44),u=n(5),c=n(7),f=n(102),d=new c.Logger(f.a),l={},p={calldata:!0,memory:!0,storage:!0},b={calldata:!0,memory:!0};function h(e,t){if("bytes"===e||"string"===e){if(p[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&b[t])return!0;return(p[t]||"payable"===t)&&d.throwArgumentError("invalid modifier","name",t),!1}function y(e,t){for(var n in t)Object(u.defineReadOnly)(e,n,t[n])}var m=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),v=new RegExp(/^(.*)\[([0-9]*)\]$/),g=function(){function e(t,n){Object(i.a)(this,e),t!==l&&d.throwError("use fromString",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),y(this,n);var r=this.type.match(v);y(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return Object(o.a)(e,[{key:"format",value:function(e){if(e||(e=m.sighash),m[e]||d.throwArgumentError("invalid format type","format",e),e===m.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var n="";return"array"===this.baseType?(n+=this.arrayChildren.format(e),n+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==m.sighash&&(n+=this.type),n+="("+this.components.map((function(t){return t.format(e)})).join(e===m.full?", ":",")+")"):n+=this.type,e!==m.sighash&&(!0===this.indexed&&(n+=" indexed"),e===m.full&&this.name&&(n+=" "+this.name)),n}}],[{key:"from",value:function(t,n){return"string"===typeof t?e.fromString(t,n):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(l,{name:t.name||null,type:P(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,n){return r=function(e,t){var n=e;function r(t){d.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function a(e){var n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,s=0;s2&&d.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||d.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=s.a.from(n[1]),n[0]):e}function O(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function S(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&d.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&d.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||d.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&d.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&d.throwArgumentError("unable to determine stateMutability","value",e),t}var x=function(e){Object(r.a)(n,e);var t=Object(a.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"format",value:function(e){if(e||(e=m.sighash),m[e]||d.throwArgumentError("invalid format type","format",e),e===m.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===m.sighash&&d.throwError("cannot format a constructor for sighash",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===m.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?n.fromString(e):n.fromObject(e)}},{key:"fromObject",value:function(e){if(n.isConstructorFragment(e))return e;"constructor"!==e.type&&d.throwArgumentError("invalid constructor object","value",e);var t=S(e);t.constant&&d.throwArgumentError("constructor cannot be constant","value",e);var r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(g.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?s.a.from(e.gas):null};return new n(l,r)}},{key:"fromString",value:function(e){var t={type:"constructor"},r=(e=_(e,t)).match(C);return r&&"constructor"===r[1].trim()||d.throwArgumentError("invalid constructor string","value",e),t.inputs=w(r[2].trim(),!1),O(r[3].trim(),t),n.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),n}(T),A=function(e){Object(r.a)(n,e);var t=Object(a.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"format",value:function(e){if(e||(e=m.sighash),m[e]||d.throwArgumentError("invalid format type","format",e),e===m.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==m.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===m.full?", ":",")+") ",e!==m.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?n.fromString(e):n.fromObject(e)}},{key:"fromObject",value:function(e){if(n.isFunctionFragment(e))return e;"function"!==e.type&&d.throwArgumentError("invalid function object","value",e);var t=S(e),r={type:e.type,name:I(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(g.fromObject):[],outputs:e.outputs?e.outputs.map(g.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?s.a.from(e.gas):null};return new n(l,r)}},{key:"fromString",value:function(e){var t={type:"function"},r=(e=_(e,t)).split(" returns ");r.length>2&&d.throwArgumentError("invalid function string","value",e);var a=r[0].match(C);if(a||d.throwArgumentError("invalid function signature","value",e),t.name=a[1].trim(),t.name&&I(t.name),t.inputs=w(a[2],!1),O(a[3].trim(),t),r.length>1){var i=r[1].match(C);""==i[1].trim()&&""==i[3].trim()||d.throwArgumentError("unexpected tokens","value",e),t.outputs=w(i[2],!1)}else t.outputs=[];return n.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),n}(x);function M(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||d.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var E=function(e){Object(r.a)(n,e);var t=Object(a.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"format",value:function(e){if(e||(e=m.sighash),m[e]||d.throwArgumentError("invalid format type","format",e),e===m.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==m.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===m.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"===typeof e?n.fromString(e):n.fromObject(e)}},{key:"fromObject",value:function(e){if(n.isErrorFragment(e))return e;"error"!==e.type&&d.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:I(e.name),inputs:e.inputs?e.inputs.map(g.fromObject):[]};return M(new n(l,t))}},{key:"fromString",value:function(e){var t={type:"error"},r=e.match(C);return r||d.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&I(t.name),t.inputs=w(r[2],!1),M(n.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),n}(T);function P(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var j=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function I(e){return e&&e.match(j)||d.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var C=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"e",(function(){return l}));var r=n(414);function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var a=e.substring(t+1,e.length-1).split(",");return{type:n,values:a=a.map((function(e){return parseFloat(e)}))}}function o(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=u(e),r=u(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e){var t="hsl"===(e=i(e)).type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,a=t[2]/100,s=r*Math.min(a,1-a),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return a-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",f=[Math.round(255*u(0)),Math.round(255*u(8)),Math.round(255*u(4))];return"hsla"===e.type&&(c+="a",f.push(t[3])),o({type:c,values:f})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return u(e)>.5?d(e,t):l(e,t)}function f(e,t){return e=i(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,o(e)}function d(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return o(e)}function l(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return o(e)}},function(e,t){function n(e,t){for(var n=0;n0&&r%1===0,"invalid connection throttle limit","connection.throttleLimit",r);var o="object"===typeof e?e.throttleCallback:null,s="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;p.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);var f={},y=null,m={method:"GET"},v=!1,g=12e4;if("string"===typeof e)y=e;else if("object"===typeof e){if(null!=e&&null!=e.url||p.throwArgumentError("missing URL","connection.url",e),y=e.url,"number"===typeof e.timeout&&e.timeout>0&&(g=e.timeout),e.headers)for(var w in e.headers)f[w.toLowerCase()]={key:w,value:String(e.headers[w])},["if-none-match","if-modified-since"].indexOf(w.toLowerCase())>=0&&(v=!0);if(m.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==y.substring(0,6)&&!0!==e.allowInsecureAuthentication&&p.throwError("basic authentication requires a secure https url",c.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:e.user,password:"[REDACTED]"});var T=e.user+":"+e.password;f.authorization={key:"Authorization",value:"Basic "+Object(i.b)(Object(u.f)(T))}}}var k=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),_=y?y.match(k):null;if(_)try{var O={statusCode:200,statusMessage:"OK",headers:{"content-type":_[1]},body:Object(i.a)(_[2])},S=O.body;return n&&(S=n(O.body,O)),Promise.resolve(S)}catch(E){p.throwError("processing response error",c.Logger.errors.SERVER_ERROR,{body:h(_[1],_[2]),error:E,requestBody:null,requestMethod:"GET",url:y})}t&&(m.method="POST",m.body=t,null==f["content-type"]&&(f["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==f["content-length"]&&(f["content-length"]={key:"Content-Length",value:String(t.length)}));var x={};Object.keys(f).forEach((function(e){var t=f[e];x[t.key]=t.value})),m.headers=x;var A=function(){var e=null;return{promise:new Promise((function(t,n){g&&(e=setTimeout((function(){null!=e&&(e=null,n(p.makeError("timeout",c.Logger.errors.TIMEOUT,{requestBody:h(m.body,x["content-type"]),requestMethod:m.method,timeout:g,url:y})))}),g))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),M=function(){return l(this,void 0,void 0,a.a.mark((function e(){var t,i,u,f,l,g,w,T,k,_;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(A.cancel(),p.throwError("bad response",c.Logger.errors.SERVER_ERROR,{status:i.statusCode,headers:i.headers,body:h(w,i.headers?i.headers["content-type"]:null),requestBody:h(m.body,x["content-type"]),requestMethod:m.method,url:y})),!n){e.next=60;break}return e.prev=37,e.next=40,n(w,i);case 40:return T=e.sent,A.cancel(),e.abrupt("return",T);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(o()&&r(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));ct.ceiling&&(c=t.ceiling),setTimeout(a,c)}return null}),(function(e){o()&&r(e)}))}()}))}},,function(e,t,n){var r=t;r.utils=n(99),r.common=n(158),r.sha=n(434),r.ripemd=n(438),r.hmac=n(439),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},function(e,t,n){var r=n(21),a=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return a(e)},o.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 a=r(n(24)),i=r(n(20));t.protobufPackage="cosmos.base.v1beta1";var o={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,a=Object.assign({},o);n.pos>>3){case 1:a.denom=n.string();break;case 2:a.amount=n.string();break;default:n.skipType(7&s)}}return a},fromJSON:function(e){var t=Object.assign({},o);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({},o);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,a=Object.assign({},s);n.pos>>3){case 1:a.denom=n.string();break;case 2:a.amount=n.string();break;default:n.skipType(7&o)}}return a},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,a=Object.assign({},u);n.pos>>3===1)a.int=n.string();else n.skipType(7&o)}return a},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,a=Object.assign({},c);n.pos>>3===1)a.dec=n.string();else n.skipType(7&o)}return a},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!==a.default&&(i.default.util.Long=a.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1)for(var n=1;n>=8;return t}function s(e,t,n){for(var r=0,a=0;at+1+r&&i.throwError("child data too short",a.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:o}}function d(e,t){if(0===e.length&&i.throwError("data too short",a.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){var n=e[t]-247;t+1+n>e.length&&i.throwError("data short segment too short",a.Logger.errors.BUFFER_OVERRUN,{});var o=s(e,t+1,n);return t+1+n+o>e.length&&i.throwError("data long segment too short",a.Logger.errors.BUFFER_OVERRUN,{}),f(e,t,t+1+n,n+o)}if(e[t]>=192){var u=e[t]-192;return t+1+u>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{}),f(e,t,t+1,u)}if(e[t]>=184){var c=e[t]-183;t+1+c>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{});var d=s(e,t+1,c);return t+1+c+d>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+c+d,result:Object(r.hexlify)(e.slice(t+1+c,t+1+c+d))}}if(e[t]>=128){var l=e[t]-128;return t+1+l>e.length&&i.throwError("data too short",a.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+l,result:Object(r.hexlify)(e.slice(t+1,t+1+l))}}return{consumed:1,result:Object(r.hexlify)(e[t])}}function l(e){var t=Object(r.arrayify)(e),n=d(t,0);return n.consumed!==t.length&&i.throwArgumentError("invalid rlp data","data",e),n.result}},function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return ce})),n.d(t,"c",(function(){return de})),n.d(t,"d",(function(){return E})),n.d(t,"e",(function(){return K})),n.d(t,"f",(function(){return pe})),n.d(t,"g",(function(){return N})),n.d(t,"h",(function(){return ae}));var r=n(14),a=n(4),i=n.n(a),o=n(17),s=n(125),u=n(96),c=n(31),f=n(93),d=n(402),l=n(403),p=n(404),b=n(405),h=n(406),y=n(407),m=n(408);function v(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,a)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){v(i,r,a,o,s,"next",e)}function s(e){v(i,r,a,o,s,"throw",e)}o(void 0)}))}}function w(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var S,x,A=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(j){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),o=new M(r||[]);return i._invoke=function(e,t,n){var r=d;return function(a,i){if(r===p)throw new Error("Generator is already running");if(r===b){if("throw"===a)throw i;return P()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=f(e,t,n);if("normal"===u.type){if(r=n.done?b:l,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=b,n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(j){return{type:"throw",arg:j}}}e.wrap=c;var d="suspendedStart",l="suspendedYield",p="executing",b="completed",h={};function y(){}function m(){}function v(){}var g={};g[i]=function(){return this};var w=Object.getPrototypeOf,T=w&&w(w(E([])));T&&T!==n&&r.call(T,i)&&(g=T);var k=v.prototype=y.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(a,i,o,s){var u=f(e[a],e,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"===typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){c.value=e,o(c)}),(function(e){return n("throw",e,o,s)}))}s(u.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,a){n(e,r,t,a)}))}return a=a?a.then(i,i):i()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var a=f(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function E(e){if(e){var n=e[i];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;A(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(n){Function("r","regeneratorRuntime = r")(t)}})),M="0x0000000000000000000000000000000000000000";!function(e){e[e.LOWEST=100]="LOWEST",e[e.LOW=500]="LOW",e[e.MEDIUM=3e3]="MEDIUM",e[e.HIGH=1e4]="HIGH"}(x||(x={}));var E=((S={})[x.LOWEST]=1,S[x.LOW]=10,S[x.MEDIUM]=60,S[x.HIGH]=200,S),P=i.a.BigInt(-1),j=i.a.BigInt(0),I=i.a.BigInt(1),C=i.a.exponentiate(i.a.BigInt(2),i.a.BigInt(96)),R=i.a.exponentiate(C,i.a.BigInt(2));function N(e){var t=e.factoryAddress,n=e.tokenA,r=e.tokenB,a=e.fee,i=e.initCodeHashManualOverride,o=n.sortsBefore(r)?[n,r]:[r,n],u=o[0],d=o[1];return Object(c.getCreate2Address)(t,Object(f.keccak256)(["bytes"],[s.b.encode(["address","address","uint24"],[u.address,d.address,a])]),null!=i?i:"0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54")}var D=function(){function e(){}return e.addDelta=function(e,t){return i.a.lessThan(t,j)?i.a.subtract(e,i.a.multiply(t,P)):i.a.add(e,t)},e}(),B=function(){function e(){}return e.mulDivRoundingUp=function(e,t,n){var r=i.a.multiply(e,t),a=i.a.divide(r,n);return i.a.notEqual(i.a.remainder(r,n),j)&&(a=i.a.add(a,I)),a},e}(),U=i.a.subtract(i.a.exponentiate(i.a.BigInt(2),i.a.BigInt(160)),I);function L(e,t){var n=i.a.multiply(e,t);return i.a.bitwiseAnd(n,r.c)}var z=function(){function e(){}return e.getAmount0Delta=function(e,t,n,r){if(i.a.greaterThan(e,t)){var a=[t,e];e=a[0],t=a[1]}var o=i.a.leftShift(n,i.a.BigInt(96)),s=i.a.subtract(t,e);return r?B.mulDivRoundingUp(B.mulDivRoundingUp(o,s,t),I,e):i.a.divide(i.a.divide(i.a.multiply(o,s),t),e)},e.getAmount1Delta=function(e,t,n,r){if(i.a.greaterThan(e,t)){var a=[t,e];e=a[0],t=a[1]}return r?B.mulDivRoundingUp(n,i.a.subtract(t,e),C):i.a.divide(i.a.multiply(n,i.a.subtract(t,e)),C)},e.getNextSqrtPriceFromInput=function(e,t,n,r){return i.a.greaterThan(e,j)||Object(o.a)(!1),i.a.greaterThan(t,j)||Object(o.a)(!1),r?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)},e.getNextSqrtPriceFromOutput=function(e,t,n,r){return i.a.greaterThan(e,j)||Object(o.a)(!1),i.a.greaterThan(t,j)||Object(o.a)(!1),r?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)},e.getNextSqrtPriceFromAmount0RoundingUp=function(e,t,n,a){if(i.a.equal(n,j))return e;var s=i.a.leftShift(t,i.a.BigInt(96));if(a){var u=L(n,e);if(i.a.equal(i.a.divide(u,n),e)){var c=function(e,t){var n=i.a.add(e,t);return i.a.bitwiseAnd(n,r.c)}(s,u);if(i.a.greaterThanOrEqual(c,s))return B.mulDivRoundingUp(s,e,c)}return B.mulDivRoundingUp(s,I,i.a.add(i.a.divide(s,e),n))}var f=L(n,e);i.a.equal(i.a.divide(f,n),e)||Object(o.a)(!1),i.a.greaterThan(s,f)||Object(o.a)(!1);var d=i.a.subtract(s,f);return B.mulDivRoundingUp(s,e,d)},e.getNextSqrtPriceFromAmount1RoundingDown=function(e,t,n,r){if(r){var a=i.a.lessThanOrEqual(n,U)?i.a.divide(i.a.leftShift(n,i.a.BigInt(96)),t):i.a.divide(i.a.multiply(n,C),t);return i.a.add(e,a)}var s=B.mulDivRoundingUp(n,C,t);return i.a.greaterThan(e,s)||Object(o.a)(!1),i.a.subtract(e,s)},e}(),F=i.a.exponentiate(i.a.BigInt(10),i.a.BigInt(6)),q=function(){function e(){}return e.computeSwapStep=function(e,t,n,r,a){var o={},s=i.a.greaterThanOrEqual(e,t),u=i.a.greaterThanOrEqual(r,j);if(u){var c=i.a.divide(i.a.multiply(r,i.a.subtract(F,i.a.BigInt(a))),F);o.amountIn=s?z.getAmount0Delta(t,e,n,!0):z.getAmount1Delta(e,t,n,!0),i.a.greaterThanOrEqual(c,o.amountIn)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=z.getNextSqrtPriceFromInput(e,n,c,s)}else o.amountOut=s?z.getAmount1Delta(t,e,n,!1):z.getAmount0Delta(e,t,n,!1),i.a.greaterThanOrEqual(i.a.multiply(r,P),o.amountOut)?o.sqrtRatioNextX96=t:o.sqrtRatioNextX96=z.getNextSqrtPriceFromOutput(e,n,i.a.multiply(r,P),s);var f=i.a.equal(t,o.sqrtRatioNextX96);return s?(o.amountIn=f&&u?o.amountIn:z.getAmount0Delta(o.sqrtRatioNextX96,e,n,!0),o.amountOut=f&&!u?o.amountOut:z.getAmount1Delta(o.sqrtRatioNextX96,e,n,!1)):(o.amountIn=f&&u?o.amountIn:z.getAmount1Delta(e,o.sqrtRatioNextX96,n,!0),o.amountOut=f&&!u?o.amountOut:z.getAmount0Delta(e,o.sqrtRatioNextX96,n,!1)),!u&&i.a.greaterThan(o.amountOut,i.a.multiply(r,P))&&(o.amountOut=i.a.multiply(r,P)),u&&i.a.notEqual(o.sqrtRatioNextX96,t)?o.feeAmount=i.a.subtract(r,o.amountIn):o.feeAmount=B.mulDivRoundingUp(o.amountIn,i.a.BigInt(a),i.a.subtract(F,i.a.BigInt(a))),[o.sqrtRatioNextX96,o.amountIn,o.amountOut,o.feeAmount]},e}(),H=i.a.BigInt(2),J=[128,64,32,16,8,4,2,1].map((function(e){return[e,i.a.exponentiate(H,i.a.BigInt(e))]}));function V(e,t){return i.a.signedRightShift(i.a.multiply(e,i.a.BigInt(t)),i.a.BigInt(128))}var W=i.a.exponentiate(i.a.BigInt(2),i.a.BigInt(32)),K=function(){function e(){}return e.getSqrtRatioAtTick=function(t){t>=e.MIN_TICK&&t<=e.MAX_TICK&&Number.isInteger(t)||Object(o.a)(!1);var n=t<0?-1*t:t,a=0!=(1&n)?i.a.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):i.a.BigInt("0x100000000000000000000000000000000");return 0!=(2&n)&&(a=V(a,"0xfff97272373d413259a46990580e213a")),0!=(4&n)&&(a=V(a,"0xfff2e50f5f656932ef12357cf3c7fdcc")),0!=(8&n)&&(a=V(a,"0xffe5caca7e10e4e61c3624eaa0941cd0")),0!=(16&n)&&(a=V(a,"0xffcb9843d60f6159c9db58835c926644")),0!=(32&n)&&(a=V(a,"0xff973b41fa98c081472e6896dfb254c0")),0!=(64&n)&&(a=V(a,"0xff2ea16466c96a3843ec78b326b52861")),0!=(128&n)&&(a=V(a,"0xfe5dee046a99a2a811c461f1969c3053")),0!=(256&n)&&(a=V(a,"0xfcbe86c7900a88aedcffc83b479aa3a4")),0!=(512&n)&&(a=V(a,"0xf987a7253ac413176f2b074cf7815e54")),0!=(1024&n)&&(a=V(a,"0xf3392b0822b70005940c7a398e4b70f3")),0!=(2048&n)&&(a=V(a,"0xe7159475a2c29b7443b29c7fa6e889d9")),0!=(4096&n)&&(a=V(a,"0xd097f3bdfd2022b8845ad8f792aa5825")),0!=(8192&n)&&(a=V(a,"0xa9f746462d870fdf8a65dc1f90e061e5")),0!=(16384&n)&&(a=V(a,"0x70d869a156d2a1b890bb3df62baf32f7")),0!=(32768&n)&&(a=V(a,"0x31be135f97d08fd981231505542fcfa6")),0!=(65536&n)&&(a=V(a,"0x9aa508b5b7a84e1c677de54f3e99bc9")),0!=(131072&n)&&(a=V(a,"0x5d6af8dedb81196699c329225ee604")),0!=(262144&n)&&(a=V(a,"0x2216e584f5fa1ea926041bedfe98")),0!=(524288&n)&&(a=V(a,"0x48a170391f7dc42444e8fa2")),t>0&&(a=i.a.divide(r.c,a)),i.a.greaterThan(i.a.remainder(a,W),j)?i.a.add(i.a.divide(a,W),I):i.a.divide(a,W)},e.getTickAtSqrtRatio=function(t){i.a.greaterThanOrEqual(t,e.MIN_SQRT_RATIO)&&i.a.lessThan(t,e.MAX_SQRT_RATIO)||Object(o.a)(!1);var n,a=i.a.leftShift(t,i.a.BigInt(32)),s=function(e){i.a.greaterThan(e,j)||Object(o.a)(!1),i.a.lessThanOrEqual(e,r.c)||Object(o.a)(!1);for(var t,n=0,a=O(J);!(t=a()).done;){var s=t.value,u=s[0],c=s[1];i.a.greaterThanOrEqual(e,c)&&(e=i.a.signedRightShift(e,i.a.BigInt(u)),n+=u)}return n}(a);n=i.a.greaterThanOrEqual(i.a.BigInt(s),i.a.BigInt(128))?i.a.signedRightShift(a,i.a.BigInt(s-127)):i.a.leftShift(a,i.a.BigInt(127-s));for(var u=i.a.leftShift(i.a.subtract(i.a.BigInt(s),i.a.BigInt(128)),i.a.BigInt(64)),c=0;c<14;c++){n=i.a.signedRightShift(i.a.multiply(n,n),i.a.BigInt(127));var f=i.a.signedRightShift(n,i.a.BigInt(128));u=i.a.bitwiseOr(u,i.a.leftShift(f,i.a.BigInt(63-c))),n=i.a.signedRightShift(n,f)}var d=i.a.multiply(u,i.a.BigInt("255738958999603826347141")),l=i.a.toNumber(i.a.signedRightShift(i.a.subtract(d,i.a.BigInt("3402992956809132418596140100660247210")),i.a.BigInt(128))),p=i.a.toNumber(i.a.signedRightShift(i.a.add(d,i.a.BigInt("291339464771989622907027621153398088495")),i.a.BigInt(128)));return l===p?l:i.a.lessThanOrEqual(e.getSqrtRatioAtTick(p),t)?p:l},e}();K.MIN_TICK=-887272,K.MAX_TICK=-K.MIN_TICK,K.MIN_SQRT_RATIO=i.a.BigInt("4295128739"),K.MAX_SQRT_RATIO=i.a.BigInt("1461446703485210103287273052203988822378723970342");var G=function(){function e(){}var t=e.prototype;return t.getTick=function(){var t=g(A.mark((function t(n){return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error(e.ERROR_MESSAGE);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.nextInitializedTickWithinOneWord=function(){var t=g(A.mark((function t(n,r,a){return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error(e.ERROR_MESSAGE);case 1:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e}();function Z(e,t){return e.index-t.index}G.ERROR_MESSAGE="No tick data provider was given";var X=function(){function e(){}return e.validateList=function(e,t){t>0||Object(o.a)(!1),e.every((function(e){return e.index%t===0}))||Object(o.a)(!1),i.a.equal(e.reduce((function(e,t){var n=t.liquidityNet;return i.a.add(e,n)}),j),j)||Object(o.a)(!1),!function(e,t){for(var n=0;n0)return!1;return!0}(e,Z)&&Object(o.a)(!1)},e.isBelowSmallest=function(e,t){return e.length>0||Object(o.a)(!1),t0||Object(o.a)(!1),t>=e[e.length-1].index},e.getTick=function(e,t){var n=e[this.binarySearch(e,t)];return n.index!==t&&Object(o.a)(!1),n},e.binarySearch=function(e,t){this.isBelowSmallest(e,t)&&Object(o.a)(!1);for(var n,r=0,a=e.length-1;;){if(e[n=Math.floor((r+a)/2)].index<=t&&(n===e.length-1||e[n+1].index>t))return n;e[n].index>8<<8)*a;if(e.isBelowSmallest(t,n))return[o,!1];var s=e.nextInitializedTick(t,n,r).index,u=Math.max(o,s);return[u,u===s]}var c=(((i+1>>8)+1<<8)-1)*a;if(this.isAtOrAboveLargest(t,n))return[c,!1];var f=this.nextInitializedTick(t,n,r).index,d=Math.min(c,f);return[d,d===f]},e}();function Y(e){var t=i.a.BigInt(e).toString(16);return t.length%2!==0&&(t="0"+t),"0x"+t}function $(e,t){var n=e.input.wrapped,r=e.pools.reduce((function(e,t,n){var r=e.inputToken,a=e.path,i=e.types,o=t.token0.equals(r)?t.token1:t.token0;return 0===n?{inputToken:o,types:["address","uint24","address"],path:[r.address,t.fee,o.address]}:{inputToken:o,types:[].concat(i,["uint24","address"]),path:[].concat(a,[t.fee,o.address])}}),{inputToken:n,path:[],types:[]}),a=r.path,i=r.types;return t?Object(f.pack)(i.reverse(),a.reverse()):Object(f.pack)(i,a)}function Q(e,t){var n=i.a.leftShift(i.a.BigInt(e),i.a.BigInt(192)),a=i.a.BigInt(t),o=i.a.divide(n,a);return Object(r.j)(o)}function ee(e,t,n){if(i.a.greaterThan(e,t)){var r=[t,e];e=r[0],t=r[1]}var a=i.a.divide(i.a.multiply(e,t),C);return i.a.divide(i.a.multiply(i.a.BigInt(n),a),i.a.subtract(t,e))}function te(e,t,n){if(i.a.greaterThan(e,t)){var r=[t,e];e=r[0],t=r[1]}var a=i.a.multiply(i.a.multiply(i.a.BigInt(n),e),t),o=i.a.multiply(C,i.a.subtract(t,e));return i.a.divide(a,o)}function ne(e,t,n){if(i.a.greaterThan(e,t)){var r=[t,e];e=r[0],t=r[1]}return i.a.divide(i.a.multiply(i.a.BigInt(n),C),i.a.subtract(t,e))}function re(e,t,n,r,a,o){if(i.a.greaterThan(t,n)){var s=[n,t];t=s[0],n=s[1]}var u=o?te:ee;if(i.a.lessThanOrEqual(e,t))return u(t,n,r);if(i.a.lessThan(e,n)){var c=u(e,n,r),f=ne(t,e,a);return i.a.lessThan(c,f)?c:f}return ne(t,n,a)}function ae(e,t){Number.isInteger(e)&&Number.isInteger(t)||Object(o.a)(!1),t>0||Object(o.a)(!1),e>=K.MIN_TICK&&e<=K.MAX_TICK||Object(o.a)(!1);var n=Math.round(e/t)*t;return nK.MAX_TICK?n-t:n}function ie(e,t,n){var a=K.getSqrtRatioAtTick(n),o=i.a.multiply(a,a);return e.sortsBefore(t)?new r.e(e,t,R,o):new r.e(e,t,o,R)}var oe=function(e){var t=e.index,n=e.liquidityGross,r=e.liquidityNet;t>=K.MIN_TICK&&t<=K.MAX_TICK||Object(o.a)(!1),this.index=t,this.liquidityGross=i.a.BigInt(n),this.liquidityNet=i.a.BigInt(r)},se=function(){function e(e,t){var n=e.map((function(e){return e instanceof oe?e:new oe(e)}));X.validateList(n,t),this.ticks=n}var t=e.prototype;return t.getTick=function(){var e=g(A.mark((function e(t){return A.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",X.getTick(this.ticks,t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.nextInitializedTickWithinOneWord=function(){var e=g(A.mark((function e(t,n,r){return A.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",X.nextInitializedTickWithinOneWord(this.ticks,t,n,r));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),e}(),ue=new G,ce=function(){function e(e,t,n,r,a,s,u){void 0===u&&(u=ue),Number.isInteger(n)&&n<1e6||Object(o.a)(!1);var c=K.getSqrtRatioAtTick(s),f=K.getSqrtRatioAtTick(s+1);i.a.greaterThanOrEqual(i.a.BigInt(r),c)&&i.a.lessThanOrEqual(i.a.BigInt(r),f)||Object(o.a)(!1);var d=e.sortsBefore(t)?[e,t]:[t,e];this.token0=d[0],this.token1=d[1],this.fee=n,this.sqrtRatioX96=i.a.BigInt(r),this.liquidity=i.a.BigInt(a),this.tickCurrent=s,this.tickDataProvider=Array.isArray(u)?new se(u,E[n]):u}e.getAddress=function(e,t,n,r){return N({factoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",fee:n,tokenA:e,tokenB:t,initCodeHashManualOverride:r})};var t=e.prototype;return t.involvesToken=function(e){return e.equals(this.token0)||e.equals(this.token1)},t.priceOf=function(e){return this.involvesToken(e)||Object(o.a)(!1),e.equals(this.token0)?this.token0Price:this.token1Price},t.getOutputAmount=function(){var t=g(A.mark((function t(n,a){var s,u,c,f,d,l,p;return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.involvesToken(n.currency)||Object(o.a)(!1),s=n.currency.equals(this.token0),t.next=4,this.swap(s,n.quotient,a);case 4:return u=t.sent,c=u.amountCalculated,f=u.sqrtRatioX96,d=u.liquidity,l=u.tickCurrent,p=s?this.token1:this.token0,t.abrupt("return",[r.a.fromRawAmount(p,i.a.multiply(c,P)),new e(this.token0,this.token1,this.fee,f,d,l,this.tickDataProvider)]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t.getInputAmount=function(){var t=g(A.mark((function t(n,a){var s,u,c,f,d,l,p;return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.currency.isToken&&this.involvesToken(n.currency)||Object(o.a)(!1),s=n.currency.equals(this.token1),t.next=4,this.swap(s,i.a.multiply(n.quotient,P),a);case 4:return u=t.sent,c=u.amountCalculated,f=u.sqrtRatioX96,d=u.liquidity,l=u.tickCurrent,p=s?this.token0:this.token1,t.abrupt("return",[r.a.fromRawAmount(p,c),new e(this.token0,this.token1,this.fee,f,d,l,this.tickDataProvider)]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t.swap=function(){var e=g(A.mark((function e(t,n,r){var a,s,u,c,f,d;return A.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r||(r=t?i.a.add(K.MIN_SQRT_RATIO,I):i.a.subtract(K.MAX_SQRT_RATIO,I)),t?(i.a.greaterThan(r,K.MIN_SQRT_RATIO)||Object(o.a)(!1),i.a.lessThan(r,this.sqrtRatioX96)||Object(o.a)(!1)):(i.a.lessThan(r,K.MAX_SQRT_RATIO)||Object(o.a)(!1),i.a.greaterThan(r,this.sqrtRatioX96)||Object(o.a)(!1)),a=i.a.greaterThanOrEqual(n,j),s={amountSpecifiedRemaining:n,amountCalculated:j,sqrtPriceX96:this.sqrtRatioX96,tick:this.tickCurrent,liquidity:this.liquidity};case 4:if(!i.a.notEqual(s.amountSpecifiedRemaining,j)||s.sqrtPriceX96==r){e.next=35;break}return(u={}).sqrtPriceStartX96=s.sqrtPriceX96,e.next=9,this.tickDataProvider.nextInitializedTickWithinOneWord(s.tick,t,this.tickSpacing);case 9:if(c=e.sent,u.tickNext=c[0],u.initialized=c[1],u.tickNextK.MAX_TICK&&(u.tickNext=K.MAX_TICK),u.sqrtPriceNextX96=K.getSqrtRatioAtTick(u.tickNext),f=q.computeSwapStep(s.sqrtPriceX96,(t?i.a.lessThan(u.sqrtPriceNextX96,r):i.a.greaterThan(u.sqrtPriceNextX96,r))?r:u.sqrtPriceNextX96,s.liquidity,s.amountSpecifiedRemaining,this.fee),s.sqrtPriceX96=f[0],u.amountIn=f[1],u.amountOut=f[2],u.feeAmount=f[3],a?(s.amountSpecifiedRemaining=i.a.subtract(s.amountSpecifiedRemaining,i.a.add(u.amountIn,u.feeAmount)),s.amountCalculated=i.a.subtract(s.amountCalculated,u.amountOut)):(s.amountSpecifiedRemaining=i.a.add(s.amountSpecifiedRemaining,u.amountOut),s.amountCalculated=i.a.add(s.amountCalculated,i.a.add(u.amountIn,u.feeAmount))),!i.a.equal(s.sqrtPriceX96,u.sqrtPriceNextX96)){e.next=32;break}if(!u.initialized){e.next=29;break}return e.t0=i.a,e.next=25,this.tickDataProvider.getTick(u.tickNext);case 25:e.t1=e.sent.liquidityNet,d=e.t0.BigInt.call(e.t0,e.t1),t&&(d=i.a.multiply(d,P)),s.liquidity=D.addDelta(s.liquidity,d);case 29:s.tick=t?u.tickNext-1:u.tickNext,e.next=33;break;case 32:s.sqrtPriceX96!=u.sqrtPriceStartX96&&(s.tick=K.getTickAtSqrtRatio(s.sqrtPriceX96));case 33:e.next=4;break;case 35:return e.abrupt("return",{amountCalculated:s.amountCalculated,sqrtRatioX96:s.sqrtPriceX96,liquidity:s.liquidity,tickCurrent:s.tick});case 36:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),T(e,[{key:"token0Price",get:function(){var e;return null!=(e=this._token0Price)?e:this._token0Price=new r.e(this.token0,this.token1,R,i.a.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}},{key:"token1Price",get:function(){var e;return null!=(e=this._token1Price)?e:this._token1Price=new r.e(this.token1,this.token0,i.a.multiply(this.sqrtRatioX96,this.sqrtRatioX96),R)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"tickSpacing",get:function(){return E[this.fee]}}]),e}(),fe=function(){function e(e){var t=e.pool,n=e.liquidity,r=e.tickLower,a=e.tickUpper;this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,r=K.MIN_TICK&&r%t.tickSpacing===0||Object(o.a)(!1),a<=K.MAX_TICK&&a%t.tickSpacing===0||Object(o.a)(!1),this.pool=t,this.tickLower=r,this.tickUpper=a,this.liquidity=i.a.BigInt(n)}var t=e.prototype;return t.ratiosAfterSlippage=function(e){var t=this.pool.token0Price.asFraction.multiply(new r.d(1).subtract(e)),n=this.pool.token0Price.asFraction.multiply(e.add(1)),a=Q(t.numerator,t.denominator);i.a.lessThanOrEqual(a,K.MIN_SQRT_RATIO)&&(a=i.a.add(K.MIN_SQRT_RATIO,i.a.BigInt(1)));var o=Q(n.numerator,n.denominator);return i.a.greaterThanOrEqual(o,K.MAX_SQRT_RATIO)&&(o=i.a.subtract(K.MAX_SQRT_RATIO,i.a.BigInt(1))),{sqrtRatioX96Lower:a,sqrtRatioX96Upper:o}},t.mintAmountsWithSlippage=function(t){var n=this.ratiosAfterSlippage(t),r=n.sqrtRatioX96Upper,a=n.sqrtRatioX96Lower,i=new ce(this.pool.token0,this.pool.token1,this.pool.fee,a,0,K.getTickAtSqrtRatio(a)),o=new ce(this.pool.token0,this.pool.token1,this.pool.fee,r,0,K.getTickAtSqrtRatio(r)),s=e.fromAmounts(k({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts,{useFullPrecision:!1}));return{amount0:new e({pool:o,liquidity:s.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount0,amount1:new e({pool:i,liquidity:s.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount1}},t.burnAmountsWithSlippage=function(t){var n=this.ratiosAfterSlippage(t),r=n.sqrtRatioX96Upper,a=n.sqrtRatioX96Lower,i=new ce(this.pool.token0,this.pool.token1,this.pool.fee,a,0,K.getTickAtSqrtRatio(a)),o=new e({pool:new ce(this.pool.token0,this.pool.token1,this.pool.fee,r,0,K.getTickAtSqrtRatio(r)),liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,s=new e({pool:i,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:o.quotient,amount1:s.quotient}},e.fromAmounts=function(t){var n=t.pool,r=t.tickLower,a=t.tickUpper,i=t.amount0,o=t.amount1,s=t.useFullPrecision,u=K.getSqrtRatioAtTick(r),c=K.getSqrtRatioAtTick(a);return new e({pool:n,tickLower:r,tickUpper:a,liquidity:re(n.sqrtRatioX96,u,c,i,o,s)})},e.fromAmount0=function(t){var n=t.pool,a=t.tickLower,i=t.tickUpper,o=t.amount0,s=t.useFullPrecision;return e.fromAmounts({pool:n,tickLower:a,tickUpper:i,amount0:o,amount1:r.c,useFullPrecision:s})},e.fromAmount1=function(t){var n=t.pool,a=t.tickLower,i=t.tickUpper,o=t.amount1;return e.fromAmounts({pool:n,tickLower:a,tickUpper:i,amount0:r.c,amount1:o,useFullPrecision:!0})},T(e,[{key:"token0PriceLower",get:function(){return ie(this.pool.token0,this.pool.token1,this.tickLower)}},{key:"token0PriceUpper",get:function(){return ie(this.pool.token0,this.pool.token1,this.tickUpper)}},{key:"amount0",get:function(){return null===this._token0Amount&&(this.pool.tickCurrent0||Object(o.a)(!1);var r=e[0].chainId,a=e.every((function(e){return e.chainId===r}));a||Object(o.a)(!1);var i=t.wrapped;e[0].involvesToken(i)||Object(o.a)(!1),e[e.length-1].involvesToken(n.wrapped)||Object(o.a)(!1);for(var s,u=[i],c=O(e.entries());!(s=c()).done;){var f=s.value,d=f[0],l=f[1],p=u[d];p.equals(l.token0)||p.equals(l.token1)||Object(o.a)(!1);var b=p.equals(l.token0)?l.token1:l.token0;u.push(b)}this.pools=e,this.tokenPath=u,this.input=t,this.output=null!=n?n:u[u.length-1]}return T(e,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;var e=this.pools.slice(1).reduce((function(e,t){var n=e.nextInput,r=e.price;return n.equals(t.token0)?{nextInput:t.token1,price:r.multiply(t.token0Price)}:{nextInput:t.token0,price:r.multiply(t.token1Price)}}),this.pools[0].token0.equals(this.input.wrapped)?{nextInput:this.pools[0].token1,price:this.pools[0].token0Price}:{nextInput:this.pools[0].token0,price:this.pools[0].token1Price}).price;return this._midPrice=new r.e(this.input,this.output,e.denominator,e.numerator)}}]),e}();function le(e,t){return e.inputAmount.currency.equals(t.inputAmount.currency)||Object(o.a)(!1),e.outputAmount.currency.equals(t.outputAmount.currency)||Object(o.a)(!1),e.outputAmount.equalTo(t.outputAmount)?e.inputAmount.equalTo(t.inputAmount)?e.swaps.reduce((function(e,t){return e+t.route.tokenPath.length}),0)-t.swaps.reduce((function(e,t){return e+t.route.tokenPath.length}),0):e.inputAmount.lessThan(t.inputAmount)?-1:1:e.outputAmount.lessThan(t.outputAmount)?1:-1}var pe=function(){function e(e){var t=e.routes,n=e.tradeType,r=t[0].inputAmount.currency,a=t[0].outputAmount.currency;t.every((function(e){var t=e.route;return r.wrapped.equals(t.input.wrapped)}))||Object(o.a)(!1),t.every((function(e){var t=e.route;return a.wrapped.equals(t.output.wrapped)}))||Object(o.a)(!1);for(var i,s=t.map((function(e){return e.route.pools.length})).reduce((function(e,t){return e+t}),0),u=new Set,c=O(t);!(i=c()).done;)for(var f,d=O(i.value.route.pools);!(f=d()).done;){var l=f.value;u.add(ce.getAddress(l.token0,l.token1,l.fee))}s!=u.size&&Object(o.a)(!1),this.swaps=t,this.tradeType=n}e.exactIn=function(){var t=g(A.mark((function t(n,a){return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.fromRoute(n,a,r.g.EXACT_INPUT));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.exactOut=function(){var t=g(A.mark((function t(n,a){return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.fromRoute(n,a,r.g.EXACT_OUTPUT));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.fromRoute=function(){var t=g(A.mark((function t(n,a,i){var s,u,c,f,d,l,p,b,h,y,m;return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=new Array(n.tokenPath.length),i!==r.g.EXACT_INPUT){t.next=19;break}a.currency.equals(n.input)||Object(o.a)(!1),s[0]=a.wrapped,f=0;case 5:if(!(f0)){t.next=32;break}return h=n.pools[b-1],t.next=26,h.getInputAmount(s[b]);case 26:y=t.sent,m=y[0],s[b-1]=m;case 29:b--,t.next=22;break;case 32:u=r.a.fromFractionalAmount(n.input,s[0].numerator,s[0].denominator),c=r.a.fromFractionalAmount(n.output,a.numerator,a.denominator);case 34:return t.abrupt("return",new e({routes:[{inputAmount:u,outputAmount:c,route:n}],tradeType:i}));case 35:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.fromRoutes=function(){var t=g(A.mark((function t(n,a){var i,s,u,c,f,d,l,p,b,h,y,m,v,g,w,T,k;return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=[],s=O(n);case 2:if((u=s()).done){t.next=43;break}if(c=u.value,f=c.route,d=c.amount,l=new Array(f.tokenPath.length),p=void 0,b=void 0,a!==r.g.EXACT_INPUT){t.next=25;break}d.currency.equals(f.input)||Object(o.a)(!1),p=r.a.fromFractionalAmount(f.input,d.numerator,d.denominator),l[0]=r.a.fromFractionalAmount(f.input.wrapped,d.numerator,d.denominator),h=0;case 12:if(!(h0)){t.next=39;break}return w=f.pools[g-1],t.next=33,w.getInputAmount(l[g]);case 33:T=t.sent,k=T[0],l[g-1]=k;case 36:g--,t.next=29;break;case 39:p=r.a.fromFractionalAmount(f.input,l[0].numerator,l[0].denominator);case 40:i.push({route:f,inputAmount:p,outputAmount:b});case 41:t.next=2;break;case 43:return t.abrupt("return",new e({routes:i,tradeType:a}));case 44:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.createUncheckedTrade=function(t){return new e(k({},t,{routes:[{inputAmount:t.inputAmount,outputAmount:t.outputAmount,route:t.route}]}))},e.createUncheckedTradeWithMultipleRoutes=function(t){return new e(t)};var t=e.prototype;return t.minimumAmountOut=function(e,t){if(void 0===t&&(t=this.outputAmount),e.lessThan(j)&&Object(o.a)(!1),this.tradeType===r.g.EXACT_OUTPUT)return t;var n=new r.b(I).add(e).invert().multiply(t.quotient).quotient;return r.a.fromRawAmount(t.currency,n)},t.maximumAmountIn=function(e,t){if(void 0===t&&(t=this.inputAmount),e.lessThan(j)&&Object(o.a)(!1),this.tradeType===r.g.EXACT_INPUT)return t;var n=new r.b(I).add(e).multiply(t.quotient).quotient;return r.a.fromRawAmount(t.currency,n)},t.worstExecutionPrice=function(e){return new r.e(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(e).quotient,this.minimumAmountOut(e).quotient)},e.bestTradeExactIn=function(){var t=g(A.mark((function t(n,a,i,s,u,c,f){var d,l,p,b,h,y,m,v,g,w,T,k;return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l=(d=void 0===s?{}:s).maxNumResults,p=void 0===l?3:l,b=d.maxHops,h=void 0===b?3:b,void 0===u&&(u=[]),void 0===c&&(c=a),void 0===f&&(f=[]),n.length>0||Object(o.a)(!1),h>0||Object(o.a)(!1),a===c||u.length>0||Object(o.a)(!1),y=c.wrapped,m=i.wrapped,v=0;case 10:if(!(v1&&n.length>1)){t.next=43;break}return k=n.slice(0,v).concat(n.slice(v+1,n.length)),t.next=43,e.bestTradeExactIn(k,a,i,{maxNumResults:p,maxHops:h-1},[].concat(u,[g]),w,f);case 43:v++,t.next=10;break;case 46:return t.abrupt("return",f);case 47:case"end":return t.stop()}}),t,null,[[15,23]])})));return function(e,n,r,a,i,o,s){return t.apply(this,arguments)}}(),e.bestTradeExactOut=function(){var t=g(A.mark((function t(n,a,i,s,u,c,f){var d,l,p,b,h,y,m,v,g,w,T,k;return A.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l=(d=void 0===s?{}:s).maxNumResults,p=void 0===l?3:l,b=d.maxHops,h=void 0===b?3:b,void 0===u&&(u=[]),void 0===c&&(c=i),void 0===f&&(f=[]),n.length>0||Object(o.a)(!1),h>0||Object(o.a)(!1),i===c||u.length>0||Object(o.a)(!1),y=c.wrapped,m=a.wrapped,v=0;case 10:if(!(v1&&n.length>1)){t.next=43;break}return k=n.slice(0,v).concat(n.slice(v+1,n.length)),t.next=43,e.bestTradeExactOut(k,a,i,{maxNumResults:p,maxHops:h-1},[g].concat(u),w,f);case 43:v++,t.next=10;break;case 46:return t.abrupt("return",f);case 47:case"end":return t.stop()}}),t,null,[[15,23]])})));return function(e,n,r,a,i,o,s){return t.apply(this,arguments)}}(),T(e,[{key:"route",get:function(){return 1!=this.swaps.length&&Object(o.a)(!1),this.swaps[0].route}},{key:"inputAmount",get:function(){if(this._inputAmount)return this._inputAmount;var e=this.swaps[0].inputAmount.currency,t=this.swaps.map((function(e){return e.inputAmount})).reduce((function(e,t){return e.add(t)}),r.a.fromRawAmount(e,0));return this._inputAmount=t,this._inputAmount}},{key:"outputAmount",get:function(){if(this._outputAmount)return this._outputAmount;var e=this.swaps[0].outputAmount.currency,t=this.swaps.map((function(e){return e.outputAmount})).reduce((function(e,t){return e.add(t)}),r.a.fromRawAmount(e,0));return this._outputAmount=t,this._outputAmount}},{key:"executionPrice",get:function(){var e;return null!=(e=this._executionPrice)?e:this._executionPrice=new r.e(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){if(this._priceImpact)return this._priceImpact;for(var e,t=r.a.fromRawAmount(this.outputAmount.currency,0),n=O(this.swaps);!(e=n()).done;){var a=e.value,i=a.route,o=a.inputAmount,s=i.midPrice;t=t.add(s.quote(o))}var u=t.subtract(this.outputAmount).divide(t);return this._priceImpact=new r.d(u.numerator,u.denominator),this._priceImpact}}]),e}(),be=function(){function e(){}return e.encodeMulticall=function(t){return Array.isArray(t)||(t=[t]),1===t.length?t[0]:e.INTERFACE.encodeFunctionData("multicall",[t])},e}();be.INTERFACE=new u.b(d.a);var he=function(){function e(){}return e.encodePermit=function(t,n){return"nonce"in n?e.INTERFACE.encodeFunctionData("selfPermitAllowed",[t.address,Y(n.nonce),Y(n.expiry),n.v,n.r,n.s]):e.INTERFACE.encodeFunctionData("selfPermit",[t.address,Y(n.amount),Y(n.deadline),n.v,n.r,n.s])},e}();he.INTERFACE=new u.b(p.a);var ye=function(){function e(){}return e.encodeFeeBips=function(e){return Y(e.multiply(1e4).quotient)},e.encodeUnwrapWETH9=function(t,n,a){if(n=Object(r.k)(n),a){var i=this.encodeFeeBips(a.fee),o=Object(r.k)(a.recipient);return e.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[Y(t),n,i,o])}return e.INTERFACE.encodeFunctionData("unwrapWETH9",[Y(t),n])},e.encodeSweepToken=function(t,n,a,i){if(a=Object(r.k)(a),i){var o=this.encodeFeeBips(i.fee),s=Object(r.k)(i.recipient);return e.INTERFACE.encodeFunctionData("sweepTokenWithFee",[t.address,Y(n),a,o,s])}return e.INTERFACE.encodeFunctionData("sweepToken",[t.address,Y(n),a])},e.encodeRefundETH=function(){return e.INTERFACE.encodeFunctionData("refundETH")},e}();ye.INTERFACE=new u.b(b.a);var me=Y(i.a.subtract(i.a.exponentiate(i.a.BigInt(2),i.a.BigInt(128)),i.a.BigInt(1)));function ve(e){return Object.keys(e).some((function(e){return"recipient"===e}))}(function(){function e(){}return e.encodeCreate=function(t){return e.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[t.token0.address,t.token1.address,t.fee,Y(t.sqrtRatioX96)])},e.createCallParameters=function(e){return{calldata:this.encodeCreate(e),value:Y(0)}},e.addCallParameters=function(t,n){i.a.greaterThan(t.liquidity,j)||Object(o.a)(!1);var a=[],s=t.mintAmounts,u=s.amount0,c=s.amount1,f=t.mintAmountsWithSlippage(n.slippageTolerance),d=Y(f.amount0),l=Y(f.amount1),p=Y(n.deadline);if(ve(n)&&n.createPool&&a.push(this.encodeCreate(t.pool)),n.token0Permit&&a.push(he.encodePermit(t.pool.token0,n.token0Permit)),n.token1Permit&&a.push(he.encodePermit(t.pool.token1,n.token1Permit)),ve(n)){var b=Object(r.k)(n.recipient);a.push(e.INTERFACE.encodeFunctionData("mint",[{token0:t.pool.token0.address,token1:t.pool.token1.address,fee:t.pool.fee,tickLower:t.tickLower,tickUpper:t.tickUpper,amount0Desired:Y(u),amount1Desired:Y(c),amount0Min:d,amount1Min:l,recipient:b,deadline:p}]))}else a.push(e.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:Y(n.tokenId),amount0Desired:Y(u),amount1Desired:Y(c),amount0Min:d,amount1Min:l,deadline:p}]));var h=Y(0);if(n.useNative){var y=n.useNative.wrapped;t.pool.token0.equals(y)||t.pool.token1.equals(y)||Object(o.a)(!1);var m=t.pool.token0.equals(y)?u:c;i.a.greaterThan(m,j)&&a.push(ye.encodeRefundETH()),h=Y(m)}return{calldata:be.encodeMulticall(a),value:h}},e.encodeCollect=function(t){var n=[],a=Y(t.tokenId),i=t.expectedCurrencyOwed0.currency.isNative||t.expectedCurrencyOwed1.currency.isNative,o=Object(r.k)(t.recipient);if(n.push(e.INTERFACE.encodeFunctionData("collect",[{tokenId:a,recipient:i?M:o,amount0Max:me,amount1Max:me}])),i){var s=t.expectedCurrencyOwed0.currency.isNative?t.expectedCurrencyOwed0.quotient:t.expectedCurrencyOwed1.quotient,u=t.expectedCurrencyOwed0.currency.isNative?t.expectedCurrencyOwed1.currency:t.expectedCurrencyOwed0.currency,c=t.expectedCurrencyOwed0.currency.isNative?t.expectedCurrencyOwed1.quotient:t.expectedCurrencyOwed0.quotient;n.push(ye.encodeUnwrapWETH9(s,o)),n.push(ye.encodeSweepToken(u,c,o))}return n},e.collectCallParameters=function(t){var n=e.encodeCollect(t);return{calldata:be.encodeMulticall(n),value:Y(0)}},e.removeCallParameters=function(t,n){var a=[],s=Y(n.deadline),u=Y(n.tokenId),c=new fe({pool:t.pool,liquidity:n.liquidityPercentage.multiply(t.liquidity).quotient,tickLower:t.tickLower,tickUpper:t.tickUpper});i.a.greaterThan(c.liquidity,j)||Object(o.a)(!1);var f=c.burnAmountsWithSlippage(n.slippageTolerance),d=f.amount0,l=f.amount1;n.permit&&a.push(e.INTERFACE.encodeFunctionData("permit",[Object(r.k)(n.permit.spender),u,Y(n.permit.deadline),n.permit.v,n.permit.r,n.permit.s])),a.push(e.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:u,liquidity:Y(c.liquidity),amount0Min:Y(d),amount1Min:Y(l),deadline:s}]));var p=n.collectOptions,b=p.expectedCurrencyOwed0,h=p.expectedCurrencyOwed1,y=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(p,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return a.push.apply(a,e.encodeCollect(k({tokenId:Y(n.tokenId),expectedCurrencyOwed0:b.add(r.a.fromRawAmount(b.currency,d)),expectedCurrencyOwed1:h.add(r.a.fromRawAmount(h.currency,l))},y))),n.liquidityPercentage.equalTo(I)?n.burnToken&&a.push(e.INTERFACE.encodeFunctionData("burn",[u])):!0===n.burnToken&&Object(o.a)(!1),{calldata:be.encodeMulticall(a),value:Y(0)}},e.safeTransferFromParameters=function(t){var n=Object(r.k)(t.recipient),a=Object(r.k)(t.sender);return{calldata:t.data?e.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256,bytes)",[a,n,Y(t.tokenId),t.data]):e.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256)",[a,n,Y(t.tokenId)]),value:Y(0)}},e}()).INTERFACE=new u.b(l.a),(function(){function e(){}return e.quoteCallParameters=function(t,n,a,i){void 0===i&&(i={});var s,u=1===t.pools.length,c=Y(n.quotient);if(u){var f,d,l,p;if(a===r.g.EXACT_INPUT)s=e.INTERFACE.encodeFunctionData("quoteExactInputSingle",[t.tokenPath[0].address,t.tokenPath[1].address,t.pools[0].fee,c,Y(null!=(f=null==(d=i)?void 0:d.sqrtPriceLimitX96)?f:0)]);else s=e.INTERFACE.encodeFunctionData("quoteExactOutputSingle",[t.tokenPath[0].address,t.tokenPath[1].address,t.pools[0].fee,c,Y(null!=(l=null==(p=i)?void 0:p.sqrtPriceLimitX96)?l:0)])}else{var b;void 0!==(null==(b=i)?void 0:b.sqrtPriceLimitX96)&&Object(o.a)(!1);var h=$(t,a===r.g.EXACT_OUTPUT);s=a===r.g.EXACT_INPUT?e.INTERFACE.encodeFunctionData("quoteExactInput",[h,c]):e.INTERFACE.encodeFunctionData("quoteExactOutput",[h,c])}return{calldata:s,value:Y(0)}},e}()).INTERFACE=new u.b(h.a);var ge=function(){function e(){}return e.encodeClaim=function(t,n){var a,i=[];i.push(e.INTERFACE.encodeFunctionData("unstakeToken",[this._encodeIncentiveKey(t),Y(n.tokenId)]));var o=Object(r.k)(n.recipient),s=null!=(a=n.amount)?a:0;return i.push(e.INTERFACE.encodeFunctionData("claimReward",[t.rewardToken.address,o,Y(s)])),i},e.collectRewards=function(t,n){t=Array.isArray(t)?t:[t];for(var r=[],a=0;a1){for(var r=[],a=0;a=0)throw e;return p.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:n})}))),null==n.chainId?n.chainId=this.getChainId():n.chainId=Promise.all([Promise.resolve(n.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&p.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,Object(f.resolveProperties)(n);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||p.throwError("missing provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),m=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,a){var i;return Object(o.a)(this,n),p.checkNew(this instanceof n?this.constructor:void 0,n),i=t.call(this),Object(f.defineReadOnly)(Object(r.a)(i),"address",e),Object(f.defineReadOnly)(Object(r.a)(i),"provider",a||null),i}return Object(s.a)(n,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){p.throwError(e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new n(this.address,e)}}]),n}(y)},function(e,t,n){"use strict";n.d(t,"b",(function(){return i}));var r=n(18),a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},i={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function o(e){return"".concat(Math.round(e),"ms")}t.a={easing:a,duration:i,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?i.standard:n,u=t.easing,c=void 0===u?a.easeInOut:u,f=t.delay,d=void 0===f?0:f;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:o(s)," ").concat(c," ").concat("string"===typeof d?d:o(d))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"f",(function(){return s})),n.d(t,"a",(function(){return u})),n.d(t,"e",(function(){return c})),n.d(t,"d",(function(){return f})),n.d(t,"j",(function(){return d})),n.d(t,"k",(function(){return l})),n.d(t,"i",(function(){return p}));var r=1,a=2,i=3,o=4,s=5,u=6,c=7,f=10001,d="So11111111111111111111111111111111111111112",l=9,p=8},function(e,t,n){!function(e){"use strict";var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function h(e,t,n,r,a){var i,o=0;for(i=0;i>>8)-1}function y(e,t,n,r){return h(e,t,n,r,16)}function m(e,t,n,r){return h(e,t,n,r,32)}function v(e,t,n,r){!function(e,t,n,r){for(var a,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,f=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,h=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,y=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,m=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,g=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,T=i,k=o,_=s,O=u,S=c,x=f,A=d,M=l,E=p,P=b,j=h,I=y,C=m,R=v,N=g,D=w,B=0;B<20;B+=2)T^=(a=(C^=(a=(E^=(a=(S^=(a=T+C|0)<<7|a>>>25)+T|0)<<9|a>>>23)+S|0)<<13|a>>>19)+E|0)<<18|a>>>14,x^=(a=(k^=(a=(R^=(a=(P^=(a=x+k|0)<<7|a>>>25)+x|0)<<9|a>>>23)+P|0)<<13|a>>>19)+R|0)<<18|a>>>14,j^=(a=(A^=(a=(_^=(a=(N^=(a=j+A|0)<<7|a>>>25)+j|0)<<9|a>>>23)+N|0)<<13|a>>>19)+_|0)<<18|a>>>14,D^=(a=(I^=(a=(M^=(a=(O^=(a=D+I|0)<<7|a>>>25)+D|0)<<9|a>>>23)+O|0)<<13|a>>>19)+M|0)<<18|a>>>14,T^=(a=(O^=(a=(_^=(a=(k^=(a=T+O|0)<<7|a>>>25)+T|0)<<9|a>>>23)+k|0)<<13|a>>>19)+_|0)<<18|a>>>14,x^=(a=(S^=(a=(M^=(a=(A^=(a=x+S|0)<<7|a>>>25)+x|0)<<9|a>>>23)+A|0)<<13|a>>>19)+M|0)<<18|a>>>14,j^=(a=(P^=(a=(E^=(a=(I^=(a=j+P|0)<<7|a>>>25)+j|0)<<9|a>>>23)+I|0)<<13|a>>>19)+E|0)<<18|a>>>14,D^=(a=(N^=(a=(R^=(a=(C^=(a=D+N|0)<<7|a>>>25)+D|0)<<9|a>>>23)+C|0)<<13|a>>>19)+R|0)<<18|a>>>14;T=T+i|0,k=k+o|0,_=_+s|0,O=O+u|0,S=S+c|0,x=x+f|0,A=A+d|0,M=M+l|0,E=E+p|0,P=P+b|0,j=j+h|0,I=I+y|0,C=C+m|0,R=R+v|0,N=N+g|0,D=D+w|0,e[0]=T>>>0&255,e[1]=T>>>8&255,e[2]=T>>>16&255,e[3]=T>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=O>>>0&255,e[13]=O>>>8&255,e[14]=O>>>16&255,e[15]=O>>>24&255,e[16]=S>>>0&255,e[17]=S>>>8&255,e[18]=S>>>16&255,e[19]=S>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=M>>>0&255,e[29]=M>>>8&255,e[30]=M>>>16&255,e[31]=M>>>24&255,e[32]=E>>>0&255,e[33]=E>>>8&255,e[34]=E>>>16&255,e[35]=E>>>24&255,e[36]=P>>>0&255,e[37]=P>>>8&255,e[38]=P>>>16&255,e[39]=P>>>24&255,e[40]=j>>>0&255,e[41]=j>>>8&255,e[42]=j>>>16&255,e[43]=j>>>24&255,e[44]=I>>>0&255,e[45]=I>>>8&255,e[46]=I>>>16&255,e[47]=I>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=R>>>0&255,e[53]=R>>>8&255,e[54]=R>>>16&255,e[55]=R>>>24&255,e[56]=N>>>0&255,e[57]=N>>>8&255,e[58]=N>>>16&255,e[59]=N>>>24&255,e[60]=D>>>0&255,e[61]=D>>>8&255,e[62]=D>>>16&255,e[63]=D>>>24&255}(e,t,n,r)}function g(e,t,n,r){!function(e,t,n,r){for(var a,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,f=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,h=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,y=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,m=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,g=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,T=0;T<20;T+=2)i^=(a=(m^=(a=(p^=(a=(c^=(a=i+m|0)<<7|a>>>25)+i|0)<<9|a>>>23)+c|0)<<13|a>>>19)+p|0)<<18|a>>>14,f^=(a=(o^=(a=(v^=(a=(b^=(a=f+o|0)<<7|a>>>25)+f|0)<<9|a>>>23)+b|0)<<13|a>>>19)+v|0)<<18|a>>>14,h^=(a=(d^=(a=(s^=(a=(g^=(a=h+d|0)<<7|a>>>25)+h|0)<<9|a>>>23)+g|0)<<13|a>>>19)+s|0)<<18|a>>>14,w^=(a=(y^=(a=(l^=(a=(u^=(a=w+y|0)<<7|a>>>25)+w|0)<<9|a>>>23)+u|0)<<13|a>>>19)+l|0)<<18|a>>>14,i^=(a=(u^=(a=(s^=(a=(o^=(a=i+u|0)<<7|a>>>25)+i|0)<<9|a>>>23)+o|0)<<13|a>>>19)+s|0)<<18|a>>>14,f^=(a=(c^=(a=(l^=(a=(d^=(a=f+c|0)<<7|a>>>25)+f|0)<<9|a>>>23)+d|0)<<13|a>>>19)+l|0)<<18|a>>>14,h^=(a=(b^=(a=(p^=(a=(y^=(a=h+b|0)<<7|a>>>25)+h|0)<<9|a>>>23)+y|0)<<13|a>>>19)+p|0)<<18|a>>>14,w^=(a=(g^=(a=(v^=(a=(m^=(a=w+g|0)<<7|a>>>25)+w|0)<<9|a>>>23)+m|0)<<13|a>>>19)+v|0)<<18|a>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=h>>>0&255,e[9]=h>>>8&255,e[10]=h>>>16&255,e[11]=h>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=d>>>0&255,e[17]=d>>>8&255,e[18]=d>>>16&255,e[19]=d>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=b>>>0&255,e[29]=b>>>8&255,e[30]=b>>>16&255,e[31]=b>>>24&255}(e,t,n,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(e,t,n,r,a,i,o){var s,u,c=new Uint8Array(16),f=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=i[u];for(;a>=64;){for(v(f,c,o,w),u=0;u<64;u++)e[t+u]=n[r+u]^f[u];for(s=1,u=8;u<16;u++)s=s+(255&c[u])|0,c[u]=255&s,s>>>=8;a-=64,t+=64,r+=64}if(a>0)for(v(f,c,o,w),u=0;u=64;){for(v(u,s,a,w),o=0;o<64;o++)e[t+o]=u[o];for(i=1,o=8;o<16;o++)i=i+(255&s[o])|0,s[o]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(v(u,s,a,w),o=0;o>>13|n<<3),r=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|r<<6),a=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(r>>>7|a<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(a>>>4|i<<12),this.r[5]=i>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function x(e,t,n,r,a,i){var o=new S(i);return o.update(n,r,a),o.finish(e,t),0}function A(e,t,n,r,a,i){var o=new Uint8Array(16);return x(o,0,n,r,a,i),y(e,t,o,0)}function M(e,t,n,r,a){var i;if(n<32)return-1;for(O(e,0,t,0,n,r,a),x(e,16,e,32,n-32,e),i=0;i<16;i++)e[i]=0;return 0}function E(e,t,n,r,a){var i,o=new Uint8Array(32);if(n<32)return-1;if(_(o,0,32,r,a),0!==A(t,16,t,32,n-32,o))return-1;for(O(e,0,t,0,n,r,a),i=0;i<32;i++)e[i]=0;return 0}function P(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function j(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-65536*r;e[0]+=r-1+37*(r-1)}function I(e,t,n){for(var r,a=~(n-1),i=0;i<16;i++)r=a&(e[i]^t[i]),e[i]^=r,t[i]^=r}function C(e,n){var r,a,i,o=t(),s=t();for(r=0;r<16;r++)s[r]=n[r];for(j(s),j(s),j(s),a=0;a<2;a++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,I(s,o,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function R(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return C(n,e),C(r,t),m(n,0,r,0)}function N(e){var t=new Uint8Array(32);return C(t,e),1&t[0]}function D(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function U(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function L(e,t,n){var r,a,i=0,o=0,s=0,u=0,c=0,f=0,d=0,l=0,p=0,b=0,h=0,y=0,m=0,v=0,g=0,w=0,T=0,k=0,_=0,O=0,S=0,x=0,A=0,M=0,E=0,P=0,j=0,I=0,C=0,R=0,N=0,D=n[0],B=n[1],U=n[2],L=n[3],z=n[4],F=n[5],q=n[6],H=n[7],J=n[8],V=n[9],W=n[10],K=n[11],G=n[12],Z=n[13],X=n[14],Y=n[15];i+=(r=t[0])*D,o+=r*B,s+=r*U,u+=r*L,c+=r*z,f+=r*F,d+=r*q,l+=r*H,p+=r*J,b+=r*V,h+=r*W,y+=r*K,m+=r*G,v+=r*Z,g+=r*X,w+=r*Y,o+=(r=t[1])*D,s+=r*B,u+=r*U,c+=r*L,f+=r*z,d+=r*F,l+=r*q,p+=r*H,b+=r*J,h+=r*V,y+=r*W,m+=r*K,v+=r*G,g+=r*Z,w+=r*X,T+=r*Y,s+=(r=t[2])*D,u+=r*B,c+=r*U,f+=r*L,d+=r*z,l+=r*F,p+=r*q,b+=r*H,h+=r*J,y+=r*V,m+=r*W,v+=r*K,g+=r*G,w+=r*Z,T+=r*X,k+=r*Y,u+=(r=t[3])*D,c+=r*B,f+=r*U,d+=r*L,l+=r*z,p+=r*F,b+=r*q,h+=r*H,y+=r*J,m+=r*V,v+=r*W,g+=r*K,w+=r*G,T+=r*Z,k+=r*X,_+=r*Y,c+=(r=t[4])*D,f+=r*B,d+=r*U,l+=r*L,p+=r*z,b+=r*F,h+=r*q,y+=r*H,m+=r*J,v+=r*V,g+=r*W,w+=r*K,T+=r*G,k+=r*Z,_+=r*X,O+=r*Y,f+=(r=t[5])*D,d+=r*B,l+=r*U,p+=r*L,b+=r*z,h+=r*F,y+=r*q,m+=r*H,v+=r*J,g+=r*V,w+=r*W,T+=r*K,k+=r*G,_+=r*Z,O+=r*X,S+=r*Y,d+=(r=t[6])*D,l+=r*B,p+=r*U,b+=r*L,h+=r*z,y+=r*F,m+=r*q,v+=r*H,g+=r*J,w+=r*V,T+=r*W,k+=r*K,_+=r*G,O+=r*Z,S+=r*X,x+=r*Y,l+=(r=t[7])*D,p+=r*B,b+=r*U,h+=r*L,y+=r*z,m+=r*F,v+=r*q,g+=r*H,w+=r*J,T+=r*V,k+=r*W,_+=r*K,O+=r*G,S+=r*Z,x+=r*X,A+=r*Y,p+=(r=t[8])*D,b+=r*B,h+=r*U,y+=r*L,m+=r*z,v+=r*F,g+=r*q,w+=r*H,T+=r*J,k+=r*V,_+=r*W,O+=r*K,S+=r*G,x+=r*Z,A+=r*X,M+=r*Y,b+=(r=t[9])*D,h+=r*B,y+=r*U,m+=r*L,v+=r*z,g+=r*F,w+=r*q,T+=r*H,k+=r*J,_+=r*V,O+=r*W,S+=r*K,x+=r*G,A+=r*Z,M+=r*X,E+=r*Y,h+=(r=t[10])*D,y+=r*B,m+=r*U,v+=r*L,g+=r*z,w+=r*F,T+=r*q,k+=r*H,_+=r*J,O+=r*V,S+=r*W,x+=r*K,A+=r*G,M+=r*Z,E+=r*X,P+=r*Y,y+=(r=t[11])*D,m+=r*B,v+=r*U,g+=r*L,w+=r*z,T+=r*F,k+=r*q,_+=r*H,O+=r*J,S+=r*V,x+=r*W,A+=r*K,M+=r*G,E+=r*Z,P+=r*X,j+=r*Y,m+=(r=t[12])*D,v+=r*B,g+=r*U,w+=r*L,T+=r*z,k+=r*F,_+=r*q,O+=r*H,S+=r*J,x+=r*V,A+=r*W,M+=r*K,E+=r*G,P+=r*Z,j+=r*X,I+=r*Y,v+=(r=t[13])*D,g+=r*B,w+=r*U,T+=r*L,k+=r*z,_+=r*F,O+=r*q,S+=r*H,x+=r*J,A+=r*V,M+=r*W,E+=r*K,P+=r*G,j+=r*Z,I+=r*X,C+=r*Y,g+=(r=t[14])*D,w+=r*B,T+=r*U,k+=r*L,_+=r*z,O+=r*F,S+=r*q,x+=r*H,A+=r*J,M+=r*V,E+=r*W,P+=r*K,j+=r*G,I+=r*Z,C+=r*X,R+=r*Y,w+=(r=t[15])*D,o+=38*(k+=r*U),s+=38*(_+=r*L),u+=38*(O+=r*z),c+=38*(S+=r*F),f+=38*(x+=r*q),d+=38*(A+=r*H),l+=38*(M+=r*J),p+=38*(E+=r*V),b+=38*(P+=r*W),h+=38*(j+=r*K),y+=38*(I+=r*G),m+=38*(C+=r*Z),v+=38*(R+=r*X),g+=38*(N+=r*Y),i=(r=(i+=38*(T+=r*B))+(a=1)+65535)-65536*(a=Math.floor(r/65536)),o=(r=o+a+65535)-65536*(a=Math.floor(r/65536)),s=(r=s+a+65535)-65536*(a=Math.floor(r/65536)),u=(r=u+a+65535)-65536*(a=Math.floor(r/65536)),c=(r=c+a+65535)-65536*(a=Math.floor(r/65536)),f=(r=f+a+65535)-65536*(a=Math.floor(r/65536)),d=(r=d+a+65535)-65536*(a=Math.floor(r/65536)),l=(r=l+a+65535)-65536*(a=Math.floor(r/65536)),p=(r=p+a+65535)-65536*(a=Math.floor(r/65536)),b=(r=b+a+65535)-65536*(a=Math.floor(r/65536)),h=(r=h+a+65535)-65536*(a=Math.floor(r/65536)),y=(r=y+a+65535)-65536*(a=Math.floor(r/65536)),m=(r=m+a+65535)-65536*(a=Math.floor(r/65536)),v=(r=v+a+65535)-65536*(a=Math.floor(r/65536)),g=(r=g+a+65535)-65536*(a=Math.floor(r/65536)),w=(r=w+a+65535)-65536*(a=Math.floor(r/65536)),i=(r=(i+=a-1+37*(a-1))+(a=1)+65535)-65536*(a=Math.floor(r/65536)),o=(r=o+a+65535)-65536*(a=Math.floor(r/65536)),s=(r=s+a+65535)-65536*(a=Math.floor(r/65536)),u=(r=u+a+65535)-65536*(a=Math.floor(r/65536)),c=(r=c+a+65535)-65536*(a=Math.floor(r/65536)),f=(r=f+a+65535)-65536*(a=Math.floor(r/65536)),d=(r=d+a+65535)-65536*(a=Math.floor(r/65536)),l=(r=l+a+65535)-65536*(a=Math.floor(r/65536)),p=(r=p+a+65535)-65536*(a=Math.floor(r/65536)),b=(r=b+a+65535)-65536*(a=Math.floor(r/65536)),h=(r=h+a+65535)-65536*(a=Math.floor(r/65536)),y=(r=y+a+65535)-65536*(a=Math.floor(r/65536)),m=(r=m+a+65535)-65536*(a=Math.floor(r/65536)),v=(r=v+a+65535)-65536*(a=Math.floor(r/65536)),g=(r=g+a+65535)-65536*(a=Math.floor(r/65536)),w=(r=w+a+65535)-65536*(a=Math.floor(r/65536)),i+=a-1+37*(a-1),e[0]=i,e[1]=o,e[2]=s,e[3]=u,e[4]=c,e[5]=f,e[6]=d,e[7]=l,e[8]=p,e[9]=b,e[10]=h,e[11]=y,e[12]=m,e[13]=v,e[14]=g,e[15]=w}function z(e,t){L(e,t,t)}function F(e,n){var r,a=t();for(r=0;r<16;r++)a[r]=n[r];for(r=253;r>=0;r--)z(a,a),2!==r&&4!==r&&L(a,a,n);for(r=0;r<16;r++)e[r]=a[r]}function q(e,n){var r,a=t();for(r=0;r<16;r++)a[r]=n[r];for(r=250;r>=0;r--)z(a,a),1!==r&&L(a,a,n);for(r=0;r<16;r++)e[r]=a[r]}function H(e,n,r){var a,i,o=new Uint8Array(32),s=new Float64Array(80),c=t(),f=t(),d=t(),l=t(),p=t(),b=t();for(i=0;i<31;i++)o[i]=n[i];for(o[31]=127&n[31]|64,o[0]&=248,D(s,r),i=0;i<16;i++)f[i]=s[i],l[i]=c[i]=d[i]=0;for(c[0]=l[0]=1,i=254;i>=0;--i)I(c,f,a=o[i>>>3]>>>(7&i)&1),I(d,l,a),B(p,c,d),U(c,c,d),B(d,f,l),U(f,f,l),z(l,p),z(b,c),L(c,d,c),L(d,f,p),B(p,c,d),U(c,c,d),z(f,c),U(d,l,b),L(c,d,u),B(c,c,l),L(d,d,c),L(c,l,b),L(l,f,s),z(f,p),I(c,f,a),I(d,l,a);for(i=0;i<16;i++)s[i+16]=c[i],s[i+32]=d[i],s[i+48]=f[i],s[i+64]=l[i];var h=s.subarray(32),y=s.subarray(16);return F(h,h),L(y,y,h),C(e,y),0}function J(e,t){return H(e,t,i)}function V(e,t){return r(t,32),J(e,t)}function W(e,t,n){var r=new Uint8Array(32);return H(r,n,t),g(e,a,r,w)}S.prototype.blocks=function(e,t,n){for(var r,a,i,o,s,u,c,f,d,l,p,b,h,y,m,v,g,w,T,k=this.fin?0:2048,_=this.h[0],O=this.h[1],S=this.h[2],x=this.h[3],A=this.h[4],M=this.h[5],E=this.h[6],P=this.h[7],j=this.h[8],I=this.h[9],C=this.r[0],R=this.r[1],N=this.r[2],D=this.r[3],B=this.r[4],U=this.r[5],L=this.r[6],z=this.r[7],F=this.r[8],q=this.r[9];n>=16;)l=d=0,l+=(_+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*C,l+=(O+=8191&(r>>>13|(a=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*q),l+=(S+=8191&(a>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*F),l+=(x+=8191&(i>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*z),d=(l+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*L))>>>13,l&=8191,l+=(M+=s>>>1&8191)*(5*U),l+=(E+=8191&(s>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*B),l+=(P+=8191&(u>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*D),l+=(j+=8191&(c>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*N),p=d+=(l+=(I+=f>>>5|k)*(5*R))>>>13,p+=_*R,p+=O*C,p+=S*(5*q),p+=x*(5*F),d=(p+=A*(5*z))>>>13,p&=8191,p+=M*(5*L),p+=E*(5*U),p+=P*(5*B),p+=j*(5*D),d+=(p+=I*(5*N))>>>13,p&=8191,b=d,b+=_*N,b+=O*R,b+=S*C,b+=x*(5*q),d=(b+=A*(5*F))>>>13,b&=8191,b+=M*(5*z),b+=E*(5*L),b+=P*(5*U),b+=j*(5*B),h=d+=(b+=I*(5*D))>>>13,h+=_*D,h+=O*N,h+=S*R,h+=x*C,d=(h+=A*(5*q))>>>13,h&=8191,h+=M*(5*F),h+=E*(5*z),h+=P*(5*L),h+=j*(5*U),y=d+=(h+=I*(5*B))>>>13,y+=_*B,y+=O*D,y+=S*N,y+=x*R,d=(y+=A*C)>>>13,y&=8191,y+=M*(5*q),y+=E*(5*F),y+=P*(5*z),y+=j*(5*L),m=d+=(y+=I*(5*U))>>>13,m+=_*U,m+=O*B,m+=S*D,m+=x*N,d=(m+=A*R)>>>13,m&=8191,m+=M*C,m+=E*(5*q),m+=P*(5*F),m+=j*(5*z),v=d+=(m+=I*(5*L))>>>13,v+=_*L,v+=O*U,v+=S*B,v+=x*D,d=(v+=A*N)>>>13,v&=8191,v+=M*R,v+=E*C,v+=P*(5*q),v+=j*(5*F),g=d+=(v+=I*(5*z))>>>13,g+=_*z,g+=O*L,g+=S*U,g+=x*B,d=(g+=A*D)>>>13,g&=8191,g+=M*N,g+=E*R,g+=P*C,g+=j*(5*q),w=d+=(g+=I*(5*F))>>>13,w+=_*F,w+=O*z,w+=S*L,w+=x*U,d=(w+=A*B)>>>13,w&=8191,w+=M*D,w+=E*N,w+=P*R,w+=j*C,T=d+=(w+=I*(5*q))>>>13,T+=_*q,T+=O*F,T+=S*z,T+=x*L,d=(T+=A*U)>>>13,T&=8191,T+=M*B,T+=E*D,T+=P*N,T+=j*R,_=l=8191&(d=(d=((d+=(T+=I*C)>>>13)<<2)+d|0)+(l&=8191)|0),O=p+=d>>>=13,S=b&=8191,x=h&=8191,A=y&=8191,M=m&=8191,E=v&=8191,P=g&=8191,j=w&=8191,I=T&=8191,t+=16,n-=16;this.h[0]=_,this.h[1]=O,this.h[2]=S,this.h[3]=x,this.h[4]=A,this.h[5]=M,this.h[6]=E,this.h[7]=P,this.h[8]=j,this.h[9]=I},S.prototype.finish=function(e,t){var n,r,a,i,o=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,i=1;i<10;i++)o[i]=this.h[i]+n,n=o[i]>>>13,o[i]&=8191;for(o[9]-=8192,r=(1^n)-1,i=0;i<10;i++)o[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|o[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),a=this.h[0]+this.pad[0],this.h[0]=65535&a,i=1;i<8;i++)a=(this.h[i]+this.pad[i]|0)+(a>>>16)|0,this.h[i]=65535&a;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},S.prototype.update=function(e,t,n){var r,a;if(this.leftover){for((a=16-this.leftover)>n&&(a=n),r=0;r=16&&(a=n-n%16,this.blocks(e,t,a),t+=a,n-=a),n){for(r=0;r=128;){for(k=0;k<16;k++)_=8*k+G,P[k]=n[_+0]<<24|n[_+1]<<16|n[_+2]<<8|n[_+3],j[k]=n[_+4]<<24|n[_+5]<<16|n[_+6]<<8|n[_+7];for(k=0;k<80;k++)if(a=I,i=C,o=R,s=N,u=D,c=B,f=U,L,l=z,p=F,b=q,h=H,y=J,m=V,v=W,K,x=65535&(S=K),A=S>>>16,M=65535&(O=L),E=O>>>16,x+=65535&(S=(J>>>14|D<<18)^(J>>>18|D<<14)^(D>>>9|J<<23)),A+=S>>>16,M+=65535&(O=(D>>>14|J<<18)^(D>>>18|J<<14)^(J>>>9|D<<23)),E+=O>>>16,x+=65535&(S=J&V^~J&W),A+=S>>>16,M+=65535&(O=D&B^~D&U),E+=O>>>16,x+=65535&(S=Z[2*k+1]),A+=S>>>16,M+=65535&(O=Z[2*k]),E+=O>>>16,O=P[k%16],A+=(S=j[k%16])>>>16,M+=65535&O,E+=O>>>16,M+=(A+=(x+=65535&S)>>>16)>>>16,x=65535&(S=T=65535&x|A<<16),A=S>>>16,M=65535&(O=w=65535&M|(E+=M>>>16)<<16),E=O>>>16,x+=65535&(S=(z>>>28|I<<4)^(I>>>2|z<<30)^(I>>>7|z<<25)),A+=S>>>16,M+=65535&(O=(I>>>28|z<<4)^(z>>>2|I<<30)^(z>>>7|I<<25)),E+=O>>>16,A+=(S=z&F^z&q^F&q)>>>16,M+=65535&(O=I&C^I&R^C&R),E+=O>>>16,d=65535&(M+=(A+=(x+=65535&S)>>>16)>>>16)|(E+=M>>>16)<<16,g=65535&x|A<<16,x=65535&(S=h),A=S>>>16,M=65535&(O=s),E=O>>>16,A+=(S=T)>>>16,M+=65535&(O=w),E+=O>>>16,C=a,R=i,N=o,D=s=65535&(M+=(A+=(x+=65535&S)>>>16)>>>16)|(E+=M>>>16)<<16,B=u,U=c,L=f,I=d,F=l,q=p,H=b,J=h=65535&x|A<<16,V=y,W=m,K=v,z=g,k%16===15)for(_=0;_<16;_++)O=P[_],x=65535&(S=j[_]),A=S>>>16,M=65535&O,E=O>>>16,O=P[(_+9)%16],x+=65535&(S=j[(_+9)%16]),A+=S>>>16,M+=65535&O,E+=O>>>16,w=P[(_+1)%16],x+=65535&(S=((T=j[(_+1)%16])>>>1|w<<31)^(T>>>8|w<<24)^(T>>>7|w<<25)),A+=S>>>16,M+=65535&(O=(w>>>1|T<<31)^(w>>>8|T<<24)^w>>>7),E+=O>>>16,w=P[(_+14)%16],A+=(S=((T=j[(_+14)%16])>>>19|w<<13)^(w>>>29|T<<3)^(T>>>6|w<<26))>>>16,M+=65535&(O=(w>>>19|T<<13)^(T>>>29|w<<3)^w>>>6),E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,P[_]=65535&M|E<<16,j[_]=65535&x|A<<16;x=65535&(S=z),A=S>>>16,M=65535&(O=I),E=O>>>16,O=e[0],A+=(S=t[0])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[0]=I=65535&M|E<<16,t[0]=z=65535&x|A<<16,x=65535&(S=F),A=S>>>16,M=65535&(O=C),E=O>>>16,O=e[1],A+=(S=t[1])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[1]=C=65535&M|E<<16,t[1]=F=65535&x|A<<16,x=65535&(S=q),A=S>>>16,M=65535&(O=R),E=O>>>16,O=e[2],A+=(S=t[2])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[2]=R=65535&M|E<<16,t[2]=q=65535&x|A<<16,x=65535&(S=H),A=S>>>16,M=65535&(O=N),E=O>>>16,O=e[3],A+=(S=t[3])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[3]=N=65535&M|E<<16,t[3]=H=65535&x|A<<16,x=65535&(S=J),A=S>>>16,M=65535&(O=D),E=O>>>16,O=e[4],A+=(S=t[4])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[4]=D=65535&M|E<<16,t[4]=J=65535&x|A<<16,x=65535&(S=V),A=S>>>16,M=65535&(O=B),E=O>>>16,O=e[5],A+=(S=t[5])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[5]=B=65535&M|E<<16,t[5]=V=65535&x|A<<16,x=65535&(S=W),A=S>>>16,M=65535&(O=U),E=O>>>16,O=e[6],A+=(S=t[6])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[6]=U=65535&M|E<<16,t[6]=W=65535&x|A<<16,x=65535&(S=K),A=S>>>16,M=65535&(O=L),E=O>>>16,O=e[7],A+=(S=t[7])>>>16,M+=65535&O,E+=O>>>16,E+=(M+=(A+=(x+=65535&S)>>>16)>>>16)>>>16,e[7]=L=65535&M|E<<16,t[7]=K=65535&x|A<<16,G+=128,r-=128}return r}function Y(e,t,n){var r,a=new Int32Array(8),i=new Int32Array(8),o=new Uint8Array(256),s=n;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,X(a,i,t,n),n%=128,r=0;r=0;--a)Q(e,t,r=n[a/8|0]>>(7&a)&1),$(t,e),$(e,e),Q(e,t,r)}function ne(e,n){var r=[t(),t(),t(),t()];P(r[0],d),P(r[1],l),P(r[2],s),L(r[3],d,l),te(e,r,n)}function re(e,n,a){var i,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(a||r(n,32),Y(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,ne(s,o),ee(e,s),i=0;i<32;i++)n[i+32]=e[i];return 0}var ae=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var n,r,a,i;for(r=63;r>=32;--r){for(n=0,a=r-32,i=r-12;a>4)*ae[a],n=t[a]>>8,t[a]&=255;for(a=0;a<32;a++)t[a]-=n*ae[a];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function oe(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,n)}function se(e,n,r,a){var i,o,s=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),f=new Float64Array(64),d=[t(),t(),t(),t()];Y(s,a,32),s[0]&=248,s[31]&=127,s[31]|=64;var l=r+64;for(i=0;i>7&&U(e[0],o,e[0]),L(e[3],e[0],e[1]),0)}(l,a))return-1;for(i=0;i=0},e.sign.keyPair=function(){var e=new Uint8Array(de),t=new Uint8Array(le);return re(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(be(e),e.length!==le)throw new Error("bad secret key size");for(var t=new Uint8Array(de),n=0;n(a>>1)-1?(a>>1)-u:u,i.isubn(s)):s=0,r[o]=s,i.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,s,u=e.andln(3)+a&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),o=0===(1&u)?0:3!==(r=e.andln(7)+a&7)&&5!==r||2!==c?u:-u,n[0].push(o),s=0===(1&c)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*a===o+1&&(a=1-a),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 a(e,"hex","le")}},function(e,t,n){"use strict";n.r(t),n.d(t,"pack",(function(){return b})),n.d(t,"keccak256",(function(){return h})),n.d(t,"sha256",(function(){return y}));var r=n(44),a=n(3),i=n(39),o=n(138),s=n(55),u=n(7),c=new RegExp("^bytes([0-9]+)$"),f=new RegExp("^(u?int)([0-9]*)$"),d=new RegExp("^(.*)\\[([0-9]*)\\]$"),l=new u.Logger("solidity/5.5.0");function p(e,t,n){switch(e){case"address":return n?Object(a.zeroPad)(t,32):Object(a.arrayify)(t);case"string":return Object(s.f)(t);case"bytes":return Object(a.arrayify)(t);case"bool":return t=t?"0x01":"0x00",n?Object(a.zeroPad)(t,32):Object(a.arrayify)(t)}var i=e.match(f);if(i){var o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!==0||0===o||o>256)&&l.throwArgumentError("invalid number type","type",e),n&&(o=256),t=r.a.from(t).toTwos(o),Object(a.zeroPad)(t,o/8)}if(i=e.match(c)){var u=parseInt(i[1]);return(String(u)!==i[1]||0===u||u>32)&&l.throwArgumentError("invalid bytes type","type",e),Object(a.arrayify)(t).byteLength!==u&&l.throwArgumentError("invalid value for ".concat(e),"value",t),n?Object(a.arrayify)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if((i=e.match(d))&&Array.isArray(t)){var b=i[1];parseInt(i[2]||String(t.length))!=t.length&&l.throwArgumentError("invalid array length for ".concat(e),"value",t);var h=[];return t.forEach((function(e){h.push(p(b,e,!0))})),Object(a.concat)(h)}return l.throwArgumentError("invalid type","type",e)}function b(e,t){e.length!=t.length&&l.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var n=[];return e.forEach((function(e,r){n.push(p(e,t[r]))})),Object(a.hexlify)(Object(a.concat)(n))}function h(e,t){return Object(i.keccak256)(b(e,t))}function y(e,t){return Object(o.c)(b(e,t))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return u}));var r=n(3),a=n(98);function i(e){return new Uint8Array(a.bech32.fromWords(a.bech32.decode(e).words))}function o(e){return a.bech32.encode("terra",a.bech32.toWords(e))}var s=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),e.startsWith("u")&&4===e.length}(e)||"uluna"===e};function u(e){for(var t=[],n=0;n1&&m.throwArgumentError("multiple matching functions","name",n),this.functions[r[0]]}var a=this.functions[b.f.fromString(e).format()];return a||m.throwArgumentError("no matching function","signature",e),a}},{key:"getEvent",value:function(e){if(Object(c.isHexString)(e)){var t=e.toLowerCase();for(var n in this.events)if(t===this.getEventTopic(n))return this.events[n];m.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var r=e.trim(),a=Object.keys(this.events).filter((function(e){return e.split("(")[0]===r}));return 0===a.length?m.throwArgumentError("no matching event","name",r):a.length>1&&m.throwArgumentError("multiple matching events","name",r),this.events[a[0]]}var i=this.events[b.c.fromString(e).format()];return i||m.throwArgumentError("no matching event","signature",e),i}},{key:"getError",value:function(e){if(Object(c.isHexString)(e)){var t=Object(l.getStatic)(this.constructor,"getSighash");for(var n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}m.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),a=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===r}));return 0===a.length?m.throwArgumentError("no matching error","name",r):a.length>1&&m.throwArgumentError("multiple matching errors","name",r),this.errors[a[0]]}var i=this.errors[b.f.fromString(e).format()];return i||m.throwArgumentError("no matching error","signature",e),i}},{key:"getSighash",value:function(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(n){throw t}}return Object(l.getStatic)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),Object(l.getStatic)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"===typeof e&&(e=this.getError(e));var n=Object(c.arrayify)(t);return Object(c.hexlify)(n.slice(0,4))!==this.getSighash(e)&&m.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"===typeof e&&(e=this.getError(e)),Object(c.hexlify)(Object(c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var n=Object(c.arrayify)(t);return Object(c.hexlify)(n.slice(0,4))!==this.getSighash(e)&&m.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(c.hexlify)(Object(c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var n=Object(c.arrayify)(t),r=null,a=null,i=null,o=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(f){}break;case 4:var s=Object(c.hexlify)(n.slice(0,4)),u=k[s];if(u)a=this._abiCoder.decode(u.inputs,n.slice(4)),i=u.name,o=u.signature,u.reason&&(r=a[0]);else try{var f=this.getError(s);a=this._abiCoder.decode(f.inputs,n.slice(4)),i=f.name,o=f.format()}catch(f){console.log(f)}}return m.throwError("call revert exception",h.Logger.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:a,errorName:i,errorSignature:o,reason:r})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(c.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var n=this;"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&m.throwError("too many arguments for "+e.format(),h.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var r=[];e.anonymous||r.push(this.getEventTopic(e));var a=function(e,t){return"string"===e.type?Object(f.a)(t):"bytes"===e.type?Object(d.keccak256)(Object(c.hexlify)(t)):("address"===e.type&&n._abiCoder.encode(["address"],[t]),Object(c.hexZeroPad)(Object(c.hexlify)(t),32))};for(t.forEach((function(t,n){var i=e.inputs[n];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?m.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((function(e){return a(i,e)}))):r.push(a(i,t)):null!=t&&m.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}},{key:"encodeEventLog",value:function(e,t){var n=this;"string"===typeof e&&(e=this.getEvent(e));var r=[],a=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&m.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,o){var s=t[o];if(e.indexed)if("string"===e.type)r.push(Object(f.a)(s));else if("bytes"===e.type)r.push(Object(d.keccak256)(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(n._abiCoder.encode([e.type],[s]))}else a.push(e),i.push(s)})),{data:this._abiCoder.encode(a,i),topics:r}}},{key:"decodeEventLog",value:function(e,t,n){if("string"===typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){var r=this.getEventTopic(e);Object(c.isHexString)(n[0],32)&&n[0].toLowerCase()===r||m.throwError("fragment/topic mismatch",h.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:r,value:n[0]}),n=n.slice(1)}var a=[],i=[],o=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(a.push(b.g.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(a.push(e),o.push(!1)):(i.push(e),o.push(!1))}));var s=null!=n?this._abiCoder.decode(a,Object(c.concat)(n)):null,u=this._abiCoder.decode(i,t,!0),f=[],d=0,l=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)f[t]=new T({_isIndexed:!0,hash:null});else if(o[t])f[t]=new T({_isIndexed:!0,hash:s[l++]});else try{f[t]=s[l++]}catch(r){f[t]=r}else try{f[t]=u[d++]}catch(r){f[t]=r}if(e.name&&null==f[e.name]){var n=f[t];n instanceof Error?Object.defineProperty(f,e.name,{enumerable:!0,get:function(){throw _("property ".concat(JSON.stringify(e.name)),n)}}):f[e.name]=n}}));for(var p=function(e){var t=f[e];t instanceof Error&&Object.defineProperty(f,e,{enumerable:!0,get:function(){throw _("index ".concat(e),t)}})},y=0;y255)return!1;return!0}function a(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(n(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function o(e,t,n,r,a){null==r&&null==a||(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,n)}var s={toBytes:function(e){var t=[],n=0;for(e=encodeURI(e);n191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[n+1])),n+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[n+1])<<6|63&e[n+2])),n+=3)}return t.join("")}},u=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],n=0;n>4]+e[15&a])}return n.join("")}}}(),c={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],b=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],h=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],m=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],g=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],T=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],k=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],_=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],O=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function S(e){for(var t=[],n=0;n>2,this._Ke[n][t%4]=i[t],this._Kd[e-n][t%4]=i[t];for(var o,s=0,u=a;u>16&255]<<24^d[o>>8&255]<<16^d[255&o]<<8^d[o>>24&255]^f[s]<<24,s+=1,8!=a)for(t=1;t>8&255]<<8^d[o>>16&255]<<16^d[o>>24&255]<<24;for(t=a/2+1;t>2,p=u%4,this._Ke[l][p]=i[t],this._Kd[e-l][p]=i[t++],u++}for(var l=1;l>24&255]^k[o>>16&255]^_[o>>8&255]^O[255&o]},x.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=S(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var o=1;o>24&255]^b[r[(a+1)%4]>>16&255]^h[r[(a+2)%4]>>8&255]^y[255&r[(a+3)%4]]^this._Ke[o][a];r=n.slice()}var s,u=i(16);for(a=0;a<4;a++)s=this._Ke[t][a],u[4*a]=255&(d[r[a]>>24&255]^s>>24),u[4*a+1]=255&(d[r[(a+1)%4]>>16&255]^s>>16),u[4*a+2]=255&(d[r[(a+2)%4]>>8&255]^s>>8),u[4*a+3]=255&(d[255&r[(a+3)%4]]^s);return u},x.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=S(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var o=1;o>24&255]^v[r[(a+3)%4]>>16&255]^g[r[(a+2)%4]>>8&255]^w[255&r[(a+1)%4]]^this._Kd[o][a];r=n.slice()}var s,u=i(16);for(a=0;a<4;a++)s=this._Kd[t][a],u[4*a]=255&(l[r[a]>>24&255]^s>>24),u[4*a+1]=255&(l[r[(a+3)%4]>>16&255]^s>>16),u[4*a+2]=255&(l[r[(a+2)%4]>>8&255]^s>>8),u[4*a+3]=255&(l[255&r[(a+1)%4]]^s);return u};var A=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new x(t)};A.prototype.encrypt=function(e){if((e=a(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),n=i(16),r=0;r=0;--t)this._counter[t]=e%256,e>>=8},j.prototype.setBytes=function(e){if(16!=(e=a(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},j.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var I=function e(t,n){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",n instanceof j||(n=new j(n)),this._counter=n,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new x(t)};I.prototype.encrypt=function(e){for(var t=a(e,!0),n=0;n16)throw new Error("PKCS#7 padding byte out of range");for(var n=e.length-t,r=0;r>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function u(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=s(t)^r>>5}t=s(t);for(var a=0;a=n;)i-=n,s.push(a>>i&o);if(r)i>0&&s.push(a<=t)return"Excess padding";if(a<n)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var c=e.slice(0,o),f=e.slice(o+1);if(f.length<6)return"Data too short";var d=u(c);if("string"===typeof d)return d;for(var l=[],p=0;p=f.length||l.push(h)}return d!==t?"Invalid checksum for "+e:{prefix:c,words:l}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){var r=n(e,t);if("object"===typeof r)return r},decode:function(e,t){var r=n(e,t);if("object"===typeof r)return r;throw new Error(r)},encode:function(e,n,a){if(a=a||90,e.length+7+n.length>a)throw new TypeError("Exceeds length limit");var i=u(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var o=e+"1",c=0;c>5!==0)throw new Error("Non 5-bit word");i=s(i)^f,o+=r.charAt(f)}for(var d=0;d<6;++d)i=s(i);i^=t;for(var l=0;l<6;++l){o+=r.charAt(i>>5*(5-l)&31)}return o},toWords:f,fromWordsUnsafe:d,fromWords:l}}t.bech32=p("bech32"),t.bech32m=p("bech32m")},function(e,t,n){"use strict";var r=n(128),a=n(51);function i(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function o(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=a,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),a=0;a>6|192,n[r++]=63&o|128):i(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,a=0;r>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=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,a){return e+t+n+r+a>>>0},t.sum64=function(e,t,n,r){var a=e[t],i=r+e[t+1]>>>0,o=(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,a,i,o,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,a,i,o,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,n,r,a,i,o,s,u,c){var f=0,d=t;return f+=(d=d+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,a,i,o,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(e){var r=n(33).default,a=n(59).default,i=n(63).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgAcknowledgementResponse=t.MsgAcknowledgement=t.MsgTimeoutOnCloseResponse=t.MsgTimeoutOnClose=t.MsgTimeoutResponse=t.MsgTimeout=t.MsgRecvPacketResponse=t.MsgRecvPacket=t.MsgChannelCloseConfirmResponse=t.MsgChannelCloseConfirm=t.MsgChannelCloseInitResponse=t.MsgChannelCloseInit=t.MsgChannelOpenConfirmResponse=t.MsgChannelOpenConfirm=t.MsgChannelOpenAckResponse=t.MsgChannelOpenAck=t.MsgChannelOpenTryResponse=t.MsgChannelOpenTry=t.MsgChannelOpenInitResponse=t.MsgChannelOpenInit=t.protobufPackage=void 0;var s=o(n(24)),u=o(n(20)),c=n(189),f=n(144);t.protobufPackage="ibc.core.channel.v1";var d={portId:"",signer:""};t.MsgChannelOpenInit={encode:function(e){var t=arguments.length>1&&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,a=Object.assign({},d);n.pos>>3){case 1:a.portId=n.string();break;case 2:a.channel=c.Channel.decode(n,n.uint32());break;case 3:a.signer=n.string();break;default:n.skipType(7&i)}}return a},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 l={};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,a=Object.assign({},l);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&&f.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,a=Object.assign({},p);for(a.proofInit=new Uint8Array;n.pos>>3){case 1:a.portId=n.string();break;case 2:a.previousChannelId=n.string();break;case 3:a.channel=c.Channel.decode(n,n.uint32());break;case 4:a.counterpartyVersion=n.string();break;case 5:a.proofInit=n.bytes();break;case 6:a.proofHeight=f.Height.decode(n,n.uint32());break;case 7:a.signer=n.string();break;default:n.skipType(7&i)}}return a},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=R(e.proofInit)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.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=f.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.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,a=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.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&&f.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,a=Object.assign({},h);for(a.proofTry=new Uint8Array;n.pos>>3){case 1:a.portId=n.string();break;case 2:a.channelId=n.string();break;case 3:a.counterpartyChannelId=n.string();break;case 4:a.counterpartyVersion=n.string();break;case 5:a.proofTry=n.bytes();break;case 6:a.proofHeight=f.Height.decode(n,n.uint32());break;case 7:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},h);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=R(e.proofTry)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},h);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=f.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var y={};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,a=Object.assign({},y);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&&f.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,a=Object.assign({},m);for(a.proofAck=new Uint8Array;n.pos>>3){case 1:a.portId=n.string();break;case 2:a.channelId=n.string();break;case 3:a.proofAck=n.bytes();break;case 4:a.proofHeight=f.Height.decode(n,n.uint32());break;case 5:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},m);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=R(e.proofAck)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},m);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=f.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var v={};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,a=Object.assign({},v);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,a=Object.assign({},g);n.pos>>3){case 1:a.portId=n.string();break;case 2:a.channelId=n.string();break;case 3:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},g);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({},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.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,a=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&&f.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,a=Object.assign({},T);for(a.proofInit=new Uint8Array;n.pos>>3){case 1:a.portId=n.string();break;case 2:a.channelId=n.string();break;case 3:a.proofInit=n.bytes();break;case 4:a.proofHeight=f.Height.decode(n,n.uint32());break;case 5:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},T);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=R(e.proofInit)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},T);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=f.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.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,a=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.proofCommitment.length&&t.uint32(18).bytes(e.proofCommitment),void 0!==e.proofHeight&&f.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,a=Object.assign({},_);for(a.proofCommitment=new Uint8Array;n.pos>>3){case 1:a.packet=c.Packet.decode(n,n.uint32());break;case 2:a.proofCommitment=n.bytes();break;case 3:a.proofHeight=f.Height.decode(n,n.uint32());break;case 4:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},_);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=R(e.proofCommitment)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},_);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=f.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var O={};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,a=Object.assign({},O);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&&f.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,a=Object.assign({},S);for(a.proofUnreceived=new Uint8Array;n.pos>>3){case 1:a.packet=c.Packet.decode(n,n.uint32());break;case 2:a.proofUnreceived=n.bytes();break;case 3:a.proofHeight=f.Height.decode(n,n.uint32());break;case 4:a.nextSequenceRecv=n.uint64();break;case 5:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},S);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=R(e.proofUnreceived)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.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({},S);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=f.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 x={};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,a=Object.assign({},x);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&&f.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,a=Object.assign({},A);for(a.proofUnreceived=new Uint8Array,a.proofClose=new Uint8Array;n.pos>>3){case 1:a.packet=c.Packet.decode(n,n.uint32());break;case 2:a.proofUnreceived=n.bytes();break;case 3:a.proofClose=n.bytes();break;case 4:a.proofHeight=f.Height.decode(n,n.uint32());break;case 5:a.nextSequenceRecv=n.uint64();break;case 6:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},A);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=R(e.proofUnreceived)),void 0!==e.proofClose&&null!==e.proofClose&&(t.proofClose=R(e.proofClose)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.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.proofClose&&null!==e.proofClose?t.proofClose=e.proofClose:t.proofClose=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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,a=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&&f.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,a=Object.assign({},E);for(a.acknowledgement=new Uint8Array,a.proofAcked=new Uint8Array;n.pos>>3){case 1:a.packet=c.Packet.decode(n,n.uint32());break;case 2:a.acknowledgement=n.bytes();break;case 3:a.proofAcked=n.bytes();break;case 4:a.proofHeight=f.Height.decode(n,n.uint32());break;case 5:a.signer=n.string();break;default:n.skipType(7&i)}}return a},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=R(e.acknowledgement)),void 0!==e.proofAcked&&null!==e.proofAcked&&(t.proofAcked=R(e.proofAcked)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=f.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?f.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=f.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var P={};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,a=Object.assign({},P);n.pos255||(r=e.charCodeAt(u++))>255||(a=e.charCodeAt(u++))>255)throw new TypeError("invalid character found");o+=i[(t=n<<16|r<<8|a)>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},c=r?function(e){return btoa(e)}:a?function(e){return Buffer.from(e,"binary").toString("base64")}:u,f=a?function(e){return Buffer.from(e).toString("base64")}:function(e){for(var t=[],n=0,r=e.length;n1&&void 0!==arguments[1]&&arguments[1];return t?s(f(e)):f(e)}},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var a=0,i=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.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)a=u(e,t,r)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=t)r++;r--,a=a/t|0;for(var i=e.length-n,o=i%r,s=Math.min(i,i-o)+n,u=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var f=["","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"],d=[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],l=[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 p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,l=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=l;p++){var b=c-p|0;f+=(o=(a=0|e.words[b])*(i=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|f}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?f[6-u.length]+u+n:u+n,(a+=2)>=26&&(a-=26,o--)}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=d[e],p=l[e];n="";var b=this.clone();for(b.negative=0;!b.isZero();){var h=b.modn(p).toString(e);n=(b=b.idivn(p)).isZero()?h+n:f[c-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var a=this.byteLength(),i=n||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,c=new e(i),f=this.clone();if(u){for(s=0;!f.isZero();s++)o=f.andln(255),f.iushrn(8),c[s]=o;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},i.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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.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)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.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)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,a=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 a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,p=0|o[1],b=8191&p,h=p>>>13,y=0|o[2],m=8191&y,v=y>>>13,g=0|o[3],w=8191&g,T=g>>>13,k=0|o[4],_=8191&k,O=k>>>13,S=0|o[5],x=8191&S,A=S>>>13,M=0|o[6],E=8191&M,P=M>>>13,j=0|o[7],I=8191&j,C=j>>>13,R=0|o[8],N=8191&R,D=R>>>13,B=0|o[9],U=8191&B,L=B>>>13,z=0|s[0],F=8191&z,q=z>>>13,H=0|s[1],J=8191&H,V=H>>>13,W=0|s[2],K=8191&W,G=W>>>13,Z=0|s[3],X=8191&Z,Y=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ae=0|s[6],ie=8191&ae,oe=ae>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],be=8191&pe,he=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,F))|0)+((8191&(a=(a=Math.imul(d,q))+Math.imul(l,F)|0))<<13)|0;c=((i=Math.imul(l,q))+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(b,F),a=(a=Math.imul(b,q))+Math.imul(h,F)|0,i=Math.imul(h,q);var me=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,V)|0)+Math.imul(l,J)|0))<<13)|0;c=((i=i+Math.imul(l,V)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,F),a=(a=Math.imul(m,q))+Math.imul(v,F)|0,i=Math.imul(v,q),r=r+Math.imul(b,J)|0,a=(a=a+Math.imul(b,V)|0)+Math.imul(h,J)|0,i=i+Math.imul(h,V)|0;var ve=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(l,K)|0))<<13)|0;c=((i=i+Math.imul(l,G)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,F),a=(a=Math.imul(w,q))+Math.imul(T,F)|0,i=Math.imul(T,q),r=r+Math.imul(m,J)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(v,J)|0,i=i+Math.imul(v,V)|0,r=r+Math.imul(b,K)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(h,K)|0,i=i+Math.imul(h,G)|0;var ge=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(l,X)|0))<<13)|0;c=((i=i+Math.imul(l,Y)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(_,F),a=(a=Math.imul(_,q))+Math.imul(O,F)|0,i=Math.imul(O,q),r=r+Math.imul(w,J)|0,a=(a=a+Math.imul(w,V)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,V)|0,r=r+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(v,K)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(b,X)|0,a=(a=a+Math.imul(b,Y)|0)+Math.imul(h,X)|0,i=i+Math.imul(h,Y)|0;var we=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,Q)|0))<<13)|0;c=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,F),a=(a=Math.imul(x,q))+Math.imul(A,F)|0,i=Math.imul(A,q),r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,V)|0,r=r+Math.imul(w,K)|0,a=(a=a+Math.imul(w,G)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(m,X)|0,a=(a=a+Math.imul(m,Y)|0)+Math.imul(v,X)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var Te=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(a=(a=a+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;c=((i=i+Math.imul(l,re)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(E,F),a=(a=Math.imul(E,q))+Math.imul(P,F)|0,i=Math.imul(P,q),r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,V)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(O,K)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(w,X)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(m,Q)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(b,ne)|0,a=(a=a+Math.imul(b,re)|0)+Math.imul(h,ne)|0,i=i+Math.imul(h,re)|0;var ke=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;c=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,F),a=(a=Math.imul(I,q))+Math.imul(C,F)|0,i=Math.imul(C,q),r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,V)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,G)|0,r=r+Math.imul(_,X)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(O,X)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(m,ne)|0,a=(a=a+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(h,ie)|0,i=i+Math.imul(h,oe)|0;var _e=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(a=(a=a+Math.imul(d,ce)|0)+Math.imul(l,ue)|0))<<13)|0;c=((i=i+Math.imul(l,ce)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,F),a=(a=Math.imul(N,q))+Math.imul(D,F)|0,i=Math.imul(D,q),r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,V)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(E,K)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,r=r+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,Y)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,r=r+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,re)|0)+Math.imul(T,ne)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,oe)|0,r=r+Math.imul(b,ue)|0,a=(a=a+Math.imul(b,ce)|0)+Math.imul(h,ue)|0,i=i+Math.imul(h,ce)|0;var Oe=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;c=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,F),a=(a=Math.imul(U,q))+Math.imul(L,F)|0,i=Math.imul(L,q),r=r+Math.imul(N,J)|0,a=(a=a+Math.imul(N,V)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,r=r+Math.imul(E,X)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(_,ne)|0,a=(a=a+Math.imul(_,re)|0)+Math.imul(O,ne)|0,i=i+Math.imul(O,re)|0,r=r+Math.imul(w,ie)|0,a=(a=a+Math.imul(w,oe)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,oe)|0,r=r+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,r=r+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(h,de)|0,i=i+Math.imul(h,le)|0;var Se=(c+(r=r+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,he)|0)+Math.imul(l,be)|0))<<13)|0;c=((i=i+Math.imul(l,he)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(U,J),a=(a=Math.imul(U,V))+Math.imul(L,J)|0,i=Math.imul(L,V),r=r+Math.imul(N,K)|0,a=(a=a+Math.imul(N,G)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,G)|0,r=r+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(x,ne)|0,a=(a=a+Math.imul(x,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,oe)|0,r=r+Math.imul(w,ue)|0,a=(a=a+Math.imul(w,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,r=r+Math.imul(m,de)|0,a=(a=a+Math.imul(m,le)|0)+Math.imul(v,de)|0,i=i+Math.imul(v,le)|0;var xe=(c+(r=r+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,he)|0)+Math.imul(h,be)|0))<<13)|0;c=((i=i+Math.imul(h,he)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(L,K)|0,i=Math.imul(L,G),r=r+Math.imul(N,X)|0,a=(a=a+Math.imul(N,Y)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,Y)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(E,ne)|0,a=(a=a+Math.imul(E,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,r=r+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,ce)|0)+Math.imul(O,ue)|0,i=i+Math.imul(O,ce)|0,r=r+Math.imul(w,de)|0,a=(a=a+Math.imul(w,le)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,le)|0;var Ae=(c+(r=r+Math.imul(m,be)|0)|0)+((8191&(a=(a=a+Math.imul(m,he)|0)+Math.imul(v,be)|0))<<13)|0;c=((i=i+Math.imul(v,he)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(L,X)|0,i=Math.imul(L,Y),r=r+Math.imul(N,Q)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,r=r+Math.imul(_,de)|0,a=(a=a+Math.imul(_,le)|0)+Math.imul(O,de)|0,i=i+Math.imul(O,le)|0;var Me=(c+(r=r+Math.imul(w,be)|0)|0)+((8191&(a=(a=a+Math.imul(w,he)|0)+Math.imul(T,be)|0))<<13)|0;c=((i=i+Math.imul(T,he)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(L,Q)|0,i=Math.imul(L,ee),r=r+Math.imul(N,ne)|0,a=(a=a+Math.imul(N,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,r=r+Math.imul(E,ue)|0,a=(a=a+Math.imul(E,ce)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var Ee=(c+(r=r+Math.imul(_,be)|0)|0)+((8191&(a=(a=a+Math.imul(_,he)|0)+Math.imul(O,be)|0))<<13)|0;c=((i=i+Math.imul(O,he)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(U,ne),a=(a=Math.imul(U,re))+Math.imul(L,ne)|0,i=Math.imul(L,re),r=r+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,oe)|0,r=r+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,r=r+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Pe=(c+(r=r+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,he)|0)+Math.imul(A,be)|0))<<13)|0;c=((i=i+Math.imul(A,he)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(L,ie)|0,i=Math.imul(L,oe),r=r+Math.imul(N,ue)|0,a=(a=a+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,ce)|0,r=r+Math.imul(I,de)|0,a=(a=a+Math.imul(I,le)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,le)|0;var je=(c+(r=r+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,he)|0)+Math.imul(P,be)|0))<<13)|0;c=((i=i+Math.imul(P,he)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(U,ue),a=(a=Math.imul(U,ce))+Math.imul(L,ue)|0,i=Math.imul(L,ce),r=r+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(D,de)|0,i=i+Math.imul(D,le)|0;var Ie=(c+(r=r+Math.imul(I,be)|0)|0)+((8191&(a=(a=a+Math.imul(I,he)|0)+Math.imul(C,be)|0))<<13)|0;c=((i=i+Math.imul(C,he)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,de),a=(a=Math.imul(U,le))+Math.imul(L,de)|0,i=Math.imul(L,le);var Ce=(c+(r=r+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,he)|0)+Math.imul(D,be)|0))<<13)|0;c=((i=i+Math.imul(D,he)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Re=(c+(r=Math.imul(U,be))|0)+((8191&(a=(a=Math.imul(U,he))+Math.imul(L,be)|0))<<13)|0;return c=((i=Math.imul(L,he))+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=ge,u[4]=we,u[5]=Te,u[6]=ke,u[7]=_e,u[8]=Oe,u[9]=Se,u[10]=xe,u[11]=Ae,u[12]=Me,u[13]=Ee,u[14]=Pe,u[15]=je,u[16]=Ie,u[17]=Ce,u[18]=Re,0!==c&&(u[19]=c,n.length++),n};function h(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(b=p),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?b(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}n.words[i]=s,r=o,o=a}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):h(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,n[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=a/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>a}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,a=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,c=0;c=0&&(0!==f||c>=a);c--){var d=0|this.words[c];this.words[c]=f<<26-i|d>>>i,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,a=1<=0);var t=e%26,n=(e-t)/26;if(r(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 a=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},i.prototype.isubn=function(e){if(r("number"===typeof e),r(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[a+n]=67108863&i}for(;a>26,this.words[a+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,u=r.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.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),a=e.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,a=this.length-1;a>=0;a--)n=(t*n+(0|this.words[a]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var a=(0|this.words[n])+67108864*t;this.words[n]=a/e|0,t=a%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0===(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,h=1;0===(n.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(n.iushrn(b);b-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,l=1;0===(n.words[0]&l)&&d<26;++d,l<<=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),o.isub(s)):(n.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.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 a=t.cmp(n);if(a<0){var i=t;t=n,n=i}else if(0===a||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.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),r(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;n--){var r=0|this.words[n],a=0|e.words[n];if(r!==a){ra&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.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},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},a(g,v),g.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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]=a,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new w;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return m[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.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)},_.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},_.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)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),b=o;0!==p.cmp(s);){for(var h=p,y=0;0!==h.cmp(s);y++)h=h.redSqr();r(y=0;r--){for(var c=t.words[r],f=u-1;f>=0;f--){var d=c>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new O(e)},a(O,_),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.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),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(157)(e))},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},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.r(t),n.d(t,"BaseX",(function(){return s})),n.d(t,"Base32",(function(){return u})),n.d(t,"Base58",(function(){return c}));var r=n(9),a=n(8),i=n(3),o=n(5),s=function(){function e(t){Object(r.a)(this,e),Object(o.defineReadOnly)(this,"alphabet",t),Object(o.defineReadOnly)(this,"base",t.length),Object(o.defineReadOnly)(this,"_alphabetMap",{}),Object(o.defineReadOnly)(this,"_leader",t.charAt(0));for(var n=0;n0;)n.push(a%this.base),a=a/this.base|0}for(var s="",u=0;0===t[u]&&u=0;--c)s+=this.alphabet[n[c]];return s}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var n=0;n>=8;for(;a>0;)t.push(255&a),a>>=8}for(var s=0;e[s]===this._leader&&s1&&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,a=Object.assign({},o);n.pos>>3){case 1:a.seconds=n.int64();break;case 2:a.nanos=n.int32();break;default:n.skipType(7&s)}}return a},fromJSON:function(e){var t=Object.assign({},o);return void 0!==e.seconds&&null!==e.seconds?t.seconds=a.default.fromString(e.seconds):t.seconds=a.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||a.default.ZERO).toString()),void 0!==e.nanos&&(t.nanos=e.nanos),t},fromPartial:function(e){var t=Object.assign({},o);return void 0!==e.seconds&&null!==e.seconds?t.seconds=e.seconds:t.seconds=a.default.ZERO,void 0!==e.nanos&&null!==e.nanos?t.nanos=e.nanos:t.nanos=0,t}},i.default.util.Long!==a.default&&(i.default.util.Long=a.default,i.default.configure())},function(e,t,n){"use strict";(function(e){var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.ValConsPublicKey=t.LegacyAminoMultisigPublicKey=t.SimplePublicKey=t.PublicKey=void 0;var a=n(23),i=n(186),o=n(536),s=n(25),u=n(537),c=n(538),f=n(98),d=e.from("eb5ae98721","hex"),l=e.from("1624de6420","hex"),p=e.from("22c1f7e2","hex"),b=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 h.fromAmino(e);case"tendermint/PubKeyMultisigThreshold":return y.fromAmino(e);case"tendermint/PubKeyEd25519":return m.fromAmino(e)}},e.fromData=function(e){switch(e["@type"]){case"/cosmos.crypto.secp256k1.PubKey":return h.fromData(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":return y.fromData(e);case"/cosmos.crypto.ed25519.PubKey":return m.fromData(e)}},e.fromProto=function(e){var t=e.typeUrl;if("/cosmos.crypto.secp256k1.PubKey"===t)return h.unpackAny(e);if("/cosmos.crypto.multisig.LegacyAminoPubKey"===t)return y.unpackAny(e);if("/cosmos.crypto.ed25519.PubKey"===t)return m.unpackAny(e);throw new Error("Pubkey type "+t+" not recognized")}}(t.PublicKey||(t.PublicKey={}));var h=function(t){function n(e){var n=t.call(this)||this;return n.key=e,n}return r(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 u.PubKey.fromPartial({key:e.from(this.key,"base64")})},n.prototype.packAny=function(){return s.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:u.PubKey.encode(this.toProto()).finish()})},n.unpackAny=function(e){return n.fromProto(u.PubKey.decode(e.value))},n.prototype.encodeAminoPubkey=function(){return e.concat([d,e.from(this.key,"base64")])},n.prototype.rawAddress=function(){var t=e.from(this.key,"base64");return(0,i.ripemd160)((0,i.sha256)(t))},n.prototype.address=function(){return f.bech32.encode("terra",f.bech32.toWords(this.rawAddress()))},n.prototype.pubkeyAddress=function(){return f.bech32.encode("terrapub",f.bech32.toWords(this.encodeAminoPubkey()))},n}(a.JSONSerializable);t.SimplePublicKey=h;var y=function(e){function t(t,n){var r=e.call(this)||this;return r.threshold=t,r.pubkeys=n,r}return r(t,e),t.prototype.encodeAminoPubkey=function(){var e=Array.from(p);e.push(8),e.push.apply(e,b(this.threshold));for(var t=0,n=this.pubkeys.map((function(e){return e.encodeAminoPubkey()}));t1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,a=new Array(r),i=0;i=0||(a[n]=e[n]);return a}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(171);function a(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(31);function a(e){var t=null;try{t=JSON.parse(e)}catch(n){return!1}return t.encseed&&t.ethaddr}function i(e){var t=null;try{t=JSON.parse(e)}catch(n){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function o(e){if(a(e))try{return Object(r.getAddress)(JSON.parse(e).ethaddr)}catch(t){return null}if(i(e))try{return Object(r.getAddress)(JSON.parse(e).address)}catch(t){return null}return null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0);function a(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return D})),n.d(t,"b",(function(){return B}));var r=n(9),a=n(8),i=n(3),o=n(5),s=n(7),u=n(102),c=n(53),f=n(15),d=n(16),l=n(31),p=function(e){Object(f.a)(n,e);var t=Object(d.a)(n);function n(e){return Object(r.a)(this,n),t.call(this,"address","address",e,!1)}return Object(a.a)(n,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=Object(l.getAddress)(t)}catch(n){this._throwError(n.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return Object(l.getAddress)(Object(i.hexZeroPad)(e.readValue().toHexString(),20))}}]),n}(c.a),b=function(e){Object(f.a)(n,e);var t=Object(d.a)(n);function n(e){var a;return Object(r.a)(this,n),(a=t.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,a}return Object(a.a)(n,[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}]),n}(c.a),h=new s.Logger(u.a);function y(e,t,n){var r=null;if(Array.isArray(n))r=n;else if(n&&"object"===typeof n){var a={};r=t.map((function(e){var t=e.localName;return t||h.throwError("cannot encode object for signature with missing names",s.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),a[t]&&h.throwError("cannot encode object for signature with duplicate names",s.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),a[t]=!0,n[t]}))}else h.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&h.throwArgumentError("types/value length mismatch","tuple",n);var i=new c.c(e.wordSize),o=new c.c(e.wordSize),u=[];t.forEach((function(e,t){var n=r[t];if(e.dynamic){var a=o.length;e.encode(o,n);var s=i.writeUpdatableValue();u.push((function(e){s(e+a)}))}else e.encode(i,n)})),u.forEach((function(e){e(i.length)}));var f=e.appendWriter(i);return f+=e.appendWriter(o)}function m(e,t){var n=[],r=e.subReader(0);t.forEach((function(t){var a=null;if(t.dynamic){var i=e.readValue(),o=r.subReader(i.toNumber());try{a=t.decode(o)}catch(u){if(u.code===s.Logger.errors.BUFFER_OVERRUN)throw u;(a=u).baseType=t.name,a.name=t.localName,a.type=t.type}}else try{a=t.decode(e)}catch(u){if(u.code===s.Logger.errors.BUFFER_OVERRUN)throw u;(a=u).baseType=t.name,a.name=t.localName,a.type=t.type}void 0!=a&&n.push(a)}));var a=t.reduce((function(e,t){var n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach((function(e,t){var r=e.localName;if(r&&1===a[r]&&("length"===r&&(r="_length"),null==n[r])){var i=n[t];i instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:function(){throw i}}):n[r]=i}}));for(var i=function(e){var t=n[e];t instanceof Error&&Object.defineProperty(n,e,{enumerable:!0,get:function(){throw t}})},o=0;o=0?a:"")+"]",u=-1===a||e.dynamic;return(o=t.call(this,"array",s,i,u)).coder=e,o.length=a,o}return Object(a.a)(n,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],n=0;ne._data.length&&h.throwError("insufficient data length",s.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var n=[],r=0;r256||r%8!==0)&&C.throwArgumentError("invalid "+n[1]+" bit length","param",e),new M(r/8,"int"===n[1],e.name)}if(n=e.type.match(R)){var a=parseInt(n[1]);return(0===a||a>32)&&C.throwArgumentError("invalid bytes length","param",e),new O(a,e.name)}return C.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new c.b(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new c.c(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,n=e.map((function(e){return t._getCoder(I.g.from(e))}));return new j(n,"_").defaultValue()}},{key:"encode",value:function(e,t){var n=this;e.length!==t.length&&C.throwError("types/values length mismatch",s.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=e.map((function(e){return n._getCoder(I.g.from(e))})),a=new j(r,"_"),i=this._getWriter();return a.encode(i,t),i.data}},{key:"decode",value:function(e,t,n){var r=this,a=e.map((function(e){return r._getCoder(I.g.from(e))}));return new j(a,"_").decode(this._getReader(Object(i.arrayify)(t),n))}}]),e}(),B=new D},function(e,t,n){"use strict";n.d(t,"a",(function(){return P})),n.d(t,"b",(function(){return j})),n.d(t,"c",(function(){return C})),n.d(t,"d",(function(){return E}));var r=n(4),a=n.n(r),i=n(14),o=n(17),s=n(93),u=n(31),c=a.a.BigInt(1e3),f=a.a.BigInt(0),d=a.a.BigInt(1),l=a.a.BigInt(5),p=a.a.BigInt(997),b=a.a.BigInt(1e3);function h(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var x="setPrototypeOf"in Object,A=function(e){function t(){var n;return(n=e.call(this)||this).isInsufficientReservesError=!0,n.name=n.constructor.name,x&&Object.setPrototypeOf(_(n),(this instanceof t?this.constructor:void 0).prototype),n}return m(t,e),t}(k(Error)),M=function(e){function t(){var n;return(n=e.call(this)||this).isInsufficientInputAmountError=!0,n.name=n.constructor.name,x&&Object.setPrototypeOf(_(n),(this instanceof t?this.constructor:void 0).prototype),n}return m(t,e),t}(k(Error)),E=function(e){var t=e.factoryAddress,n=e.tokenA,r=e.tokenB,a=n.sortsBefore(r)?[n,r]:[r,n],i=a[0],o=a[1];return Object(u.getCreate2Address)(t,Object(s.keccak256)(["bytes"],[Object(s.pack)(["address","address"],[i.address,o.address])]),"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f")},P=function(){function e(t,n){var r=t.currency.sortsBefore(n.currency)?[t,n]:[n,t];this.liquidityToken=new i.f(r[0].currency.chainId,e.getAddress(r[0].currency,r[1].currency),18,"UNI-V2","Uniswap V2"),this.tokenAmounts=r}e.getAddress=function(e,t){return E({factoryAddress:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",tokenA:e,tokenB:t})};var t=e.prototype;return t.involvesToken=function(e){return e.equals(this.token0)||e.equals(this.token1)},t.priceOf=function(e){return this.involvesToken(e)||Object(o.a)(!1),e.equals(this.token0)?this.token0Price:this.token1Price},t.reserveOf=function(e){return this.involvesToken(e)||Object(o.a)(!1),e.equals(this.token0)?this.reserve0:this.reserve1},t.getOutputAmount=function(t){if(this.involvesToken(t.currency)||Object(o.a)(!1),a.a.equal(this.reserve0.quotient,f)||a.a.equal(this.reserve1.quotient,f))throw new A;var n=this.reserveOf(t.currency),r=this.reserveOf(t.currency.equals(this.token0)?this.token1:this.token0),s=a.a.multiply(t.quotient,p),u=a.a.multiply(s,r.quotient),c=a.a.add(a.a.multiply(n.quotient,b),s),d=i.a.fromRawAmount(t.currency.equals(this.token0)?this.token1:this.token0,a.a.divide(u,c));if(a.a.equal(d.quotient,f))throw new M;return[d,new e(n.add(t),r.subtract(d))]},t.getInputAmount=function(t){if(this.involvesToken(t.currency)||Object(o.a)(!1),a.a.equal(this.reserve0.quotient,f)||a.a.equal(this.reserve1.quotient,f)||a.a.greaterThanOrEqual(t.quotient,this.reserveOf(t.currency).quotient))throw new A;var n=this.reserveOf(t.currency),r=this.reserveOf(t.currency.equals(this.token0)?this.token1:this.token0),s=a.a.multiply(a.a.multiply(r.quotient,t.quotient),b),u=a.a.multiply(a.a.subtract(n.quotient,t.quotient),p),c=i.a.fromRawAmount(t.currency.equals(this.token0)?this.token1:this.token0,a.a.add(a.a.divide(s,u),d));return[c,new e(r.add(c),n.subtract(t))]},t.getLiquidityMinted=function(e,t,n){e.currency.equals(this.liquidityToken)||Object(o.a)(!1);var r,s=t.currency.sortsBefore(n.currency)?[t,n]:[n,t];if(s[0].currency.equals(this.token0)&&s[1].currency.equals(this.token1)||Object(o.a)(!1),a.a.equal(e.quotient,f))r=a.a.subtract(Object(i.j)(a.a.multiply(s[0].quotient,s[1].quotient)),c);else{var u=a.a.divide(a.a.multiply(s[0].quotient,e.quotient),this.reserve0.quotient),d=a.a.divide(a.a.multiply(s[1].quotient,e.quotient),this.reserve1.quotient);r=a.a.lessThanOrEqual(u,d)?u:d}if(!a.a.greaterThan(r,f))throw new M;return i.a.fromRawAmount(this.liquidityToken,r)},t.getLiquidityValue=function(e,t,n,r,s){var u;if(void 0===r&&(r=!1),this.involvesToken(e)||Object(o.a)(!1),t.currency.equals(this.liquidityToken)||Object(o.a)(!1),n.currency.equals(this.liquidityToken)||Object(o.a)(!1),a.a.lessThanOrEqual(n.quotient,t.quotient)||Object(o.a)(!1),r){s||Object(o.a)(!1);var c=a.a.BigInt(s);if(a.a.equal(c,f))u=t;else{var d=Object(i.j)(a.a.multiply(this.reserve0.quotient,this.reserve1.quotient)),p=Object(i.j)(c);if(a.a.greaterThan(d,p)){var b=a.a.multiply(t.quotient,a.a.subtract(d,p)),h=a.a.add(a.a.multiply(d,l),p),y=a.a.divide(b,h);u=t.add(i.a.fromRawAmount(this.liquidityToken,y))}else u=t}}else u=t;return i.a.fromRawAmount(e,a.a.divide(a.a.multiply(n.quotient,this.reserveOf(e).quotient),u.quotient))},y(e,[{key:"token0Price",get:function(){var e=this.tokenAmounts[1].divide(this.tokenAmounts[0]);return new i.e(this.token0,this.token1,e.denominator,e.numerator)}},{key:"token1Price",get:function(){var e=this.tokenAmounts[0].divide(this.tokenAmounts[1]);return new i.e(this.token1,this.token0,e.denominator,e.numerator)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"token0",get:function(){return this.tokenAmounts[0].currency}},{key:"token1",get:function(){return this.tokenAmounts[1].currency}},{key:"reserve0",get:function(){return this.tokenAmounts[0]}},{key:"reserve1",get:function(){return this.tokenAmounts[1]}}]),e}(),j=function(){function e(e,t,n){this._midPrice=null,e.length>0||Object(o.a)(!1);var r=e[0].chainId;e.every((function(e){return e.chainId===r}))||Object(o.a)(!1);var a=t.wrapped;e[0].involvesToken(a)||Object(o.a)(!1),"undefined"===typeof n||e[e.length-1].involvesToken(n.wrapped)||Object(o.a)(!1);for(var i,s=[a],u=S(e.entries());!(i=u()).done;){var c=i.value,f=c[0],d=c[1],l=s[f];l.equals(d.token0)||l.equals(d.token1)||Object(o.a)(!1);var p=l.equals(d.token0)?d.token1:d.token0;s.push(p)}this.pairs=e,this.path=s,this.input=t,this.output=n}return y(e,[{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;for(var e,t=[],n=S(this.pairs.entries());!(e=n()).done;){var r=e.value,a=r[0],o=r[1];t.push(this.path[a].equals(o.token0)?new i.e(o.reserve0.currency,o.reserve1.currency,o.reserve0.quotient,o.reserve1.quotient):new i.e(o.reserve1.currency,o.reserve0.currency,o.reserve1.quotient,o.reserve0.quotient))}var s=t.slice(1).reduce((function(e,t){return e.multiply(t)}),t[0]);return this._midPrice=new i.e(this.input,this.output,s.denominator,s.numerator)}},{key:"chainId",get:function(){return this.pairs[0].chainId}}]),e}();function I(e,t){var n=function(e,t){return e.inputAmount.currency.equals(t.inputAmount.currency)||Object(o.a)(!1),e.outputAmount.currency.equals(t.outputAmount.currency)||Object(o.a)(!1),e.outputAmount.equalTo(t.outputAmount)?e.inputAmount.equalTo(t.inputAmount)?0:e.inputAmount.lessThan(t.inputAmount)?-1:1:e.outputAmount.lessThan(t.outputAmount)?1:-1}(e,t);return 0!==n?n:e.priceImpact.lessThan(t.priceImpact)?-1:e.priceImpact.greaterThan(t.priceImpact)?1:e.route.path.length-t.route.path.length}var C=function(){function e(e,t,n){this.route=e,this.tradeType=n;var r=new Array(e.path.length);if(n===i.g.EXACT_INPUT){t.currency.equals(e.input)||Object(o.a)(!1),r[0]=t.wrapped;for(var a=0;a0;u--){var c=e.pairs[u-1].getInputAmount(r[u])[0];r[u-1]=c}this.inputAmount=i.a.fromFractionalAmount(e.input,r[0].numerator,r[0].denominator),this.outputAmount=i.a.fromFractionalAmount(e.output,t.numerator,t.denominator)}this.executionPrice=new i.e(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient),this.priceImpact=Object(i.h)(e.midPrice,this.inputAmount,this.outputAmount)}e.exactIn=function(t,n){return new e(t,n,i.g.EXACT_INPUT)},e.exactOut=function(t,n){return new e(t,n,i.g.EXACT_OUTPUT)};var t=e.prototype;return t.minimumAmountOut=function(e){if(e.lessThan(f)&&Object(o.a)(!1),this.tradeType===i.g.EXACT_OUTPUT)return this.outputAmount;var t=new i.b(d).add(e).invert().multiply(this.outputAmount.quotient).quotient;return i.a.fromRawAmount(this.outputAmount.currency,t)},t.maximumAmountIn=function(e){if(e.lessThan(f)&&Object(o.a)(!1),this.tradeType===i.g.EXACT_INPUT)return this.inputAmount;var t=new i.b(d).add(e).multiply(this.inputAmount.quotient).quotient;return i.a.fromRawAmount(this.inputAmount.currency,t)},e.bestTradeExactIn=function(t,n,r,a,s,u,c){var d=void 0===a?{}:a,l=d.maxNumResults,p=void 0===l?3:l,b=d.maxHops,h=void 0===b?3:b;void 0===s&&(s=[]),void 0===u&&(u=n),void 0===c&&(c=[]),t.length>0||Object(o.a)(!1),h>0||Object(o.a)(!1),n===u||s.length>0||Object(o.a)(!1);for(var y=u.wrapped,m=r.wrapped,v=0;v1&&t.length>1){var T=t.slice(0,v).concat(t.slice(v+1,t.length));e.bestTradeExactIn(T,n,r,{maxNumResults:p,maxHops:h-1},[].concat(s,[g]),w,c)}}}return c},t.worstExecutionPrice=function(e){return new i.e(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(e).quotient,this.minimumAmountOut(e).quotient)},e.bestTradeExactOut=function(t,n,r,a,s,u,c){var d=void 0===a?{}:a,l=d.maxNumResults,p=void 0===l?3:l,b=d.maxHops,h=void 0===b?3:b;void 0===s&&(s=[]),void 0===u&&(u=r),void 0===c&&(c=[]),t.length>0||Object(o.a)(!1),h>0||Object(o.a)(!1),r===u||s.length>0||Object(o.a)(!1);for(var y=u.wrapped,m=n.wrapped,v=0;v1&&t.length>1){var T=t.slice(0,v).concat(t.slice(v+1,t.length));e.bestTradeExactOut(T,n,r,{maxNumResults:p,maxHops:h-1},[g].concat(s),w,c)}}}return c},e}()},,function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},function(e,t,n){"use strict";(function(e){var r=t;function a(e,t,n){for(var r=Object.keys(t),a=0;a0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"===typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=a,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.option&&t.uint32(8).int32(e.option),""!==e.weight&&t.uint32(18).string(e.weight),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,a=Object.assign({},m);n.pos>>3){case 1:a.option=n.int32();break;case 2:a.weight=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},m);return void 0!==e.option&&null!==e.option?t.option=p(e.option):t.option=0,void 0!==e.weight&&null!==e.weight?t.weight=String(e.weight):t.weight="",t},toJSON:function(e){var t={};return void 0!==e.option&&(t.option=b(e.option)),void 0!==e.weight&&(t.weight=e.weight),t},fromPartial:function(e){var t=Object.assign({},m);return void 0!==e.option&&null!==e.option?t.option=e.option:t.option=0,void 0!==e.weight&&null!==e.weight?t.weight=e.weight:t.weight="",t}};var v={title:"",description:""};t.TextProposal={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.title&&t.uint32(10).string(e.title),""!==e.description&&t.uint32(18).string(e.description),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,a=Object.assign({},v);n.pos>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);return void 0!==e.title&&null!==e.title?t.title=String(e.title):t.title="",void 0!==e.description&&null!==e.description?t.description=String(e.description):t.description="",t},toJSON:function(e){var t={};return void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),t},fromPartial:function(e){var t=Object.assign({},v);return void 0!==e.title&&null!==e.title?t.title=e.title:t.title="",void 0!==e.description&&null!==e.description?t.description=e.description:t.description="",t}};var g={proposalId:s.default.UZERO,depositor:""};t.Deposit={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();e.proposalId.isZero()||t.uint32(8).uint64(e.proposalId),""!==e.depositor&&t.uint32(18).string(e.depositor);var n,a=r(e.amount);try{for(a.s();!(n=a.n()).done;){var i=n.value;l.Coin.encode(i,t.uint32(26).fork()).ldelim()}}catch(o){a.e(o)}finally{a.f()}return 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,a=Object.assign({},g);for(a.amount=[];n.pos>>3){case 1:a.proposalId=n.uint64();break;case 2:a.depositor=n.string();break;case 3:a.amount.push(l.Coin.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},g);if(t.amount=[],void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=s.default.fromString(e.proposalId):t.proposalId=s.default.UZERO,void 0!==e.depositor&&null!==e.depositor?t.depositor=String(e.depositor):t.depositor="",void 0!==e.amount&&null!==e.amount){var n,a=r(e.amount);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.amount.push(l.Coin.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.proposalId&&(t.proposalId=(e.proposalId||s.default.UZERO).toString()),void 0!==e.depositor&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map((function(e){return e?l.Coin.toJSON(e):void 0})):t.amount=[],t},fromPartial:function(e){var t=Object.assign({},g);if(t.amount=[],void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=e.proposalId:t.proposalId=s.default.UZERO,void 0!==e.depositor&&null!==e.depositor?t.depositor=e.depositor:t.depositor="",void 0!==e.amount&&null!==e.amount){var n,a=r(e.amount);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.amount.push(l.Coin.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return t}};var w={proposalId:s.default.UZERO,status:0};t.Proposal={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();e.proposalId.isZero()||n.uint32(8).uint64(e.proposalId),void 0!==e.content&&c.Any.encode(e.content,n.uint32(18).fork()).ldelim(),0!==e.status&&n.uint32(24).int32(e.status),void 0!==e.finalTallyResult&&t.TallyResult.encode(e.finalTallyResult,n.uint32(34).fork()).ldelim(),void 0!==e.submitTime&&d.Timestamp.encode(j(e.submitTime),n.uint32(42).fork()).ldelim(),void 0!==e.depositEndTime&&d.Timestamp.encode(j(e.depositEndTime),n.uint32(50).fork()).ldelim();var a,i=r(e.totalDeposit);try{for(i.s();!(a=i.n()).done;){var o=a.value;l.Coin.encode(o,n.uint32(58).fork()).ldelim()}}catch(s){i.e(s)}finally{i.f()}return void 0!==e.votingStartTime&&d.Timestamp.encode(j(e.votingStartTime),n.uint32(66).fork()).ldelim(),void 0!==e.votingEndTime&&d.Timestamp.encode(j(e.votingEndTime),n.uint32(74).fork()).ldelim(),n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},w);for(i.totalDeposit=[];r.pos>>3){case 1:i.proposalId=r.uint64();break;case 2:i.content=c.Any.decode(r,r.uint32());break;case 3:i.status=r.int32();break;case 4:i.finalTallyResult=t.TallyResult.decode(r,r.uint32());break;case 5:i.submitTime=I(d.Timestamp.decode(r,r.uint32()));break;case 6:i.depositEndTime=I(d.Timestamp.decode(r,r.uint32()));break;case 7:i.totalDeposit.push(l.Coin.decode(r,r.uint32()));break;case 8:i.votingStartTime=I(d.Timestamp.decode(r,r.uint32()));break;case 9:i.votingEndTime=I(d.Timestamp.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},w);if(n.totalDeposit=[],void 0!==e.proposalId&&null!==e.proposalId?n.proposalId=s.default.fromString(e.proposalId):n.proposalId=s.default.UZERO,void 0!==e.content&&null!==e.content?n.content=c.Any.fromJSON(e.content):n.content=void 0,void 0!==e.status&&null!==e.status?n.status=h(e.status):n.status=0,void 0!==e.finalTallyResult&&null!==e.finalTallyResult?n.finalTallyResult=t.TallyResult.fromJSON(e.finalTallyResult):n.finalTallyResult=void 0,void 0!==e.submitTime&&null!==e.submitTime?n.submitTime=C(e.submitTime):n.submitTime=void 0,void 0!==e.depositEndTime&&null!==e.depositEndTime?n.depositEndTime=C(e.depositEndTime):n.depositEndTime=void 0,void 0!==e.totalDeposit&&null!==e.totalDeposit){var a,i=r(e.totalDeposit);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.totalDeposit.push(l.Coin.fromJSON(o))}}catch(u){i.e(u)}finally{i.f()}}return void 0!==e.votingStartTime&&null!==e.votingStartTime?n.votingStartTime=C(e.votingStartTime):n.votingStartTime=void 0,void 0!==e.votingEndTime&&null!==e.votingEndTime?n.votingEndTime=C(e.votingEndTime):n.votingEndTime=void 0,n},toJSON:function(e){var n={};return void 0!==e.proposalId&&(n.proposalId=(e.proposalId||s.default.UZERO).toString()),void 0!==e.content&&(n.content=e.content?c.Any.toJSON(e.content):void 0),void 0!==e.status&&(n.status=y(e.status)),void 0!==e.finalTallyResult&&(n.finalTallyResult=e.finalTallyResult?t.TallyResult.toJSON(e.finalTallyResult):void 0),void 0!==e.submitTime&&(n.submitTime=e.submitTime.toISOString()),void 0!==e.depositEndTime&&(n.depositEndTime=e.depositEndTime.toISOString()),e.totalDeposit?n.totalDeposit=e.totalDeposit.map((function(e){return e?l.Coin.toJSON(e):void 0})):n.totalDeposit=[],void 0!==e.votingStartTime&&(n.votingStartTime=e.votingStartTime.toISOString()),void 0!==e.votingEndTime&&(n.votingEndTime=e.votingEndTime.toISOString()),n},fromPartial:function(e){var n=Object.assign({},w);if(n.totalDeposit=[],void 0!==e.proposalId&&null!==e.proposalId?n.proposalId=e.proposalId:n.proposalId=s.default.UZERO,void 0!==e.content&&null!==e.content?n.content=c.Any.fromPartial(e.content):n.content=void 0,void 0!==e.status&&null!==e.status?n.status=e.status:n.status=0,void 0!==e.finalTallyResult&&null!==e.finalTallyResult?n.finalTallyResult=t.TallyResult.fromPartial(e.finalTallyResult):n.finalTallyResult=void 0,void 0!==e.submitTime&&null!==e.submitTime?n.submitTime=e.submitTime:n.submitTime=void 0,void 0!==e.depositEndTime&&null!==e.depositEndTime?n.depositEndTime=e.depositEndTime:n.depositEndTime=void 0,void 0!==e.totalDeposit&&null!==e.totalDeposit){var a,i=r(e.totalDeposit);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.totalDeposit.push(l.Coin.fromPartial(o))}}catch(u){i.e(u)}finally{i.f()}}return void 0!==e.votingStartTime&&null!==e.votingStartTime?n.votingStartTime=e.votingStartTime:n.votingStartTime=void 0,void 0!==e.votingEndTime&&null!==e.votingEndTime?n.votingEndTime=e.votingEndTime:n.votingEndTime=void 0,n}};var T={yes:"",abstain:"",no:"",noWithVeto:""};t.TallyResult={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.yes&&t.uint32(10).string(e.yes),""!==e.abstain&&t.uint32(18).string(e.abstain),""!==e.no&&t.uint32(26).string(e.no),""!==e.noWithVeto&&t.uint32(34).string(e.noWithVeto),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,a=Object.assign({},T);n.pos>>3){case 1:a.yes=n.string();break;case 2:a.abstain=n.string();break;case 3:a.no=n.string();break;case 4:a.noWithVeto=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},T);return void 0!==e.yes&&null!==e.yes?t.yes=String(e.yes):t.yes="",void 0!==e.abstain&&null!==e.abstain?t.abstain=String(e.abstain):t.abstain="",void 0!==e.no&&null!==e.no?t.no=String(e.no):t.no="",void 0!==e.noWithVeto&&null!==e.noWithVeto?t.noWithVeto=String(e.noWithVeto):t.noWithVeto="",t},toJSON:function(e){var t={};return void 0!==e.yes&&(t.yes=e.yes),void 0!==e.abstain&&(t.abstain=e.abstain),void 0!==e.no&&(t.no=e.no),void 0!==e.noWithVeto&&(t.noWithVeto=e.noWithVeto),t},fromPartial:function(e){var t=Object.assign({},T);return void 0!==e.yes&&null!==e.yes?t.yes=e.yes:t.yes="",void 0!==e.abstain&&null!==e.abstain?t.abstain=e.abstain:t.abstain="",void 0!==e.no&&null!==e.no?t.no=e.no:t.no="",void 0!==e.noWithVeto&&null!==e.noWithVeto?t.noWithVeto=e.noWithVeto:t.noWithVeto="",t}};var k={proposalId:s.default.UZERO,voter:"",option:0};t.Vote={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();e.proposalId.isZero()||n.uint32(8).uint64(e.proposalId),""!==e.voter&&n.uint32(18).string(e.voter),0!==e.option&&n.uint32(24).int32(e.option);var a,i=r(e.options);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.WeightedVoteOption.encode(o,n.uint32(34).fork()).ldelim()}}catch(s){i.e(s)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},k);for(i.options=[];r.pos>>3){case 1:i.proposalId=r.uint64();break;case 2:i.voter=r.string();break;case 3:i.option=r.int32();break;case 4:i.options.push(t.WeightedVoteOption.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},k);if(n.options=[],void 0!==e.proposalId&&null!==e.proposalId?n.proposalId=s.default.fromString(e.proposalId):n.proposalId=s.default.UZERO,void 0!==e.voter&&null!==e.voter?n.voter=String(e.voter):n.voter="",void 0!==e.option&&null!==e.option?n.option=p(e.option):n.option=0,void 0!==e.options&&null!==e.options){var a,i=r(e.options);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.options.push(t.WeightedVoteOption.fromJSON(o))}}catch(u){i.e(u)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.proposalId&&(n.proposalId=(e.proposalId||s.default.UZERO).toString()),void 0!==e.voter&&(n.voter=e.voter),void 0!==e.option&&(n.option=b(e.option)),e.options?n.options=e.options.map((function(e){return e?t.WeightedVoteOption.toJSON(e):void 0})):n.options=[],n},fromPartial:function(e){var n=Object.assign({},k);if(n.options=[],void 0!==e.proposalId&&null!==e.proposalId?n.proposalId=e.proposalId:n.proposalId=s.default.UZERO,void 0!==e.voter&&null!==e.voter?n.voter=e.voter:n.voter="",void 0!==e.option&&null!==e.option?n.option=e.option:n.option=0,void 0!==e.options&&null!==e.options){var a,i=r(e.options);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.options.push(t.WeightedVoteOption.fromPartial(o))}}catch(u){i.e(u)}finally{i.f()}}return n}};var _={};t.DepositParams={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create(),a=r(e.minDeposit);try{for(a.s();!(t=a.n()).done;){var i=t.value;l.Coin.encode(i,n.uint32(10).fork()).ldelim()}}catch(o){a.e(o)}finally{a.f()}return void 0!==e.maxDepositPeriod&&f.Duration.encode(e.maxDepositPeriod,n.uint32(18).fork()).ldelim(),n},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,a=Object.assign({},_);for(a.minDeposit=[];n.pos>>3){case 1:a.minDeposit.push(l.Coin.decode(n,n.uint32()));break;case 2:a.maxDepositPeriod=f.Duration.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},_);if(t.minDeposit=[],void 0!==e.minDeposit&&null!==e.minDeposit){var n,a=r(e.minDeposit);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.minDeposit.push(l.Coin.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return void 0!==e.maxDepositPeriod&&null!==e.maxDepositPeriod?t.maxDepositPeriod=f.Duration.fromJSON(e.maxDepositPeriod):t.maxDepositPeriod=void 0,t},toJSON:function(e){var t={};return e.minDeposit?t.minDeposit=e.minDeposit.map((function(e){return e?l.Coin.toJSON(e):void 0})):t.minDeposit=[],void 0!==e.maxDepositPeriod&&(t.maxDepositPeriod=e.maxDepositPeriod?f.Duration.toJSON(e.maxDepositPeriod):void 0),t},fromPartial:function(e){var t=Object.assign({},_);if(t.minDeposit=[],void 0!==e.minDeposit&&null!==e.minDeposit){var n,a=r(e.minDeposit);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.minDeposit.push(l.Coin.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return void 0!==e.maxDepositPeriod&&null!==e.maxDepositPeriod?t.maxDepositPeriod=f.Duration.fromPartial(e.maxDepositPeriod):t.maxDepositPeriod=void 0,t}};var O={};t.VotingParams={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.votingPeriod&&f.Duration.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),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,a=Object.assign({},O);n.pos>>3===1)a.votingPeriod=f.Duration.decode(n,n.uint32());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},O);return void 0!==e.votingPeriod&&null!==e.votingPeriod?t.votingPeriod=f.Duration.fromJSON(e.votingPeriod):t.votingPeriod=void 0,t},toJSON:function(e){var t={};return void 0!==e.votingPeriod&&(t.votingPeriod=e.votingPeriod?f.Duration.toJSON(e.votingPeriod):void 0),t},fromPartial:function(e){var t=Object.assign({},O);return void 0!==e.votingPeriod&&null!==e.votingPeriod?t.votingPeriod=f.Duration.fromPartial(e.votingPeriod):t.votingPeriod=void 0,t}};var S={};t.TallyParams={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.quorum.length&&t.uint32(10).bytes(e.quorum),0!==e.threshold.length&&t.uint32(18).bytes(e.threshold),0!==e.vetoThreshold.length&&t.uint32(26).bytes(e.vetoThreshold),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,a=Object.assign({},S);for(a.quorum=new Uint8Array,a.threshold=new Uint8Array,a.vetoThreshold=new Uint8Array;n.pos>>3){case 1:a.quorum=n.bytes();break;case 2:a.threshold=n.bytes();break;case 3:a.vetoThreshold=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},S);return t.quorum=new Uint8Array,t.threshold=new Uint8Array,t.vetoThreshold=new Uint8Array,void 0!==e.quorum&&null!==e.quorum&&(t.quorum=M(e.quorum)),void 0!==e.threshold&&null!==e.threshold&&(t.threshold=M(e.threshold)),void 0!==e.vetoThreshold&&null!==e.vetoThreshold&&(t.vetoThreshold=M(e.vetoThreshold)),t},toJSON:function(e){var t={};return void 0!==e.quorum&&(t.quorum=P(void 0!==e.quorum?e.quorum:new Uint8Array)),void 0!==e.threshold&&(t.threshold=P(void 0!==e.threshold?e.threshold:new Uint8Array)),void 0!==e.vetoThreshold&&(t.vetoThreshold=P(void 0!==e.vetoThreshold?e.vetoThreshold:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},S);return void 0!==e.quorum&&null!==e.quorum?t.quorum=e.quorum:t.quorum=new Uint8Array,void 0!==e.threshold&&null!==e.threshold?t.threshold=e.threshold:t.threshold=new Uint8Array,void 0!==e.vetoThreshold&&null!==e.vetoThreshold?t.vetoThreshold=e.vetoThreshold:t.vetoThreshold=new Uint8Array,t}};var x=function(){if("undefined"!==typeof x)return x;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),A=x.atob||function(e){return x.Buffer.from(e,"base64").toString("binary")};function M(e){for(var t=A(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.sender&&t.uint32(10).string(e.sender),0!==e.wasmByteCode.length&&t.uint32(18).bytes(e.wasmByteCode),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,a=Object.assign({},f);for(a.wasmByteCode=new Uint8Array;n.pos>>3){case 1:a.sender=n.string();break;case 2:a.wasmByteCode=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);return t.wasmByteCode=new Uint8Array,void 0!==e.sender&&null!==e.sender?t.sender=String(e.sender):t.sender="",void 0!==e.wasmByteCode&&null!==e.wasmByteCode&&(t.wasmByteCode=A(e.wasmByteCode)),t},toJSON:function(e){var t={};return void 0!==e.sender&&(t.sender=e.sender),void 0!==e.wasmByteCode&&(t.wasmByteCode=E(void 0!==e.wasmByteCode?e.wasmByteCode:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.sender&&null!==e.sender?t.sender=e.sender:t.sender="",void 0!==e.wasmByteCode&&null!==e.wasmByteCode?t.wasmByteCode=e.wasmByteCode:t.wasmByteCode=new Uint8Array,t}};var d={codeId:s.default.UZERO};t.MsgStoreCodeResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return e.codeId.isZero()||t.uint32(8).uint64(e.codeId),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,a=Object.assign({},d);n.pos>>3===1)a.codeId=n.uint64();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},d);return void 0!==e.codeId&&null!==e.codeId?t.codeId=s.default.fromString(e.codeId):t.codeId=s.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.codeId&&(t.codeId=(e.codeId||s.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},d);return void 0!==e.codeId&&null!==e.codeId?t.codeId=e.codeId:t.codeId=s.default.UZERO,t}};var l={codeId:s.default.UZERO,sender:""};t.MsgMigrateCode={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return e.codeId.isZero()||t.uint32(8).uint64(e.codeId),""!==e.sender&&t.uint32(18).string(e.sender),0!==e.wasmByteCode.length&&t.uint32(26).bytes(e.wasmByteCode),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,a=Object.assign({},l);for(a.wasmByteCode=new Uint8Array;n.pos>>3){case 1:a.codeId=n.uint64();break;case 2:a.sender=n.string();break;case 3:a.wasmByteCode=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return t.wasmByteCode=new Uint8Array,void 0!==e.codeId&&null!==e.codeId?t.codeId=s.default.fromString(e.codeId):t.codeId=s.default.UZERO,void 0!==e.sender&&null!==e.sender?t.sender=String(e.sender):t.sender="",void 0!==e.wasmByteCode&&null!==e.wasmByteCode&&(t.wasmByteCode=A(e.wasmByteCode)),t},toJSON:function(e){var t={};return void 0!==e.codeId&&(t.codeId=(e.codeId||s.default.UZERO).toString()),void 0!==e.sender&&(t.sender=e.sender),void 0!==e.wasmByteCode&&(t.wasmByteCode=E(void 0!==e.wasmByteCode?e.wasmByteCode:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.codeId&&null!==e.codeId?t.codeId=e.codeId:t.codeId=s.default.UZERO,void 0!==e.sender&&null!==e.sender?t.sender=e.sender:t.sender="",void 0!==e.wasmByteCode&&null!==e.wasmByteCode?t.wasmByteCode=e.wasmByteCode:t.wasmByteCode=new Uint8Array,t}};var p={};t.MsgMigrateCodeResponse={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,a=Object.assign({},p);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();""!==e.sender&&t.uint32(10).string(e.sender),""!==e.admin&&t.uint32(18).string(e.admin),e.codeId.isZero()||t.uint32(24).uint64(e.codeId),0!==e.initMsg.length&&t.uint32(34).bytes(e.initMsg);var n,r=i(e.initCoins);try{for(r.s();!(n=r.n()).done;){var a=n.value;c.Coin.encode(a,t.uint32(42).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return 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,a=Object.assign({},b);for(a.initCoins=[],a.initMsg=new Uint8Array;n.pos>>3){case 1:a.sender=n.string();break;case 2:a.admin=n.string();break;case 3:a.codeId=n.uint64();break;case 4:a.initMsg=n.bytes();break;case 5:a.initCoins.push(c.Coin.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);if(t.initCoins=[],t.initMsg=new Uint8Array,void 0!==e.sender&&null!==e.sender?t.sender=String(e.sender):t.sender="",void 0!==e.admin&&null!==e.admin?t.admin=String(e.admin):t.admin="",void 0!==e.codeId&&null!==e.codeId?t.codeId=s.default.fromString(e.codeId):t.codeId=s.default.UZERO,void 0!==e.initMsg&&null!==e.initMsg&&(t.initMsg=A(e.initMsg)),void 0!==e.initCoins&&null!==e.initCoins){var n,r=i(e.initCoins);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.initCoins.push(c.Coin.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return t},toJSON:function(e){var t={};return void 0!==e.sender&&(t.sender=e.sender),void 0!==e.admin&&(t.admin=e.admin),void 0!==e.codeId&&(t.codeId=(e.codeId||s.default.UZERO).toString()),void 0!==e.initMsg&&(t.initMsg=E(void 0!==e.initMsg?e.initMsg:new Uint8Array)),e.initCoins?t.initCoins=e.initCoins.map((function(e){return e?c.Coin.toJSON(e):void 0})):t.initCoins=[],t},fromPartial:function(e){var t=Object.assign({},b);if(t.initCoins=[],void 0!==e.sender&&null!==e.sender?t.sender=e.sender:t.sender="",void 0!==e.admin&&null!==e.admin?t.admin=e.admin:t.admin="",void 0!==e.codeId&&null!==e.codeId?t.codeId=e.codeId:t.codeId=s.default.UZERO,void 0!==e.initMsg&&null!==e.initMsg?t.initMsg=e.initMsg:t.initMsg=new Uint8Array,void 0!==e.initCoins&&null!==e.initCoins){var n,r=i(e.initCoins);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.initCoins.push(c.Coin.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return t}};var h={contractAddress:""};t.MsgInstantiateContractResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.contractAddress&&t.uint32(10).string(e.contractAddress),0!==e.data.length&&t.uint32(18).bytes(e.data),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,a=Object.assign({},h);for(a.data=new Uint8Array;n.pos>>3){case 1:a.contractAddress=n.string();break;case 2:a.data=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},h);return t.data=new Uint8Array,void 0!==e.contractAddress&&null!==e.contractAddress?t.contractAddress=String(e.contractAddress):t.contractAddress="",void 0!==e.data&&null!==e.data&&(t.data=A(e.data)),t},toJSON:function(e){var t={};return void 0!==e.contractAddress&&(t.contractAddress=e.contractAddress),void 0!==e.data&&(t.data=E(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},h);return void 0!==e.contractAddress&&null!==e.contractAddress?t.contractAddress=e.contractAddress:t.contractAddress="",void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,t}};var y={sender:"",contract:""};t.MsgExecuteContract={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();""!==e.sender&&t.uint32(10).string(e.sender),""!==e.contract&&t.uint32(18).string(e.contract),0!==e.executeMsg.length&&t.uint32(26).bytes(e.executeMsg);var n,r=i(e.coins);try{for(r.s();!(n=r.n()).done;){var a=n.value;c.Coin.encode(a,t.uint32(42).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return 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,a=Object.assign({},y);for(a.coins=[],a.executeMsg=new Uint8Array;n.pos>>3){case 1:a.sender=n.string();break;case 2:a.contract=n.string();break;case 3:a.executeMsg=n.bytes();break;case 5:a.coins.push(c.Coin.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);if(t.coins=[],t.executeMsg=new Uint8Array,void 0!==e.sender&&null!==e.sender?t.sender=String(e.sender):t.sender="",void 0!==e.contract&&null!==e.contract?t.contract=String(e.contract):t.contract="",void 0!==e.executeMsg&&null!==e.executeMsg&&(t.executeMsg=A(e.executeMsg)),void 0!==e.coins&&null!==e.coins){var n,r=i(e.coins);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.coins.push(c.Coin.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return t},toJSON:function(e){var t={};return void 0!==e.sender&&(t.sender=e.sender),void 0!==e.contract&&(t.contract=e.contract),void 0!==e.executeMsg&&(t.executeMsg=E(void 0!==e.executeMsg?e.executeMsg:new Uint8Array)),e.coins?t.coins=e.coins.map((function(e){return e?c.Coin.toJSON(e):void 0})):t.coins=[],t},fromPartial:function(e){var t=Object.assign({},y);if(t.coins=[],void 0!==e.sender&&null!==e.sender?t.sender=e.sender:t.sender="",void 0!==e.contract&&null!==e.contract?t.contract=e.contract:t.contract="",void 0!==e.executeMsg&&null!==e.executeMsg?t.executeMsg=e.executeMsg:t.executeMsg=new Uint8Array,void 0!==e.coins&&null!==e.coins){var n,r=i(e.coins);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.coins.push(c.Coin.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return t}};var m={};t.MsgExecuteContractResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.data.length&&t.uint32(10).bytes(e.data),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,a=Object.assign({},m);for(a.data=new Uint8Array;n.pos>>3===1)a.data=n.bytes();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},m);return t.data=new Uint8Array,void 0!==e.data&&null!==e.data&&(t.data=A(e.data)),t},toJSON:function(e){var t={};return void 0!==e.data&&(t.data=E(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},m);return void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,t}};var v={admin:"",contract:"",newCodeId:s.default.UZERO};t.MsgMigrateContract={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.admin&&t.uint32(10).string(e.admin),""!==e.contract&&t.uint32(18).string(e.contract),e.newCodeId.isZero()||t.uint32(24).uint64(e.newCodeId),0!==e.migrateMsg.length&&t.uint32(34).bytes(e.migrateMsg),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,a=Object.assign({},v);for(a.migrateMsg=new Uint8Array;n.pos>>3){case 1:a.admin=n.string();break;case 2:a.contract=n.string();break;case 3:a.newCodeId=n.uint64();break;case 4:a.migrateMsg=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);return t.migrateMsg=new Uint8Array,void 0!==e.admin&&null!==e.admin?t.admin=String(e.admin):t.admin="",void 0!==e.contract&&null!==e.contract?t.contract=String(e.contract):t.contract="",void 0!==e.newCodeId&&null!==e.newCodeId?t.newCodeId=s.default.fromString(e.newCodeId):t.newCodeId=s.default.UZERO,void 0!==e.migrateMsg&&null!==e.migrateMsg&&(t.migrateMsg=A(e.migrateMsg)),t},toJSON:function(e){var t={};return void 0!==e.admin&&(t.admin=e.admin),void 0!==e.contract&&(t.contract=e.contract),void 0!==e.newCodeId&&(t.newCodeId=(e.newCodeId||s.default.UZERO).toString()),void 0!==e.migrateMsg&&(t.migrateMsg=E(void 0!==e.migrateMsg?e.migrateMsg:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},v);return void 0!==e.admin&&null!==e.admin?t.admin=e.admin:t.admin="",void 0!==e.contract&&null!==e.contract?t.contract=e.contract:t.contract="",void 0!==e.newCodeId&&null!==e.newCodeId?t.newCodeId=e.newCodeId:t.newCodeId=s.default.UZERO,void 0!==e.migrateMsg&&null!==e.migrateMsg?t.migrateMsg=e.migrateMsg:t.migrateMsg=new Uint8Array,t}};var g={};t.MsgMigrateContractResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.data.length&&t.uint32(10).bytes(e.data),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,a=Object.assign({},g);for(a.data=new Uint8Array;n.pos>>3===1)a.data=n.bytes();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},g);return t.data=new Uint8Array,void 0!==e.data&&null!==e.data&&(t.data=A(e.data)),t},toJSON:function(e){var t={};return void 0!==e.data&&(t.data=E(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},g);return void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,t}};var w={admin:"",newAdmin:"",contract:""};t.MsgUpdateContractAdmin={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.admin&&t.uint32(10).string(e.admin),""!==e.newAdmin&&t.uint32(18).string(e.newAdmin),""!==e.contract&&t.uint32(26).string(e.contract),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,a=Object.assign({},w);n.pos>>3){case 1:a.admin=n.string();break;case 2:a.newAdmin=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},w);return void 0!==e.admin&&null!==e.admin?t.admin=String(e.admin):t.admin="",void 0!==e.newAdmin&&null!==e.newAdmin?t.newAdmin=String(e.newAdmin):t.newAdmin="",void 0!==e.contract&&null!==e.contract?t.contract=String(e.contract):t.contract="",t},toJSON:function(e){var t={};return void 0!==e.admin&&(t.admin=e.admin),void 0!==e.newAdmin&&(t.newAdmin=e.newAdmin),void 0!==e.contract&&(t.contract=e.contract),t},fromPartial:function(e){var t=Object.assign({},w);return void 0!==e.admin&&null!==e.admin?t.admin=e.admin:t.admin="",void 0!==e.newAdmin&&null!==e.newAdmin?t.newAdmin=e.newAdmin:t.newAdmin="",void 0!==e.contract&&null!==e.contract?t.contract=e.contract:t.contract="",t}};var T={};t.MsgUpdateContractAdminResponse={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,a=Object.assign({},T);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.admin&&t.uint32(10).string(e.admin),""!==e.contract&&t.uint32(18).string(e.contract),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,a=Object.assign({},k);n.pos>>3){case 1:a.admin=n.string();break;case 2:a.contract=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},k);return void 0!==e.admin&&null!==e.admin?t.admin=String(e.admin):t.admin="",void 0!==e.contract&&null!==e.contract?t.contract=String(e.contract):t.contract="",t},toJSON:function(e){var t={};return void 0!==e.admin&&(t.admin=e.admin),void 0!==e.contract&&(t.contract=e.contract),t},fromPartial:function(e){var t=Object.assign({},k);return void 0!==e.admin&&null!==e.admin?t.admin=e.admin:t.admin="",void 0!==e.contract&&null!==e.contract?t.contract=e.contract:t.contract="",t}};var _={};t.MsgClearContractAdminResponse={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,a=Object.assign({},_);n.pos1)){e=e.substring(1);var n=t[0];try{null==a[e]&&Object(w.defineReadOnly)(a,e,a[n])}catch(r){}null==a.functions[e]&&Object(w.defineReadOnly)(a.functions,e,a.functions[n]),null==a.callStatic[e]&&Object(w.defineReadOnly)(a.callStatic,e,a.callStatic[n]),null==a.populateTransaction[e]&&Object(w.defineReadOnly)(a.populateTransaction,e,a.populateTransaction[n]),null==a.estimateGas[e]&&Object(w.defineReadOnly)(a.estimateGas,e,a.estimateGas[n])}}))}return Object(f.a)(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&O.throwError("contract not deployed",k.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||O.throwError("sending a transactions require a signer",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var n=Object(w.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=n[e]&&O.throwError("cannot override "+e,k.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),n.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(n)}))}},{key:"connect",value:function(e){"string"===typeof e&&(e=new y.b(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Object(w.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new R);if("event"===e)return this._normalizeRunningEvent(new C("event",null));if("*"===e)return this._normalizeRunningEvent(new D(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new N(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var n=e.topics[0];if("string"!==typeof n)throw new Error("invalid topic");var r=this.interface.getEvent(n);return this._normalizeRunningEvent(new N(this.address,this.interface,r,e.topics))}catch(i){}var a={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new C(I(a),a))}return this._normalizeRunningEvent(new D(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];var t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,n){var r=this,a=Object(w.deepCopy)(t);return a.removeListener=function(){n&&(e.removeListener(n),r._checkRunningEvents(e))},a.getBlock=function(){return r.provider.getBlock(t.blockHash)},a.getTransaction=function(){return r.provider.getTransaction(t.transactionHash)},a.getTransactionReceipt=function(){return r.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(a),a}},{key:"_addEventListener",value:function(e,t,n){var a=this;if(this.provider||O.throwError("events require a provider or a signer with a provider",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var i=function(n){var i=a._wrapEvent(e,n,t);if(null==i.decodeError)try{var o=e.getEmit(i);a.emit.apply(a,[e.filter].concat(Object(r.a)(o)))}catch(s){i.decodeError=s.error}null!=e.filter&&a.emit("event",i),null!=i.decodeError&&a.emit("error",i.decodeError,i)};this._wrappedEmits[e.tag]=i,null!=e.filter&&this.provider.on(e.filter,i)}}},{key:"queryFilter",value:function(e,t,n){var r=this,a=this._getRunningEvent(e),i=Object(w.shallowCopy)(a.filter);return"string"===typeof t&&Object(g.isHexString)(t,32)?(null!=n&&O.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((function(e){return e.map((function(e){return r._wrapEvent(a,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1;for(var t=this._getRunningEvent(e),n=arguments.length,r=new Array(n>1?n-1:0),a=1;a0;return this._checkRunningEvents(t),i}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,n){return e+t._runningEvents[n].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this;if(!this.provider)return[];if(null==e){var n=function(){var e=[];for(var n in t._runningEvents)t._runningEvents[n].listeners().forEach((function(t){e.push(t)}));return{v:e}}();if("object"===typeof n)return n.v}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this;if(null==e){for(var t in this._runningEvents){var n=this._runningEvents[t];n.removeAllListeners(),this._checkRunningEvents(n)}return this}var r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var n=this._getRunningEvent(e);return n.removeListener(t),this._checkRunningEvents(n),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return Object(m.getContractAddress)(e)}},{key:"getInterface",value:function(e){return b.b.isInterface(e)?e:new b.b(e)}},{key:"isIndexed",value:function(e){return b.a.isIndexed(e)}}]),e}(),U=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(f.a)(n)}(B),L=function(){function e(t,n,r){Object(c.a)(this,e);var a=null;"0x"!==(a="string"===typeof n?n:Object(g.isBytes)(n)?Object(g.hexlify)(n):n&&"string"===typeof n.object?n.object:"!").substring(0,2)&&(a="0x"+a),(!Object(g.isHexString)(a)||a.length%2)&&O.throwArgumentError("invalid bytecode","bytecode",n),r&&!y.a.isSigner(r)&&O.throwArgumentError("invalid signer","signer",r),Object(w.defineReadOnly)(this,"bytecode",a),Object(w.defineReadOnly)(this,"interface",Object(w.getStatic)(this instanceof e?this.constructor:void 0,"getInterface")(t)),Object(w.defineReadOnly)(this,"signer",r||null)}return Object(f.a)(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,n=new Array(t),r=0;r2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&a.throwArgumentError("invalid value","value",e);var n=t[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");var i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];n.length;){if(n.length<=3){o.unshift(n);break}var s=n.length-3;o.unshift(n.substring(s)),n=n.substring(0,s)}return r+o.join(",")+i}function s(e,t){if("string"===typeof t){var n=i.indexOf(t);-1!==n&&(t=3*n)}return Object(r.b)(e,null!=t?t:18)}function u(e,t){if("string"!==typeof e&&a.throwArgumentError("value must be a string","value",e),"string"===typeof t){var n=i.indexOf(t);-1!==n&&(t=3*n)}return Object(r.c)(e,null!=t?t:18)}function c(e){return s(e,18)}function f(e){return u(e,18)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return l}));var r=n(66),a=n.n(r),i=n(3),o=n(199),s=n(7),u=new s.Logger("sha2/5.5.0");function c(e){return"0x"+a.a.ripemd160().update(Object(i.arrayify)(e)).digest("hex")}function f(e){return"0x"+a.a.sha256().update(Object(i.arrayify)(e)).digest("hex")}function d(e){return"0x"+a.a.sha512().update(Object(i.arrayify)(e)).digest("hex")}function l(e,t,n){return o.a[e]||u.throwError("unsupported algorithm "+e,s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+a.a.hmac(a.a[e],Object(i.arrayify)(t)).update(Object(i.arrayify)(n)).digest("hex")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(121);function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(447).Buffer}catch(M){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,a){for(var i=0,o=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&o0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.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)a=u(e,t,r)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=t)r++;r--,a=a/t|0;for(var i=e.length-n,o=i%r,s=Math.min(i,i-o)+n,u=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(M){i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?""}var l=["","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"],p=[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],b=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?l[6-u.length]+u+n:u+n,(a+=2)>=26&&(a-=26,o--)}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=p[e],f=b[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modrn(f).toString(e);n=(d=d.idivn(f)).isZero()?h+n:l[c-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};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 a=0|e.words[0],i=0|t.words[0],o=a*i,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,l=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=l;p++){var b=c-p|0;f+=(o=(a=0|e.words[b])*(i=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|f}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var a=this.byteLength(),i=n||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,a),o},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,a=0,i=0;a>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=o>>>24,i+=2)}if(n=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===i?(n>=0&&(e[n--]=o>>24&255),r=0,i=0):(r=o>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=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},i.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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.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)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.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)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,a=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 a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,p=0|o[1],b=8191&p,h=p>>>13,y=0|o[2],m=8191&y,v=y>>>13,g=0|o[3],w=8191&g,T=g>>>13,k=0|o[4],_=8191&k,O=k>>>13,S=0|o[5],x=8191&S,A=S>>>13,M=0|o[6],E=8191&M,P=M>>>13,j=0|o[7],I=8191&j,C=j>>>13,R=0|o[8],N=8191&R,D=R>>>13,B=0|o[9],U=8191&B,L=B>>>13,z=0|s[0],F=8191&z,q=z>>>13,H=0|s[1],J=8191&H,V=H>>>13,W=0|s[2],K=8191&W,G=W>>>13,Z=0|s[3],X=8191&Z,Y=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ae=0|s[6],ie=8191&ae,oe=ae>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],be=8191&pe,he=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,F))|0)+((8191&(a=(a=Math.imul(d,q))+Math.imul(l,F)|0))<<13)|0;c=((i=Math.imul(l,q))+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(b,F),a=(a=Math.imul(b,q))+Math.imul(h,F)|0,i=Math.imul(h,q);var me=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,V)|0)+Math.imul(l,J)|0))<<13)|0;c=((i=i+Math.imul(l,V)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,F),a=(a=Math.imul(m,q))+Math.imul(v,F)|0,i=Math.imul(v,q),r=r+Math.imul(b,J)|0,a=(a=a+Math.imul(b,V)|0)+Math.imul(h,J)|0,i=i+Math.imul(h,V)|0;var ve=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(l,K)|0))<<13)|0;c=((i=i+Math.imul(l,G)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,F),a=(a=Math.imul(w,q))+Math.imul(T,F)|0,i=Math.imul(T,q),r=r+Math.imul(m,J)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(v,J)|0,i=i+Math.imul(v,V)|0,r=r+Math.imul(b,K)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(h,K)|0,i=i+Math.imul(h,G)|0;var ge=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(l,X)|0))<<13)|0;c=((i=i+Math.imul(l,Y)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(_,F),a=(a=Math.imul(_,q))+Math.imul(O,F)|0,i=Math.imul(O,q),r=r+Math.imul(w,J)|0,a=(a=a+Math.imul(w,V)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,V)|0,r=r+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(v,K)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(b,X)|0,a=(a=a+Math.imul(b,Y)|0)+Math.imul(h,X)|0,i=i+Math.imul(h,Y)|0;var we=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,Q)|0))<<13)|0;c=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,F),a=(a=Math.imul(x,q))+Math.imul(A,F)|0,i=Math.imul(A,q),r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,V)|0,r=r+Math.imul(w,K)|0,a=(a=a+Math.imul(w,G)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(m,X)|0,a=(a=a+Math.imul(m,Y)|0)+Math.imul(v,X)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var Te=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(a=(a=a+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;c=((i=i+Math.imul(l,re)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(E,F),a=(a=Math.imul(E,q))+Math.imul(P,F)|0,i=Math.imul(P,q),r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,V)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(O,K)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(w,X)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(m,Q)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(b,ne)|0,a=(a=a+Math.imul(b,re)|0)+Math.imul(h,ne)|0,i=i+Math.imul(h,re)|0;var ke=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;c=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,F),a=(a=Math.imul(I,q))+Math.imul(C,F)|0,i=Math.imul(C,q),r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,V)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,G)|0,r=r+Math.imul(_,X)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(O,X)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(m,ne)|0,a=(a=a+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(h,ie)|0,i=i+Math.imul(h,oe)|0;var _e=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(a=(a=a+Math.imul(d,ce)|0)+Math.imul(l,ue)|0))<<13)|0;c=((i=i+Math.imul(l,ce)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,F),a=(a=Math.imul(N,q))+Math.imul(D,F)|0,i=Math.imul(D,q),r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,V)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(E,K)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,r=r+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,Y)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,r=r+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,re)|0)+Math.imul(T,ne)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,oe)|0,r=r+Math.imul(b,ue)|0,a=(a=a+Math.imul(b,ce)|0)+Math.imul(h,ue)|0,i=i+Math.imul(h,ce)|0;var Oe=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;c=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,F),a=(a=Math.imul(U,q))+Math.imul(L,F)|0,i=Math.imul(L,q),r=r+Math.imul(N,J)|0,a=(a=a+Math.imul(N,V)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,r=r+Math.imul(E,X)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(_,ne)|0,a=(a=a+Math.imul(_,re)|0)+Math.imul(O,ne)|0,i=i+Math.imul(O,re)|0,r=r+Math.imul(w,ie)|0,a=(a=a+Math.imul(w,oe)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,oe)|0,r=r+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,r=r+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(h,de)|0,i=i+Math.imul(h,le)|0;var Se=(c+(r=r+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,he)|0)+Math.imul(l,be)|0))<<13)|0;c=((i=i+Math.imul(l,he)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(U,J),a=(a=Math.imul(U,V))+Math.imul(L,J)|0,i=Math.imul(L,V),r=r+Math.imul(N,K)|0,a=(a=a+Math.imul(N,G)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,G)|0,r=r+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(x,ne)|0,a=(a=a+Math.imul(x,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,oe)|0,r=r+Math.imul(w,ue)|0,a=(a=a+Math.imul(w,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,r=r+Math.imul(m,de)|0,a=(a=a+Math.imul(m,le)|0)+Math.imul(v,de)|0,i=i+Math.imul(v,le)|0;var xe=(c+(r=r+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,he)|0)+Math.imul(h,be)|0))<<13)|0;c=((i=i+Math.imul(h,he)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(L,K)|0,i=Math.imul(L,G),r=r+Math.imul(N,X)|0,a=(a=a+Math.imul(N,Y)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,Y)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(E,ne)|0,a=(a=a+Math.imul(E,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,r=r+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,ce)|0)+Math.imul(O,ue)|0,i=i+Math.imul(O,ce)|0,r=r+Math.imul(w,de)|0,a=(a=a+Math.imul(w,le)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,le)|0;var Ae=(c+(r=r+Math.imul(m,be)|0)|0)+((8191&(a=(a=a+Math.imul(m,he)|0)+Math.imul(v,be)|0))<<13)|0;c=((i=i+Math.imul(v,he)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(L,X)|0,i=Math.imul(L,Y),r=r+Math.imul(N,Q)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,r=r+Math.imul(_,de)|0,a=(a=a+Math.imul(_,le)|0)+Math.imul(O,de)|0,i=i+Math.imul(O,le)|0;var Me=(c+(r=r+Math.imul(w,be)|0)|0)+((8191&(a=(a=a+Math.imul(w,he)|0)+Math.imul(T,be)|0))<<13)|0;c=((i=i+Math.imul(T,he)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(L,Q)|0,i=Math.imul(L,ee),r=r+Math.imul(N,ne)|0,a=(a=a+Math.imul(N,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,r=r+Math.imul(E,ue)|0,a=(a=a+Math.imul(E,ce)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var Ee=(c+(r=r+Math.imul(_,be)|0)|0)+((8191&(a=(a=a+Math.imul(_,he)|0)+Math.imul(O,be)|0))<<13)|0;c=((i=i+Math.imul(O,he)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(U,ne),a=(a=Math.imul(U,re))+Math.imul(L,ne)|0,i=Math.imul(L,re),r=r+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,oe)|0,r=r+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,r=r+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Pe=(c+(r=r+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,he)|0)+Math.imul(A,be)|0))<<13)|0;c=((i=i+Math.imul(A,he)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(L,ie)|0,i=Math.imul(L,oe),r=r+Math.imul(N,ue)|0,a=(a=a+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,ce)|0,r=r+Math.imul(I,de)|0,a=(a=a+Math.imul(I,le)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,le)|0;var je=(c+(r=r+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,he)|0)+Math.imul(P,be)|0))<<13)|0;c=((i=i+Math.imul(P,he)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(U,ue),a=(a=Math.imul(U,ce))+Math.imul(L,ue)|0,i=Math.imul(L,ce),r=r+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(D,de)|0,i=i+Math.imul(D,le)|0;var Ie=(c+(r=r+Math.imul(I,be)|0)|0)+((8191&(a=(a=a+Math.imul(I,he)|0)+Math.imul(C,be)|0))<<13)|0;c=((i=i+Math.imul(C,he)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,de),a=(a=Math.imul(U,le))+Math.imul(L,de)|0,i=Math.imul(L,le);var Ce=(c+(r=r+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,he)|0)+Math.imul(D,be)|0))<<13)|0;c=((i=i+Math.imul(D,he)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Re=(c+(r=Math.imul(U,be))|0)+((8191&(a=(a=Math.imul(U,he))+Math.imul(L,be)|0))<<13)|0;return c=((i=Math.imul(L,he))+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=ge,u[4]=we,u[5]=Te,u[6]=ke,u[7]=_e,u[8]=Oe,u[9]=Se,u[10]=xe,u[11]=Ae,u[12]=Me,u[13]=Ee,u[14]=Pe,u[15]=je,u[16]=Ie,u[17]=Ce,u[18]=Re,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}n.words[i]=s,r=o,o=a}return 0!==r?n.words[i]=r:n.length--,n._strip()}function v(e,t,n){return m(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(y=h),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?h(this,e,t):n<1024?m(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,n[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,n+=i/67108864|0,n+=o>>>26,this.words[a]=67108863&o}return 0!==n&&(this.words[a]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>a&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,a=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,c=0;c=0&&(0!==f||c>=a);c--){var d=0|this.words[c];this.words[c]=f<<26-i|d>>>i,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,a=1<=0);var t=e%26,n=(e-t)/26;if(r(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 a=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},i.prototype.isubn=function(e){if(r("number"===typeof e),r(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[a+n]=67108863&i}for(;a>26,this.words[a+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,u=r.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.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),a=e.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,a=0,i=this.length-1;i>=0;i--)a=(n*a+(0|this.words[i]))%e;return t?-a:a},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,a=this.length-1;a>=0;a--){var i=(0|this.words[a])+67108864*n;this.words[a]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0===(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,h=1;0===(n.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(n.iushrn(b);b-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,l=1;0===(n.words[0]&l)&&d<26;++d,l<<=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),o.isub(s)):(n.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.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 a=t.cmp(n);if(a<0){var i=t;t=n,n=i}else if(0===a||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.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),r(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;n--){var r=0|this.words[n],a=0|e.words[n];if(r!==a){ra&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new x(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function T(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){T.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function O(){T.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){T.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}T.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},T.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},T.prototype.split=function(e,t){e.iushrn(this.n,0,t)},T.prototype.imulK=function(e){return e.imul(this.k)},a(k,T),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.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]=a,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new _;else if("p192"===e)t=new O;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return w[e]=t,t},x.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),b=o;0!==p.cmp(s);){for(var h=p,y=0;0!==h.cmp(s);y++)h=h.redSqr();r(y=0;r--){for(var c=t.words[r],f=u-1;f>=0;f--){var d=c>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},a(A,x),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),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(157)(e))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(11);function a(t){var n=t.accounts.map(i);return new r.f({programId:new r.b(t.program_id),data:e.from(t.data),keys:n})}function i(e){return{pubkey:new r.b(e.pubkey),isSigner:e.is_signer,isWritable:e.is_writable}}}).call(this,n(21).Buffer)},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(6),a=n(18),i=n(0),o=n(22),s=n(26),u=n(32),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},f=i.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,f=e.classes,d=e.className,l=e.color,p=void 0===l?"initial":l,b=e.component,h=e.display,y=void 0===h?"initial":h,m=e.gutterBottom,v=void 0!==m&&m,g=e.noWrap,w=void 0!==g&&g,T=e.paragraph,k=void 0!==T&&T,_=e.variant,O=void 0===_?"body1":_,S=e.variantMapping,x=void 0===S?c:S,A=Object(a.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),M=b||(k?"p":x[O]||c[O])||"span";return i.createElement(M,Object(r.a)({className:Object(o.a)(f.root,d,"inherit"!==O&&f[O],"initial"!==p&&f["color".concat(Object(u.a)(p))],w&&f.noWrap,v&&f.gutterBottom,k&&f.paragraph,"inherit"!==s&&f["align".concat(Object(u.a)(s))],"initial"!==y&&f["display".concat(Object(u.a)(y))]),ref:t},A))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(f)},function(e,t,n){"use strict";var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Params=t.Height=t.UpgradeProposal=t.ClientUpdateProposal=t.ClientConsensusStates=t.ConsensusStateWithHeight=t.IdentifiedClientState=t.protobufPackage=void 0;var i=a(n(24)),o=a(n(20)),s=n(25),u=n(183);t.protobufPackage="ibc.core.client.v1";var c={clientId:""};t.IdentifiedClientState={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.clientId&&t.uint32(10).string(e.clientId),void 0!==e.clientState&&s.Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.clientState=s.Any.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},c);return void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.clientState&&null!==e.clientState?t.clientState=s.Any.fromJSON(e.clientState):t.clientState=void 0,t},toJSON:function(e){var t={};return void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.clientState&&(t.clientState=e.clientState?s.Any.toJSON(e.clientState):void 0),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.clientState&&null!==e.clientState?t.clientState=s.Any.fromPartial(e.clientState):t.clientState=void 0,t}};var f={};t.ConsensusStateWithHeight={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return void 0!==e.height&&t.Height.encode(e.height,n.uint32(10).fork()).ldelim(),void 0!==e.consensusState&&s.Any.encode(e.consensusState,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},f);r.pos>>3){case 1:i.height=t.Height.decode(r,r.uint32());break;case 2:i.consensusState=s.Any.decode(r,r.uint32());break;default:r.skipType(7&u)}}return i},fromJSON:function(e){var n=Object.assign({},f);return void 0!==e.height&&null!==e.height?n.height=t.Height.fromJSON(e.height):n.height=void 0,void 0!==e.consensusState&&null!==e.consensusState?n.consensusState=s.Any.fromJSON(e.consensusState):n.consensusState=void 0,n},toJSON:function(e){var n={};return void 0!==e.height&&(n.height=e.height?t.Height.toJSON(e.height):void 0),void 0!==e.consensusState&&(n.consensusState=e.consensusState?s.Any.toJSON(e.consensusState):void 0),n},fromPartial:function(e){var n=Object.assign({},f);return void 0!==e.height&&null!==e.height?n.height=t.Height.fromPartial(e.height):n.height=void 0,void 0!==e.consensusState&&null!==e.consensusState?n.consensusState=s.Any.fromPartial(e.consensusState):n.consensusState=void 0,n}};var d={clientId:""};t.ClientConsensusStates={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();""!==e.clientId&&n.uint32(10).string(e.clientId);var a,i=r(e.consensusStates);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.ConsensusStateWithHeight.encode(s,n.uint32(18).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},d);for(i.consensusStates=[];r.pos>>3){case 1:i.clientId=r.string();break;case 2:i.consensusStates.push(t.ConsensusStateWithHeight.decode(r,r.uint32()));break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},d);if(n.consensusStates=[],void 0!==e.clientId&&null!==e.clientId?n.clientId=String(e.clientId):n.clientId="",void 0!==e.consensusStates&&null!==e.consensusStates){var a,i=r(e.consensusStates);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.consensusStates.push(t.ConsensusStateWithHeight.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.clientId&&(n.clientId=e.clientId),e.consensusStates?n.consensusStates=e.consensusStates.map((function(e){return e?t.ConsensusStateWithHeight.toJSON(e):void 0})):n.consensusStates=[],n},fromPartial:function(e){var n=Object.assign({},d);if(n.consensusStates=[],void 0!==e.clientId&&null!==e.clientId?n.clientId=e.clientId:n.clientId="",void 0!==e.consensusStates&&null!==e.consensusStates){var a,i=r(e.consensusStates);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.consensusStates.push(t.ConsensusStateWithHeight.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var l={title:"",description:"",subjectClientId:"",substituteClientId:""};t.ClientUpdateProposal={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.title&&t.uint32(10).string(e.title),""!==e.description&&t.uint32(18).string(e.description),""!==e.subjectClientId&&t.uint32(26).string(e.subjectClientId),""!==e.substituteClientId&&t.uint32(34).string(e.substituteClientId),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);n.pos>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;case 3:a.subjectClientId=n.string();break;case 4:a.substituteClientId=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.title&&null!==e.title?t.title=String(e.title):t.title="",void 0!==e.description&&null!==e.description?t.description=String(e.description):t.description="",void 0!==e.subjectClientId&&null!==e.subjectClientId?t.subjectClientId=String(e.subjectClientId):t.subjectClientId="",void 0!==e.substituteClientId&&null!==e.substituteClientId?t.substituteClientId=String(e.substituteClientId):t.substituteClientId="",t},toJSON:function(e){var t={};return void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),void 0!==e.subjectClientId&&(t.subjectClientId=e.subjectClientId),void 0!==e.substituteClientId&&(t.substituteClientId=e.substituteClientId),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.title&&null!==e.title?t.title=e.title:t.title="",void 0!==e.description&&null!==e.description?t.description=e.description:t.description="",void 0!==e.subjectClientId&&null!==e.subjectClientId?t.subjectClientId=e.subjectClientId:t.subjectClientId="",void 0!==e.substituteClientId&&null!==e.substituteClientId?t.substituteClientId=e.substituteClientId:t.substituteClientId="",t}};var p={title:"",description:""};t.UpgradeProposal={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.title&&t.uint32(10).string(e.title),""!==e.description&&t.uint32(18).string(e.description),void 0!==e.plan&&u.Plan.encode(e.plan,t.uint32(26).fork()).ldelim(),void 0!==e.upgradedClientState&&s.Any.encode(e.upgradedClientState,t.uint32(34).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);n.pos>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;case 3:a.plan=u.Plan.decode(n,n.uint32());break;case 4:a.upgradedClientState=s.Any.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);return void 0!==e.title&&null!==e.title?t.title=String(e.title):t.title="",void 0!==e.description&&null!==e.description?t.description=String(e.description):t.description="",void 0!==e.plan&&null!==e.plan?t.plan=u.Plan.fromJSON(e.plan):t.plan=void 0,void 0!==e.upgradedClientState&&null!==e.upgradedClientState?t.upgradedClientState=s.Any.fromJSON(e.upgradedClientState):t.upgradedClientState=void 0,t},toJSON:function(e){var t={};return void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),void 0!==e.plan&&(t.plan=e.plan?u.Plan.toJSON(e.plan):void 0),void 0!==e.upgradedClientState&&(t.upgradedClientState=e.upgradedClientState?s.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial:function(e){var t=Object.assign({},p);return void 0!==e.title&&null!==e.title?t.title=e.title:t.title="",void 0!==e.description&&null!==e.description?t.description=e.description:t.description="",void 0!==e.plan&&null!==e.plan?t.plan=u.Plan.fromPartial(e.plan):t.plan=void 0,void 0!==e.upgradedClientState&&null!==e.upgradedClientState?t.upgradedClientState=s.Any.fromPartial(e.upgradedClientState):t.upgradedClientState=void 0,t}};var b={revisionNumber:i.default.UZERO,revisionHeight:i.default.UZERO};t.Height={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return e.revisionNumber.isZero()||t.uint32(8).uint64(e.revisionNumber),e.revisionHeight.isZero()||t.uint32(16).uint64(e.revisionHeight),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},b);n.pos>>3){case 1:a.revisionNumber=n.uint64();break;case 2:a.revisionHeight=n.uint64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);return void 0!==e.revisionNumber&&null!==e.revisionNumber?t.revisionNumber=i.default.fromString(e.revisionNumber):t.revisionNumber=i.default.UZERO,void 0!==e.revisionHeight&&null!==e.revisionHeight?t.revisionHeight=i.default.fromString(e.revisionHeight):t.revisionHeight=i.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.revisionNumber&&(t.revisionNumber=(e.revisionNumber||i.default.UZERO).toString()),void 0!==e.revisionHeight&&(t.revisionHeight=(e.revisionHeight||i.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},b);return void 0!==e.revisionNumber&&null!==e.revisionNumber?t.revisionNumber=e.revisionNumber:t.revisionNumber=i.default.UZERO,void 0!==e.revisionHeight&&null!==e.revisionHeight?t.revisionHeight=e.revisionHeight:t.revisionHeight=i.default.UZERO,t}};var h={allowedClients:""};t.Params={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.allowedClients);try{for(a.s();!(t=a.n()).done;){var i=t.value;n.uint32(10).string(i)}}catch(s){a.e(s)}finally{a.f()}return n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},h);for(a.allowedClients=[];n.pos>>3===1)a.allowedClients.push(n.string());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},h);if(t.allowedClients=[],void 0!==e.allowedClients&&null!==e.allowedClients){var n,a=r(e.allowedClients);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.allowedClients.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.allowedClients?t.allowedClients=e.allowedClients.map((function(e){return e})):t.allowedClients=[],t},fromPartial:function(e){var t=Object.assign({},h);if(t.allowedClients=[],void 0!==e.allowedClients&&null!==e.allowedClients){var n,a=r(e.allowedClients);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.allowedClients.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},function(e,t,n){"use strict";var r,a="object"===typeof Reflect?Reflect:null,i=a&&"function"===typeof a.apply?a.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=a&&"function"===typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function a(n){e.removeListener(t,i),r(n)}function i(){"function"===typeof e.removeListener&&e.removeListener("error",a),n([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"===typeof e.on&&m(e,"error",t,n)}(e,a,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var a,i,o,s;if(c(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),o=i[t]),void 0===o)o=i[t]=n,++e._eventsCount;else if("function"===typeof o?o=i[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(a=f(e))>0&&o.length>a&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function l(){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 p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=l.bind(r);return a.listener=n,r.wrapFn=a,a}function b(e,t,n){var r=e._events;if(void 0===r)return[];var a=r[t];return void 0===a?[]:"function"===typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=a[e];if(void 0===u)return!1;if("function"===typeof u)i(u,this,t);else{var c=u.length,f=y(u,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){o=n[i].listener,a=i;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return b(this,e,!0)},s.prototype.rawListeners=function(e){return b(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";var r={};function a(e,t,n){n||(n=Error);var a=function(e){var n,r;function a(n,r,a){return e.call(this,function(e,n,r){return"string"===typeof t?t:t(e,n,r)}(n,r,a))||this}return r=e,(n=a).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,a}(n);a.prototype.name=n.name,a.prototype.code=e,r[e]=a}function i(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,a,o,s;if("string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var u=function(e,t,n){return"number"!==typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(r," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var a=n(342),i=n(346);n(51)(c,a);for(var o=r(i.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,a=(n-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=a},function(e,t,n){"use strict";n.d(t,"b",(function(){return I})),n.d(t,"a",(function(){return C})),n.d(t,"c",(function(){return R}));var r=n(9),a=n(8),i=n(15),o=n(16),s=n(1),u=n.n(s),c=n(97),f=n.n(c),d=n(222),l=n.n(d),p=n(31),b=n(3),h=n(56),y=n(39),m=n(707),v=n(155),g=n(5),w=n(48),T=n(43),k=n(7),_=n(215),O=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},S=new k.Logger(_.a);function x(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}var A=function(e){Object(i.a)(n,e);var t=Object(o.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"isKeystoreAccount",value:function(e){return!(!e||!e._isKeystoreAccount)}}]),n}(g.Description);function M(e,t){var n=Object(T.b)(Object(T.c)(e,"crypto/ciphertext"));if(Object(b.hexlify)(Object(y.keccak256)(Object(b.concat)([t.slice(16,32),n]))).substring(2)!==Object(T.c)(e,"crypto/mac").toLowerCase())throw new Error("invalid password");var r=function(e,t,n){if("aes-128-ctr"===Object(T.c)(e,"crypto/cipher")){var r=Object(T.b)(Object(T.c)(e,"crypto/cipherparams/iv")),a=new f.a.Counter(r),i=new f.a.ModeOfOperation.ctr(t,a);return Object(b.arrayify)(i.decrypt(n))}return null}(e,t.slice(0,16),n);r||S.throwError("unsupported cipher",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var a=t.slice(32,64),i=Object(w.computeAddress)(r);if(e.address){var o=e.address.toLowerCase();if("0x"!==o.substring(0,2)&&(o="0x"+o),Object(p.getAddress)(o)!==i)throw new Error("address mismatch")}var s={_isKeystoreAccount:!0,address:i,privateKey:Object(b.hexlify)(r)};if("0.1"===Object(T.c)(e,"x-ethers/version")){var u=Object(T.b)(Object(T.c)(e,"x-ethers/mnemonicCiphertext")),c=Object(T.b)(Object(T.c)(e,"x-ethers/mnemonicCounter")),d=new f.a.Counter(c),l=new f.a.ModeOfOperation.ctr(a,d),m=Object(T.c)(e,"x-ethers/path")||h.defaultPath,v=Object(T.c)(e,"x-ethers/locale")||"en",g=Object(b.arrayify)(l.decrypt(u));try{var _=Object(h.entropyToMnemonic)(g,v),O=h.HDNode.fromMnemonic(_,null,v).derivePath(m);if(O.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=O.mnemonic}catch(x){if(x.code!==k.Logger.errors.INVALID_ARGUMENT||"wordlist"!==x.argument)throw x}}return new A(s)}function E(e,t,n,r,a){return Object(b.arrayify)(Object(m.a)(e,t,n,r,a))}function P(e,t,n,r,a){return Promise.resolve(E(e,t,n,r,a))}function j(e,t,n,r,a){var i=Object(T.a)(t),o=Object(T.c)(e,"crypto/kdf");if(o&&"string"===typeof o){var s=function(e,t){return S.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===o.toLowerCase()){var u=Object(T.b)(Object(T.c)(e,"crypto/kdfparams/salt")),c=parseInt(Object(T.c)(e,"crypto/kdfparams/n")),f=parseInt(Object(T.c)(e,"crypto/kdfparams/r")),d=parseInt(Object(T.c)(e,"crypto/kdfparams/p"));c&&f&&d||s("kdf",o),0!==(c&c-1)&&s("N",c);var l=parseInt(Object(T.c)(e,"crypto/kdfparams/dklen"));return 32!==l&&s("dklen",l),r(i,u,c,f,d,64,a)}if("pbkdf2"===o.toLowerCase()){var p=Object(T.b)(Object(T.c)(e,"crypto/kdfparams/salt")),b=null,h=Object(T.c)(e,"crypto/kdfparams/prf");"hmac-sha256"===h?b="sha256":"hmac-sha512"===h?b="sha512":s("prf",h);var y=parseInt(Object(T.c)(e,"crypto/kdfparams/c")),m=parseInt(Object(T.c)(e,"crypto/kdfparams/dklen"));return 32!==m&&s("dklen",m),n(i,p,y,m,b)}}return S.throwArgumentError("unsupported key-derivation function","kdf",o)}function I(e,t){var n=JSON.parse(e);return M(n,j(n,t,E,l.a.syncScrypt))}function C(e,t,n){return O(this,void 0,void 0,u.a.mark((function r(){var a,i;return u.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=JSON.parse(e),r.next=3,j(a,t,P,l.a.scrypt,n);case 3:return i=r.sent,r.abrupt("return",M(a,i));case 5:case"end":return r.stop()}}),r)})))}function R(e,t,n,r){try{if(Object(p.getAddress)(e.address)!==Object(w.computeAddress)(e.privateKey))throw new Error("address/privateKey mismatch");if(x(e)){var a=e.mnemonic;if(h.HDNode.fromMnemonic(a.phrase,null,a.locale).derivePath(a.path||h.defaultPath).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(M){return Promise.reject(M)}"function"!==typeof n||r||(r=n,n={}),n||(n={});var i=Object(b.arrayify)(e.privateKey),o=Object(T.a)(t),s=null,u=null,c=null;if(x(e)){var d=e.mnemonic;s=Object(b.arrayify)(Object(h.mnemonicToEntropy)(d.phrase,d.locale||"en")),u=d.path||h.defaultPath,c=d.locale||"en"}var m=n.client;m||(m="ethers.js");var g=null;g=n.salt?Object(b.arrayify)(n.salt):Object(v.a)(32);var k=null;if(n.iv){if(16!==(k=Object(b.arrayify)(n.iv)).length)throw new Error("invalid iv")}else k=Object(v.a)(16);var _=null;if(n.uuid){if(16!==(_=Object(b.arrayify)(n.uuid)).length)throw new Error("invalid uuid")}else _=Object(v.a)(16);var O=1<<17,S=8,A=1;return n.scrypt&&(n.scrypt.N&&(O=n.scrypt.N),n.scrypt.r&&(S=n.scrypt.r),n.scrypt.p&&(A=n.scrypt.p)),l.a.scrypt(o,g,O,S,A,64,r).then((function(t){var n=(t=Object(b.arrayify)(t)).slice(0,16),r=t.slice(16,32),a=t.slice(32,64),o=new f.a.Counter(k),d=new f.a.ModeOfOperation.ctr(n,o),l=Object(b.arrayify)(d.encrypt(i)),p=Object(y.keccak256)(Object(b.concat)([r,l])),h={address:e.address.substring(2).toLowerCase(),id:Object(T.d)(_),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(b.hexlify)(k).substring(2)},ciphertext:Object(b.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:Object(b.hexlify)(g).substring(2),n:O,dklen:32,p:A,r:S},mac:p.substring(2)}};if(s){var w=Object(v.a)(16),x=new f.a.Counter(w),M=new f.a.ModeOfOperation.ctr(a,x),E=Object(b.arrayify)(M.encrypt(s)),P=new Date,j=P.getUTCFullYear()+"-"+Object(T.e)(P.getUTCMonth()+1,2)+"-"+Object(T.e)(P.getUTCDate(),2)+"T"+Object(T.e)(P.getUTCHours(),2)+"-"+Object(T.e)(P.getUTCMinutes(),2)+"-"+Object(T.e)(P.getUTCSeconds(),2)+".0Z";h["x-ethers"]={client:m,gethFilename:"UTC--"+j+"--"+h.address,mnemonicCounter:Object(b.hexlify)(w).substring(2),mnemonicCiphertext:Object(b.hexlify)(E).substring(2),path:u,locale:c,version:"0.1"}}return JSON.stringify(h)}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0);function a(e){var t=e.controlled,n=e.default,a=(e.name,e.state,r.useRef(void 0!==t).current),i=r.useState(n),o=i[0],s=i[1];return[a?t:o,r.useCallback((function(e){a||s(e)}),[])]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(60);function a(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(412),a=Object(r.a)();t.a=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(6),a=n(0),i=n.n(a),o=n(415);function s(e,t){var n=function(t,n){return i.a.createElement(o.a,Object(r.a)({ref:n},t),e)};return n.muiName=o.a.muiName,i.a.memo(i.a.forwardRef(n))}},function(e,t,n){"use strict";var r=n(0),a=n.n(r);t.a=a.a.createContext(null)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var r=n(3),a=n(7),i=n(394),o=new a.Logger(i.a);var s=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw new Error("unable to locate global object")}(),u=s.crypto||s.msCrypto;function c(e){(e<=0||e>1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return u.getRandomValues(t),Object(r.arrayify)(t)}u&&u.getRandomValues||(o.warn("WARNING: Missing strong random number source"),u={getRandomValues:function(e){return o.throwError("no secure random source avaialble",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,n(35))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return f}));var r=n(24),a=n.n(r),i=n(20),o=n.n(i),s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c={nodeName:"",counter:"0",timestamp:"0",version:"",guardianAddr:"",bootTimestamp:"0"},f={encode:function(e,t){var n,r;void 0===t&&(t=o.a.Writer.create()),""!==e.nodeName&&t.uint32(10).string(e.nodeName),"0"!==e.counter&&t.uint32(16).int64(e.counter),"0"!==e.timestamp&&t.uint32(24).int64(e.timestamp);try{for(var a=u(e.networks),i=a.next();!i.done;i=a.next()){var s=i.value;l.encode(s,t.uint32(34).fork()).ldelim()}}catch(c){n={error:c}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return""!==e.version&&t.uint32(42).string(e.version),""!==e.guardianAddr&&t.uint32(50).string(e.guardianAddr),"0"!==e.bootTimestamp&&t.uint32(56).int64(e.bootTimestamp),t},decode:function(e,t){var n=e instanceof o.a.Reader?e:new o.a.Reader(e),r=void 0===t?n.len:n.pos+t,a=s({},c);for(a.networks=[];n.pos>>3){case 1:a.nodeName=n.string();break;case 2:a.counter=b(n.int64());break;case 3:a.timestamp=b(n.int64());break;case 4:a.networks.push(l.decode(n,n.uint32()));break;case 5:a.version=n.string();break;case 6:a.guardianAddr=n.string();break;case 7:a.bootTimestamp=b(n.int64());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t,n,r=s({},c);if(r.networks=[],void 0!==e.nodeName&&null!==e.nodeName?r.nodeName=String(e.nodeName):r.nodeName="",void 0!==e.counter&&null!==e.counter?r.counter=String(e.counter):r.counter="0",void 0!==e.timestamp&&null!==e.timestamp?r.timestamp=String(e.timestamp):r.timestamp="0",void 0!==e.networks&&null!==e.networks)try{for(var a=u(e.networks),i=a.next();!i.done;i=a.next()){var o=i.value;r.networks.push(l.fromJSON(o))}}catch(f){t={error:f}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return void 0!==e.version&&null!==e.version?r.version=String(e.version):r.version="",void 0!==e.guardianAddr&&null!==e.guardianAddr?r.guardianAddr=String(e.guardianAddr):r.guardianAddr="",void 0!==e.bootTimestamp&&null!==e.bootTimestamp?r.bootTimestamp=String(e.bootTimestamp):r.bootTimestamp="0",r},toJSON:function(e){var t={};return void 0!==e.nodeName&&(t.nodeName=e.nodeName),void 0!==e.counter&&(t.counter=e.counter),void 0!==e.timestamp&&(t.timestamp=e.timestamp),e.networks?t.networks=e.networks.map((function(e){return e?l.toJSON(e):void 0})):t.networks=[],void 0!==e.version&&(t.version=e.version),void 0!==e.guardianAddr&&(t.guardianAddr=e.guardianAddr),void 0!==e.bootTimestamp&&(t.bootTimestamp=e.bootTimestamp),t},fromPartial:function(e){var t,n,r=s({},c);if(r.networks=[],void 0!==e.nodeName&&null!==e.nodeName?r.nodeName=e.nodeName:r.nodeName="",void 0!==e.counter&&null!==e.counter?r.counter=e.counter:r.counter="0",void 0!==e.timestamp&&null!==e.timestamp?r.timestamp=e.timestamp:r.timestamp="0",void 0!==e.networks&&null!==e.networks)try{for(var a=u(e.networks),i=a.next();!i.done;i=a.next()){var o=i.value;r.networks.push(l.fromPartial(o))}}catch(f){t={error:f}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return void 0!==e.version&&null!==e.version?r.version=e.version:r.version="",void 0!==e.guardianAddr&&null!==e.guardianAddr?r.guardianAddr=e.guardianAddr:r.guardianAddr="",void 0!==e.bootTimestamp&&null!==e.bootTimestamp?r.bootTimestamp=e.bootTimestamp:r.bootTimestamp="0",r}},d={id:0,height:"0",contractAddress:"",errorCount:"0"},l={encode:function(e,t){return void 0===t&&(t=o.a.Writer.create()),0!==e.id&&t.uint32(8).uint32(e.id),"0"!==e.height&&t.uint32(16).int64(e.height),""!==e.contractAddress&&t.uint32(26).string(e.contractAddress),"0"!==e.errorCount&&t.uint32(32).uint64(e.errorCount),t},decode:function(e,t){for(var n=e instanceof o.a.Reader?e:new o.a.Reader(e),r=void 0===t?n.len:n.pos+t,a=s({},d);n.pos>>3){case 1:a.id=n.uint32();break;case 2:a.height=b(n.int64());break;case 3:a.contractAddress=n.string();break;case 4:a.errorCount=b(n.uint64());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=s({},d);return void 0!==e.id&&null!==e.id?t.id=Number(e.id):t.id=0,void 0!==e.height&&null!==e.height?t.height=String(e.height):t.height="0",void 0!==e.contractAddress&&null!==e.contractAddress?t.contractAddress=String(e.contractAddress):t.contractAddress="",void 0!==e.errorCount&&null!==e.errorCount?t.errorCount=String(e.errorCount):t.errorCount="0",t},toJSON:function(e){var t={};return void 0!==e.id&&(t.id=e.id),void 0!==e.height&&(t.height=e.height),void 0!==e.contractAddress&&(t.contractAddress=e.contractAddress),void 0!==e.errorCount&&(t.errorCount=e.errorCount),t},fromPartial:function(e){var t=s({},d);return void 0!==e.id&&null!==e.id?t.id=e.id:t.id=0,void 0!==e.height&&null!==e.height?t.height=e.height:t.height="0",void 0!==e.contractAddress&&null!==e.contractAddress?t.contractAddress=e.contractAddress:t.contractAddress="",void 0!==e.errorCount&&null!==e.errorCount?t.errorCount=e.errorCount:t.errorCount="0",t}},p=function(){if("undefined"!==typeof p)return p;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}();p.atob;p.btoa;function b(e){return e.toString()}o.a.util.Long!==a.a&&(o.a.util.Long=a.a,o.a.configure())}).call(this,n(35))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";var r=n(99),a=n(128);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var a=0;a>>24&255,r[a++]=e>>>16&255,r[a++]=e>>>8&255,r[a++]=255&e}else for(r[a++]=255&e,r[a++]=e>>>8&255,r[a++]=e>>>16&255,r[a++]=e>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.description&&u.Description.encode(e.description,t.uint32(10).fork()).ldelim(),void 0!==e.commission&&u.CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),""!==e.minSelfDelegation&&t.uint32(26).string(e.minSelfDelegation),""!==e.delegatorAddress&&t.uint32(34).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(42).string(e.validatorAddress),void 0!==e.pubkey&&c.Any.encode(e.pubkey,t.uint32(50).fork()).ldelim(),void 0!==e.value&&f.Coin.encode(e.value,t.uint32(58).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);n.pos>>3){case 1:a.description=u.Description.decode(n,n.uint32());break;case 2:a.commission=u.CommissionRates.decode(n,n.uint32());break;case 3:a.minSelfDelegation=n.string();break;case 4:a.delegatorAddress=n.string();break;case 5:a.validatorAddress=n.string();break;case 6:a.pubkey=c.Any.decode(n,n.uint32());break;case 7:a.value=f.Coin.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.description&&null!==e.description?t.description=u.Description.fromJSON(e.description):t.description=void 0,void 0!==e.commission&&null!==e.commission?t.commission=u.CommissionRates.fromJSON(e.commission):t.commission=void 0,void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?t.minSelfDelegation=String(e.minSelfDelegation):t.minSelfDelegation="",void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",void 0!==e.pubkey&&null!==e.pubkey?t.pubkey=c.Any.fromJSON(e.pubkey):t.pubkey=void 0,void 0!==e.value&&null!==e.value?t.value=f.Coin.fromJSON(e.value):t.value=void 0,t},toJSON:function(e){var t={};return void 0!==e.description&&(t.description=e.description?u.Description.toJSON(e.description):void 0),void 0!==e.commission&&(t.commission=e.commission?u.CommissionRates.toJSON(e.commission):void 0),void 0!==e.minSelfDelegation&&(t.minSelfDelegation=e.minSelfDelegation),void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.pubkey&&(t.pubkey=e.pubkey?c.Any.toJSON(e.pubkey):void 0),void 0!==e.value&&(t.value=e.value?f.Coin.toJSON(e.value):void 0),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.description&&null!==e.description?t.description=u.Description.fromPartial(e.description):t.description=void 0,void 0!==e.commission&&null!==e.commission?t.commission=u.CommissionRates.fromPartial(e.commission):t.commission=void 0,void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?t.minSelfDelegation=e.minSelfDelegation:t.minSelfDelegation="",void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",void 0!==e.pubkey&&null!==e.pubkey?t.pubkey=c.Any.fromPartial(e.pubkey):t.pubkey=void 0,void 0!==e.value&&null!==e.value?t.value=f.Coin.fromPartial(e.value):t.value=void 0,t}};var p={};t.MsgCreateValidatorResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.description&&u.Description.encode(e.description,t.uint32(10).fork()).ldelim(),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),""!==e.commissionRate&&t.uint32(26).string(e.commissionRate),""!==e.minSelfDelegation&&t.uint32(34).string(e.minSelfDelegation),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},b);n.pos>>3){case 1:a.description=u.Description.decode(n,n.uint32());break;case 2:a.validatorAddress=n.string();break;case 3:a.commissionRate=n.string();break;case 4:a.minSelfDelegation=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);return void 0!==e.description&&null!==e.description?t.description=u.Description.fromJSON(e.description):t.description=void 0,void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",void 0!==e.commissionRate&&null!==e.commissionRate?t.commissionRate=String(e.commissionRate):t.commissionRate="",void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?t.minSelfDelegation=String(e.minSelfDelegation):t.minSelfDelegation="",t},toJSON:function(e){var t={};return void 0!==e.description&&(t.description=e.description?u.Description.toJSON(e.description):void 0),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.commissionRate&&(t.commissionRate=e.commissionRate),void 0!==e.minSelfDelegation&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial:function(e){var t=Object.assign({},b);return void 0!==e.description&&null!==e.description?t.description=u.Description.fromPartial(e.description):t.description=void 0,void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",void 0!==e.commissionRate&&null!==e.commissionRate?t.commissionRate=e.commissionRate:t.commissionRate="",void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?t.minSelfDelegation=e.minSelfDelegation:t.minSelfDelegation="",t}};var h={};t.MsgEditValidatorResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},h);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),void 0!==e.amount&&f.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},y);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=f.Coin.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",void 0!==e.amount&&null!==e.amount?t.amount=f.Coin.fromJSON(e.amount):t.amount=void 0,t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.amount&&(t.amount=e.amount?f.Coin.toJSON(e.amount):void 0),t},fromPartial:function(e){var t=Object.assign({},y);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",void 0!==e.amount&&null!==e.amount?t.amount=f.Coin.fromPartial(e.amount):t.amount=void 0,t}};var m={};t.MsgDelegateResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},m);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&t.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&t.uint32(26).string(e.validatorDstAddress),void 0!==e.amount&&f.Coin.encode(e.amount,t.uint32(34).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},v);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;case 4:a.amount=f.Coin.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?t.validatorSrcAddress=String(e.validatorSrcAddress):t.validatorSrcAddress="",void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?t.validatorDstAddress=String(e.validatorDstAddress):t.validatorDstAddress="",void 0!==e.amount&&null!==e.amount?t.amount=f.Coin.fromJSON(e.amount):t.amount=void 0,t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(t.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(t.validatorDstAddress=e.validatorDstAddress),void 0!==e.amount&&(t.amount=e.amount?f.Coin.toJSON(e.amount):void 0),t},fromPartial:function(e){var t=Object.assign({},v);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?t.validatorSrcAddress=e.validatorSrcAddress:t.validatorSrcAddress="",void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?t.validatorDstAddress=e.validatorDstAddress:t.validatorDstAddress="",void 0!==e.amount&&null!==e.amount?t.amount=f.Coin.fromPartial(e.amount):t.amount=void 0,t}};var g={};t.MsgBeginRedelegateResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.completionTime&&d.Timestamp.encode(_(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},g);n.pos>>3===1)a.completionTime=O(d.Timestamp.decode(n,n.uint32()));else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},g);return void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=S(e.completionTime):t.completionTime=void 0,t},toJSON:function(e){var t={};return void 0!==e.completionTime&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial:function(e){var t=Object.assign({},g);return void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=e.completionTime:t.completionTime=void 0,t}};var w={delegatorAddress:"",validatorAddress:""};t.MsgUndelegate={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),void 0!==e.amount&&f.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},w);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=f.Coin.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},w);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",void 0!==e.amount&&null!==e.amount?t.amount=f.Coin.fromJSON(e.amount):t.amount=void 0,t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.amount&&(t.amount=e.amount?f.Coin.toJSON(e.amount):void 0),t},fromPartial:function(e){var t=Object.assign({},w);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",void 0!==e.amount&&null!==e.amount?t.amount=f.Coin.fromPartial(e.amount):t.amount=void 0,t}};var T={};t.MsgUndelegateResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.completionTime&&d.Timestamp.encode(_(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},T);n.pos>>3===1)a.completionTime=O(d.Timestamp.decode(n,n.uint32()));else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},T);return void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=S(e.completionTime):t.completionTime=void 0,t},toJSON:function(e){var t={};return void 0!==e.completionTime&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial:function(e){var t=Object.assign({},T);return void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=e.completionTime:t.completionTime=void 0,t}};var k=function(){function e(t){r(this,e),this.rpc=t,this.CreateValidator=this.CreateValidator.bind(this),this.EditValidator=this.EditValidator.bind(this),this.Delegate=this.Delegate.bind(this),this.BeginRedelegate=this.BeginRedelegate.bind(this),this.Undelegate=this.Undelegate.bind(this)}return a(e,[{key:"CreateValidator",value:function(e){var n=t.MsgCreateValidator.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","CreateValidator",n).then((function(e){return t.MsgCreateValidatorResponse.decode(new s.default.Reader(e))}))}},{key:"EditValidator",value:function(e){var n=t.MsgEditValidator.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","EditValidator",n).then((function(e){return t.MsgEditValidatorResponse.decode(new s.default.Reader(e))}))}},{key:"Delegate",value:function(e){var n=t.MsgDelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Delegate",n).then((function(e){return t.MsgDelegateResponse.decode(new s.default.Reader(e))}))}},{key:"BeginRedelegate",value:function(e){var n=t.MsgBeginRedelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","BeginRedelegate",n).then((function(e){return t.MsgBeginRedelegateResponse.decode(new s.default.Reader(e))}))}},{key:"Undelegate",value:function(e){var n=t.MsgUndelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Undelegate",n).then((function(e){return t.MsgUndelegateResponse.decode(new s.default.Reader(e))}))}}]),e}();function _(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function O(e){var t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function S(e){return e instanceof Date?e:"string"===typeof e?new Date(e):O(d.Timestamp.fromJSON(e))}t.MsgClientImpl=k,s.default.util.Long!==o.default&&(s.default.util.Long=o.default,s.default.configure())},function(e,t,n){"use strict";var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.RedelegationResponse=t.RedelegationEntryResponse=t.DelegationResponse=t.Params=t.Redelegation=t.RedelegationEntry=t.UnbondingDelegationEntry=t.UnbondingDelegation=t.Delegation=t.DVVTriplets=t.DVVTriplet=t.DVPairs=t.DVPair=t.ValAddresses=t.Validator=t.Description=t.Commission=t.CommissionRates=t.HistoricalInfo=t.bondStatusToJSON=t.bondStatusFromJSON=t.BondStatus=t.protobufPackage=void 0;var i,o=a(n(24)),s=a(n(20)),u=n(317),c=n(25),f=n(181),d=n(68),l=n(114);function p(e){switch(e){case 0:case"BOND_STATUS_UNSPECIFIED":return i.BOND_STATUS_UNSPECIFIED;case 1:case"BOND_STATUS_UNBONDED":return i.BOND_STATUS_UNBONDED;case 2:case"BOND_STATUS_UNBONDING":return i.BOND_STATUS_UNBONDING;case 3:case"BOND_STATUS_BONDED":return i.BOND_STATUS_BONDED;default:return i.UNRECOGNIZED}}function b(e){switch(e){case i.BOND_STATUS_UNSPECIFIED:return"BOND_STATUS_UNSPECIFIED";case i.BOND_STATUS_UNBONDED:return"BOND_STATUS_UNBONDED";case i.BOND_STATUS_UNBONDING:return"BOND_STATUS_UNBONDING";case i.BOND_STATUS_BONDED:return"BOND_STATUS_BONDED";default:return"UNKNOWN"}}t.protobufPackage="cosmos.staking.v1beta1",function(e){e[e.BOND_STATUS_UNSPECIFIED=0]="BOND_STATUS_UNSPECIFIED",e[e.BOND_STATUS_UNBONDED=1]="BOND_STATUS_UNBONDED",e[e.BOND_STATUS_UNBONDING=2]="BOND_STATUS_UNBONDING",e[e.BOND_STATUS_BONDED=3]="BOND_STATUS_BONDED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(i=t.BondStatus||(t.BondStatus={})),t.bondStatusFromJSON=p,t.bondStatusToJSON=b;var h={};t.HistoricalInfo={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();void 0!==e.header&&u.Header.encode(e.header,n.uint32(10).fork()).ldelim();var a,i=r(e.valset);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.Validator.encode(o,n.uint32(18).fork()).ldelim()}}catch(c){i.e(c)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},h);for(i.valset=[];r.pos>>3){case 1:i.header=u.Header.decode(r,r.uint32());break;case 2:i.valset.push(t.Validator.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},h);if(n.valset=[],void 0!==e.header&&null!==e.header?n.header=u.Header.fromJSON(e.header):n.header=void 0,void 0!==e.valset&&null!==e.valset){var a,i=r(e.valset);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.valset.push(t.Validator.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.header&&(n.header=e.header?u.Header.toJSON(e.header):void 0),e.valset?n.valset=e.valset.map((function(e){return e?t.Validator.toJSON(e):void 0})):n.valset=[],n},fromPartial:function(e){var n=Object.assign({},h);if(n.valset=[],void 0!==e.header&&null!==e.header?n.header=u.Header.fromPartial(e.header):n.header=void 0,void 0!==e.valset&&null!==e.valset){var a,i=r(e.valset);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.valset.push(t.Validator.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var y={rate:"",maxRate:"",maxChangeRate:""};t.CommissionRates={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.rate&&t.uint32(10).string(e.rate),""!==e.maxRate&&t.uint32(18).string(e.maxRate),""!==e.maxChangeRate&&t.uint32(26).string(e.maxChangeRate),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},y);n.pos>>3){case 1:a.rate=n.string();break;case 2:a.maxRate=n.string();break;case 3:a.maxChangeRate=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);return void 0!==e.rate&&null!==e.rate?t.rate=String(e.rate):t.rate="",void 0!==e.maxRate&&null!==e.maxRate?t.maxRate=String(e.maxRate):t.maxRate="",void 0!==e.maxChangeRate&&null!==e.maxChangeRate?t.maxChangeRate=String(e.maxChangeRate):t.maxChangeRate="",t},toJSON:function(e){var t={};return void 0!==e.rate&&(t.rate=e.rate),void 0!==e.maxRate&&(t.maxRate=e.maxRate),void 0!==e.maxChangeRate&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial:function(e){var t=Object.assign({},y);return void 0!==e.rate&&null!==e.rate?t.rate=e.rate:t.rate="",void 0!==e.maxRate&&null!==e.maxRate?t.maxRate=e.maxRate:t.maxRate="",void 0!==e.maxChangeRate&&null!==e.maxChangeRate?t.maxChangeRate=e.maxChangeRate:t.maxChangeRate="",t}};var m={};t.Commission={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.commissionRates&&t.CommissionRates.encode(e.commissionRates,n.uint32(10).fork()).ldelim(),void 0!==e.updateTime&&l.Timestamp.encode(N(e.updateTime),n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},m);r.pos>>3){case 1:i.commissionRates=t.CommissionRates.decode(r,r.uint32());break;case 2:i.updateTime=D(l.Timestamp.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},m);return void 0!==e.commissionRates&&null!==e.commissionRates?n.commissionRates=t.CommissionRates.fromJSON(e.commissionRates):n.commissionRates=void 0,void 0!==e.updateTime&&null!==e.updateTime?n.updateTime=B(e.updateTime):n.updateTime=void 0,n},toJSON:function(e){var n={};return void 0!==e.commissionRates&&(n.commissionRates=e.commissionRates?t.CommissionRates.toJSON(e.commissionRates):void 0),void 0!==e.updateTime&&(n.updateTime=e.updateTime.toISOString()),n},fromPartial:function(e){var n=Object.assign({},m);return void 0!==e.commissionRates&&null!==e.commissionRates?n.commissionRates=t.CommissionRates.fromPartial(e.commissionRates):n.commissionRates=void 0,void 0!==e.updateTime&&null!==e.updateTime?n.updateTime=e.updateTime:n.updateTime=void 0,n}};var v={moniker:"",identity:"",website:"",securityContact:"",details:""};t.Description={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.moniker&&t.uint32(10).string(e.moniker),""!==e.identity&&t.uint32(18).string(e.identity),""!==e.website&&t.uint32(26).string(e.website),""!==e.securityContact&&t.uint32(34).string(e.securityContact),""!==e.details&&t.uint32(42).string(e.details),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},v);n.pos>>3){case 1:a.moniker=n.string();break;case 2:a.identity=n.string();break;case 3:a.website=n.string();break;case 4:a.securityContact=n.string();break;case 5:a.details=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);return void 0!==e.moniker&&null!==e.moniker?t.moniker=String(e.moniker):t.moniker="",void 0!==e.identity&&null!==e.identity?t.identity=String(e.identity):t.identity="",void 0!==e.website&&null!==e.website?t.website=String(e.website):t.website="",void 0!==e.securityContact&&null!==e.securityContact?t.securityContact=String(e.securityContact):t.securityContact="",void 0!==e.details&&null!==e.details?t.details=String(e.details):t.details="",t},toJSON:function(e){var t={};return void 0!==e.moniker&&(t.moniker=e.moniker),void 0!==e.identity&&(t.identity=e.identity),void 0!==e.website&&(t.website=e.website),void 0!==e.securityContact&&(t.securityContact=e.securityContact),void 0!==e.details&&(t.details=e.details),t},fromPartial:function(e){var t=Object.assign({},v);return void 0!==e.moniker&&null!==e.moniker?t.moniker=e.moniker:t.moniker="",void 0!==e.identity&&null!==e.identity?t.identity=e.identity:t.identity="",void 0!==e.website&&null!==e.website?t.website=e.website:t.website="",void 0!==e.securityContact&&null!==e.securityContact?t.securityContact=e.securityContact:t.securityContact="",void 0!==e.details&&null!==e.details?t.details=e.details:t.details="",t}};var g={operatorAddress:"",jailed:!1,status:0,tokens:"",delegatorShares:"",unbondingHeight:o.default.ZERO,minSelfDelegation:""};t.Validator={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.operatorAddress&&n.uint32(10).string(e.operatorAddress),void 0!==e.consensusPubkey&&c.Any.encode(e.consensusPubkey,n.uint32(18).fork()).ldelim(),!0===e.jailed&&n.uint32(24).bool(e.jailed),0!==e.status&&n.uint32(32).int32(e.status),""!==e.tokens&&n.uint32(42).string(e.tokens),""!==e.delegatorShares&&n.uint32(50).string(e.delegatorShares),void 0!==e.description&&t.Description.encode(e.description,n.uint32(58).fork()).ldelim(),e.unbondingHeight.isZero()||n.uint32(64).int64(e.unbondingHeight),void 0!==e.unbondingTime&&l.Timestamp.encode(N(e.unbondingTime),n.uint32(74).fork()).ldelim(),void 0!==e.commission&&t.Commission.encode(e.commission,n.uint32(82).fork()).ldelim(),""!==e.minSelfDelegation&&n.uint32(90).string(e.minSelfDelegation),n},decode:function(e,n){for(var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},g);r.pos>>3){case 1:i.operatorAddress=r.string();break;case 2:i.consensusPubkey=c.Any.decode(r,r.uint32());break;case 3:i.jailed=r.bool();break;case 4:i.status=r.int32();break;case 5:i.tokens=r.string();break;case 6:i.delegatorShares=r.string();break;case 7:i.description=t.Description.decode(r,r.uint32());break;case 8:i.unbondingHeight=r.int64();break;case 9:i.unbondingTime=D(l.Timestamp.decode(r,r.uint32()));break;case 10:i.commission=t.Commission.decode(r,r.uint32());break;case 11:i.minSelfDelegation=r.string();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},g);return void 0!==e.operatorAddress&&null!==e.operatorAddress?n.operatorAddress=String(e.operatorAddress):n.operatorAddress="",void 0!==e.consensusPubkey&&null!==e.consensusPubkey?n.consensusPubkey=c.Any.fromJSON(e.consensusPubkey):n.consensusPubkey=void 0,void 0!==e.jailed&&null!==e.jailed?n.jailed=Boolean(e.jailed):n.jailed=!1,void 0!==e.status&&null!==e.status?n.status=p(e.status):n.status=0,void 0!==e.tokens&&null!==e.tokens?n.tokens=String(e.tokens):n.tokens="",void 0!==e.delegatorShares&&null!==e.delegatorShares?n.delegatorShares=String(e.delegatorShares):n.delegatorShares="",void 0!==e.description&&null!==e.description?n.description=t.Description.fromJSON(e.description):n.description=void 0,void 0!==e.unbondingHeight&&null!==e.unbondingHeight?n.unbondingHeight=o.default.fromString(e.unbondingHeight):n.unbondingHeight=o.default.ZERO,void 0!==e.unbondingTime&&null!==e.unbondingTime?n.unbondingTime=B(e.unbondingTime):n.unbondingTime=void 0,void 0!==e.commission&&null!==e.commission?n.commission=t.Commission.fromJSON(e.commission):n.commission=void 0,void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?n.minSelfDelegation=String(e.minSelfDelegation):n.minSelfDelegation="",n},toJSON:function(e){var n={};return void 0!==e.operatorAddress&&(n.operatorAddress=e.operatorAddress),void 0!==e.consensusPubkey&&(n.consensusPubkey=e.consensusPubkey?c.Any.toJSON(e.consensusPubkey):void 0),void 0!==e.jailed&&(n.jailed=e.jailed),void 0!==e.status&&(n.status=b(e.status)),void 0!==e.tokens&&(n.tokens=e.tokens),void 0!==e.delegatorShares&&(n.delegatorShares=e.delegatorShares),void 0!==e.description&&(n.description=e.description?t.Description.toJSON(e.description):void 0),void 0!==e.unbondingHeight&&(n.unbondingHeight=(e.unbondingHeight||o.default.ZERO).toString()),void 0!==e.unbondingTime&&(n.unbondingTime=e.unbondingTime.toISOString()),void 0!==e.commission&&(n.commission=e.commission?t.Commission.toJSON(e.commission):void 0),void 0!==e.minSelfDelegation&&(n.minSelfDelegation=e.minSelfDelegation),n},fromPartial:function(e){var n=Object.assign({},g);return void 0!==e.operatorAddress&&null!==e.operatorAddress?n.operatorAddress=e.operatorAddress:n.operatorAddress="",void 0!==e.consensusPubkey&&null!==e.consensusPubkey?n.consensusPubkey=c.Any.fromPartial(e.consensusPubkey):n.consensusPubkey=void 0,void 0!==e.jailed&&null!==e.jailed?n.jailed=e.jailed:n.jailed=!1,void 0!==e.status&&null!==e.status?n.status=e.status:n.status=0,void 0!==e.tokens&&null!==e.tokens?n.tokens=e.tokens:n.tokens="",void 0!==e.delegatorShares&&null!==e.delegatorShares?n.delegatorShares=e.delegatorShares:n.delegatorShares="",void 0!==e.description&&null!==e.description?n.description=t.Description.fromPartial(e.description):n.description=void 0,void 0!==e.unbondingHeight&&null!==e.unbondingHeight?n.unbondingHeight=e.unbondingHeight:n.unbondingHeight=o.default.ZERO,void 0!==e.unbondingTime&&null!==e.unbondingTime?n.unbondingTime=e.unbondingTime:n.unbondingTime=void 0,void 0!==e.commission&&null!==e.commission?n.commission=t.Commission.fromPartial(e.commission):n.commission=void 0,void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?n.minSelfDelegation=e.minSelfDelegation:n.minSelfDelegation="",n}};var w={addresses:""};t.ValAddresses={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create(),a=r(e.addresses);try{for(a.s();!(t=a.n()).done;){var i=t.value;n.uint32(10).string(i)}}catch(o){a.e(o)}finally{a.f()}return n},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,a=Object.assign({},w);for(a.addresses=[];n.pos>>3===1)a.addresses.push(n.string());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},w);if(t.addresses=[],void 0!==e.addresses&&null!==e.addresses){var n,a=r(e.addresses);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.addresses.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.addresses?t.addresses=e.addresses.map((function(e){return e})):t.addresses=[],t},fromPartial:function(e){var t=Object.assign({},w);if(t.addresses=[],void 0!==e.addresses&&null!==e.addresses){var n,a=r(e.addresses);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.addresses.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var T={delegatorAddress:"",validatorAddress:""};t.DVPair={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},T);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},T);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial:function(e){var t=Object.assign({},T);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",t}};var k={};t.DVPairs={encode:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create(),i=r(e.pairs);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.DVPair.encode(o,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return a},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},k);for(i.pairs=[];r.pos>>3===1)i.pairs.push(t.DVPair.decode(r,r.uint32()));else r.skipType(7&o)}return i},fromJSON:function(e){var n=Object.assign({},k);if(n.pairs=[],void 0!==e.pairs&&null!==e.pairs){var a,i=r(e.pairs);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.pairs.push(t.DVPair.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return e.pairs?n.pairs=e.pairs.map((function(e){return e?t.DVPair.toJSON(e):void 0})):n.pairs=[],n},fromPartial:function(e){var n=Object.assign({},k);if(n.pairs=[],void 0!==e.pairs&&null!==e.pairs){var a,i=r(e.pairs);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.pairs.push(t.DVPair.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var _={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.DVVTriplet={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&t.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&t.uint32(26).string(e.validatorDstAddress),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},_);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},_);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?t.validatorSrcAddress=String(e.validatorSrcAddress):t.validatorSrcAddress="",void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?t.validatorDstAddress=String(e.validatorDstAddress):t.validatorDstAddress="",t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(t.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial:function(e){var t=Object.assign({},_);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?t.validatorSrcAddress=e.validatorSrcAddress:t.validatorSrcAddress="",void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?t.validatorDstAddress=e.validatorDstAddress:t.validatorDstAddress="",t}};var O={};t.DVVTriplets={encode:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create(),i=r(e.triplets);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.DVVTriplet.encode(o,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return a},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},O);for(i.triplets=[];r.pos>>3===1)i.triplets.push(t.DVVTriplet.decode(r,r.uint32()));else r.skipType(7&o)}return i},fromJSON:function(e){var n=Object.assign({},O);if(n.triplets=[],void 0!==e.triplets&&null!==e.triplets){var a,i=r(e.triplets);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.triplets.push(t.DVVTriplet.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return e.triplets?n.triplets=e.triplets.map((function(e){return e?t.DVVTriplet.toJSON(e):void 0})):n.triplets=[],n},fromPartial:function(e){var n=Object.assign({},O);if(n.triplets=[],void 0!==e.triplets&&null!==e.triplets){var a,i=r(e.triplets);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.triplets.push(t.DVVTriplet.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var S={delegatorAddress:"",validatorAddress:"",shares:""};t.Delegation={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),""!==e.shares&&t.uint32(26).string(e.shares),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},S);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.shares=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},S);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",void 0!==e.shares&&null!==e.shares?t.shares=String(e.shares):t.shares="",t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.shares&&(t.shares=e.shares),t},fromPartial:function(e){var t=Object.assign({},S);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",void 0!==e.shares&&null!==e.shares?t.shares=e.shares:t.shares="",t}};var x={delegatorAddress:"",validatorAddress:""};t.UnbondingDelegation={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();""!==e.delegatorAddress&&n.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&n.uint32(18).string(e.validatorAddress);var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.UnbondingDelegationEntry.encode(o,n.uint32(26).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},x);for(i.entries=[];r.pos>>3){case 1:i.delegatorAddress=r.string();break;case 2:i.validatorAddress=r.string();break;case 3:i.entries.push(t.UnbondingDelegationEntry.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},x);if(n.entries=[],void 0!==e.delegatorAddress&&null!==e.delegatorAddress?n.delegatorAddress=String(e.delegatorAddress):n.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?n.validatorAddress=String(e.validatorAddress):n.validatorAddress="",void 0!==e.entries&&null!==e.entries){var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.entries.push(t.UnbondingDelegationEntry.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.delegatorAddress&&(n.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(n.validatorAddress=e.validatorAddress),e.entries?n.entries=e.entries.map((function(e){return e?t.UnbondingDelegationEntry.toJSON(e):void 0})):n.entries=[],n},fromPartial:function(e){var n=Object.assign({},x);if(n.entries=[],void 0!==e.delegatorAddress&&null!==e.delegatorAddress?n.delegatorAddress=e.delegatorAddress:n.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?n.validatorAddress=e.validatorAddress:n.validatorAddress="",void 0!==e.entries&&null!==e.entries){var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.entries.push(t.UnbondingDelegationEntry.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var A={creationHeight:o.default.ZERO,initialBalance:"",balance:""};t.UnbondingDelegationEntry={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return e.creationHeight.isZero()||t.uint32(8).int64(e.creationHeight),void 0!==e.completionTime&&l.Timestamp.encode(N(e.completionTime),t.uint32(18).fork()).ldelim(),""!==e.initialBalance&&t.uint32(26).string(e.initialBalance),""!==e.balance&&t.uint32(34).string(e.balance),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},A);n.pos>>3){case 1:a.creationHeight=n.int64();break;case 2:a.completionTime=D(l.Timestamp.decode(n,n.uint32()));break;case 3:a.initialBalance=n.string();break;case 4:a.balance=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},A);return void 0!==e.creationHeight&&null!==e.creationHeight?t.creationHeight=o.default.fromString(e.creationHeight):t.creationHeight=o.default.ZERO,void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=B(e.completionTime):t.completionTime=void 0,void 0!==e.initialBalance&&null!==e.initialBalance?t.initialBalance=String(e.initialBalance):t.initialBalance="",void 0!==e.balance&&null!==e.balance?t.balance=String(e.balance):t.balance="",t},toJSON:function(e){var t={};return void 0!==e.creationHeight&&(t.creationHeight=(e.creationHeight||o.default.ZERO).toString()),void 0!==e.completionTime&&(t.completionTime=e.completionTime.toISOString()),void 0!==e.initialBalance&&(t.initialBalance=e.initialBalance),void 0!==e.balance&&(t.balance=e.balance),t},fromPartial:function(e){var t=Object.assign({},A);return void 0!==e.creationHeight&&null!==e.creationHeight?t.creationHeight=e.creationHeight:t.creationHeight=o.default.ZERO,void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=e.completionTime:t.completionTime=void 0,void 0!==e.initialBalance&&null!==e.initialBalance?t.initialBalance=e.initialBalance:t.initialBalance="",void 0!==e.balance&&null!==e.balance?t.balance=e.balance:t.balance="",t}};var M={creationHeight:o.default.ZERO,initialBalance:"",sharesDst:""};t.RedelegationEntry={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return e.creationHeight.isZero()||t.uint32(8).int64(e.creationHeight),void 0!==e.completionTime&&l.Timestamp.encode(N(e.completionTime),t.uint32(18).fork()).ldelim(),""!==e.initialBalance&&t.uint32(26).string(e.initialBalance),""!==e.sharesDst&&t.uint32(34).string(e.sharesDst),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},M);n.pos>>3){case 1:a.creationHeight=n.int64();break;case 2:a.completionTime=D(l.Timestamp.decode(n,n.uint32()));break;case 3:a.initialBalance=n.string();break;case 4:a.sharesDst=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},M);return void 0!==e.creationHeight&&null!==e.creationHeight?t.creationHeight=o.default.fromString(e.creationHeight):t.creationHeight=o.default.ZERO,void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=B(e.completionTime):t.completionTime=void 0,void 0!==e.initialBalance&&null!==e.initialBalance?t.initialBalance=String(e.initialBalance):t.initialBalance="",void 0!==e.sharesDst&&null!==e.sharesDst?t.sharesDst=String(e.sharesDst):t.sharesDst="",t},toJSON:function(e){var t={};return void 0!==e.creationHeight&&(t.creationHeight=(e.creationHeight||o.default.ZERO).toString()),void 0!==e.completionTime&&(t.completionTime=e.completionTime.toISOString()),void 0!==e.initialBalance&&(t.initialBalance=e.initialBalance),void 0!==e.sharesDst&&(t.sharesDst=e.sharesDst),t},fromPartial:function(e){var t=Object.assign({},M);return void 0!==e.creationHeight&&null!==e.creationHeight?t.creationHeight=e.creationHeight:t.creationHeight=o.default.ZERO,void 0!==e.completionTime&&null!==e.completionTime?t.completionTime=e.completionTime:t.completionTime=void 0,void 0!==e.initialBalance&&null!==e.initialBalance?t.initialBalance=e.initialBalance:t.initialBalance="",void 0!==e.sharesDst&&null!==e.sharesDst?t.sharesDst=e.sharesDst:t.sharesDst="",t}};var E={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.Redelegation={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();""!==e.delegatorAddress&&n.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&n.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&n.uint32(26).string(e.validatorDstAddress);var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.RedelegationEntry.encode(o,n.uint32(34).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},E);for(i.entries=[];r.pos>>3){case 1:i.delegatorAddress=r.string();break;case 2:i.validatorSrcAddress=r.string();break;case 3:i.validatorDstAddress=r.string();break;case 4:i.entries.push(t.RedelegationEntry.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},E);if(n.entries=[],void 0!==e.delegatorAddress&&null!==e.delegatorAddress?n.delegatorAddress=String(e.delegatorAddress):n.delegatorAddress="",void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?n.validatorSrcAddress=String(e.validatorSrcAddress):n.validatorSrcAddress="",void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?n.validatorDstAddress=String(e.validatorDstAddress):n.validatorDstAddress="",void 0!==e.entries&&null!==e.entries){var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.entries.push(t.RedelegationEntry.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.delegatorAddress&&(n.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(n.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(n.validatorDstAddress=e.validatorDstAddress),e.entries?n.entries=e.entries.map((function(e){return e?t.RedelegationEntry.toJSON(e):void 0})):n.entries=[],n},fromPartial:function(e){var n=Object.assign({},E);if(n.entries=[],void 0!==e.delegatorAddress&&null!==e.delegatorAddress?n.delegatorAddress=e.delegatorAddress:n.delegatorAddress="",void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?n.validatorSrcAddress=e.validatorSrcAddress:n.validatorSrcAddress="",void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?n.validatorDstAddress=e.validatorDstAddress:n.validatorDstAddress="",void 0!==e.entries&&null!==e.entries){var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.entries.push(t.RedelegationEntry.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var P={maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:""};t.Params={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.unbondingTime&&f.Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),0!==e.maxValidators&&t.uint32(16).uint32(e.maxValidators),0!==e.maxEntries&&t.uint32(24).uint32(e.maxEntries),0!==e.historicalEntries&&t.uint32(32).uint32(e.historicalEntries),""!==e.bondDenom&&t.uint32(42).string(e.bondDenom),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},P);n.pos>>3){case 1:a.unbondingTime=f.Duration.decode(n,n.uint32());break;case 2:a.maxValidators=n.uint32();break;case 3:a.maxEntries=n.uint32();break;case 4:a.historicalEntries=n.uint32();break;case 5:a.bondDenom=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},P);return void 0!==e.unbondingTime&&null!==e.unbondingTime?t.unbondingTime=f.Duration.fromJSON(e.unbondingTime):t.unbondingTime=void 0,void 0!==e.maxValidators&&null!==e.maxValidators?t.maxValidators=Number(e.maxValidators):t.maxValidators=0,void 0!==e.maxEntries&&null!==e.maxEntries?t.maxEntries=Number(e.maxEntries):t.maxEntries=0,void 0!==e.historicalEntries&&null!==e.historicalEntries?t.historicalEntries=Number(e.historicalEntries):t.historicalEntries=0,void 0!==e.bondDenom&&null!==e.bondDenom?t.bondDenom=String(e.bondDenom):t.bondDenom="",t},toJSON:function(e){var t={};return void 0!==e.unbondingTime&&(t.unbondingTime=e.unbondingTime?f.Duration.toJSON(e.unbondingTime):void 0),void 0!==e.maxValidators&&(t.maxValidators=e.maxValidators),void 0!==e.maxEntries&&(t.maxEntries=e.maxEntries),void 0!==e.historicalEntries&&(t.historicalEntries=e.historicalEntries),void 0!==e.bondDenom&&(t.bondDenom=e.bondDenom),t},fromPartial:function(e){var t=Object.assign({},P);return void 0!==e.unbondingTime&&null!==e.unbondingTime?t.unbondingTime=f.Duration.fromPartial(e.unbondingTime):t.unbondingTime=void 0,void 0!==e.maxValidators&&null!==e.maxValidators?t.maxValidators=e.maxValidators:t.maxValidators=0,void 0!==e.maxEntries&&null!==e.maxEntries?t.maxEntries=e.maxEntries:t.maxEntries=0,void 0!==e.historicalEntries&&null!==e.historicalEntries?t.historicalEntries=e.historicalEntries:t.historicalEntries=0,void 0!==e.bondDenom&&null!==e.bondDenom?t.bondDenom=e.bondDenom:t.bondDenom="",t}};var j={};t.DelegationResponse={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.delegation&&t.Delegation.encode(e.delegation,n.uint32(10).fork()).ldelim(),void 0!==e.balance&&d.Coin.encode(e.balance,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},j);r.pos>>3){case 1:i.delegation=t.Delegation.decode(r,r.uint32());break;case 2:i.balance=d.Coin.decode(r,r.uint32());break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},j);return void 0!==e.delegation&&null!==e.delegation?n.delegation=t.Delegation.fromJSON(e.delegation):n.delegation=void 0,void 0!==e.balance&&null!==e.balance?n.balance=d.Coin.fromJSON(e.balance):n.balance=void 0,n},toJSON:function(e){var n={};return void 0!==e.delegation&&(n.delegation=e.delegation?t.Delegation.toJSON(e.delegation):void 0),void 0!==e.balance&&(n.balance=e.balance?d.Coin.toJSON(e.balance):void 0),n},fromPartial:function(e){var n=Object.assign({},j);return void 0!==e.delegation&&null!==e.delegation?n.delegation=t.Delegation.fromPartial(e.delegation):n.delegation=void 0,void 0!==e.balance&&null!==e.balance?n.balance=d.Coin.fromPartial(e.balance):n.balance=void 0,n}};var I={balance:""};t.RedelegationEntryResponse={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.redelegationEntry&&t.RedelegationEntry.encode(e.redelegationEntry,n.uint32(10).fork()).ldelim(),""!==e.balance&&n.uint32(34).string(e.balance),n},decode:function(e,n){for(var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},I);r.pos>>3){case 1:i.redelegationEntry=t.RedelegationEntry.decode(r,r.uint32());break;case 4:i.balance=r.string();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},I);return void 0!==e.redelegationEntry&&null!==e.redelegationEntry?n.redelegationEntry=t.RedelegationEntry.fromJSON(e.redelegationEntry):n.redelegationEntry=void 0,void 0!==e.balance&&null!==e.balance?n.balance=String(e.balance):n.balance="",n},toJSON:function(e){var n={};return void 0!==e.redelegationEntry&&(n.redelegationEntry=e.redelegationEntry?t.RedelegationEntry.toJSON(e.redelegationEntry):void 0),void 0!==e.balance&&(n.balance=e.balance),n},fromPartial:function(e){var n=Object.assign({},I);return void 0!==e.redelegationEntry&&null!==e.redelegationEntry?n.redelegationEntry=t.RedelegationEntry.fromPartial(e.redelegationEntry):n.redelegationEntry=void 0,void 0!==e.balance&&null!==e.balance?n.balance=e.balance:n.balance="",n}};var C={};t.RedelegationResponse={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();void 0!==e.redelegation&&t.Redelegation.encode(e.redelegation,n.uint32(10).fork()).ldelim();var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.RedelegationEntryResponse.encode(o,n.uint32(18).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},C);for(i.entries=[];r.pos>>3){case 1:i.redelegation=t.Redelegation.decode(r,r.uint32());break;case 2:i.entries.push(t.RedelegationEntryResponse.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},C);if(n.entries=[],void 0!==e.redelegation&&null!==e.redelegation?n.redelegation=t.Redelegation.fromJSON(e.redelegation):n.redelegation=void 0,void 0!==e.entries&&null!==e.entries){var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.entries.push(t.RedelegationEntryResponse.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.redelegation&&(n.redelegation=e.redelegation?t.Redelegation.toJSON(e.redelegation):void 0),e.entries?n.entries=e.entries.map((function(e){return e?t.RedelegationEntryResponse.toJSON(e):void 0})):n.entries=[],n},fromPartial:function(e){var n=Object.assign({},C);if(n.entries=[],void 0!==e.redelegation&&null!==e.redelegation?n.redelegation=t.Redelegation.fromPartial(e.redelegation):n.redelegation=void 0,void 0!==e.entries&&null!==e.entries){var a,i=r(e.entries);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.entries.push(t.RedelegationEntryResponse.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var R={notBondedTokens:"",bondedTokens:""};function N(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function D(e){var t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function B(e){return e instanceof Date?e:"string"===typeof e?new Date(e):D(l.Timestamp.fromJSON(e))}t.Pool={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.notBondedTokens&&t.uint32(10).string(e.notBondedTokens),""!==e.bondedTokens&&t.uint32(18).string(e.bondedTokens),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},R);n.pos>>3){case 1:a.notBondedTokens=n.string();break;case 2:a.bondedTokens=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},R);return void 0!==e.notBondedTokens&&null!==e.notBondedTokens?t.notBondedTokens=String(e.notBondedTokens):t.notBondedTokens="",void 0!==e.bondedTokens&&null!==e.bondedTokens?t.bondedTokens=String(e.bondedTokens):t.bondedTokens="",t},toJSON:function(e){var t={};return void 0!==e.notBondedTokens&&(t.notBondedTokens=e.notBondedTokens),void 0!==e.bondedTokens&&(t.bondedTokens=e.bondedTokens),t},fromPartial:function(e){var t=Object.assign({},R);return void 0!==e.notBondedTokens&&null!==e.notBondedTokens?t.notBondedTokens=e.notBondedTokens:t.notBondedTokens="",void 0!==e.bondedTokens&&null!==e.bondedTokens?t.bondedTokens=e.bondedTokens:t.bondedTokens="",t}},s.default.util.Long!==o.default&&(s.default.util.Long=o.default,s.default.configure())},function(e,t,n){"use strict";(function(e){var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SignatureDescriptor_Data_Multi=t.SignatureDescriptor_Data_Single=t.SignatureDescriptor_Data=t.SignatureDescriptor=t.SignatureDescriptors=t.signModeToJSON=t.signModeFromJSON=t.SignMode=t.protobufPackage=void 0;var i,o=a(n(24)),s=a(n(20)),u=n(25),c=n(192);function f(e){switch(e){case 0:case"SIGN_MODE_UNSPECIFIED":return i.SIGN_MODE_UNSPECIFIED;case 1:case"SIGN_MODE_DIRECT":return i.SIGN_MODE_DIRECT;case 2:case"SIGN_MODE_TEXTUAL":return i.SIGN_MODE_TEXTUAL;case 127:case"SIGN_MODE_LEGACY_AMINO_JSON":return i.SIGN_MODE_LEGACY_AMINO_JSON;default:return i.UNRECOGNIZED}}function d(e){switch(e){case i.SIGN_MODE_UNSPECIFIED:return"SIGN_MODE_UNSPECIFIED";case i.SIGN_MODE_DIRECT:return"SIGN_MODE_DIRECT";case i.SIGN_MODE_TEXTUAL:return"SIGN_MODE_TEXTUAL";case i.SIGN_MODE_LEGACY_AMINO_JSON:return"SIGN_MODE_LEGACY_AMINO_JSON";default:return"UNKNOWN"}}t.protobufPackage="cosmos.tx.signing.v1beta1",function(e){e[e.SIGN_MODE_UNSPECIFIED=0]="SIGN_MODE_UNSPECIFIED",e[e.SIGN_MODE_DIRECT=1]="SIGN_MODE_DIRECT",e[e.SIGN_MODE_TEXTUAL=2]="SIGN_MODE_TEXTUAL",e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]="SIGN_MODE_LEGACY_AMINO_JSON",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(i=t.SignMode||(t.SignMode={})),t.signModeFromJSON=f,t.signModeToJSON=d;var l={};t.SignatureDescriptors={encode:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create(),i=r(e.signatures);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.SignatureDescriptor.encode(o,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return a},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},l);for(i.signatures=[];r.pos>>3===1)i.signatures.push(t.SignatureDescriptor.decode(r,r.uint32()));else r.skipType(7&o)}return i},fromJSON:function(e){var n=Object.assign({},l);if(n.signatures=[],void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(t.SignatureDescriptor.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return e.signatures?n.signatures=e.signatures.map((function(e){return e?t.SignatureDescriptor.toJSON(e):void 0})):n.signatures=[],n},fromPartial:function(e){var n=Object.assign({},l);if(n.signatures=[],void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(t.SignatureDescriptor.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var p={sequence:o.default.UZERO};t.SignatureDescriptor={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.publicKey&&u.Any.encode(e.publicKey,n.uint32(10).fork()).ldelim(),void 0!==e.data&&t.SignatureDescriptor_Data.encode(e.data,n.uint32(18).fork()).ldelim(),e.sequence.isZero()||n.uint32(24).uint64(e.sequence),n},decode:function(e,n){for(var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},p);r.pos>>3){case 1:i.publicKey=u.Any.decode(r,r.uint32());break;case 2:i.data=t.SignatureDescriptor_Data.decode(r,r.uint32());break;case 3:i.sequence=r.uint64();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},p);return void 0!==e.publicKey&&null!==e.publicKey?n.publicKey=u.Any.fromJSON(e.publicKey):n.publicKey=void 0,void 0!==e.data&&null!==e.data?n.data=t.SignatureDescriptor_Data.fromJSON(e.data):n.data=void 0,void 0!==e.sequence&&null!==e.sequence?n.sequence=o.default.fromString(e.sequence):n.sequence=o.default.UZERO,n},toJSON:function(e){var n={};return void 0!==e.publicKey&&(n.publicKey=e.publicKey?u.Any.toJSON(e.publicKey):void 0),void 0!==e.data&&(n.data=e.data?t.SignatureDescriptor_Data.toJSON(e.data):void 0),void 0!==e.sequence&&(n.sequence=(e.sequence||o.default.UZERO).toString()),n},fromPartial:function(e){var n=Object.assign({},p);return void 0!==e.publicKey&&null!==e.publicKey?n.publicKey=u.Any.fromPartial(e.publicKey):n.publicKey=void 0,void 0!==e.data&&null!==e.data?n.data=t.SignatureDescriptor_Data.fromPartial(e.data):n.data=void 0,void 0!==e.sequence&&null!==e.sequence?n.sequence=e.sequence:n.sequence=o.default.UZERO,n}};var b={};t.SignatureDescriptor_Data={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.single&&t.SignatureDescriptor_Data_Single.encode(e.single,n.uint32(10).fork()).ldelim(),void 0!==e.multi&&t.SignatureDescriptor_Data_Multi.encode(e.multi,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},b);r.pos>>3){case 1:i.single=t.SignatureDescriptor_Data_Single.decode(r,r.uint32());break;case 2:i.multi=t.SignatureDescriptor_Data_Multi.decode(r,r.uint32());break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},b);return void 0!==e.single&&null!==e.single?n.single=t.SignatureDescriptor_Data_Single.fromJSON(e.single):n.single=void 0,void 0!==e.multi&&null!==e.multi?n.multi=t.SignatureDescriptor_Data_Multi.fromJSON(e.multi):n.multi=void 0,n},toJSON:function(e){var n={};return void 0!==e.single&&(n.single=e.single?t.SignatureDescriptor_Data_Single.toJSON(e.single):void 0),void 0!==e.multi&&(n.multi=e.multi?t.SignatureDescriptor_Data_Multi.toJSON(e.multi):void 0),n},fromPartial:function(e){var n=Object.assign({},b);return void 0!==e.single&&null!==e.single?n.single=t.SignatureDescriptor_Data_Single.fromPartial(e.single):n.single=void 0,void 0!==e.multi&&null!==e.multi?n.multi=t.SignatureDescriptor_Data_Multi.fromPartial(e.multi):n.multi=void 0,n}};var h={mode:0};t.SignatureDescriptor_Data_Single={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return 0!==e.mode&&t.uint32(8).int32(e.mode),0!==e.signature.length&&t.uint32(18).bytes(e.signature),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,a=Object.assign({},h);for(a.signature=new Uint8Array;n.pos>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},h);return t.signature=new Uint8Array,void 0!==e.mode&&null!==e.mode?t.mode=f(e.mode):t.mode=0,void 0!==e.signature&&null!==e.signature&&(t.signature=function(e){for(var t=v(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();void 0!==e.bitarray&&c.CompactBitArray.encode(e.bitarray,n.uint32(10).fork()).ldelim();var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.SignatureDescriptor_Data.encode(o,n.uint32(18).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},y);for(i.signatures=[];r.pos>>3){case 1:i.bitarray=c.CompactBitArray.decode(r,r.uint32());break;case 2:i.signatures.push(t.SignatureDescriptor_Data.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},y);if(n.signatures=[],void 0!==e.bitarray&&null!==e.bitarray?n.bitarray=c.CompactBitArray.fromJSON(e.bitarray):n.bitarray=void 0,void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(t.SignatureDescriptor_Data.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.bitarray&&(n.bitarray=e.bitarray?c.CompactBitArray.toJSON(e.bitarray):void 0),e.signatures?n.signatures=e.signatures.map((function(e){return e?t.SignatureDescriptor_Data.toJSON(e):void 0})):n.signatures=[],n},fromPartial:function(e){var n=Object.assign({},y);if(n.signatures=[],void 0!==e.bitarray&&null!==e.bitarray?n.bitarray=c.CompactBitArray.fromPartial(e.bitarray):n.bitarray=void 0,void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(t.SignatureDescriptor_Data.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var m=function(){if("undefined"!==typeof m)return m;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),v=m.atob||function(e){return m.Buffer.from(e,"base64").toString("binary")};var g=m.btoa||function(e){return m.Buffer.from(e,"binary").toString("base64")};s.default.util.Long!==o.default&&(s.default.util.Long=o.default,s.default.configure())}).call(this,n(35))},function(e,t,n){"use strict";var r=n(593).Buffer,a=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(r.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=d,t=3;break;default:return this.write=l,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function f(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function l(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return a>0&&(e.lastNeed=a-1),a;if(--r=0)return a>0&&(e.lastNeed=a-2),a;if(--r=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"===typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"===typeof e},t.isString=function(e){return"string"===typeof e},t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"===typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"===typeof e},t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=n(21).Buffer.isBuffer},function(e,t,n){"use strict";n.r(t),n.d(t,"Provider",(function(){return r.b})),n.d(t,"BaseProvider",(function(){return se})),n.d(t,"Resolver",(function(){return ae})),n.d(t,"UrlJsonRpcProvider",(function(){return Ce})),n.d(t,"FallbackProvider",(function(){return dt})),n.d(t,"AlchemyProvider",(function(){return Be})),n.d(t,"AlchemyWebSocketProvider",(function(){return De})),n.d(t,"CloudflareProvider",(function(){return ze})),n.d(t,"EtherscanProvider",(function(){return Ze})),n.d(t,"InfuraProvider",(function(){return yt})),n.d(t,"InfuraWebSocketProvider",(function(){return ht})),n.d(t,"JsonRpcProvider",(function(){return _e})),n.d(t,"JsonRpcBatchProvider",(function(){return mt})),n.d(t,"NodesmithProvider",(function(){return gt})),n.d(t,"PocketProvider",(function(){return kt})),n.d(t,"StaticJsonRpcProvider",(function(){return Ie})),n.d(t,"Web3Provider",(function(){return xt})),n.d(t,"WebSocketProvider",(function(){return Ee})),n.d(t,"IpcProvider",(function(){return lt})),n.d(t,"JsonRpcSigner",(function(){return we})),n.d(t,"getDefaultProvider",(function(){return Mt})),n.d(t,"getNetwork",(function(){return l})),n.d(t,"isCommunityResource",(function(){return U})),n.d(t,"isCommunityResourcable",(function(){return B})),n.d(t,"showThrottleMessage",(function(){return z})),n.d(t,"Formatter",(function(){return D}));var r=n(95),a=n(7),i=new a.Logger("networks/5.5.2");function o(e){var t=function(t,n){null==n&&(n={});var r=[];if(t.InfuraProvider)try{r.push(new t.InfuraProvider(e,n.infura))}catch(o){}if(t.EtherscanProvider)try{r.push(new t.EtherscanProvider(e,n.etherscan))}catch(o){}if(t.AlchemyProvider)try{r.push(new t.AlchemyProvider(e,n.alchemy))}catch(o){}if(t.PocketProvider){try{var a=new t.PocketProvider(e);a.network&&-1===["goerli","ropsten","rinkeby"].indexOf(a.network.name)&&r.push(a)}catch(o){}}if(t.CloudflareProvider)try{r.push(new t.CloudflareProvider(e))}catch(o){}if(0===r.length)return null;if(t.FallbackProvider){var i=1;return null!=n.quorum?i=n.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(r,i)}return r[0]};return t.renetwork=function(e){return o(e)},t}function s(e,t){var n=function(n,r){return n.JsonRpcProvider?new n.JsonRpcProvider(e,t):null};return n.renetwork=function(t){return s(e,t)},n}var u={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:o("homestead")},c={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:o("ropsten")},f={chainId:63,name:"classicMordor",_defaultProvider:s("https://www.ethercluster.com/mordor","classicMordor")},d={unspecified:{chainId:0,name:"unspecified"},homestead:u,mainnet:u,morden:{chainId:2,name:"morden"},ropsten:c,testnet:c,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:o("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:o("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:s("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:f,classicTestnet:f,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:s("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic"},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism"},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function l(e){if(null==e)return null;if("number"===typeof e){for(var t in d){var n=d[t];if(n.chainId===e)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"===typeof e){var r=d[e];return null==r?null:{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress,_defaultProvider:r._defaultProvider||null}}var a=d[e.name];if(!a)return"number"!==typeof e.chainId&&i.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==a.chainId&&i.throwArgumentError("network chainId mismatch","network",e);var o,s=e._defaultProvider||null;return null==s&&a._defaultProvider&&(s=(o=a._defaultProvider)&&"function"===typeof o.renetwork?a._defaultProvider.renetwork(e):a._defaultProvider),{name:e.name,chainId:a.chainId,ensAddress:e.ensAddress||a.ensAddress||null,_defaultProvider:s}}var p=n(27),b=n(15),h=n(16),y=n(9),m=n(8),v=n(1),g=n.n(v),w=n(111),T=n(44),k=n(3),_=n(256),O=n(229),S=n(5),x=n(138),A=n(55),M=n(64),E=n(257),P=n.n(E),j="providers/5.5.2",I=n(31),C=n(275),R=n(48),N=new a.Logger(j),D=function(){function e(){Object(y.a)(this,e),N.checkNew(this instanceof e?this.constructor:void 0,e),this.formats=this.getDefaultFormats()}return Object(m.a)(e,[{key:"getDefaultFormats",value:function(){var t=this,n={},r=this.address.bind(this),a=this.bigNumber.bind(this),i=this.blockTag.bind(this),o=this.data.bind(this),s=this.hash.bind(this),u=this.hex.bind(this),c=this.number.bind(this),f=this.type.bind(this);return n.transaction={hash:s,type:f,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(c,null),transactionIndex:e.allowNull(c,null),confirmations:e.allowNull(c,null),from:r,gasPrice:e.allowNull(a),maxPriorityFeePerGas:e.allowNull(a),maxFeePerGas:e.allowNull(a),gasLimit:a,to:e.allowNull(r,null),value:a,nonce:c,data:o,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(c),creates:e.allowNull(r,null),raw:e.allowNull(o)},n.transactionRequest={from:e.allowNull(r),nonce:e.allowNull(c),gasLimit:e.allowNull(a),gasPrice:e.allowNull(a),maxPriorityFeePerGas:e.allowNull(a),maxFeePerGas:e.allowNull(a),to:e.allowNull(r),value:e.allowNull(a),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(c),accessList:e.allowNull(this.accessList.bind(this),null)},n.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:r,topics:e.arrayOf(s),data:o,logIndex:c,blockHash:s},n.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(r,null),transactionIndex:c,root:e.allowNull(u),gasUsed:a,logsBloom:e.allowNull(o),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:e.allowNull(c,null),cumulativeGasUsed:a,effectiveGasPrice:e.allowNull(a),status:e.allowNull(c),type:f},n.block={hash:s,parentHash:s,number:c,timestamp:c,nonce:e.allowNull(u),difficulty:this.difficulty.bind(this),gasLimit:a,gasUsed:a,miner:r,extraData:o,transactions:e.allowNull(e.arrayOf(s)),baseFeePerGas:e.allowNull(a)},n.blockWithTransactions=Object(S.shallowCopy)(n.block),n.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),n.filter={fromBlock:e.allowNull(i,void 0),toBlock:e.allowNull(i,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(r,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},n.filterLog={blockNumber:e.allowNull(c),blockHash:e.allowNull(s),transactionIndex:c,removed:e.allowNull(this.boolean.bind(this)),address:r,data:e.allowFalsish(o,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:c},n}},{key:"accessList",value:function(e){return Object(R.accessListify)(e||[])}},{key:"number",value:function(e){return"0x"===e?0:T.a.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:T.a.from(e).toNumber()}},{key:"bigNumber",value:function(e){return T.a.from(e)}},{key:"boolean",value:function(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}},{key:"hex",value:function(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Object(k.isHexString)(e))?e.toLowerCase():N.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var n=this.hex(e,t);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}},{key:"address",value:function(e){return Object(I.getAddress)(e)}},{key:"callAddress",value:function(e){if(!Object(k.isHexString)(e,32))return null;var t=Object(I.getAddress)(Object(k.hexDataSlice)(e,12));return t===C.a?null:t}},{key:"contractAddress",value:function(e){return Object(I.getContractAddress)(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";if("latest"===e||"pending"===e)return e;if("number"===typeof e||Object(k.isHexString)(e))return Object(k.hexValue)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var n=this.hex(e,t);return 32!==Object(k.hexDataLength)(n)?N.throwArgumentError("invalid hash","value",e):n}},{key:"difficulty",value:function(e){if(null==e)return null;var t=T.a.from(e);try{return t.toNumber()}catch(n){}return null}},{key:"uint256",value:function(e){if(!Object(k.isHexString)(e))throw new Error("invalid uint256");return Object(k.hexZeroPad)(e,32)}},{key:"_block",value:function(t,n){null!=t.author&&null==t.miner&&(t.miner=t.author);var r=null!=t._difficulty?t._difficulty:t.difficulty,a=e.check(n,t);return a._difficulty=null==r?null:T.a.from(r),a}},{key:"block",value:function(e){return this._block(e,this.formats.block)}},{key:"blockWithTransactions",value:function(e){return this._block(e,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(t){return e.check(this.formats.transactionRequest,t)}},{key:"transactionResponse",value:function(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&T.a.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);var n=e.check(this.formats.transaction,t);if(null!=t.chainId){var r=t.chainId;Object(k.isHexString)(r)&&(r=T.a.from(r).toNumber()),n.chainId=r}else{var a=t.networkId;null==a&&null==n.v&&(a=t.chainId),Object(k.isHexString)(a)&&(a=T.a.from(a).toNumber()),"number"!==typeof a&&null!=n.v&&((a=(n.v-35)/2)<0&&(a=0),a=parseInt(a)),"number"!==typeof a&&(a=0),n.chainId=a}return n.blockHash&&"x"===n.blockHash.replace(/0/g,"")&&(n.blockHash=null),n}},{key:"transaction",value:function(e){return Object(R.parse)(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var n=e.check(this.formats.receipt,t);if(null!=n.root)if(n.root.length<=4){var r=T.a.from(n.root).toNumber();0===r||1===r?(null!=n.status&&n.status!==r&&N.throwArgumentError("alt-root-status/status mismatch","value",{root:n.root,status:n.status}),n.status=r,delete n.root):N.throwArgumentError("invalid alt-root-status","value.root",n.root)}else 66!==n.root.length&&N.throwArgumentError("invalid root hash","value.root",n.root);return null!=n.status&&(n.byzantium=!0),n}},{key:"topics",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.topics(e)})):null!=e?this.hash(e,!0):null}},{key:"filter",value:function(t){return e.check(this.formats.filter,t)}},{key:"filterLog",value:function(t){return e.check(this.formats.filterLog,t)}}],[{key:"check",value:function(e,t){var n={};for(var r in e)try{var a=e[r](t[r]);void 0!==a&&(n[r]=a)}catch(i){throw i.checkKey=r,i.checkValue=t[r],i}return n}},{key:"allowNull",value:function(e,t){return function(n){return null==n?t:e(n)}}},{key:"allowFalsish",value:function(e,t){return function(n){return n?e(n):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var n=[];return t.forEach((function(t){n.push(e(t))})),n}}}]),e}();function B(e){return e&&"function"===typeof e.isCommunityResource}function U(e){return B(e)&&e.isCommunityResource()}var L=!1;function z(){L||(L=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var F=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},q=new a.Logger(j);function H(e){return null==e?"null":(32!==Object(k.hexDataLength)(e)&&q.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function J(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[H(e)]=!0}));var n=Object.keys(t);return n.sort(),n.join("|")}return H(e)})).join("&")}function V(e){if("string"===typeof e){if(e=e.toLowerCase(),32===Object(k.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+J(e);if(r.a.isForkEvent(e))throw q.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+J(e.topics||[])}throw new Error("invalid event - "+e)}function W(){return(new Date).getTime()}function K(e){return new Promise((function(t){setTimeout(t,e)}))}var G=["block","network","pending","poll"],Z=function(){function e(t,n,r){Object(y.a)(this,e),Object(S.defineReadOnly)(this,"tag",t),Object(S.defineReadOnly)(this,"listener",n),Object(S.defineReadOnly)(this,"once",r)}return Object(m.a)(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,n=e[1],r=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),a={};return r.length>0&&(a.topics=r),n&&"*"!==n&&(a.address=n),a}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||G.indexOf(this.tag)>=0}}]),e}(),X={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Y(e){return Object(k.hexZeroPad)(T.a.from(e).toHexString(),32)}function $(e){return w.Base58.encode(Object(k.concat)([e,Object(k.hexDataSlice)(Object(x.c)(Object(x.c)(e)),0,4)]))}var Q=new RegExp("^(ipfs)://(.*)$","i"),ee=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Q,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function te(e){try{return Object(A.h)(ne(e))}catch(t){}return null}function ne(e){if("0x"===e)return null;var t=T.a.from(Object(k.hexDataSlice)(e,0,32)).toNumber(),n=T.a.from(Object(k.hexDataSlice)(e,t,t+32)).toNumber();return Object(k.hexDataSlice)(e,t+32,t+32+n)}function re(e){return"https://gateway.ipfs.io/ipfs/".concat(e.substring(7))}var ae=function(){function e(t,n,r,a){Object(y.a)(this,e),Object(S.defineReadOnly)(this,"provider",t),Object(S.defineReadOnly)(this,"name",r),Object(S.defineReadOnly)(this,"address",t.formatter.address(n)),Object(S.defineReadOnly)(this,"_resolvedAddress",a)}return Object(m.a)(e,[{key:"_fetchBytes",value:function(e,t){return F(this,void 0,void 0,g.a.mark((function n(){var r;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r={to:this.address,data:Object(k.hexConcat)([e,Object(O.b)(this.name),t||"0x"])},n.prev=1,n.t0=ne,n.next=5,this.provider.call(r);case 5:return n.t1=n.sent,n.abrupt("return",(0,n.t0)(n.t1));case 9:if(n.prev=9,n.t2=n.catch(1),n.t2.code!==a.Logger.errors.CALL_EXCEPTION){n.next=13;break}return n.abrupt("return",null);case 13:return n.abrupt("return",null);case 14:case"end":return n.stop()}}),n,this,[[1,9]])})))}},{key:"_getAddress",value:function(e,t){var n=X[String(e)];if(null==n&&q.throwError("unsupported coin type: ".concat(e),a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===n.ilk)return this.provider.formatter.address(t);var r=Object(k.arrayify)(t);if(null!=n.p2pkh){var i=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){var o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return $(Object(k.concat)([[n.p2pkh],"0x"+i[2]]))}}if(null!=n.p2sh){var s=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){var u=parseInt(s[1],16);if(s[2].length===2*u&&u>=1&&u<=75)return $(Object(k.concat)([[n.p2sh],"0x"+s[2]]))}}if(null!=n.prefix){var c=r[1],f=r[0];if(0===f?20!==c&&32!==c&&(f=-1):f=-1,f>=0&&r.length===2+c&&c>=1&&c<=75){var d=P.a.toWords(r.slice(2));return d.unshift(f),P.a.encode(n.prefix,d)}}return null}},{key:"getAddress",value:function(e){return F(this,void 0,void 0,g.a.mark((function t(){var n,r,i,o;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=17;break}return t.prev=2,n={to:this.address,data:"0x3b3b57de"+Object(O.b)(this.name).substring(2)},t.next=6,this.provider.call(n);case 6:if("0x"!==(r=t.sent)&&r!==_.a){t.next=9;break}return t.abrupt("return",null);case 9:return t.abrupt("return",this.provider.formatter.callAddress(r));case 12:if(t.prev=12,t.t0=t.catch(2),t.t0.code!==a.Logger.errors.CALL_EXCEPTION){t.next=16;break}return t.abrupt("return",null);case 16:throw t.t0;case 17:return t.next=19,this._fetchBytes("0xf1cb7e06",Y(e));case 19:if(null!=(i=t.sent)&&"0x"!==i){t.next=22;break}return t.abrupt("return",null);case 22:return null==(o=this._getAddress(e,i))&&q.throwError("invalid or unsupported coin data",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:i}),t.abrupt("return",o);case 25:case"end":return t.stop()}}),t,this,[[2,12]])})))}},{key:"getAvatar",value:function(){return F(this,void 0,void 0,g.a.mark((function e(){var t,n,r,a,i,o,s,u,c,f,d,l,p,b,h,y;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(n=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:r=0;case 8:if(!(r0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return n=this._internalBlockNumber,t.prev=5,t.next=8,n;case 8:if(r=t.sent,!(W()-r.respTime<=e)){t.next=11;break}return t.abrupt("return",r.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==n){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return a=W(),i=Object(S.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,n=e.networkError;if(n)throw o._internalBlockNumber===i&&(o._internalBlockNumber=null),n;var r=W();return(t=T.a.from(t).toNumber())1e3)q.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",q.makeError("network block skew detected",a.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(i=this._emitted.block+1;i<=r;i++)this.emit("block",i);return this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=o._emitted[e];"pending"!==t&&r-t>12&&delete o._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,a=o.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(o._emitted["t:"+t]=e.blockNumber,o.emit(t,e),null):null})).catch((function(e){o.emit("error",e)}));n.push(a);break;case"filter":var i=e.filter;i.fromBlock=o._lastBlockNumber+1,i.toBlock=r;var s=o.getLogs(i).then((function(e){0!==e.length&&e.forEach((function(e){o._emitted["b:"+e.blockHash]=e.blockNumber,o._emitted["t:"+e.transactionHash]=e.blockNumber,o.emit(i,e)}))})).catch((function(e){o.emit("error",e)}));n.push(s)}})),this._lastBlockNumber=r,Promise.all(n).then((function(){o.emit("didPoll",t)})).catch((function(e){o.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return F(this,void 0,void 0,g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",q.throwError("provider does not support network detection",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return F(this,void 0,void 0,g.a.mark((function e(){var t,n,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(n=e.sent,t.chainId===n.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=n,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",n,t),e.next=19,K(0);case 19:return e.abrupt("return",this._network);case 20:throw r=q.makeError("underlying network changed",a.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:n}),this.emit("error",r),r;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=W();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,n){return F(this,void 0,void 0,g.a.mark((function r(){return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._waitForTransaction(e,null==t?1:t,n||0,null));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"_waitForTransaction",value:function(e,t,n,r){return F(this,void 0,void 0,g.a.mark((function i(){var o,s=this;return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e);case 2:if(!(((o=i.sent)?o.confirmations:0)>=t)){i.next=5;break}return i.abrupt("return",o);case 5:return i.abrupt("return",new Promise((function(i,o){var u=[],c=!1,f=function(){return!!c||(c=!0,u.forEach((function(e){e()})),!1)},d=function(e){e.confirmations0){var h=setTimeout((function(){f()||o(q.makeError("timeout exceeded",a.Logger.errors.TIMEOUT,{timeout:n}))}),n);h.unref&&h.unref(),u.push((function(){clearTimeout(h)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return F(this,void 0,void 0,g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return F(this,void 0,void 0,g.a.mark((function e(){var t;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",T.a.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",q.throwError("bad result from backend",a.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return F(this,void 0,void 0,g.a.mark((function n(){var r,i;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,Object(S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getBalance",r);case 7:return i=n.sent,n.prev=8,n.abrupt("return",T.a.from(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",q.throwError("bad result from backend",a.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return F(this,void 0,void 0,g.a.mark((function n(){var r,i;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,Object(S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getTransactionCount",r);case 7:return i=n.sent,n.prev=8,n.abrupt("return",T.a.from(i).toNumber());case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",q.throwError("bad result from backend",a.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return F(this,void 0,void 0,g.a.mark((function n(){var r,i;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,Object(S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getCode",r);case 7:return i=n.sent,n.prev=8,n.abrupt("return",Object(k.hexlify)(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",q.throwError("bad result from backend",a.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,n){return F(this,void 0,void 0,g.a.mark((function r(){var i,o;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,Object(S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((function(e){return Object(k.hexValue)(e)}))});case 4:return i=r.sent,r.next=7,this.perform("getStorageAt",i);case 7:return o=r.sent,r.prev=8,r.abrupt("return",Object(k.hexlify)(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",q.throwError("bad result from backend",a.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,n){var r=this;if(null!=t&&32!==Object(k.hexDataLength)(t))throw new Error("invalid response - sendTransaction");var i=e;return null!=t&&e.hash!==t&&q.throwError("Transaction hash mismatch from Provider.sendTransaction.",a.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return F(r,void 0,void 0,g.a.mark((function r(){var o,s;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t=1),null==i&&(i=0),o=void 0,0!==t&&null!=n&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n}),r.next=6,this._waitForTransaction(e.hash,t,i,o);case 6:if(null!=(s=r.sent)||0!==t){r.next=9;break}return r.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&q.throwError("transaction failed",a.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),r.abrupt("return",s);case 12:case"end":return r.stop()}}),r,this)})))},i}},{key:"sendTransaction",value:function(e){return F(this,void 0,void 0,g.a.mark((function t(){var n,r,a,i;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return Object(k.hexlify)(e)}));case 4:return n=t.sent,null==(r=this.formatter.transaction(e)).confirmations&&(r.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return a=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:n});case 13:return i=t.sent,t.abrupt("return",this._wrapTransaction(r,i,a));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=r,t.t0.transactionHash=r.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return F(this,void 0,void 0,g.a.mark((function t(){var n,r,a=this;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return n=t.sent,r={},["from","to"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?a._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?T.a.from(e):null})))})),["type"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return null!=e?e:null})))})),n.accessList&&(r.accessList=this.formatter.accessList(n.accessList)),["data"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?Object(k.hexlify)(e):null})))})),t.t0=this.formatter,t.next=12,Object(S.resolveProperties)(r);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return F(this,void 0,void 0,g.a.mark((function t(){var n,r=this;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,n={},null!=e.address&&(n.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(n[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(n[t]=r._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,Object(S.resolveProperties)(n);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"call",value:function(e,t){return F(this,void 0,void 0,g.a.mark((function n(){var r,i;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,Object(S.resolveProperties)({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("call",r);case 7:return i=n.sent,n.prev=8,n.abrupt("return",Object(k.hexlify)(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",q.throwError("bad result from backend",a.Logger.errors.SERVER_ERROR,{method:"call",params:r,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"estimateGas",value:function(e){return F(this,void 0,void 0,g.a.mark((function t(){var n,r;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Object(S.resolveProperties)({transaction:this._getTransactionRequest(e)});case 4:return n=t.sent,t.next=7,this.perform("estimateGas",n);case 7:return r=t.sent,t.prev=8,t.abrupt("return",T.a.from(r));case 12:return t.prev=12,t.t0=t.catch(8),t.abrupt("return",q.throwError("bad result from backend",a.Logger.errors.SERVER_ERROR,{method:"estimateGas",params:n,result:r,error:t.t0}));case 15:case"end":return t.stop()}}),t,this,[[8,12]])})))}},{key:"_getAddress",value:function(e){return F(this,void 0,void 0,g.a.mark((function t(){var n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return"string"!==typeof(e=t.sent)&&q.throwArgumentError("invalid address or ENS name","name",e),t.next=6,this.resolveName(e);case 6:return null==(n=t.sent)&&q.throwError("ENS name not configured",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(e),")")}),t.abrupt("return",n);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlock",value:function(e,t){return F(this,void 0,void 0,g.a.mark((function n(){var r,a,i=this;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,e;case 4:if(e=n.sent,r=-128,a={includeTransactions:!!t},!Object(k.isHexString)(e,32)){n.next=11;break}a.blockHash=e,n.next=21;break;case 11:return n.prev=11,n.next=14,this._getBlockTag(e);case 14:a.blockTag=n.sent,Object(k.isHexString)(a.blockTag)&&(r=parseInt(a.blockTag.substring(2),16)),n.next=21;break;case 18:n.prev=18,n.t0=n.catch(11),q.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e);case 21:return n.abrupt("return",Object(M.poll)((function(){return F(i,void 0,void 0,g.a.mark((function e(){var n,i,o,s,u,c,f=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getBlock",a);case 2:if(null!=(n=e.sent)){e.next=11;break}if(null==a.blockHash){e.next=7;break}if(null!=this._emitted["b:"+a.blockHash]){e.next=7;break}return e.abrupt("return",null);case 7:if(null==a.blockTag){e.next=10;break}if(!(r>this._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}i=null,o=0;case 14:if(!(oa.length)){t.next=24;break}return t.abrupt("return",null);case 24:return o=Object(A.h)(a.slice(0,i)),t.next=27,this.resolveName(o);case 27:if(t.sent==e){t.next=30;break}return t.abrupt("return",null);case 30:return t.abrupt("return",o);case 31:case"end":return t.stop()}}),t,this)})))}},{key:"getAvatar",value:function(e){return F(this,void 0,void 0,g.a.mark((function t(){var n,r,a,i,o;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=null,!Object(k.isHexString)(e)){t.next=12;break}return r=this.formatter.address(e),a=r.substring(2).toLowerCase()+".addr.reverse",t.next=6,this._getResolver(a);case 6:if(i=t.sent){t.next=9;break}return t.abrupt("return",null);case 9:n=new ae(this,i,"_",r),t.next=17;break;case 12:return t.next=14,this.getResolver(e);case 14:if(n=t.sent){t.next=17;break}return t.abrupt("return",null);case 17:return t.next=19,n.getAvatar();case 19:if(null!=(o=t.sent)){t.next=22;break}return t.abrupt("return",null);case 22:return t.abrupt("return",o.url);case 23:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(e,t){return q.throwError(e+" not implemented",a.Logger.errors.NOT_IMPLEMENTED,{operation:e})}},{key:"_startEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,n){var r=new Z(V(e),t,n);return this._events.push(r),this._startEvent(r),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&pe.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",a.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:o}),t}function ye(e){return new Promise((function(t){setTimeout(t,e)}))}function me(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function ve(e){return e?e.toLowerCase():e}var ge={},we=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e,r,a){var i;if(Object(y.a)(this,n),pe.checkNew(this instanceof n?this.constructor:void 0,n),i=t.call(this),e!==ge)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return Object(S.defineReadOnly)(Object(p.a)(i),"provider",r),null==a&&(a=0),"string"===typeof a?(Object(S.defineReadOnly)(Object(p.a)(i),"_address",i.provider.formatter.address(a)),Object(S.defineReadOnly)(Object(p.a)(i),"_index",null)):"number"===typeof a?(Object(S.defineReadOnly)(Object(p.a)(i),"_index",a),Object(S.defineReadOnly)(Object(p.a)(i),"_address",null)):pe.throwArgumentError("invalid address or index","addressOrIndex",a),i}return Object(m.a)(n,[{key:"connect",value:function(e){return pe.throwError("cannot alter JSON-RPC Signer connection",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Te(ge,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&pe.throwError("unknown account #"+e._index,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=Object(S.shallowCopy)(e);var n=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var r=Object(S.shallowCopy)(e);r.from=n,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return le(t,void 0,void 0,g.a.mark((function t(){var n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(n=t.sent)&&pe.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)})))}))),Object(S.resolveProperties)({tx:Object(S.resolveProperties)(e),sender:n}).then((function(n){var r=n.tx,a=n.sender;null!=r.from?r.from.toLowerCase()!==a&&pe.throwArgumentError("from address mismatch","transaction",e):r.from=a;var i=t.provider.constructor.hexlifyTransaction(r,{from:!0});return t.provider.send("eth_sendTransaction",[i]).then((function(e){return e}),(function(e){return he("sendTransaction",e,i)}))}))}},{key:"signTransaction",value:function(e){return pe.throwError("signing transactions is unsupported",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return le(this,void 0,void 0,g.a.mark((function t(){var n,r,a=this;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return n=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return r=t.sent,t.prev=6,t.next=9,Object(M.poll)((function(){return le(a,void 0,void 0,g.a.mark((function e(){var t;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(r);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,r,n));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=r,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return le(this,void 0,void 0,g.a.mark((function t(){var n,r;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?Object(A.f)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.next=6,this.provider.send("personal_sign",[Object(k.hexlify)(n),r.toLowerCase()]);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"_legacySignMessage",value:function(e){return le(this,void 0,void 0,g.a.mark((function t(){var n,r;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?Object(A.f)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.next=6,this.provider.send("eth_sign",[r.toLowerCase(),Object(k.hexlify)(n)]);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,n){return le(this,void 0,void 0,g.a.mark((function r(){var a,i,o=this;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,de.a.resolveNames(e,t,n,(function(e){return o.provider.resolveName(e)}));case 2:return a=r.sent,r.next=5,this.getAddress();case 5:return i=r.sent,r.next=8,this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(de.a.getPayload(a.domain,t,a.value))]);case 8:return r.abrupt("return",r.sent);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"unlock",value:function(e){return le(this,void 0,void 0,g.a.mark((function t(){var n,r;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.provider,t.next=3,this.getAddress();case 3:return r=t.sent,t.abrupt("return",n.send("personal_unlockAccount",[r.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),n}(fe.a),Te=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(y.a)(this,n),t.apply(this,arguments)}return Object(m.a)(n,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(n){return t.provider.waitForTransaction(e,n)}}}))}}]),n}(we),ke={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},_e=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e,r){var a;Object(y.a)(this,n),pe.checkNew(this instanceof n?this.constructor:void 0,n);var i=r;return null==i&&(i=new Promise((function(e,t){setTimeout((function(){a.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),a=t.call(this,i),e||(e=Object(S.getStatic)(a.constructor,"defaultUrl")()),"string"===typeof e?Object(S.defineReadOnly)(Object(p.a)(a),"connection",Object.freeze({url:e})):Object(S.defineReadOnly)(Object(p.a)(a),"connection",Object.freeze(Object(S.shallowCopy)(e))),a._nextId=42,a}return Object(m.a)(n,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return le(this,void 0,void 0,g.a.mark((function e(){var t,n;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ye(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return n=Object(S.getStatic)(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",n(T.a.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",pe.throwError("could not detect network",a.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",pe.throwError("could not detect network",a.Logger.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new we(ge,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var n=this,r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Object(S.deepCopy)(r),provider:this});var a=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(a&&this._cache[e])return this._cache[e];var i=Object(M.fetchJson)(this.connection,JSON.stringify(r),me).then((function(e){return n.emit("debug",{action:"response",request:r,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",error:e,request:r,provider:n}),e}));return a&&(this._cache[e]=i,setTimeout((function(){n._cache[e]=null}),0)),i}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[ve(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[ve(t.address),t.blockTag]];case"getCode":return["eth_getCode",[ve(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[ve(t.address),t.position,t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Object(S.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Object(S.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=ve(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return le(this,void 0,void 0,g.a.mark((function n(){var r,i,o;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("call"!==e&&"estimateGas"!==e){n.next=8;break}if(!(r=t.transaction)||null==r.type||!T.a.from(r.type).isZero()){n.next=8;break}if(null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas){n.next=8;break}return n.next=6,this.getFeeData();case 6:null==(i=n.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((t=Object(S.shallowCopy)(t)).transaction=Object(S.shallowCopy)(r),delete t.transaction.type);case 8:return null==(o=this.prepareRequest(e,t))&&pe.throwError(e+" not implemented",a.Logger.errors.NOT_IMPLEMENTED,{operation:e}),n.prev=10,n.next=13,this.send(o[0],o[1]);case 13:return n.abrupt("return",n.sent);case 16:return n.prev=16,n.t0=n.catch(10),n.abrupt("return",he(e,n.t0,t));case 19:case"end":return n.stop()}}),n,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),Object(ue.a)(Object(ce.a)(n.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;var r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return ye(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((function(e){}))}(),n})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),Object(ue.a)(Object(ce.a)(n.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var n=Object(S.shallowCopy)(ke);if(t)for(var r in t)t[r]&&(n[r]=!0);Object(S.checkProperties)(e,n);var a={};return["gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var n=Object(k.hexValue)(e[t]);"gasLimit"===t&&(t="gas"),a[t]=n}})),["from","to","data"].forEach((function(t){null!=e[t]&&(a[t]=Object(k.hexlify)(e[t]))})),e.accessList&&(a.accessList=Object(R.accessListify)(e.accessList)),a}}]),n}(se),Oe=null;try{if(null==(Oe=WebSocket))throw new Error("inject please")}catch(Et){var Se=new a.Logger(j);Oe=function(){Se.throwError("WebSockets not supported in this environment",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var xe=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},Ae=new a.Logger(j),Me=1,Ee=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e,r){var i,o;Object(y.a)(this,n),"any"===r&&Ae.throwError("WebSocketProvider does not support 'any' network yet",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(o=t.call(this,e,r))._pollingInterval=-1,o._wsReady=!1,Object(S.defineReadOnly)(Object(p.a)(o),"_websocket",new Oe(o.connection.url)),Object(S.defineReadOnly)(Object(p.a)(o),"_requests",{}),Object(S.defineReadOnly)(Object(p.a)(o),"_subs",{}),Object(S.defineReadOnly)(Object(p.a)(o),"_subIds",{}),Object(S.defineReadOnly)(Object(p.a)(o),"_detectNetwork",Object(ue.a)((i=Object(p.a)(o),Object(ce.a)(n.prototype)),"detectNetwork",i).call(i)),o._websocket.onopen=function(){o._wsReady=!0,Object.keys(o._requests).forEach((function(e){o._websocket.send(o._requests[e].payload)}))},o._websocket.onmessage=function(e){var t=e.data,n=JSON.parse(t);if(null!=n.id){var r=String(n.id),a=o._requests[r];if(delete o._requests[r],void 0!==n.result)a.callback(null,n.result),o.emit("debug",{action:"response",request:JSON.parse(a.payload),response:n.result,provider:Object(p.a)(o)});else{var i=null;n.error?(i=new Error(n.error.message||"unknown error"),Object(S.defineReadOnly)(i,"code",n.error.code||null),Object(S.defineReadOnly)(i,"response",t)):i=new Error("unknown error"),a.callback(i,void 0),o.emit("debug",{action:"response",error:i,request:JSON.parse(a.payload),provider:Object(p.a)(o)})}}else if("eth_subscription"===n.method){var s=o._subs[n.params.subscription];s&&s.processFunc(n.params.result)}else console.warn("this should not happen")};var s=setInterval((function(){o.emit("poll")}),1e3);return s.unref&&s.unref(),o}return Object(m.a)(n,[{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){Ae.throwError("cannot set polling interval on WebSocketProvider",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){Ae.throwError("cannot reset events block on WebSocketProvider",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return xe(this,void 0,void 0,g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})))}},{key:"polling",set:function(e){e&&Ae.throwError("cannot set polling on WebSocketProvider",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var n=this,r=Me++;return new Promise((function(a,i){var o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});n.emit("debug",{action:"request",request:JSON.parse(o),provider:n}),n._requests[String(r)]={callback:function(e,t){return e?i(e):a(t)},payload:o},n._wsReady&&n._websocket.send(o)}))}},{key:"_subscribe",value:function(e,t,n){return xe(this,void 0,void 0,g.a.mark((function r(){var a,i,o=this;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==(a=this._subIds[e])&&(a=Promise.all(t).then((function(e){return o.send("eth_subscribe",e)})),this._subIds[e]=a),r.next=4,a;case 4:i=r.sent,this._subs[i]={tag:e,processFunc:n};case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var n=T.a.from(e.number).toNumber();t._emitted.block=n,t.emit("block",n)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(e){t.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(function(n){null==n.removed&&(n.removed=!1),t.emit(e.filter,t.formatter.filterLog(n))}));break;case"tx":var n=function(e){var n=e.hash;t.getTransactionReceipt(n).then((function(e){e&&t.emit(n,e)}))};n(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(n)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}},{key:"_stopEvent",value:function(e){var t=this,n=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;n="tx"}else if(this.listenerCount(e.event))return;var r=this._subIds[n];r&&(delete this._subIds[n],r.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return xe(this,void 0,void 0,g.a.mark((function e(){var t=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._websocket.readyState!==Oe.CONNECTING){e.next=3;break}return e.next=3,new Promise((function(e){t._websocket.onopen=function(){e(!0)},t._websocket.onerror=function(){e(!1)}}));case 3:this._websocket.close(1e3);case 4:case"end":return e.stop()}}),e,this)})))}}],[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}]),n}(_e),Pe=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},je=new a.Logger(j),Ie=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(y.a)(this,n),t.apply(this,arguments)}return Object(m.a)(n,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return Object(ue.a)(Object(ce.a)(n.prototype),"detectNetwork",e)}}});return Pe(this,void 0,void 0,g.a.mark((function e(){var n;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(n=e.sent)||je.throwError("no network detected",a.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(Object(S.defineReadOnly)(this,"_network",n),this.emit("network",n,null));case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}}]),n}(_e),Ce=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e,r){var a;Object(y.a)(this,n),je.checkAbstract(this instanceof n?this.constructor:void 0,n),e=Object(S.getStatic)(this instanceof n?this.constructor:void 0,"getNetwork")(e),r=Object(S.getStatic)(this instanceof n?this.constructor:void 0,"getApiKey")(r);var i=Object(S.getStatic)(this instanceof n?this.constructor:void 0,"getUrl")(e,r);return a=t.call(this,i,e),"string"===typeof r?Object(S.defineReadOnly)(Object(p.a)(a),"apiKey",r):null!=r&&Object.keys(r).forEach((function(e){Object(S.defineReadOnly)(Object(p.a)(a),e,r[e])})),a}return Object(m.a)(n,[{key:"_startPending",value:function(){je.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return je.throwError("API provider does not support signing",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(e){return e}},{key:"getUrl",value:function(e,t){return je.throwError("not implemented; sub-classes must override getUrl",a.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),n}(Ie),Re=new a.Logger(j),Ne="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",De=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e,r){var a;Object(y.a)(this,n);var i=new Be(e,r),o=i.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return a=t.call(this,o,i.network),Object(S.defineReadOnly)(Object(p.a)(a),"apiKey",i.apiKey),a}return Object(m.a)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Ne}}]),n}(Ee),Be=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(y.a)(this,n),t.apply(this,arguments)}return Object(m.a)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Ne}}],[{key:"getWebSocketProvider",value:function(e,t){return new De(e,t)}},{key:"getApiKey",value:function(e){return null==e?Ne:(e&&"string"!==typeof e&&Re.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":n="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":n="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.alchemyapi.io/v2/";break;case"kovan":n="eth-kovan.alchemyapi.io/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-rinkeby":n="arb-rinkeby.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":n="opt-kovan.g.alchemy.com/v2/";break;default:Re.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+t,throttleCallback:function(e,n){return t===Ne&&z(),Promise.resolve(!0)}}}}]),n}(Ce),Ue=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},Le=new a.Logger(j),ze=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(y.a)(this,n),t.apply(this,arguments)}return Object(m.a)(n,[{key:"perform",value:function(e,t){var r=this,a=Object.create(null,{perform:{get:function(){return Object(ue.a)(Object(ce.a)(n.prototype),"perform",r)}}});return Ue(this,void 0,void 0,g.a.mark((function n(){var r;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("getBlockNumber"!==e){n.next=5;break}return n.next=3,a.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return r=n.sent,n.abrupt("return",r.number);case 5:return n.abrupt("return",a.perform.call(this,e,t));case 6:case"end":return n.stop()}}),n,this)})))}}],[{key:"getApiKey",value:function(e){return null!=e&&Le.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var n=null;if("homestead"===e.name)n="https://cloudflare-eth.com/";else Le.throwArgumentError("unsupported network","network",arguments[0]);return n}}]),n}(Ce),Fe=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},qe=new a.Logger(j);function He(e){var t={};for(var n in e)if(null!=e[n]){var r=e[n];"type"===n&&0===r||(r={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n]?Object(k.hexValue)(Object(k.hexlify)(r)):"accessList"===n?"["+Object(R.accessListify)(r).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(k.hexlify)(r),t[n]=r)}return t}function Je(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"OK"!=e.message){var t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function Ve(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var n=new Error("invalid response");throw n.result=JSON.stringify(e),n}if(e.error){var r=new Error(e.error.message||"unknown error");throw e.error.code&&(r.code=e.error.code),e.error.data&&(r.data=e.error.data),r}return e.result}function We(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}var Ke="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function Ge(e,t,n){if("call"===e&&t.code===a.Logger.errors.SERVER_ERROR){var r=t.error;if(r&&(r.message.match(/reverted/i)||r.message.match(/VM execution error/i))){var i=r.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),Object(k.isHexString)(i))return i;qe.throwError("missing revert data in call exception",a.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var o=t.message;throw t.code===a.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?o=t.error.message:"string"===typeof t.body?o=t.body:"string"===typeof t.responseText&&(o=t.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&qe.throwError("insufficient funds for intrinsic transaction cost",a.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&qe.throwError("nonce has already been used",a.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/another transaction with same nonce/)&&qe.throwError("replacement fee too low",a.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/execution failed due to an exception|execution reverted/)&&qe.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",a.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}var Ze=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e,r){var a;return Object(y.a)(this,n),qe.checkNew(this instanceof n?this.constructor:void 0,n),a=t.call(this,e),Object(S.defineReadOnly)(Object(p.a)(a),"baseUrl",a.getBaseUrl()),Object(S.defineReadOnly)(Object(p.a)(a),"apiKey",r||Ke),a}return Object(m.a)(n,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return qe.throwArgumentError("unsupported network","network",name)}},{key:"getUrl",value:function(e,t){var n=Object.keys(t).reduce((function(e,n){var r=t[n];return null!=r&&(e+="&".concat(n,"=").concat(r)),e}),""),r=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(n).concat(r)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,n){return Fe(this,void 0,void 0,g.a.mark((function r(){var a,i,o,s,u,c,f=this;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=n?this.getPostUrl():this.getUrl(e,t),i=n?this.getPostData(e,t):null,o="proxy"===e?Ve:Je,this.emit("debug",{action:"request",request:a,provider:this}),s={url:a,throttleSlotInterval:1e3,throttleCallback:function(e,t){return f.isCommunityResource()&&z(),Promise.resolve(!0)}},u=null,i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(i).map((function(e){return"".concat(e,"=").concat(i[e])})).join("&")),r.next=9,Object(M.fetchJson)(s,u,o||Ve);case 9:return c=r.sent,this.emit("debug",{action:"response",request:a,response:Object(S.deepCopy)(c),provider:this}),r.abrupt("return",c);case 12:case"end":return r.stop()}}),r,this)})))}},{key:"detectNetwork",value:function(){return Fe(this,void 0,void 0,g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,i=Object.create(null,{perform:{get:function(){return Object(ue.a)(Object(ce.a)(n.prototype),"perform",r)}}});return Fe(this,void 0,void 0,g.a.mark((function n(){var r,o,s,u,c,f,d,l,p;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=e,n.next="getBlockNumber"===n.t0?3:"getGasPrice"===n.t0?4:"getBalance"===n.t0?5:"getTransactionCount"===n.t0?6:"getCode"===n.t0?7:"getStorageAt"===n.t0?8:"sendTransaction"===n.t0?9:"getBlock"===n.t0?10:"getTransaction"===n.t0?13:"getTransactionReceipt"===n.t0?14:"call"===n.t0?15:"estimateGas"===n.t0?29:"getLogs"===n.t0?41:"getEtherPrice"===n.t0?65:72;break;case 3:return n.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return n.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return n.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return n.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return n.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return n.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Ge("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){n.next=12;break}return n.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){n.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(r=He(t.transaction)).module="proxy",r.action="eth_call",n.prev=20,n.next=23,this.fetch("proxy",r,!0);case 23:return n.abrupt("return",n.sent);case 26:return n.prev=26,n.t1=n.catch(20),n.abrupt("return",Ge("call",n.t1,t.transaction));case 29:return(o=He(t.transaction)).module="proxy",o.action="eth_estimateGas",n.prev=32,n.next=35,this.fetch("proxy",o,!0);case 35:return n.abrupt("return",n.sent);case 38:return n.prev=38,n.t2=n.catch(32),n.abrupt("return",Ge("estimateGas",n.t2,t.transaction));case 41:return s={action:"getLogs"},t.filter.fromBlock&&(s.fromBlock=We(t.filter.fromBlock)),t.filter.toBlock&&(s.toBlock=We(t.filter.toBlock)),t.filter.address&&(s.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&qe.throwError("unsupported topic count",a.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(u=t.filter.topics[0])&&66===u.length||qe.throwError("unsupported topic format",a.Logger.errors.UNSUPPORTED_OPERATION,{topic0:u}),s.topic0=u)),n.next=48,this.fetch("logs",s);case 48:c=n.sent,f={},d=0;case 51:if(!(dt?null:(r+a)/2}function nt(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(T.a.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return nt(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var n=e[t];return n="function"===typeof n?"[function]":nt(n),JSON.stringify(t)+":"+n})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var rt=1;function at(e){var t=null,n=null,r=new Promise((function(r){t=function(){n&&(clearTimeout(n),n=null),r()},n=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return r},wait:function(e){return r=r.then(e)}}}var it=[a.Logger.errors.CALL_EXCEPTION,a.Logger.errors.INSUFFICIENT_FUNDS,a.Logger.errors.NONCE_EXPIRED,a.Logger.errors.REPLACEMENT_UNDERPRICED,a.Logger.errors.UNPREDICTABLE_GAS_LIMIT],ot=["address","args","errorArgs","errorSignature","method","transaction"];function st(e,t){var n={weight:e.weight};return Object.defineProperty(n,"provider",{get:function(){return e.provider}}),e.start&&(n.start=e.start),t&&(n.duration=t-e.start),e.done&&(e.error?n.error=e.error:n.result=e.result||null),n}function ut(e,t,n){var r=nt;switch(t){case"getBlockNumber":return function(t){var n=t.map((function(e){return e.result})),r=tt(t.map((function(e){return e.result})),2);if(null!=r)return r=Math.ceil(r),n.indexOf(r+1)>=0&&r++,r>=e._highestBlockNumber&&(e._highestBlockNumber=r),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return tt(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":r=function(e){return null==e?null:((e=Object(S.shallowCopy)(e)).confirmations=-1,nt(e))};break;case"getBlock":r=n.includeTransactions?function(e){return null==e?null:((e=Object(S.shallowCopy)(e)).transactions=e.transactions.map((function(e){return(e=Object(S.shallowCopy)(e)).confirmations=-1,e})),nt(e))}:function(e){return null==e?null:nt(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(n){var r={};n.forEach((function(t){var n=e(t.result);r[n]||(r[n]={count:0,result:t.result}),r[n].count++}));for(var a=Object.keys(r),i=0;i=t)return o.result}}}(r,e.quorum)}function ct(e,t){return Ye(this,void 0,void 0,g.a.mark((function n(){var r;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(null!=(r=e.provider).blockNumber&&r.blockNumber>=t||-1===t)){n.next=3;break}return n.abrupt("return",r);case 3:return n.abrupt("return",Object(M.poll)((function(){return new Promise((function(n,a){setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))}),{oncePoll:r}));case 4:case"end":return n.stop()}}),n)})))}function ft(e,t,n,r){return Ye(this,void 0,void 0,g.a.mark((function i(){var o,s;return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.provider,i.t0=n,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?28:"getLogs"===i.t0?29:35;break;case 4:return i.abrupt("return",o[n]());case 5:if(!o.getEtherPrice){i.next=7;break}return i.abrupt("return",o.getEtherPrice());case 7:return i.abrupt("break",35);case 8:if(!r.blockTag||!Object(k.isHexString)(r.blockTag)){i.next=12;break}return i.next=11,ct(e,t);case 11:o=i.sent;case 12:return i.abrupt("return",o[n](r.address,r.blockTag||"latest"));case 13:if(!r.blockTag||!Object(k.isHexString)(r.blockTag)){i.next=17;break}return i.next=16,ct(e,t);case 16:o=i.sent;case 17:return i.abrupt("return",o.getStorageAt(r.address,r.position,r.blockTag||"latest"));case 18:if(!r.blockTag||!Object(k.isHexString)(r.blockTag)){i.next=22;break}return i.next=21,ct(e,t);case 21:o=i.sent;case 22:return i.abrupt("return",o[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash));case 23:if(!r.blockTag||!Object(k.isHexString)(r.blockTag)){i.next=27;break}return i.next=26,ct(e,t);case 26:o=i.sent;case 27:return i.abrupt("return",o[n](r.transaction));case 28:return i.abrupt("return",o[n](r.transactionHash));case 29:if(!((s=r.filter).fromBlock&&Object(k.isHexString)(s.fromBlock)||s.toBlock&&Object(k.isHexString)(s.toBlock))){i.next=34;break}return i.next=33,ct(e,t);case 33:o=i.sent;case 34:return i.abrupt("return",o.getLogs(s));case 35:return i.abrupt("return",$e.throwError("unknown method error",a.Logger.errors.UNKNOWN_ERROR,{method:n,params:r}));case 36:case"end":return i.stop()}}),i)})))}var dt=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e,a){var i;Object(y.a)(this,n),$e.checkNew(this instanceof n?this.constructor:void 0,n),0===e.length&&$e.throwArgumentError("missing providers","providers",e);var o=e.map((function(e,t){if(r.b.isProvider(e)){var n=U(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:n,priority:1})}var a=Object(S.shallowCopy)(e);null==a.priority&&(a.priority=1),null==a.stallTimeout&&(a.stallTimeout=U(e)?2e3:750),null==a.weight&&(a.weight=1);var i=a.weight;return(i%1||i>512||i<1)&&$e.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),i),Object.freeze(a)})),s=o.reduce((function(e,t){return e+t.weight}),0);null==a?a=s/2:a>s&&$e.throwArgumentError("quorum will always fail; larger than total weight","quorum",a);var u=et(o.map((function(e){return e.provider.network})));return null==u&&(u=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then(e,t)}),0)}))),i=t.call(this,u),Object(S.defineReadOnly)(Object(p.a)(i),"providerConfigs",Object.freeze(o)),Object(S.defineReadOnly)(Object(p.a)(i),"quorum",a),i._highestBlockNumber=-1,i}return Object(m.a)(n,[{key:"detectNetwork",value:function(){return Ye(this,void 0,void 0,g.a.mark((function e(){var t;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",et(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return Ye(this,void 0,void 0,g.a.mark((function n(){var r,i,o,s,u,c,f,d,l,p,b=this;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("sendTransaction"!==e){n.next=13;break}return n.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:r=n.sent,i=0;case 5:if(!(i=b.quorum)){n.next=19;break}if(void 0===(p=s(l))){n.next=15;break}return u.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),n.abrupt("return",{v:p});case 15:if(d){n.next=18;break}return n.next=18,at(100).getPromise();case 18:d=!1;case 19:if(h=u.reduce((function(e,t){if(!t.done||null==t.error)return e;var n=t.error.code;return it.indexOf(n)>=0&&(e[n]||(e[n]={error:t.error,weight:0}),e[n].weight+=t.weight),e}),{}),Object.keys(h).forEach((function(e){var t=h[e];if(!(t.weighte.length)&&(t=e.length);for(var n=0,r=new Array(t);n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function B(e,t,n){D.call(this,e,t,n)}D.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var r,a,i=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f>2]|=e[f]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(i[r>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=s){for(this.start=r-s,this.block=i[c],r=0;r>=8);n>0;)a.unshift(n),n=255&(e>>=8),++r;return t?a.push(r):a.unshift(r),this.update(a),a.length},D.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}var r=0,a=e.length;if(t)r=a;else for(var i=0;i=57344?r+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++i)),r+=4)}return r+=this.encode(8*r),this.update(e),r},D.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15];o%t===0&&(U(n),i=0)}return a&&(e=n[i],s+=p[e>>4&15]+p[15&e],a>1&&(s+=p[e>>12&15]+p[e>>8&15]),a>2&&(s+=p[e>>20&15]+p[e>>16&15])),s},D.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,a=this.extraBytes,i=0,o=0,s=this.outputBits>>3;e=a?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n===0&&U(r)}return i&&(e=s<<2,t=r[o],u[e]=255&t,i>1&&(u[e+1]=t>>8&255),i>2&&(u[e+2]=t>>16&255)),u},B.prototype=new D,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var U=function(e){var t,n,r,a,i,o,s,u,c,f,d,l,p,b,h,m,v,g,w,T,k,_,O,S,x,A,M,E,P,j,I,C,R,N,D,B,U,L,z,F,q,H,J,V,W,K,G,Z,X,Y,$,Q,ee,te,ne,re,ae,ie,oe,se,ue,ce,fe;for(r=0;r<48;r+=2)a=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=a^(u<<1|c>>>31),n=i^(c<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(f<<1|d>>>31),n=s^(d<<1|f>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(l<<1|p>>>31),n=c^(p<<1|l>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=f^(a<<1|i>>>31),n=d^(i<<1|a>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,b=e[0],h=e[1],K=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,J=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,B=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,$=e[35]<<15|e[34]>>>17,C=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,S=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ae=e[16]<<23|e[17]>>>9,L=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,T=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,A=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,F=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,O=e[49]<<14|e[48]>>>18,e[0]=b^~m&g,e[1]=h^~v&w,e[10]=S^~A&E,e[11]=x^~M&P,e[20]=N^~B&L,e[21]=D^~U&z,e[30]=V^~K&Z,e[31]=W^~G&X,e[40]=te^~re&ie,e[41]=ne^~ae&oe,e[2]=m^~g&T,e[3]=v^~w&k,e[12]=A^~E&j,e[13]=M^~P&I,e[22]=B^~L&F,e[23]=U^~z&q,e[32]=K^~Z&Y,e[33]=G^~X&$,e[42]=re^~ie&se,e[43]=ae^~oe&ue,e[4]=g^~T&_,e[5]=w^~k&O,e[14]=E^~j&C,e[15]=P^~I&R,e[24]=L^~F&H,e[25]=z^~q&J,e[34]=Z^~Y&Q,e[35]=X^~$&ee,e[44]=ie^~se&ce,e[45]=oe^~ue&fe,e[6]=T^~_&b,e[7]=k^~O&h,e[16]=j^~C&S,e[17]=I^~R&x,e[26]=F^~H&N,e[27]=q^~J&D,e[36]=Y^~Q&V,e[37]=$^~ee&W,e[46]=se^~ce&te,e[47]=ue^~fe&ne,e[8]=_^~b&m,e[9]=O^~h&v,e[18]=C^~S&A,e[19]=R^~x&M,e[28]=H^~N&B,e[29]=J^~D&U,e[38]=Q^~V&K,e[39]=ee^~W&G,e[48]=ce^~te&re,e[49]=fe^~ne&ae,e[0]^=y[r],e[1]^=y[r+1]};if(f)e.exports=M;else{for(P=0;P0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=i(t,1,this._bitLength),a=(1<=o;f--)u=(u<<1)+r[f];c.push(u)}for(var d=this.jpoint(null,null,null),l=this.jpoint(null,null,null),p=a;p>0;p--){for(o=0;o=0;c--){for(var f=0;c>=0&&0===o[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var d=o[c];s(0!==d),u="affine"===e.type?d>0?u.mixedAdd(a[d-1>>1]):u.mixedAdd(a[-d-1>>1].neg()):d>0?u.add(a[d-1>>1]):u.add(a[-d-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,n,r,a){var s,u,c,f=this._wnafT1,d=this._wnafT2,l=this._wnafT3,p=0;for(s=0;s=1;s-=2){var h=s-1,y=s;if(1===f[h]&&1===f[y]){var m=[t[h],null,null,t[y]];0===t[h].y.cmp(t[y].y)?(m[1]=t[h].add(t[y]),m[2]=t[h].toJ().mixedAdd(t[y].neg())):0===t[h].y.cmp(t[y].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[y]),m[2]=t[h].add(t[y].neg())):(m[1]=t[h].toJ().mixedAdd(t[y]),m[2]=t[h].toJ().mixedAdd(t[y].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=o(n[h],n[y]);for(p=Math.max(g[0].length,p),l[h]=new Array(p),l[y]=new Array(p),u=0;u=0;s--){for(var O=0;s>=0;){var S=!0;for(u=0;u=0&&O++,k=k.dblp(O),s<0)break;for(u=0;u0?c=d[u][x-1>>1]:x<0&&(c=d[u][-x-1>>1].neg()),k="affine"===c.type?k.mixedAdd(c):k.add(c))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,a=0;a1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.withdrawAddress&&t.uint32(18).string(e.withdrawAddress),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,a=Object.assign({},f);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.withdrawAddress=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.withdrawAddress&&null!==e.withdrawAddress?t.withdrawAddress=String(e.withdrawAddress):t.withdrawAddress="",t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.withdrawAddress&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.withdrawAddress&&null!==e.withdrawAddress?t.withdrawAddress=e.withdrawAddress:t.withdrawAddress="",t}};var d={};t.MsgSetWithdrawAddressResponse={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,a=Object.assign({},d);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),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,a=Object.assign({},l);n.pos>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=String(e.delegatorAddress):t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",t},toJSON:function(e){var t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.delegatorAddress&&null!==e.delegatorAddress?t.delegatorAddress=e.delegatorAddress:t.delegatorAddress="",void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",t}};var p={};t.MsgWithdrawDelegatorRewardResponse={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,a=Object.assign({},p);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.validatorAddress&&t.uint32(10).string(e.validatorAddress),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,a=Object.assign({},b);n.pos>>3===1)a.validatorAddress=n.string();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},b);return void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=String(e.validatorAddress):t.validatorAddress="",t},toJSON:function(e){var t={};return void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial:function(e){var t=Object.assign({},b);return void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress="",t}};var h={};t.MsgWithdrawValidatorCommissionResponse={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,a=Object.assign({},h);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create(),r=i(e.amount);try{for(r.s();!(t=r.n()).done;){var a=t.value;c.Coin.encode(a,n.uint32(10).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return""!==e.depositor&&n.uint32(18).string(e.depositor),n},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,a=Object.assign({},y);for(a.amount=[];n.pos>>3){case 1:a.amount.push(c.Coin.decode(n,n.uint32()));break;case 2:a.depositor=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);if(t.amount=[],void 0!==e.amount&&null!==e.amount){var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.amount.push(c.Coin.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return void 0!==e.depositor&&null!==e.depositor?t.depositor=String(e.depositor):t.depositor="",t},toJSON:function(e){var t={};return e.amount?t.amount=e.amount.map((function(e){return e?c.Coin.toJSON(e):void 0})):t.amount=[],void 0!==e.depositor&&(t.depositor=e.depositor),t},fromPartial:function(e){var t=Object.assign({},y);if(t.amount=[],void 0!==e.amount&&null!==e.amount){var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.amount.push(c.Coin.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return void 0!==e.depositor&&null!==e.depositor?t.depositor=e.depositor:t.depositor="",t}};var m={};t.MsgFundCommunityPoolResponse={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,a=Object.assign({},m);n.pos1&&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,a=Object.assign({},o);n.pos>>3){case 1:a.seconds=n.int64();break;case 2:a.nanos=n.int32();break;default:n.skipType(7&s)}}return a},fromJSON:function(e){var t=Object.assign({},o);return void 0!==e.seconds&&null!==e.seconds?t.seconds=a.default.fromString(e.seconds):t.seconds=a.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||a.default.ZERO).toString()),void 0!==e.nanos&&(t.nanos=e.nanos),t},fromPartial:function(e){var t=Object.assign({},o);return void 0!==e.seconds&&null!==e.seconds?t.seconds=e.seconds:t.seconds=a.default.ZERO,void 0!==e.nanos&&null!==e.nanos?t.nanos=e.nanos:t.nanos=0,t}},i.default.util.Long!==a.default&&(i.default.util.Long=a.default,i.default.configure())},function(e,t,n){"use strict";var r=n(59).default,a=n(63).default,i=n(33).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgDepositResponse=t.MsgDeposit=t.MsgVoteWeightedResponse=t.MsgVoteWeighted=t.MsgVoteResponse=t.MsgVote=t.MsgSubmitProposalResponse=t.MsgSubmitProposal=t.protobufPackage=void 0;var s=o(n(24)),u=o(n(20)),c=n(25),f=n(131),d=n(68);t.protobufPackage="cosmos.gov.v1beta1";var l={proposer:""};t.MsgSubmitProposal={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();void 0!==e.content&&c.Any.encode(e.content,t.uint32(10).fork()).ldelim();var n,r=i(e.initialDeposit);try{for(r.s();!(n=r.n()).done;){var a=n.value;d.Coin.encode(a,t.uint32(18).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return""!==e.proposer&&t.uint32(26).string(e.proposer),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,a=Object.assign({},l);for(a.initialDeposit=[];n.pos>>3){case 1:a.content=c.Any.decode(n,n.uint32());break;case 2:a.initialDeposit.push(d.Coin.decode(n,n.uint32()));break;case 3:a.proposer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);if(t.initialDeposit=[],void 0!==e.content&&null!==e.content?t.content=c.Any.fromJSON(e.content):t.content=void 0,void 0!==e.initialDeposit&&null!==e.initialDeposit){var n,r=i(e.initialDeposit);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.initialDeposit.push(d.Coin.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return void 0!==e.proposer&&null!==e.proposer?t.proposer=String(e.proposer):t.proposer="",t},toJSON:function(e){var t={};return void 0!==e.content&&(t.content=e.content?c.Any.toJSON(e.content):void 0),e.initialDeposit?t.initialDeposit=e.initialDeposit.map((function(e){return e?d.Coin.toJSON(e):void 0})):t.initialDeposit=[],void 0!==e.proposer&&(t.proposer=e.proposer),t},fromPartial:function(e){var t=Object.assign({},l);if(t.initialDeposit=[],void 0!==e.content&&null!==e.content?t.content=c.Any.fromPartial(e.content):t.content=void 0,void 0!==e.initialDeposit&&null!==e.initialDeposit){var n,r=i(e.initialDeposit);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.initialDeposit.push(d.Coin.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return void 0!==e.proposer&&null!==e.proposer?t.proposer=e.proposer:t.proposer="",t}};var p={proposalId:s.default.UZERO};t.MsgSubmitProposalResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return e.proposalId.isZero()||t.uint32(8).uint64(e.proposalId),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,a=Object.assign({},p);n.pos>>3===1)a.proposalId=n.uint64();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},p);return void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=s.default.fromString(e.proposalId):t.proposalId=s.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.proposalId&&(t.proposalId=(e.proposalId||s.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},p);return void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=e.proposalId:t.proposalId=s.default.UZERO,t}};var b={proposalId:s.default.UZERO,voter:"",option:0};t.MsgVote={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return e.proposalId.isZero()||t.uint32(8).uint64(e.proposalId),""!==e.voter&&t.uint32(18).string(e.voter),0!==e.option&&t.uint32(24).int32(e.option),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,a=Object.assign({},b);n.pos>>3){case 1:a.proposalId=n.uint64();break;case 2:a.voter=n.string();break;case 3:a.option=n.int32();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);return void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=s.default.fromString(e.proposalId):t.proposalId=s.default.UZERO,void 0!==e.voter&&null!==e.voter?t.voter=String(e.voter):t.voter="",void 0!==e.option&&null!==e.option?t.option=f.voteOptionFromJSON(e.option):t.option=0,t},toJSON:function(e){var t={};return void 0!==e.proposalId&&(t.proposalId=(e.proposalId||s.default.UZERO).toString()),void 0!==e.voter&&(t.voter=e.voter),void 0!==e.option&&(t.option=f.voteOptionToJSON(e.option)),t},fromPartial:function(e){var t=Object.assign({},b);return void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=e.proposalId:t.proposalId=s.default.UZERO,void 0!==e.voter&&null!==e.voter?t.voter=e.voter:t.voter="",void 0!==e.option&&null!==e.option?t.option=e.option:t.option=0,t}};var h={};t.MsgVoteResponse={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,a=Object.assign({},h);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();e.proposalId.isZero()||t.uint32(8).uint64(e.proposalId),""!==e.voter&&t.uint32(18).string(e.voter);var n,r=i(e.options);try{for(r.s();!(n=r.n()).done;){var a=n.value;f.WeightedVoteOption.encode(a,t.uint32(26).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return 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,a=Object.assign({},y);for(a.options=[];n.pos>>3){case 1:a.proposalId=n.uint64();break;case 2:a.voter=n.string();break;case 3:a.options.push(f.WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);if(t.options=[],void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=s.default.fromString(e.proposalId):t.proposalId=s.default.UZERO,void 0!==e.voter&&null!==e.voter?t.voter=String(e.voter):t.voter="",void 0!==e.options&&null!==e.options){var n,r=i(e.options);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.options.push(f.WeightedVoteOption.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return t},toJSON:function(e){var t={};return void 0!==e.proposalId&&(t.proposalId=(e.proposalId||s.default.UZERO).toString()),void 0!==e.voter&&(t.voter=e.voter),e.options?t.options=e.options.map((function(e){return e?f.WeightedVoteOption.toJSON(e):void 0})):t.options=[],t},fromPartial:function(e){var t=Object.assign({},y);if(t.options=[],void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=e.proposalId:t.proposalId=s.default.UZERO,void 0!==e.voter&&null!==e.voter?t.voter=e.voter:t.voter="",void 0!==e.options&&null!==e.options){var n,r=i(e.options);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.options.push(f.WeightedVoteOption.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return t}};var m={};t.MsgVoteWeightedResponse={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,a=Object.assign({},m);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();e.proposalId.isZero()||t.uint32(8).uint64(e.proposalId),""!==e.depositor&&t.uint32(18).string(e.depositor);var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;d.Coin.encode(a,t.uint32(26).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return 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,a=Object.assign({},v);for(a.amount=[];n.pos>>3){case 1:a.proposalId=n.uint64();break;case 2:a.depositor=n.string();break;case 3:a.amount.push(d.Coin.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);if(t.amount=[],void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=s.default.fromString(e.proposalId):t.proposalId=s.default.UZERO,void 0!==e.depositor&&null!==e.depositor?t.depositor=String(e.depositor):t.depositor="",void 0!==e.amount&&null!==e.amount){var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.amount.push(d.Coin.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return t},toJSON:function(e){var t={};return void 0!==e.proposalId&&(t.proposalId=(e.proposalId||s.default.UZERO).toString()),void 0!==e.depositor&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map((function(e){return e?d.Coin.toJSON(e):void 0})):t.amount=[],t},fromPartial:function(e){var t=Object.assign({},v);if(t.amount=[],void 0!==e.proposalId&&null!==e.proposalId?t.proposalId=e.proposalId:t.proposalId=s.default.UZERO,void 0!==e.depositor&&null!==e.depositor?t.depositor=e.depositor:t.depositor="",void 0!==e.amount&&null!==e.amount){var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.amount.push(d.Coin.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return t}};var g={};t.MsgDepositResponse={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,a=Object.assign({},g);n.pos1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.name&&t.uint32(10).string(e.name),void 0!==e.time&&s.Timestamp.encode(l(e.time),t.uint32(18).fork()).ldelim(),e.height.isZero()||t.uint32(24).int64(e.height),""!==e.info&&t.uint32(34).string(e.info),void 0!==e.upgradedClientState&&o.Any.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),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,a=Object.assign({},u);n.pos>>3){case 1:a.name=n.string();break;case 2:a.time=p(s.Timestamp.decode(n,n.uint32()));break;case 3:a.height=n.int64();break;case 4:a.info=n.string();break;case 5:a.upgradedClientState=o.Any.decode(n,n.uint32());break;default:n.skipType(7&c)}}return a},fromJSON:function(e){var t,n=Object.assign({},u);return void 0!==e.name&&null!==e.name?n.name=String(e.name):n.name="",void 0!==e.time&&null!==e.time?n.time=(t=e.time)instanceof Date?t:"string"===typeof t?new Date(t):p(s.Timestamp.fromJSON(t)):n.time=void 0,void 0!==e.height&&null!==e.height?n.height=a.default.fromString(e.height):n.height=a.default.ZERO,void 0!==e.info&&null!==e.info?n.info=String(e.info):n.info="",void 0!==e.upgradedClientState&&null!==e.upgradedClientState?n.upgradedClientState=o.Any.fromJSON(e.upgradedClientState):n.upgradedClientState=void 0,n},toJSON:function(e){var t={};return void 0!==e.name&&(t.name=e.name),void 0!==e.time&&(t.time=e.time.toISOString()),void 0!==e.height&&(t.height=(e.height||a.default.ZERO).toString()),void 0!==e.info&&(t.info=e.info),void 0!==e.upgradedClientState&&(t.upgradedClientState=e.upgradedClientState?o.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.name&&null!==e.name?t.name=e.name:t.name="",void 0!==e.time&&null!==e.time?t.time=e.time:t.time=void 0,void 0!==e.height&&null!==e.height?t.height=e.height:t.height=a.default.ZERO,void 0!==e.info&&null!==e.info?t.info=e.info:t.info="",void 0!==e.upgradedClientState&&null!==e.upgradedClientState?t.upgradedClientState=o.Any.fromPartial(e.upgradedClientState):t.upgradedClientState=void 0,t}};var c={title:"",description:""};t.SoftwareUpgradeProposal={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.title&&n.uint32(10).string(e.title),""!==e.description&&n.uint32(18).string(e.description),void 0!==e.plan&&t.Plan.encode(e.plan,n.uint32(26).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof i.default.Reader?e:new i.default.Reader(e),a=void 0===n?r.len:r.pos+n,o=Object.assign({},c);r.pos>>3){case 1:o.title=r.string();break;case 2:o.description=r.string();break;case 3:o.plan=t.Plan.decode(r,r.uint32());break;default:r.skipType(7&s)}}return o},fromJSON:function(e){var n=Object.assign({},c);return void 0!==e.title&&null!==e.title?n.title=String(e.title):n.title="",void 0!==e.description&&null!==e.description?n.description=String(e.description):n.description="",void 0!==e.plan&&null!==e.plan?n.plan=t.Plan.fromJSON(e.plan):n.plan=void 0,n},toJSON:function(e){var n={};return void 0!==e.title&&(n.title=e.title),void 0!==e.description&&(n.description=e.description),void 0!==e.plan&&(n.plan=e.plan?t.Plan.toJSON(e.plan):void 0),n},fromPartial:function(e){var n=Object.assign({},c);return void 0!==e.title&&null!==e.title?n.title=e.title:n.title="",void 0!==e.description&&null!==e.description?n.description=e.description:n.description="",void 0!==e.plan&&null!==e.plan?n.plan=t.Plan.fromPartial(e.plan):n.plan=void 0,n}};var f={title:"",description:""};t.CancelSoftwareUpgradeProposal={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.title&&t.uint32(10).string(e.title),""!==e.description&&t.uint32(18).string(e.description),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,a=Object.assign({},f);n.pos>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(7&o)}}return a},fromJSON:function(e){var t=Object.assign({},f);return void 0!==e.title&&null!==e.title?t.title=String(e.title):t.title="",void 0!==e.description&&null!==e.description?t.description=String(e.description):t.description="",t},toJSON:function(e){var t={};return void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.title&&null!==e.title?t.title=e.title:t.title="",void 0!==e.description&&null!==e.description?t.description=e.description:t.description="",t}};var d={name:"",version:a.default.UZERO};function l(e){var t;return{seconds:(t=e.getTime()/1e3,a.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function p(e){var t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}t.ModuleVersion={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.name&&t.uint32(10).string(e.name),e.version.isZero()||t.uint32(16).uint64(e.version),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,a=Object.assign({},d);n.pos>>3){case 1:a.name=n.string();break;case 2:a.version=n.uint64();break;default:n.skipType(7&o)}}return a},fromJSON:function(e){var t=Object.assign({},d);return void 0!==e.name&&null!==e.name?t.name=String(e.name):t.name="",void 0!==e.version&&null!==e.version?t.version=a.default.fromString(e.version):t.version=a.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.name&&(t.name=e.name),void 0!==e.version&&(t.version=(e.version||a.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},d);return void 0!==e.name&&null!==e.name?t.name=e.name:t.name="",void 0!==e.version&&null!==e.version?t.version=e.version:t.version=a.default.UZERO,t}},i.default.util.Long!==a.default&&(i.default.util.Long=a.default,i.default.configure())},,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;var s=n(23),u=n(75),c=n(115),f=n(164),d=o(n(24)),l=function(e){function t(t,n,r,a,i,o,s,u,c,f,d){var l=e.call(this)||this;return l.operator_address=t,l.consensus_pubkey=n,l.jailed=r,l.status=a,l.tokens=i,l.delegator_shares=o,l.description=s,l.unbonding_height=u,l.unbonding_time=c,l.commission=f,l.min_self_delegation=d,l}return r(t,e),t.prototype.toAmino=function(){return{operator_address:this.operator_address,consensus_pubkey:this.consensus_pubkey.toAmino(),jailed:this.jailed,status:this.status,tokens:this.tokens.toString(),delegator_shares:this.delegator_shares.toString(),description:this.description,unbonding_height:this.unbonding_height.toFixed(),unbonding_time:this.unbonding_time.toISOString(),commission:this.commission.toAmino(),min_self_delegation:this.min_self_delegation.toString()}},t.fromAmino=function(e){return new t(e.operator_address,c.ValConsPublicKey.fromAmino(e.consensus_pubkey),e.jailed||!1,e.status||0,new u.Int(e.tokens),new u.Dec(e.delegator_shares),t.Description.fromAmino(e.description),Number.parseInt(e.unbonding_height),new Date(e.unbonding_time),t.Commission.fromAmino(e.commission),new u.Int(e.min_self_delegation))},t.prototype.toData=function(){return{operator_address:this.operator_address,consensus_pubkey:this.consensus_pubkey.toData(),jailed:this.jailed,status:this.status,tokens:this.tokens.toString(),delegator_shares:this.delegator_shares.toString(),description:this.description,unbonding_height:this.unbonding_height.toFixed(),unbonding_time:this.unbonding_time.toISOString(),commission:this.commission.toData(),min_self_delegation:this.min_self_delegation.toString()}},t.fromData=function(e){return new t(e.operator_address,c.ValConsPublicKey.fromData(e.consensus_pubkey),e.jailed||!1,e.status||0,new u.Int(e.tokens),new u.Dec(e.delegator_shares),t.Description.fromData(e.description),Number.parseInt(e.unbonding_height),new Date(e.unbonding_time),t.Commission.fromData(e.commission),new u.Int(e.min_self_delegation))},t.prototype.toProto=function(){var e=this,t=e.operator_address,n=e.consensus_pubkey,r=e.jailed,a=e.status,i=e.tokens,o=e.delegator_shares,s=e.description,u=e.unbonding_height,c=e.unbonding_time,l=e.commission,p=e.min_self_delegation;return f.Validator.fromPartial({commission:l.toProto(),consensusPubkey:n.packAny(),delegatorShares:o.toString(),description:s.toProto(),jailed:r,minSelfDelegation:p.toString(),operatorAddress:t,status:a,tokens:i.toString(),unbondingHeight:d.fromNumber(u),unbondingTime:c})},t.fromProto=function(e){return new t(e.operatorAddress,c.ValConsPublicKey.unpackAny(e.consensusPubkey),e.jailed,e.status,new u.Int(e.tokens),new u.Dec(e.delegatorShares),t.Description.fromProto(e.description),e.unbondingHeight.toNumber(),e.unbondingTime,t.Commission.fromProto(e.commission),new u.Int(e.minSelfDelegation))},t}(s.JSONSerializable);t.Validator=l,function(e){e.Status=f.BondStatus;var t=function(e){function t(t,n,r,a,i){var o=e.call(this)||this;return o.moniker=t,o.identity=n,o.website=r,o.details=a,o.security_contact=i,o}return r(t,e),t.prototype.toAmino=function(){return{moniker:this.moniker,identity:this.identity,website:this.website,details:this.details,security_contact:this.security_contact}},t.fromAmino=function(e){return new t(e.moniker,e.identity||"",e.website||"",e.details||"",e.security_contact||"")},t.prototype.toData=function(){return{moniker:this.moniker,identity:this.identity,website:this.website,details:this.details,security_contact:this.security_contact}},t.fromData=function(e){return new t(e.moniker,e.identity||"",e.website||"",e.details||"",e.security_contact||"")},t.prototype.toProto=function(){var e=this,t=e.moniker,n=e.identity,r=e.website,a=e.details,i=e.security_contact;return f.Description.fromPartial({details:a,identity:n,moniker:t,securityContact:i,website:r})},t.fromProto=function(e){return new t(e.moniker,e.identity,e.website,e.details,e.securityContact)},t}(s.JSONSerializable);e.Description=t;var n=function(e){function t(t,n,r){var a=e.call(this)||this;return a.rate=t,a.max_rate=n,a.max_change_rate=r,a}return r(t,e),t.fromAmino=function(e){var n=e.rate,r=e.max_rate,a=e.max_change_rate;return new t(new u.Dec(n),new u.Dec(r),new u.Dec(a))},t.prototype.toAmino=function(){var e=this,t=e.rate,n=e.max_rate,r=e.max_change_rate;return{rate:t.toString(),max_rate:n.toString(),max_change_rate:r.toString()}},t.fromData=function(e){var n=e.rate,r=e.max_rate,a=e.max_change_rate;return new t(new u.Dec(n),new u.Dec(r),new u.Dec(a))},t.prototype.toData=function(){var e=this,t=e.rate,n=e.max_rate,r=e.max_change_rate;return{rate:t.toString(),max_rate:n.toString(),max_change_rate:r.toString()}},t.fromProto=function(e){return new t(new u.Dec(e.rate),new u.Dec(e.maxRate),new u.Dec(e.maxChangeRate))},t.prototype.toProto=function(){var e=this,t=e.rate,n=e.max_rate,r=e.max_change_rate;return f.CommissionRates.fromPartial({maxChangeRate:r.toString(),maxRate:n.toString(),rate:t.toString()})},t}(s.JSONSerializable);e.CommissionRates=n;var a=function(e){function t(t,n){var r=e.call(this)||this;return r.commission_rates=t,r.update_time=n,r}return r(t,e),t.prototype.toAmino=function(){return{commission_rates:this.commission_rates.toAmino(),update_time:this.update_time.toISOString()}},t.fromAmino=function(e){return new t(n.fromAmino(e.commission_rates),new Date(e.update_time))},t.prototype.toData=function(){return{commission_rates:this.commission_rates.toData(),update_time:this.update_time.toISOString()}},t.fromData=function(e){return new t(n.fromData(e.commission_rates),new Date(e.update_time))},t.prototype.toProto=function(){var e=this.commission_rates,t=this.update_time;return f.Commission.fromPartial({commissionRates:e.toProto(),updateTime:t})},t.fromProto=function(e){return new t(n.fromProto(e.commissionRates),e.updateTime)},t}(s.JSONSerializable);e.Commission=a}(l=t.Validator||(t.Validator={})),t.Validator=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.sha256=t.hashToHex=void 0;var r=n(313),a=n(534),i=n(535),o=n(320);t.hashToHex=function(e){return r.SHA256.hash(i.Base64.parse(e)).toString().toUpperCase()},t.sha256=function(e){return r.SHA256.hash(new o.Word32Array(e)).toUint8Array()},t.ripemd160=function(e){return a.RIPEMD160.hash(new o.Word32Array(e)).toUint8Array()}},function(e,t,n){"use strict";(function(e){var r=n(33).default,a=n(59).default,i=n(63).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgSubmitMisbehaviourResponse=t.MsgSubmitMisbehaviour=t.MsgUpgradeClientResponse=t.MsgUpgradeClient=t.MsgUpdateClientResponse=t.MsgUpdateClient=t.MsgCreateClientResponse=t.MsgCreateClient=t.protobufPackage=void 0;var s=o(n(24)),u=o(n(20)),c=n(25);t.protobufPackage="ibc.core.client.v1";var f={signer:""};t.MsgCreateClient={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.clientState&&c.Any.encode(e.clientState,t.uint32(10).fork()).ldelim(),void 0!==e.consensusState&&c.Any.encode(e.consensusState,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,a=Object.assign({},f);n.pos>>3){case 1:a.clientState=c.Any.decode(n,n.uint32());break;case 2:a.consensusState=c.Any.decode(n,n.uint32());break;case 3:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);return void 0!==e.clientState&&null!==e.clientState?t.clientState=c.Any.fromJSON(e.clientState):t.clientState=void 0,void 0!==e.consensusState&&null!==e.consensusState?t.consensusState=c.Any.fromJSON(e.consensusState):t.consensusState=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.clientState&&(t.clientState=e.clientState?c.Any.toJSON(e.clientState):void 0),void 0!==e.consensusState&&(t.consensusState=e.consensusState?c.Any.toJSON(e.consensusState):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.clientState&&null!==e.clientState?t.clientState=c.Any.fromPartial(e.clientState):t.clientState=void 0,void 0!==e.consensusState&&null!==e.consensusState?t.consensusState=c.Any.fromPartial(e.consensusState):t.consensusState=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var d={};t.MsgCreateClientResponse={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,a=Object.assign({},d);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.clientId&&t.uint32(10).string(e.clientId),void 0!==e.header&&c.Any.encode(e.header,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,a=Object.assign({},l);n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.header=c.Any.decode(n,n.uint32());break;case 3:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.header&&null!==e.header?t.header=c.Any.fromJSON(e.header):t.header=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.clientId&&(t.clientId=e.clientId),void 0!==e.header&&(t.header=e.header?c.Any.toJSON(e.header):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.header&&null!==e.header?t.header=c.Any.fromPartial(e.header):t.header=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var p={};t.MsgUpdateClientResponse={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,a=Object.assign({},p);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.clientId&&t.uint32(10).string(e.clientId),void 0!==e.clientState&&c.Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),void 0!==e.consensusState&&c.Any.encode(e.consensusState,t.uint32(26).fork()).ldelim(),0!==e.proofUpgradeClient.length&&t.uint32(34).bytes(e.proofUpgradeClient),0!==e.proofUpgradeConsensusState.length&&t.uint32(42).bytes(e.proofUpgradeConsensusState),""!==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,a=Object.assign({},b);for(a.proofUpgradeClient=new Uint8Array,a.proofUpgradeConsensusState=new Uint8Array;n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.clientState=c.Any.decode(n,n.uint32());break;case 3:a.consensusState=c.Any.decode(n,n.uint32());break;case 4:a.proofUpgradeClient=n.bytes();break;case 5:a.proofUpgradeConsensusState=n.bytes();break;case 6:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);return t.proofUpgradeClient=new Uint8Array,t.proofUpgradeConsensusState=new Uint8Array,void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.clientState&&null!==e.clientState?t.clientState=c.Any.fromJSON(e.clientState):t.clientState=void 0,void 0!==e.consensusState&&null!==e.consensusState?t.consensusState=c.Any.fromJSON(e.consensusState):t.consensusState=void 0,void 0!==e.proofUpgradeClient&&null!==e.proofUpgradeClient&&(t.proofUpgradeClient=T(e.proofUpgradeClient)),void 0!==e.proofUpgradeConsensusState&&null!==e.proofUpgradeConsensusState&&(t.proofUpgradeConsensusState=T(e.proofUpgradeConsensusState)),void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.clientState&&(t.clientState=e.clientState?c.Any.toJSON(e.clientState):void 0),void 0!==e.consensusState&&(t.consensusState=e.consensusState?c.Any.toJSON(e.consensusState):void 0),void 0!==e.proofUpgradeClient&&(t.proofUpgradeClient=_(void 0!==e.proofUpgradeClient?e.proofUpgradeClient:new Uint8Array)),void 0!==e.proofUpgradeConsensusState&&(t.proofUpgradeConsensusState=_(void 0!==e.proofUpgradeConsensusState?e.proofUpgradeConsensusState:new Uint8Array)),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},b);return void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.clientState&&null!==e.clientState?t.clientState=c.Any.fromPartial(e.clientState):t.clientState=void 0,void 0!==e.consensusState&&null!==e.consensusState?t.consensusState=c.Any.fromPartial(e.consensusState):t.consensusState=void 0,void 0!==e.proofUpgradeClient&&null!==e.proofUpgradeClient?t.proofUpgradeClient=e.proofUpgradeClient:t.proofUpgradeClient=new Uint8Array,void 0!==e.proofUpgradeConsensusState&&null!==e.proofUpgradeConsensusState?t.proofUpgradeConsensusState=e.proofUpgradeConsensusState:t.proofUpgradeConsensusState=new Uint8Array,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var h={};t.MsgUpgradeClientResponse={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,a=Object.assign({},h);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.clientId&&t.uint32(10).string(e.clientId),void 0!==e.misbehaviour&&c.Any.encode(e.misbehaviour,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,a=Object.assign({},y);n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.misbehaviour=c.Any.decode(n,n.uint32());break;case 3:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);return void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.misbehaviour&&null!==e.misbehaviour?t.misbehaviour=c.Any.fromJSON(e.misbehaviour):t.misbehaviour=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.clientId&&(t.clientId=e.clientId),void 0!==e.misbehaviour&&(t.misbehaviour=e.misbehaviour?c.Any.toJSON(e.misbehaviour):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},y);return void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.misbehaviour&&null!==e.misbehaviour?t.misbehaviour=c.Any.fromPartial(e.misbehaviour):t.misbehaviour=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var m={};t.MsgSubmitMisbehaviourResponse={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,a=Object.assign({},m);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.clientId&&t.uint32(10).string(e.clientId),void 0!==e.counterparty&&c.Counterparty.encode(e.counterparty,t.uint32(18).fork()).ldelim(),void 0!==e.version&&c.Version.encode(e.version,t.uint32(26).fork()).ldelim(),e.delayPeriod.isZero()||t.uint32(32).uint64(e.delayPeriod),""!==e.signer&&t.uint32(42).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,a=Object.assign({},l);n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.counterparty=c.Counterparty.decode(n,n.uint32());break;case 3:a.version=c.Version.decode(n,n.uint32());break;case 4:a.delayPeriod=n.uint64();break;case 5:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.counterparty&&null!==e.counterparty?t.counterparty=c.Counterparty.fromJSON(e.counterparty):t.counterparty=void 0,void 0!==e.version&&null!==e.version?t.version=c.Version.fromJSON(e.version):t.version=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?t.delayPeriod=s.default.fromString(e.delayPeriod):t.delayPeriod=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.clientId&&(t.clientId=e.clientId),void 0!==e.counterparty&&(t.counterparty=e.counterparty?c.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.version&&(t.version=e.version?c.Version.toJSON(e.version):void 0),void 0!==e.delayPeriod&&(t.delayPeriod=(e.delayPeriod||s.default.UZERO).toString()),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.counterparty&&null!==e.counterparty?t.counterparty=c.Counterparty.fromPartial(e.counterparty):t.counterparty=void 0,void 0!==e.version&&null!==e.version?t.version=c.Version.fromPartial(e.version):t.version=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?t.delayPeriod=e.delayPeriod:t.delayPeriod=s.default.UZERO,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var p={};t.MsgConnectionOpenInitResponse={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,a=Object.assign({},p);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();""!==e.clientId&&t.uint32(10).string(e.clientId),""!==e.previousConnectionId&&t.uint32(18).string(e.previousConnectionId),void 0!==e.clientState&&f.Any.encode(e.clientState,t.uint32(26).fork()).ldelim(),void 0!==e.counterparty&&c.Counterparty.encode(e.counterparty,t.uint32(34).fork()).ldelim(),e.delayPeriod.isZero()||t.uint32(40).uint64(e.delayPeriod);var n,r=i(e.counterpartyVersions);try{for(r.s();!(n=r.n()).done;){var a=n.value;c.Version.encode(a,t.uint32(50).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return void 0!==e.proofHeight&&d.Height.encode(e.proofHeight,t.uint32(58).fork()).ldelim(),0!==e.proofInit.length&&t.uint32(66).bytes(e.proofInit),0!==e.proofClient.length&&t.uint32(74).bytes(e.proofClient),0!==e.proofConsensus.length&&t.uint32(82).bytes(e.proofConsensus),void 0!==e.consensusHeight&&d.Height.encode(e.consensusHeight,t.uint32(90).fork()).ldelim(),""!==e.signer&&t.uint32(98).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,a=Object.assign({},b);for(a.counterpartyVersions=[],a.proofInit=new Uint8Array,a.proofClient=new Uint8Array,a.proofConsensus=new Uint8Array;n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.previousConnectionId=n.string();break;case 3:a.clientState=f.Any.decode(n,n.uint32());break;case 4:a.counterparty=c.Counterparty.decode(n,n.uint32());break;case 5:a.delayPeriod=n.uint64();break;case 6:a.counterpartyVersions.push(c.Version.decode(n,n.uint32()));break;case 7:a.proofHeight=d.Height.decode(n,n.uint32());break;case 8:a.proofInit=n.bytes();break;case 9:a.proofClient=n.bytes();break;case 10:a.proofConsensus=n.bytes();break;case 11:a.consensusHeight=d.Height.decode(n,n.uint32());break;case 12:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);if(t.counterpartyVersions=[],t.proofInit=new Uint8Array,t.proofClient=new Uint8Array,t.proofConsensus=new Uint8Array,void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.previousConnectionId&&null!==e.previousConnectionId?t.previousConnectionId=String(e.previousConnectionId):t.previousConnectionId="",void 0!==e.clientState&&null!==e.clientState?t.clientState=f.Any.fromJSON(e.clientState):t.clientState=void 0,void 0!==e.counterparty&&null!==e.counterparty?t.counterparty=c.Counterparty.fromJSON(e.counterparty):t.counterparty=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?t.delayPeriod=s.default.fromString(e.delayPeriod):t.delayPeriod=s.default.UZERO,void 0!==e.counterpartyVersions&&null!==e.counterpartyVersions){var n,r=i(e.counterpartyVersions);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.counterpartyVersions.push(c.Version.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=d.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.proofInit&&null!==e.proofInit&&(t.proofInit=_(e.proofInit)),void 0!==e.proofClient&&null!==e.proofClient&&(t.proofClient=_(e.proofClient)),void 0!==e.proofConsensus&&null!==e.proofConsensus&&(t.proofConsensus=_(e.proofConsensus)),void 0!==e.consensusHeight&&null!==e.consensusHeight?t.consensusHeight=d.Height.fromJSON(e.consensusHeight):t.consensusHeight=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.clientId&&(t.clientId=e.clientId),void 0!==e.previousConnectionId&&(t.previousConnectionId=e.previousConnectionId),void 0!==e.clientState&&(t.clientState=e.clientState?f.Any.toJSON(e.clientState):void 0),void 0!==e.counterparty&&(t.counterparty=e.counterparty?c.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.delayPeriod&&(t.delayPeriod=(e.delayPeriod||s.default.UZERO).toString()),e.counterpartyVersions?t.counterpartyVersions=e.counterpartyVersions.map((function(e){return e?c.Version.toJSON(e):void 0})):t.counterpartyVersions=[],void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?d.Height.toJSON(e.proofHeight):void 0),void 0!==e.proofInit&&(t.proofInit=S(void 0!==e.proofInit?e.proofInit:new Uint8Array)),void 0!==e.proofClient&&(t.proofClient=S(void 0!==e.proofClient?e.proofClient:new Uint8Array)),void 0!==e.proofConsensus&&(t.proofConsensus=S(void 0!==e.proofConsensus?e.proofConsensus:new Uint8Array)),void 0!==e.consensusHeight&&(t.consensusHeight=e.consensusHeight?d.Height.toJSON(e.consensusHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},b);if(t.counterpartyVersions=[],void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.previousConnectionId&&null!==e.previousConnectionId?t.previousConnectionId=e.previousConnectionId:t.previousConnectionId="",void 0!==e.clientState&&null!==e.clientState?t.clientState=f.Any.fromPartial(e.clientState):t.clientState=void 0,void 0!==e.counterparty&&null!==e.counterparty?t.counterparty=c.Counterparty.fromPartial(e.counterparty):t.counterparty=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?t.delayPeriod=e.delayPeriod:t.delayPeriod=s.default.UZERO,void 0!==e.counterpartyVersions&&null!==e.counterpartyVersions){var n,r=i(e.counterpartyVersions);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.counterpartyVersions.push(c.Version.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=d.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.proofInit&&null!==e.proofInit?t.proofInit=e.proofInit:t.proofInit=new Uint8Array,void 0!==e.proofClient&&null!==e.proofClient?t.proofClient=e.proofClient:t.proofClient=new Uint8Array,void 0!==e.proofConsensus&&null!==e.proofConsensus?t.proofConsensus=e.proofConsensus:t.proofConsensus=new Uint8Array,void 0!==e.consensusHeight&&null!==e.consensusHeight?t.consensusHeight=d.Height.fromPartial(e.consensusHeight):t.consensusHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var h={};t.MsgConnectionOpenTryResponse={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,a=Object.assign({},h);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.connectionId&&t.uint32(10).string(e.connectionId),""!==e.counterpartyConnectionId&&t.uint32(18).string(e.counterpartyConnectionId),void 0!==e.version&&c.Version.encode(e.version,t.uint32(26).fork()).ldelim(),void 0!==e.clientState&&f.Any.encode(e.clientState,t.uint32(34).fork()).ldelim(),void 0!==e.proofHeight&&d.Height.encode(e.proofHeight,t.uint32(42).fork()).ldelim(),0!==e.proofTry.length&&t.uint32(50).bytes(e.proofTry),0!==e.proofClient.length&&t.uint32(58).bytes(e.proofClient),0!==e.proofConsensus.length&&t.uint32(66).bytes(e.proofConsensus),void 0!==e.consensusHeight&&d.Height.encode(e.consensusHeight,t.uint32(74).fork()).ldelim(),""!==e.signer&&t.uint32(82).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,a=Object.assign({},y);for(a.proofTry=new Uint8Array,a.proofClient=new Uint8Array,a.proofConsensus=new Uint8Array;n.pos>>3){case 1:a.connectionId=n.string();break;case 2:a.counterpartyConnectionId=n.string();break;case 3:a.version=c.Version.decode(n,n.uint32());break;case 4:a.clientState=f.Any.decode(n,n.uint32());break;case 5:a.proofHeight=d.Height.decode(n,n.uint32());break;case 6:a.proofTry=n.bytes();break;case 7:a.proofClient=n.bytes();break;case 8:a.proofConsensus=n.bytes();break;case 9:a.consensusHeight=d.Height.decode(n,n.uint32());break;case 10:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);return t.proofTry=new Uint8Array,t.proofClient=new Uint8Array,t.proofConsensus=new Uint8Array,void 0!==e.connectionId&&null!==e.connectionId?t.connectionId=String(e.connectionId):t.connectionId="",void 0!==e.counterpartyConnectionId&&null!==e.counterpartyConnectionId?t.counterpartyConnectionId=String(e.counterpartyConnectionId):t.counterpartyConnectionId="",void 0!==e.version&&null!==e.version?t.version=c.Version.fromJSON(e.version):t.version=void 0,void 0!==e.clientState&&null!==e.clientState?t.clientState=f.Any.fromJSON(e.clientState):t.clientState=void 0,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=d.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.proofTry&&null!==e.proofTry&&(t.proofTry=_(e.proofTry)),void 0!==e.proofClient&&null!==e.proofClient&&(t.proofClient=_(e.proofClient)),void 0!==e.proofConsensus&&null!==e.proofConsensus&&(t.proofConsensus=_(e.proofConsensus)),void 0!==e.consensusHeight&&null!==e.consensusHeight?t.consensusHeight=d.Height.fromJSON(e.consensusHeight):t.consensusHeight=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.connectionId&&(t.connectionId=e.connectionId),void 0!==e.counterpartyConnectionId&&(t.counterpartyConnectionId=e.counterpartyConnectionId),void 0!==e.version&&(t.version=e.version?c.Version.toJSON(e.version):void 0),void 0!==e.clientState&&(t.clientState=e.clientState?f.Any.toJSON(e.clientState):void 0),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?d.Height.toJSON(e.proofHeight):void 0),void 0!==e.proofTry&&(t.proofTry=S(void 0!==e.proofTry?e.proofTry:new Uint8Array)),void 0!==e.proofClient&&(t.proofClient=S(void 0!==e.proofClient?e.proofClient:new Uint8Array)),void 0!==e.proofConsensus&&(t.proofConsensus=S(void 0!==e.proofConsensus?e.proofConsensus:new Uint8Array)),void 0!==e.consensusHeight&&(t.consensusHeight=e.consensusHeight?d.Height.toJSON(e.consensusHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},y);return void 0!==e.connectionId&&null!==e.connectionId?t.connectionId=e.connectionId:t.connectionId="",void 0!==e.counterpartyConnectionId&&null!==e.counterpartyConnectionId?t.counterpartyConnectionId=e.counterpartyConnectionId:t.counterpartyConnectionId="",void 0!==e.version&&null!==e.version?t.version=c.Version.fromPartial(e.version):t.version=void 0,void 0!==e.clientState&&null!==e.clientState?t.clientState=f.Any.fromPartial(e.clientState):t.clientState=void 0,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=d.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.proofTry&&null!==e.proofTry?t.proofTry=e.proofTry:t.proofTry=new Uint8Array,void 0!==e.proofClient&&null!==e.proofClient?t.proofClient=e.proofClient:t.proofClient=new Uint8Array,void 0!==e.proofConsensus&&null!==e.proofConsensus?t.proofConsensus=e.proofConsensus:t.proofConsensus=new Uint8Array,void 0!==e.consensusHeight&&null!==e.consensusHeight?t.consensusHeight=d.Height.fromPartial(e.consensusHeight):t.consensusHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var m={};t.MsgConnectionOpenAckResponse={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,a=Object.assign({},m);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.connectionId&&t.uint32(10).string(e.connectionId),0!==e.proofAck.length&&t.uint32(18).bytes(e.proofAck),void 0!==e.proofHeight&&d.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,a=Object.assign({},v);for(a.proofAck=new Uint8Array;n.pos>>3){case 1:a.connectionId=n.string();break;case 2:a.proofAck=n.bytes();break;case 3:a.proofHeight=d.Height.decode(n,n.uint32());break;case 4:a.signer=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);return t.proofAck=new Uint8Array,void 0!==e.connectionId&&null!==e.connectionId?t.connectionId=String(e.connectionId):t.connectionId="",void 0!==e.proofAck&&null!==e.proofAck&&(t.proofAck=_(e.proofAck)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=d.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.connectionId&&(t.connectionId=e.connectionId),void 0!==e.proofAck&&(t.proofAck=S(void 0!==e.proofAck?e.proofAck:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?d.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.connectionId&&null!==e.connectionId?t.connectionId=e.connectionId:t.connectionId="",void 0!==e.proofAck&&null!==e.proofAck?t.proofAck=e.proofAck:t.proofAck=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=d.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var g={};t.MsgConnectionOpenConfirmResponse={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,a=Object.assign({},g);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();0!==e.state&&n.uint32(8).int32(e.state),0!==e.ordering&&n.uint32(16).int32(e.ordering),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(26).fork()).ldelim();var a,i=r(e.connectionHops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.uint32(34).string(o)}}catch(s){i.e(s)}finally{i.f()}return""!==e.version&&n.uint32(42).string(e.version),n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},b);for(i.connectionHops=[];r.pos>>3){case 1:i.state=r.int32();break;case 2:i.ordering=r.int32();break;case 3:i.counterparty=t.Counterparty.decode(r,r.uint32());break;case 4:i.connectionHops.push(r.string());break;case 5:i.version=r.string();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},b);if(n.connectionHops=[],void 0!==e.state&&null!==e.state?n.state=f(e.state):n.state=0,void 0!==e.ordering&&null!==e.ordering?n.ordering=l(e.ordering):n.ordering=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromJSON(e.counterparty):n.counterparty=void 0,void 0!==e.connectionHops&&null!==e.connectionHops){var a,i=r(e.connectionHops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.connectionHops.push(String(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.version&&null!==e.version?n.version=String(e.version):n.version="",n},toJSON:function(e){var n={};return void 0!==e.state&&(n.state=d(e.state)),void 0!==e.ordering&&(n.ordering=p(e.ordering)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),e.connectionHops?n.connectionHops=e.connectionHops.map((function(e){return e})):n.connectionHops=[],void 0!==e.version&&(n.version=e.version),n},fromPartial:function(e){var n=Object.assign({},b);if(n.connectionHops=[],void 0!==e.state&&null!==e.state?n.state=e.state:n.state=0,void 0!==e.ordering&&null!==e.ordering?n.ordering=e.ordering:n.ordering=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromPartial(e.counterparty):n.counterparty=void 0,void 0!==e.connectionHops&&null!==e.connectionHops){var a,i=r(e.connectionHops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.connectionHops.push(o)}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.version&&null!==e.version?n.version=e.version:n.version="",n}};var h={state:0,ordering:0,connectionHops:"",version:"",portId:"",channelId:""};t.IdentifiedChannel={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();0!==e.state&&n.uint32(8).int32(e.state),0!==e.ordering&&n.uint32(16).int32(e.ordering),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(26).fork()).ldelim();var a,i=r(e.connectionHops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.uint32(34).string(o)}}catch(s){i.e(s)}finally{i.f()}return""!==e.version&&n.uint32(42).string(e.version),""!==e.portId&&n.uint32(50).string(e.portId),""!==e.channelId&&n.uint32(58).string(e.channelId),n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},h);for(i.connectionHops=[];r.pos>>3){case 1:i.state=r.int32();break;case 2:i.ordering=r.int32();break;case 3:i.counterparty=t.Counterparty.decode(r,r.uint32());break;case 4:i.connectionHops.push(r.string());break;case 5:i.version=r.string();break;case 6:i.portId=r.string();break;case 7:i.channelId=r.string();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},h);if(n.connectionHops=[],void 0!==e.state&&null!==e.state?n.state=f(e.state):n.state=0,void 0!==e.ordering&&null!==e.ordering?n.ordering=l(e.ordering):n.ordering=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromJSON(e.counterparty):n.counterparty=void 0,void 0!==e.connectionHops&&null!==e.connectionHops){var a,i=r(e.connectionHops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.connectionHops.push(String(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.version&&null!==e.version?n.version=String(e.version):n.version="",void 0!==e.portId&&null!==e.portId?n.portId=String(e.portId):n.portId="",void 0!==e.channelId&&null!==e.channelId?n.channelId=String(e.channelId):n.channelId="",n},toJSON:function(e){var n={};return void 0!==e.state&&(n.state=d(e.state)),void 0!==e.ordering&&(n.ordering=p(e.ordering)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),e.connectionHops?n.connectionHops=e.connectionHops.map((function(e){return e})):n.connectionHops=[],void 0!==e.version&&(n.version=e.version),void 0!==e.portId&&(n.portId=e.portId),void 0!==e.channelId&&(n.channelId=e.channelId),n},fromPartial:function(e){var n=Object.assign({},h);if(n.connectionHops=[],void 0!==e.state&&null!==e.state?n.state=e.state:n.state=0,void 0!==e.ordering&&null!==e.ordering?n.ordering=e.ordering:n.ordering=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromPartial(e.counterparty):n.counterparty=void 0,void 0!==e.connectionHops&&null!==e.connectionHops){var a,i=r(e.connectionHops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.connectionHops.push(o)}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.version&&null!==e.version?n.version=e.version:n.version="",void 0!==e.portId&&null!==e.portId?n.portId=e.portId:n.portId="",void 0!==e.channelId&&null!==e.channelId?n.channelId=e.channelId:n.channelId="",n}};var y={portId:"",channelId:""};t.Counterparty={encode:function(e){var t=arguments.length>1&&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),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,a=Object.assign({},y);n.pos>>3){case 1:a.portId=n.string();break;case 2:a.channelId=n.string();break;default:n.skipType(7&i)}}return a},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="",t},toJSON:function(e){var t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),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="",t}};var m={sequence:s.default.UZERO,sourcePort:"",sourceChannel:"",destinationPort:"",destinationChannel:"",timeoutTimestamp:s.default.UZERO};t.Packet={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return e.sequence.isZero()||t.uint32(8).uint64(e.sequence),""!==e.sourcePort&&t.uint32(18).string(e.sourcePort),""!==e.sourceChannel&&t.uint32(26).string(e.sourceChannel),""!==e.destinationPort&&t.uint32(34).string(e.destinationPort),""!==e.destinationChannel&&t.uint32(42).string(e.destinationChannel),0!==e.data.length&&t.uint32(50).bytes(e.data),void 0!==e.timeoutHeight&&c.Height.encode(e.timeoutHeight,t.uint32(58).fork()).ldelim(),e.timeoutTimestamp.isZero()||t.uint32(64).uint64(e.timeoutTimestamp),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,a=Object.assign({},m);for(a.data=new Uint8Array;n.pos>>3){case 1:a.sequence=n.uint64();break;case 2:a.sourcePort=n.string();break;case 3:a.sourceChannel=n.string();break;case 4:a.destinationPort=n.string();break;case 5:a.destinationChannel=n.string();break;case 6:a.data=n.bytes();break;case 7:a.timeoutHeight=c.Height.decode(n,n.uint32());break;case 8:a.timeoutTimestamp=n.uint64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},m);return t.data=new Uint8Array,void 0!==e.sequence&&null!==e.sequence?t.sequence=s.default.fromString(e.sequence):t.sequence=s.default.UZERO,void 0!==e.sourcePort&&null!==e.sourcePort?t.sourcePort=String(e.sourcePort):t.sourcePort="",void 0!==e.sourceChannel&&null!==e.sourceChannel?t.sourceChannel=String(e.sourceChannel):t.sourceChannel="",void 0!==e.destinationPort&&null!==e.destinationPort?t.destinationPort=String(e.destinationPort):t.destinationPort="",void 0!==e.destinationChannel&&null!==e.destinationChannel?t.destinationChannel=String(e.destinationChannel):t.destinationChannel="",void 0!==e.data&&null!==e.data&&(t.data=k(e.data)),void 0!==e.timeoutHeight&&null!==e.timeoutHeight?t.timeoutHeight=c.Height.fromJSON(e.timeoutHeight):t.timeoutHeight=void 0,void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?t.timeoutTimestamp=s.default.fromString(e.timeoutTimestamp):t.timeoutTimestamp=s.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.sequence&&(t.sequence=(e.sequence||s.default.UZERO).toString()),void 0!==e.sourcePort&&(t.sourcePort=e.sourcePort),void 0!==e.sourceChannel&&(t.sourceChannel=e.sourceChannel),void 0!==e.destinationPort&&(t.destinationPort=e.destinationPort),void 0!==e.destinationChannel&&(t.destinationChannel=e.destinationChannel),void 0!==e.data&&(t.data=O(void 0!==e.data?e.data:new Uint8Array)),void 0!==e.timeoutHeight&&(t.timeoutHeight=e.timeoutHeight?c.Height.toJSON(e.timeoutHeight):void 0),void 0!==e.timeoutTimestamp&&(t.timeoutTimestamp=(e.timeoutTimestamp||s.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},m);return void 0!==e.sequence&&null!==e.sequence?t.sequence=e.sequence:t.sequence=s.default.UZERO,void 0!==e.sourcePort&&null!==e.sourcePort?t.sourcePort=e.sourcePort:t.sourcePort="",void 0!==e.sourceChannel&&null!==e.sourceChannel?t.sourceChannel=e.sourceChannel:t.sourceChannel="",void 0!==e.destinationPort&&null!==e.destinationPort?t.destinationPort=e.destinationPort:t.destinationPort="",void 0!==e.destinationChannel&&null!==e.destinationChannel?t.destinationChannel=e.destinationChannel:t.destinationChannel="",void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,void 0!==e.timeoutHeight&&null!==e.timeoutHeight?t.timeoutHeight=c.Height.fromPartial(e.timeoutHeight):t.timeoutHeight=void 0,void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?t.timeoutTimestamp=e.timeoutTimestamp:t.timeoutTimestamp=s.default.UZERO,t}};var v={portId:"",channelId:"",sequence:s.default.UZERO};t.PacketState={encode:function(e){var t=arguments.length>1&&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.sequence.isZero()||t.uint32(24).uint64(e.sequence),0!==e.data.length&&t.uint32(34).bytes(e.data),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,a=Object.assign({},v);for(a.data=new Uint8Array;n.pos>>3){case 1:a.portId=n.string();break;case 2:a.channelId=n.string();break;case 3:a.sequence=n.uint64();break;case 4:a.data=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);return t.data=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.sequence&&null!==e.sequence?t.sequence=s.default.fromString(e.sequence):t.sequence=s.default.UZERO,void 0!==e.data&&null!==e.data&&(t.data=k(e.data)),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.sequence&&(t.sequence=(e.sequence||s.default.UZERO).toString()),void 0!==e.data&&(t.data=O(void 0!==e.data?e.data:new Uint8Array)),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.sequence&&null!==e.sequence?t.sequence=e.sequence:t.sequence=s.default.UZERO,void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,t}};var g={};t.Acknowledgement={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.result&&t.uint32(170).bytes(e.result),void 0!==e.error&&t.uint32(178).string(e.error),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,a=Object.assign({},g);n.pos>>3){case 21:a.result=n.bytes();break;case 22:a.error=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},g);return void 0!==e.result&&null!==e.result&&(t.result=k(e.result)),void 0!==e.error&&null!==e.error?t.error=String(e.error):t.error=void 0,t},toJSON:function(e){var t={};return void 0!==e.result&&(t.result=void 0!==e.result?O(e.result):void 0),void 0!==e.error&&(t.error=e.error),t},fromPartial:function(e){var t=Object.assign({},g);return void 0!==e.result&&null!==e.result?t.result=e.result:t.result=void 0,void 0!==e.error&&null!==e.error?t.error=e.error:t.error=void 0,t}};var w=function(){if("undefined"!==typeof w)return w;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),T=w.atob||function(e){return w.Buffer.from(e,"base64").toString("binary")};function k(e){for(var t=T(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==e.body&&t.TxBody.encode(e.body,n.uint32(10).fork()).ldelim(),void 0!==e.authInfo&&t.AuthInfo.encode(e.authInfo,n.uint32(18).fork()).ldelim();var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var s=a.value;n.uint32(26).bytes(s)}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},d);for(i.signatures=[];r.pos>>3){case 1:i.body=t.TxBody.decode(r,r.uint32());break;case 2:i.authInfo=t.AuthInfo.decode(r,r.uint32());break;case 3:i.signatures.push(r.bytes());break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},d);if(n.signatures=[],void 0!==e.body&&null!==e.body?n.body=t.TxBody.fromJSON(e.body):n.body=void 0,void 0!==e.authInfo&&null!==e.authInfo?n.authInfo=t.AuthInfo.fromJSON(e.authInfo):n.authInfo=void 0,void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(_(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.body&&(n.body=e.body?t.TxBody.toJSON(e.body):void 0),void 0!==e.authInfo&&(n.authInfo=e.authInfo?t.AuthInfo.toJSON(e.authInfo):void 0),e.signatures?n.signatures=e.signatures.map((function(e){return S(void 0!==e?e:new Uint8Array)})):n.signatures=[],n},fromPartial:function(e){var n=Object.assign({},d);if(n.signatures=[],void 0!==e.body&&null!==e.body?n.body=t.TxBody.fromPartial(e.body):n.body=void 0,void 0!==e.authInfo&&null!==e.authInfo?n.authInfo=t.AuthInfo.fromPartial(e.authInfo):n.authInfo=void 0,void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(o)}}catch(s){i.e(s)}finally{i.f()}}return n}};var l={};t.TxRaw={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();0!==e.bodyBytes.length&&t.uint32(10).bytes(e.bodyBytes),0!==e.authInfoBytes.length&&t.uint32(18).bytes(e.authInfoBytes);var n,a=r(e.signatures);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.uint32(26).bytes(i)}}catch(s){a.e(s)}finally{a.f()}return t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);for(a.signatures=[],a.bodyBytes=new Uint8Array,a.authInfoBytes=new Uint8Array;n.pos>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.signatures.push(n.bytes());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);if(t.signatures=[],t.bodyBytes=new Uint8Array,t.authInfoBytes=new Uint8Array,void 0!==e.bodyBytes&&null!==e.bodyBytes&&(t.bodyBytes=_(e.bodyBytes)),void 0!==e.authInfoBytes&&null!==e.authInfoBytes&&(t.authInfoBytes=_(e.authInfoBytes)),void 0!==e.signatures&&null!==e.signatures){var n,a=r(e.signatures);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.signatures.push(_(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.bodyBytes&&(t.bodyBytes=S(void 0!==e.bodyBytes?e.bodyBytes:new Uint8Array)),void 0!==e.authInfoBytes&&(t.authInfoBytes=S(void 0!==e.authInfoBytes?e.authInfoBytes:new Uint8Array)),e.signatures?t.signatures=e.signatures.map((function(e){return S(void 0!==e?e:new Uint8Array)})):t.signatures=[],t},fromPartial:function(e){var t=Object.assign({},l);if(t.signatures=[],void 0!==e.bodyBytes&&null!==e.bodyBytes?t.bodyBytes=e.bodyBytes:t.bodyBytes=new Uint8Array,void 0!==e.authInfoBytes&&null!==e.authInfoBytes?t.authInfoBytes=e.authInfoBytes:t.authInfoBytes=new Uint8Array,void 0!==e.signatures&&null!==e.signatures){var n,a=r(e.signatures);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.signatures.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var p={chainId:"",accountNumber:i.default.UZERO};t.SignDoc={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.bodyBytes.length&&t.uint32(10).bytes(e.bodyBytes),0!==e.authInfoBytes.length&&t.uint32(18).bytes(e.authInfoBytes),""!==e.chainId&&t.uint32(26).string(e.chainId),e.accountNumber.isZero()||t.uint32(32).uint64(e.accountNumber),t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);for(a.bodyBytes=new Uint8Array,a.authInfoBytes=new Uint8Array;n.pos>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.chainId=n.string();break;case 4:a.accountNumber=n.uint64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);return t.bodyBytes=new Uint8Array,t.authInfoBytes=new Uint8Array,void 0!==e.bodyBytes&&null!==e.bodyBytes&&(t.bodyBytes=_(e.bodyBytes)),void 0!==e.authInfoBytes&&null!==e.authInfoBytes&&(t.authInfoBytes=_(e.authInfoBytes)),void 0!==e.chainId&&null!==e.chainId?t.chainId=String(e.chainId):t.chainId="",void 0!==e.accountNumber&&null!==e.accountNumber?t.accountNumber=i.default.fromString(e.accountNumber):t.accountNumber=i.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.bodyBytes&&(t.bodyBytes=S(void 0!==e.bodyBytes?e.bodyBytes:new Uint8Array)),void 0!==e.authInfoBytes&&(t.authInfoBytes=S(void 0!==e.authInfoBytes?e.authInfoBytes:new Uint8Array)),void 0!==e.chainId&&(t.chainId=e.chainId),void 0!==e.accountNumber&&(t.accountNumber=(e.accountNumber||i.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},p);return void 0!==e.bodyBytes&&null!==e.bodyBytes?t.bodyBytes=e.bodyBytes:t.bodyBytes=new Uint8Array,void 0!==e.authInfoBytes&&null!==e.authInfoBytes?t.authInfoBytes=e.authInfoBytes:t.authInfoBytes=new Uint8Array,void 0!==e.chainId&&null!==e.chainId?t.chainId=e.chainId:t.chainId="",void 0!==e.accountNumber&&null!==e.accountNumber?t.accountNumber=e.accountNumber:t.accountNumber=i.default.UZERO,t}};var b={memo:"",timeoutHeight:i.default.UZERO};t.TxBody={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.messages);try{for(a.s();!(t=a.n()).done;){var i=t.value;s.Any.encode(i,n.uint32(10).fork()).ldelim()}}catch(b){a.e(b)}finally{a.f()}""!==e.memo&&n.uint32(18).string(e.memo),e.timeoutHeight.isZero()||n.uint32(24).uint64(e.timeoutHeight);var u,c=r(e.extensionOptions);try{for(c.s();!(u=c.n()).done;){var f=u.value;s.Any.encode(f,n.uint32(8186).fork()).ldelim()}}catch(b){c.e(b)}finally{c.f()}var d,l=r(e.nonCriticalExtensionOptions);try{for(l.s();!(d=l.n()).done;){var p=d.value;s.Any.encode(p,n.uint32(16378).fork()).ldelim()}}catch(b){l.e(b)}finally{l.f()}return n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},b);for(a.messages=[],a.extensionOptions=[],a.nonCriticalExtensionOptions=[];n.pos>>3){case 1:a.messages.push(s.Any.decode(n,n.uint32()));break;case 2:a.memo=n.string();break;case 3:a.timeoutHeight=n.uint64();break;case 1023:a.extensionOptions.push(s.Any.decode(n,n.uint32()));break;case 2047:a.nonCriticalExtensionOptions.push(s.Any.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);if(t.messages=[],t.extensionOptions=[],t.nonCriticalExtensionOptions=[],void 0!==e.messages&&null!==e.messages){var n,a=r(e.messages);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.messages.push(s.Any.fromJSON(o))}}catch(h){a.e(h)}finally{a.f()}}if(void 0!==e.memo&&null!==e.memo?t.memo=String(e.memo):t.memo="",void 0!==e.timeoutHeight&&null!==e.timeoutHeight?t.timeoutHeight=i.default.fromString(e.timeoutHeight):t.timeoutHeight=i.default.UZERO,void 0!==e.extensionOptions&&null!==e.extensionOptions){var u,c=r(e.extensionOptions);try{for(c.s();!(u=c.n()).done;){var f=u.value;t.extensionOptions.push(s.Any.fromJSON(f))}}catch(h){c.e(h)}finally{c.f()}}if(void 0!==e.nonCriticalExtensionOptions&&null!==e.nonCriticalExtensionOptions){var d,l=r(e.nonCriticalExtensionOptions);try{for(l.s();!(d=l.n()).done;){var p=d.value;t.nonCriticalExtensionOptions.push(s.Any.fromJSON(p))}}catch(h){l.e(h)}finally{l.f()}}return t},toJSON:function(e){var t={};return e.messages?t.messages=e.messages.map((function(e){return e?s.Any.toJSON(e):void 0})):t.messages=[],void 0!==e.memo&&(t.memo=e.memo),void 0!==e.timeoutHeight&&(t.timeoutHeight=(e.timeoutHeight||i.default.UZERO).toString()),e.extensionOptions?t.extensionOptions=e.extensionOptions.map((function(e){return e?s.Any.toJSON(e):void 0})):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map((function(e){return e?s.Any.toJSON(e):void 0})):t.nonCriticalExtensionOptions=[],t},fromPartial:function(e){var t=Object.assign({},b);if(t.messages=[],t.extensionOptions=[],t.nonCriticalExtensionOptions=[],void 0!==e.messages&&null!==e.messages){var n,a=r(e.messages);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.messages.push(s.Any.fromPartial(o))}}catch(h){a.e(h)}finally{a.f()}}if(void 0!==e.memo&&null!==e.memo?t.memo=e.memo:t.memo="",void 0!==e.timeoutHeight&&null!==e.timeoutHeight?t.timeoutHeight=e.timeoutHeight:t.timeoutHeight=i.default.UZERO,void 0!==e.extensionOptions&&null!==e.extensionOptions){var u,c=r(e.extensionOptions);try{for(c.s();!(u=c.n()).done;){var f=u.value;t.extensionOptions.push(s.Any.fromPartial(f))}}catch(h){c.e(h)}finally{c.f()}}if(void 0!==e.nonCriticalExtensionOptions&&null!==e.nonCriticalExtensionOptions){var d,l=r(e.nonCriticalExtensionOptions);try{for(l.s();!(d=l.n()).done;){var p=d.value;t.nonCriticalExtensionOptions.push(s.Any.fromPartial(p))}}catch(h){l.e(h)}finally{l.f()}}return t}};var h={};t.AuthInfo={encode:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),i=r(e.signerInfos);try{for(i.s();!(n=i.n()).done;){var s=n.value;t.SignerInfo.encode(s,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return void 0!==e.fee&&t.Fee.encode(e.fee,a.uint32(18).fork()).ldelim(),a},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},h);for(i.signerInfos=[];r.pos>>3){case 1:i.signerInfos.push(t.SignerInfo.decode(r,r.uint32()));break;case 2:i.fee=t.Fee.decode(r,r.uint32());break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},h);if(n.signerInfos=[],void 0!==e.signerInfos&&null!==e.signerInfos){var a,i=r(e.signerInfos);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signerInfos.push(t.SignerInfo.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.fee&&null!==e.fee?n.fee=t.Fee.fromJSON(e.fee):n.fee=void 0,n},toJSON:function(e){var n={};return e.signerInfos?n.signerInfos=e.signerInfos.map((function(e){return e?t.SignerInfo.toJSON(e):void 0})):n.signerInfos=[],void 0!==e.fee&&(n.fee=e.fee?t.Fee.toJSON(e.fee):void 0),n},fromPartial:function(e){var n=Object.assign({},h);if(n.signerInfos=[],void 0!==e.signerInfos&&null!==e.signerInfos){var a,i=r(e.signerInfos);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signerInfos.push(t.SignerInfo.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.fee&&null!==e.fee?n.fee=t.Fee.fromPartial(e.fee):n.fee=void 0,n}};var y={sequence:i.default.UZERO};t.SignerInfo={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return void 0!==e.publicKey&&s.Any.encode(e.publicKey,n.uint32(10).fork()).ldelim(),void 0!==e.modeInfo&&t.ModeInfo.encode(e.modeInfo,n.uint32(18).fork()).ldelim(),e.sequence.isZero()||n.uint32(24).uint64(e.sequence),n},decode:function(e,n){for(var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},y);r.pos>>3){case 1:i.publicKey=s.Any.decode(r,r.uint32());break;case 2:i.modeInfo=t.ModeInfo.decode(r,r.uint32());break;case 3:i.sequence=r.uint64();break;default:r.skipType(7&u)}}return i},fromJSON:function(e){var n=Object.assign({},y);return void 0!==e.publicKey&&null!==e.publicKey?n.publicKey=s.Any.fromJSON(e.publicKey):n.publicKey=void 0,void 0!==e.modeInfo&&null!==e.modeInfo?n.modeInfo=t.ModeInfo.fromJSON(e.modeInfo):n.modeInfo=void 0,void 0!==e.sequence&&null!==e.sequence?n.sequence=i.default.fromString(e.sequence):n.sequence=i.default.UZERO,n},toJSON:function(e){var n={};return void 0!==e.publicKey&&(n.publicKey=e.publicKey?s.Any.toJSON(e.publicKey):void 0),void 0!==e.modeInfo&&(n.modeInfo=e.modeInfo?t.ModeInfo.toJSON(e.modeInfo):void 0),void 0!==e.sequence&&(n.sequence=(e.sequence||i.default.UZERO).toString()),n},fromPartial:function(e){var n=Object.assign({},y);return void 0!==e.publicKey&&null!==e.publicKey?n.publicKey=s.Any.fromPartial(e.publicKey):n.publicKey=void 0,void 0!==e.modeInfo&&null!==e.modeInfo?n.modeInfo=t.ModeInfo.fromPartial(e.modeInfo):n.modeInfo=void 0,void 0!==e.sequence&&null!==e.sequence?n.sequence=e.sequence:n.sequence=i.default.UZERO,n}};var m={};t.ModeInfo={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return void 0!==e.single&&t.ModeInfo_Single.encode(e.single,n.uint32(10).fork()).ldelim(),void 0!==e.multi&&t.ModeInfo_Multi.encode(e.multi,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},m);r.pos>>3){case 1:i.single=t.ModeInfo_Single.decode(r,r.uint32());break;case 2:i.multi=t.ModeInfo_Multi.decode(r,r.uint32());break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},m);return void 0!==e.single&&null!==e.single?n.single=t.ModeInfo_Single.fromJSON(e.single):n.single=void 0,void 0!==e.multi&&null!==e.multi?n.multi=t.ModeInfo_Multi.fromJSON(e.multi):n.multi=void 0,n},toJSON:function(e){var n={};return void 0!==e.single&&(n.single=e.single?t.ModeInfo_Single.toJSON(e.single):void 0),void 0!==e.multi&&(n.multi=e.multi?t.ModeInfo_Multi.toJSON(e.multi):void 0),n},fromPartial:function(e){var n=Object.assign({},m);return void 0!==e.single&&null!==e.single?n.single=t.ModeInfo_Single.fromPartial(e.single):n.single=void 0,void 0!==e.multi&&null!==e.multi?n.multi=t.ModeInfo_Multi.fromPartial(e.multi):n.multi=void 0,n}};var v={mode:0};t.ModeInfo_Single={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.mode&&t.uint32(8).int32(e.mode),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},v);n.pos>>3===1)a.mode=n.int32();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},v);return void 0!==e.mode&&null!==e.mode?t.mode=u.signModeFromJSON(e.mode):t.mode=0,t},toJSON:function(e){var t={};return void 0!==e.mode&&(t.mode=u.signModeToJSON(e.mode)),t},fromPartial:function(e){var t=Object.assign({},v);return void 0!==e.mode&&null!==e.mode?t.mode=e.mode:t.mode=0,t}};var g={};t.ModeInfo_Multi={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==e.bitarray&&c.CompactBitArray.encode(e.bitarray,n.uint32(10).fork()).ldelim();var a,i=r(e.modeInfos);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.ModeInfo.encode(s,n.uint32(18).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},g);for(i.modeInfos=[];r.pos>>3){case 1:i.bitarray=c.CompactBitArray.decode(r,r.uint32());break;case 2:i.modeInfos.push(t.ModeInfo.decode(r,r.uint32()));break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},g);if(n.modeInfos=[],void 0!==e.bitarray&&null!==e.bitarray?n.bitarray=c.CompactBitArray.fromJSON(e.bitarray):n.bitarray=void 0,void 0!==e.modeInfos&&null!==e.modeInfos){var a,i=r(e.modeInfos);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.modeInfos.push(t.ModeInfo.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.bitarray&&(n.bitarray=e.bitarray?c.CompactBitArray.toJSON(e.bitarray):void 0),e.modeInfos?n.modeInfos=e.modeInfos.map((function(e){return e?t.ModeInfo.toJSON(e):void 0})):n.modeInfos=[],n},fromPartial:function(e){var n=Object.assign({},g);if(n.modeInfos=[],void 0!==e.bitarray&&null!==e.bitarray?n.bitarray=c.CompactBitArray.fromPartial(e.bitarray):n.bitarray=void 0,void 0!==e.modeInfos&&null!==e.modeInfos){var a,i=r(e.modeInfos);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.modeInfos.push(t.ModeInfo.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var w={gasLimit:i.default.UZERO,payer:"",granter:""};t.Fee={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.amount);try{for(a.s();!(t=a.n()).done;){var i=t.value;f.Coin.encode(i,n.uint32(10).fork()).ldelim()}}catch(s){a.e(s)}finally{a.f()}return e.gasLimit.isZero()||n.uint32(16).uint64(e.gasLimit),""!==e.payer&&n.uint32(26).string(e.payer),""!==e.granter&&n.uint32(34).string(e.granter),n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},w);for(a.amount=[];n.pos>>3){case 1:a.amount.push(f.Coin.decode(n,n.uint32()));break;case 2:a.gasLimit=n.uint64();break;case 3:a.payer=n.string();break;case 4:a.granter=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},w);if(t.amount=[],void 0!==e.amount&&null!==e.amount){var n,a=r(e.amount);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.amount.push(f.Coin.fromJSON(o))}}catch(s){a.e(s)}finally{a.f()}}return void 0!==e.gasLimit&&null!==e.gasLimit?t.gasLimit=i.default.fromString(e.gasLimit):t.gasLimit=i.default.UZERO,void 0!==e.payer&&null!==e.payer?t.payer=String(e.payer):t.payer="",void 0!==e.granter&&null!==e.granter?t.granter=String(e.granter):t.granter="",t},toJSON:function(e){var t={};return e.amount?t.amount=e.amount.map((function(e){return e?f.Coin.toJSON(e):void 0})):t.amount=[],void 0!==e.gasLimit&&(t.gasLimit=(e.gasLimit||i.default.UZERO).toString()),void 0!==e.payer&&(t.payer=e.payer),void 0!==e.granter&&(t.granter=e.granter),t},fromPartial:function(e){var t=Object.assign({},w);if(t.amount=[],void 0!==e.amount&&null!==e.amount){var n,a=r(e.amount);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.amount.push(f.Coin.fromPartial(o))}}catch(s){a.e(s)}finally{a.f()}}return void 0!==e.gasLimit&&null!==e.gasLimit?t.gasLimit=e.gasLimit:t.gasLimit=i.default.UZERO,void 0!==e.payer&&null!==e.payer?t.payer=e.payer:t.payer="",void 0!==e.granter&&null!==e.granter?t.granter=e.granter:t.granter="",t}};var T=function(){if("undefined"!==typeof T)return T;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),k=T.atob||function(e){return T.Buffer.from(e,"base64").toString("binary")};function _(e){for(var t=k(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.signatures);try{for(a.s();!(t=a.n()).done;){var i=t.value;n.uint32(10).bytes(i)}}catch(s){a.e(s)}finally{a.f()}return n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},s);for(a.signatures=[];n.pos>>3===1)a.signatures.push(n.bytes());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},s);if(t.signatures=[],void 0!==e.signatures&&null!==e.signatures){var n,a=r(e.signatures);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.signatures.push(d(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.signatures?t.signatures=e.signatures.map((function(e){return p(void 0!==e?e:new Uint8Array)})):t.signatures=[],t},fromPartial:function(e){var t=Object.assign({},s);if(t.signatures=[],void 0!==e.signatures&&null!==e.signatures){var n,a=r(e.signatures);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.signatures.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var u={extraBitsStored:0};t.CompactBitArray={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.extraBitsStored&&t.uint32(8).uint32(e.extraBitsStored),0!==e.elems.length&&t.uint32(18).bytes(e.elems),t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},u);for(a.elems=new Uint8Array;n.pos>>3){case 1:a.extraBitsStored=n.uint32();break;case 2:a.elems=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},u);return t.elems=new Uint8Array,void 0!==e.extraBitsStored&&null!==e.extraBitsStored?t.extraBitsStored=Number(e.extraBitsStored):t.extraBitsStored=0,void 0!==e.elems&&null!==e.elems&&(t.elems=d(e.elems)),t},toJSON:function(e){var t={};return void 0!==e.extraBitsStored&&(t.extraBitsStored=e.extraBitsStored),void 0!==e.elems&&(t.elems=p(void 0!==e.elems?e.elems:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.extraBitsStored&&null!==e.extraBitsStored?t.extraBitsStored=e.extraBitsStored:t.extraBitsStored=0,void 0!==e.elems&&null!==e.elems?t.elems=e.elems:t.elems=new Uint8Array,t}};var c=function(){if("undefined"!==typeof c)return c;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),f=c.atob||function(e){return c.Buffer.from(e,"base64").toString("binary")};function d(e){for(var t=f(e),n=new Uint8Array(t.length),r=0;r=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(o)})),e.exports=u}).call(this,n(78))},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="ethers/5.5.3"},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){e.sha256="sha256",e.sha512="sha512"}(r||(r={}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(44),a=(new RegExp("\0","g"),function(e){return{amount:r.a.from(e.slice(1,33)).toBigInt(),originAddress:e.slice(33,65).toString("hex"),originChain:e.readUInt16BE(65),targetAddress:e.slice(67,99).toString("hex"),targetChain:e.readUInt16BE(99)}})}).call(this,n(21).Buffer)},function(e,t,n){"use strict";(function(e){n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"e",(function(){return l})),n.d(t,"a",(function(){return p}));var r=n(90),a=n(94),i=n(11),o=n(58),s=n(3),u=function(e){return e===r.c||e===r.b||e===r.d||e===r.a||e===r.f||e===r.e},c=function(t){return e.from(t).toString("hex")},f=function(t){return new Uint8Array(e.from(t,"hex"))},d=function(t,n){try{return t?n===r.g?new i.b(f(t)).toString():u(n)?Object(o.hexZeroPad)(Object(o.hexValue)(f(t)),20):n===r.h?function(e){return e.startsWith("01")}(t)?function(t){return e.from(Object(o.stripZeros)(f(t.substr(2)))).toString("ascii")}(t):Object(a.c)(f(t.substr(24))):t:void 0}catch(s){}},l=function(t,n){return t&&n?u(n)?c(Object(s.zeroPad)(Object(s.arrayify)(t),32)):n===r.g?c(Object(s.zeroPad)(new i.b(t).toBytes(),32)):n===r.h?Object(a.d)(t)?"01"+c(Object(s.zeroPad)(new Uint8Array(e.from(t,"ascii")),31)):c(Object(s.zeroPad)(Object(a.b)(t),32)):null:null};function p(e,t){return Array.apply(0,new Array(Math.ceil(e.length/t))).map((function(n,r){return e.slice(r*t,(r+1)*t)}))}}).call(this,n(21).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(11);var r=n(38),a=(n(30),function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}),i=function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=(n+=a.l)&&e<=n+a.h&&(e-n)%(a.d||1)===0){if(a.e&&-1!==a.e.indexOf(e-n))continue;return a}}return null}var s=i("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),u="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),c=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],f=a("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),d=a("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),l=a("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");for(var t=[],n=0;n=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=o(e,c);if(t)return[e+t.s];var n=f[e];if(n)return n;var r=d[e];return r?[e+r[0]]:l[e]||null}(e);return t||[e]})),n=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[]),(n=Object(r.g)(Object(r.e)(n),r.a.NFKC)).forEach((function(e){if(o(e,p))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),n.forEach((function(e){if(o(e,s))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var a=Object(r.e)(n);if("-"===a.substring(0,1)||"--"===a.substring(2,4)||"-"===a.substring(a.length-1))throw new Error("invalid hyphen");if(a.length>63)throw new Error("too long");return a}},function(e,t,n){e.exports=n(463)(n(464))},function(e,t,n){e.exports=n(683)},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return be})),n.d(t,"b",(function(){return he}));var r=n(0),a=n.n(r),i=n(45),o=n(22),s=n(6),u=n(18),c=n(118),f=n(416),d=n(34),l=n(71),p=n(89),b=n(77);function h(e,t){var n=function(e,t){var n,r=t.getBoundingClientRect();if(t.fakeTransform)n=t.fakeTransform;else{var a=window.getComputedStyle(t);n=a.getPropertyValue("-webkit-transform")||a.getPropertyValue("transform")}var i=0,o=0;if(n&&"none"!==n&&"string"===typeof n){var s=n.split("(")[1].split(")")[0].split(",");i=parseInt(s[4],10),o=parseInt(s[5],10)}return"left"===e?"translateX(".concat(window.innerWidth,"px) translateX(").concat(i-r.left,"px)"):"right"===e?"translateX(-".concat(r.left+r.width-i,"px)"):"up"===e?"translateY(".concat(window.innerHeight,"px) translateY(").concat(o-r.top,"px)"):"translateY(-".concat(r.top+r.height-o,"px)")}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}var y={enter:p.b.enteringScreen,exit:p.b.leavingScreen},m=r.forwardRef((function(e,t){var n=e.children,a=e.direction,o=void 0===a?"down":a,p=e.in,m=e.onEnter,v=e.onEntered,g=e.onEntering,w=e.onExit,T=e.onExited,k=e.onExiting,_=e.style,O=e.timeout,S=void 0===O?y:O,x=e.TransitionComponent,A=void 0===x?f.a:x,M=Object(u.a)(e,["children","direction","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),E=Object(l.a)(),P=r.useRef(null),j=r.useCallback((function(e){P.current=i.findDOMNode(e)}),[]),I=Object(d.a)(n.ref,j),C=Object(d.a)(I,t),R=function(e){return function(t){e&&(void 0===t?e(P.current):e(P.current,t))}},N=R((function(e,t){h(o,e),Object(b.b)(e),m&&m(e,t)})),D=R((function(e,t){var n=Object(b.a)({timeout:S,style:_},{mode:"enter"});e.style.webkitTransition=E.transitions.create("-webkit-transform",Object(s.a)({},n,{easing:E.transitions.easing.easeOut})),e.style.transition=E.transitions.create("transform",Object(s.a)({},n,{easing:E.transitions.easing.easeOut})),e.style.webkitTransform="none",e.style.transform="none",g&&g(e,t)})),B=R(v),U=R(k),L=R((function(e){var t=Object(b.a)({timeout:S,style:_},{mode:"exit"});e.style.webkitTransition=E.transitions.create("-webkit-transform",Object(s.a)({},t,{easing:E.transitions.easing.sharp})),e.style.transition=E.transitions.create("transform",Object(s.a)({},t,{easing:E.transitions.easing.sharp})),h(o,e),w&&w(e)})),z=R((function(e){e.style.webkitTransition="",e.style.transition="",T&&T(e)})),F=r.useCallback((function(){P.current&&h(o,P.current)}),[o]);return r.useEffect((function(){if(!p&&"down"!==o&&"right"!==o){var e=Object(c.a)((function(){P.current&&h(o,P.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[o,p]),r.useEffect((function(){p||F()}),[p,F]),r.createElement(A,Object(s.a)({nodeRef:P,onEnter:N,onEntered:B,onEntering:D,onExit:L,onExited:z,onExiting:U,appear:!0,in:p,timeout:S},M),(function(e,t){return r.cloneElement(n,Object(s.a)({ref:C,style:Object(s.a)({visibility:"exited"!==e||p?void 0:"hidden"},_,n.props.style)},t))}))}));var v=n(26),g=n(62),w=n(752),T=n(751),k=n(415),_=n(60),O=n(81);function S(e){return e.substring(2).toLowerCase()}var x=function(e){var t=e.children,n=e.disableReactTree,a=void 0!==n&&n,o=e.mouseEvent,s=void 0===o?"onClick":o,u=e.onClickAway,c=e.touchEvent,f=void 0===c?"onTouchEnd":c,l=r.useRef(!1),p=r.useRef(null),b=r.useRef(!1),h=r.useRef(!1);r.useEffect((function(){return setTimeout((function(){b.current=!0}),0),function(){b.current=!1}}),[]);var y=r.useCallback((function(e){p.current=i.findDOMNode(e)}),[]),m=Object(d.a)(t.ref,y),v=Object(O.a)((function(e){var t=h.current;if(h.current=!1,b.current&&p.current&&!function(e){return document.documentElement.clientWidth-1;else n=!Object(_.a)(p.current).documentElement.contains(e.target)||p.current.contains(e.target);n||!a&&t||u(e)}})),g=function(e){return function(n){h.current=!0;var r=t.props[e];r&&r(n)}},w={ref:m};return!1!==f&&(w[f]=g(f)),r.useEffect((function(){if(!1!==f){var e=S(f),t=Object(_.a)(p.current),n=function(){l.current=!0};return t.addEventListener(e,v),t.addEventListener("touchmove",n),function(){t.removeEventListener(e,v),t.removeEventListener("touchmove",n)}}}),[v,f]),!1!==s&&(w[s]=g(s)),r.useEffect((function(){if(!1!==s){var e=S(s),t=Object(_.a)(p.current);return t.addEventListener(e,v),function(){t.removeEventListener(e,v)}}}),[v,s]),r.createElement(r.Fragment,null,r.cloneElement(t,w))};n(205);function A(e,t){for(var n=0;n=0||(a[n]=e[n]);return a}var P=a.a.createContext(),j={root:{},anchorOriginTopCenter:{},anchorOriginBottomCenter:{},anchorOriginTopRight:{},anchorOriginBottomRight:{},anchorOriginTopLeft:{},anchorOriginBottomLeft:{}},I={containerRoot:{},containerAnchorOriginTopCenter:{},containerAnchorOriginBottomCenter:{},containerAnchorOriginTopRight:{},containerAnchorOriginBottomRight:{},containerAnchorOriginTopLeft:{},containerAnchorOriginBottomLeft:{}},C={default:20,dense:4},R={default:6,dense:2},N={maxSnack:3,dense:!1,hideIconVariant:!1,variant:"default",autoHideDuration:5e3,anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:m,transitionDuration:{enter:225,exit:195}},D=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},B=function(e){return Object.keys(e).filter((function(e){return!I[e]})).reduce((function(t,n){var r;return M({},t,((r={})[n]=e[n],r))}),{})},U={TIMEOUT:"timeout",CLICKAWAY:"clickaway",MAXSNACK:"maxsnack",INSTRUCTED:"instructed"},L=function(e){return"containerAnchorOrigin"+e},z=function(e){var t=e.vertical,n=e.horizontal;return"anchorOrigin"+D(t)+D(n)},F=function(e){return"variant"+D(e)},q=function(e){return!!e||0===e},H=function(e){return"number"===typeof e||null===e};function J(e,t,n){return void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={}),M({},n,{},t,{},e)}var V=function(e){var t;return{root:(t={display:"flex",flexWrap:"wrap",flexGrow:1},t[e.breakpoints.up("sm")]={flexGrow:"initial",minWidth:288},t)}},W=Object(r.forwardRef)((function(e,t){var n=e.classes,r=e.className,i=E(e,["classes","className"]);return a.a.createElement("div",Object.assign({ref:t,className:Object(o.a)(n.root,r)},i))})),K=Object(v.a)(V)(W),G={right:"left",left:"right",bottom:"up",top:"down"},Z=function(e){return"center"!==e.horizontal?G[e.horizontal]:G[e.vertical]},X=function(e){return a.a.createElement(k.a,Object.assign({},e),a.a.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z"}))},Y=function(e){return a.a.createElement(k.a,Object.assign({},e),a.a.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},$=function(e){return a.a.createElement(k.a,Object.assign({},e),a.a.createElement("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"}))},Q=function(e){return a.a.createElement(k.a,Object.assign({},e),a.a.createElement("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z"}))},ee={fontSize:20,marginInlineEnd:8},te={default:void 0,success:a.a.createElement(X,{style:ee}),warning:a.a.createElement(Y,{style:ee}),error:a.a.createElement($,{style:ee}),info:a.a.createElement(Q,{style:ee})};function ne(e,t){return e.reduce((function(e,n){return null==n?e:function(){for(var r=arguments.length,a=new Array(r),i=0;i .MuiCollapse-container, & > .MuiCollapse-root",fe="& > .MuiCollapse-container > .MuiCollapse-wrapper, & > .MuiCollapse-root > .MuiCollapse-wrapper",de=Object(w.a)((function(e){var t,n,r,a,i;return{root:(t={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:e.zIndex.snackbar,height:"auto",width:"auto",transition:"top 300ms ease 0ms, right 300ms ease 0ms, bottom 300ms ease 0ms, left 300ms ease 0ms, margin 300ms ease 0ms, max-width 300ms ease 0ms",pointerEvents:"none"},t[ce]={pointerEvents:"all"},t[fe]={padding:R.default+"px 0px",transition:"padding 300ms ease 0ms"},t.maxWidth="calc(100% - "+2*C.default+"px)",t[e.breakpoints.down("xs")]={width:"100%",maxWidth:"calc(100% - 32px)"},t),rootDense:(n={},n[fe]={padding:R.dense+"px 0px"},n),top:{top:C.default-R.default,flexDirection:"column"},bottom:{bottom:C.default-R.default,flexDirection:"column-reverse"},left:(r={left:C.default},r[e.breakpoints.up("sm")]={alignItems:"flex-start"},r[e.breakpoints.down("xs")]={left:"16px"},r),right:(a={right:C.default},a[e.breakpoints.up("sm")]={alignItems:"flex-end"},a[e.breakpoints.down("xs")]={right:"16px"},a),center:(i={left:"50%",transform:"translateX(-50%)"},i[e.breakpoints.up("sm")]={alignItems:"center"},i)}})),le=function(e){var t=de(),n=e.className,r=e.anchorOrigin,i=e.dense,s=E(e,["className","anchorOrigin","dense"]),u=Object(o.a)(t[r.vertical],t[r.horizontal],t.root,n,i&&t.rootDense);return a.a.createElement("div",Object.assign({className:u},s))},pe=a.a.memo(le),be=function(e){var t,n,r,s,u;function c(t){var n;return(n=e.call(this,t)||this).enqueueSnackbar=function(e,t){void 0===t&&(t={});var r=t,a=r.key,i=r.preventDuplicate,o=E(r,["key","preventDuplicate"]),s=q(a),u=s?a:(new Date).getTime()+Math.random(),c=function(e,t,n){return function(r){return"autoHideDuration"===r?H(e.autoHideDuration)?e.autoHideDuration:H(t.autoHideDuration)?t.autoHideDuration:N.autoHideDuration:e[r]||t[r]||n[r]}}(o,n.props,N),f=M({key:u},o,{message:e,open:!0,entered:!1,requestClose:!1,variant:c("variant"),anchorOrigin:c("anchorOrigin"),autoHideDuration:c("autoHideDuration")});return o.persist&&(f.autoHideDuration=void 0),n.setState((function(t){if(void 0===i&&n.props.preventDuplicate||i){var r=function(t){return s?t.key===a:t.message===e},o=t.queue.findIndex(r)>-1,u=t.snacks.findIndex(r)>-1;if(o||u)return t}return n.handleDisplaySnack(M({},t,{queue:[].concat(t.queue,[f])}))})),u},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?M({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some((function(e){return!e.open||e.requestClose})))return e;var t=!1,r=!1;e.snacks.reduce((function(e,t){return e+(t.open&&t.persist?1:0)}),0)===n.maxSnack&&(r=!0);var a=e.snacks.map((function(e){return t||e.persist&&!r?M({},e):(t=!0,e.entered?(e.onClose&&e.onClose(null,U.MAXSNACK,e.key),n.props.onClose&&n.props.onClose(null,U.MAXSNACK,e.key),M({},e,{open:!1})):M({},e,{requestClose:!0}))}));return M({},e,{snacks:a})},n.handleEnteredSnack=function(e,t,r){if(!q(r))throw new Error("handleEnteredSnack Cannot be called with undefined key");n.setState((function(e){return{snacks:e.snacks.map((function(e){return e.key===r?M({},e,{entered:!0}):M({},e)}))}}))},n.handleCloseSnack=function(e,t,r){if(n.props.onClose&&n.props.onClose(e,t,r),t!==U.CLICKAWAY){var a=void 0===r;n.setState((function(e){var t=e.snacks,n=e.queue;return{snacks:t.map((function(e){return a||e.key===r?e.entered?M({},e,{open:!1}):M({},e,{requestClose:!0}):M({},e)})),queue:n.filter((function(e){return e.key!==r}))}}))}},n.closeSnackbar=function(e){var t=n.state.snacks.find((function(t){return t.key===e}));q(e)&&t&&t.onClose&&t.onClose(null,U.INSTRUCTED,e),n.handleCloseSnack(null,U.INSTRUCTED,e)},n.handleExitedSnack=function(e,t,r){var a=t||r;if(!q(a))throw new Error("handleExitedSnack Cannot be called with undefined key");n.setState((function(e){var t=n.processQueue(M({},e,{snacks:e.snacks.filter((function(e){return e.key!==a}))}));return 0===t.queue.length?t:n.handleDismissOldest(t)}))},n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar,closeSnackbar:n.closeSnackbar}},n}return n=e,(t=c).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,c.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,r=n.iconVariant,s=n.dense,u=void 0===s?N.dense:s,c=n.hideIconVariant,f=void 0===c?N.hideIconVariant:c,d=n.domRoot,l=n.children,p=n.classes,b=void 0===p?{}:p,h=E(n,["maxSnack","preventDuplicate","variant","anchorOrigin","iconVariant","dense","hideIconVariant","domRoot","children","classes"]),y=this.state.snacks.reduce((function(e,t){var n,r,a=(r=t.anchorOrigin,""+D(r.vertical)+D(r.horizontal)),i=e[a]||[];return M({},e,((n={})[a]=[].concat(i,[t]),n))}),{}),m=Object.keys(y).map((function(t){var n=y[t];return a.a.createElement(pe,{key:t,dense:u,anchorOrigin:n[0].anchorOrigin,className:Object(o.a)(b.containerRoot,b[L(t)])},n.map((function(t){return a.a.createElement(ue,Object.assign({},h,{key:t.key,snack:t,dense:u,iconVariant:r,hideIconVariant:f,classes:B(b),onClose:e.handleCloseSnack,onExited:ne([e.handleExitedSnack,e.props.onExited]),onEntered:ne([e.handleEnteredSnack,e.props.onEntered])}))})))}));return a.a.createElement(P.Provider,{value:t},l,d?Object(i.createPortal)(m,d):m)},r=c,(s=[{key:"maxSnack",get:function(){return this.props.maxSnack||N.maxSnack}}])&&A(r.prototype,s),u&&A(r,u),c}(r.Component),he=function(){return Object(r.useContext)(P)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(49),a=n(121);var i=n(212);function o(e,t,n){return o=Object(i.a)()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Object(a.a)(i,n.prototype),i},o.apply(null,arguments)}function s(e){var t="function"===typeof Map?new Map:void 0;return s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return o(e,arguments,Object(r.a)(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Object(a.a)(i,e)},s(e)}},function(e,t,n){"use strict";(function(t){!function(n){var r=2147483647;function a(e){var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),n=1779033703,r=3144134277,a=1013904242,i=2773480762,o=1359893119,s=2600822924,u=528734635,c=1541459225,f=new Uint32Array(64);function d(e){for(var d=0,l=e.length;l>=64;){var p=n,b=r,h=a,y=i,m=o,v=s,g=u,w=c,T=void 0,k=void 0,_=void 0,O=void 0,S=void 0;for(k=0;k<16;k++)_=d+4*k,f[k]=(255&e[_])<<24|(255&e[_+1])<<16|(255&e[_+2])<<8|255&e[_+3];for(k=16;k<64;k++)O=((T=f[k-2])>>>17|T<<15)^(T>>>19|T<<13)^T>>>10,S=((T=f[k-15])>>>7|T<<25)^(T>>>18|T<<14)^T>>>3,f[k]=(O+f[k-7]|0)+(S+f[k-16]|0)|0;for(k=0;k<64;k++)O=(((m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&v^~m&g)|0)+(w+(t[k]+f[k]|0)|0)|0,S=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&b^p&h^b&h)|0,w=g,g=v,v=m,m=y+O|0,y=h,h=b,b=p,p=O+S|0;n=n+p|0,r=r+b|0,a=a+h|0,i=i+y|0,o=o+m|0,s=s+v|0,u=u+g|0,c=c+w|0,d+=64,l-=64}}d(e);var l,p=e.length%64,b=e.length/536870912|0,h=e.length<<3,y=p<56?56:120,m=e.slice(e.length-p,e.length);for(m.push(128),l=p+1;l>>24&255),m.push(b>>>16&255),m.push(b>>>8&255),m.push(b>>>0&255),m.push(h>>>24&255),m.push(h>>>16&255),m.push(h>>>8&255),m.push(h>>>0&255),d(m),[n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function i(e,t,n){e=e.length<=64?e:a(e);var r,i=64+t.length+4,o=new Array(i),s=new Array(64),u=[];for(r=0;r<64;r++)o[r]=54;for(r=0;r=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;n>=32;)c(),u=u.concat(a(s.concat(a(o)))),n-=32;return n>0&&(c(),u=u.concat(a(s.concat(a(o))).slice(0,n))),u}function o(e,t,n,r,a){var i;for(f(e,16*(2*n-1),a,0,16),i=0;i<2*n;i++)c(e,16*i,a,16),u(a,r),f(a,0,e,t+16*i,16);for(i=0;i>>32-t}function u(e,t){f(e,0,t,0,16);for(var n=8;n>0;n-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(var r=0;r<16;++r)e[r]+=t[r]}function c(e,t,n,r){for(var a=0;a=256)return!1}return!0}function l(e,t){if("number"!==typeof e||e%1)throw new Error("invalid "+t);return e}function p(e,n,a,s,u,p,b){if(a=l(a,"N"),s=l(s,"r"),u=l(u,"p"),p=l(p,"dkLen"),0===a||0!==(a&a-1))throw new Error("N must be power of 2");if(a>r/128/s)throw new Error("N too large");if(s>r/128/u)throw new Error("r too large");if(!d(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!d(n))throw new Error("salt must be an array or buffer");n=Array.prototype.slice.call(n);for(var h=i(e,n,128*u*s),y=new Uint32Array(32*u*s),m=0;mI&&(n=I);for(var r=0;rI&&(n=I);for(var l=0;l>0&255),h.push(y[R]>>8&255),h.push(y[R]>>16&255),h.push(y[R]>>24&255);var N=i(e,h,p);return b&&b(null,1,N),N}b&&C(t)};if(!b)for(;;){var N=R();if(void 0!=N)return N}R()}var b={scrypt:function(e,t,n,r,a,i,o){return new Promise((function(s,u){var c=0;o&&o(0),p(e,t,n,r,a,i,(function(e,t,n){if(e)u(e);else if(n)o&&1!==c&&o(1),s(new Uint8Array(n));else if(o&&t!==c)return c=t,o(t)}))}))},syncScrypt:function(e,t,n,r,a,i){return new Uint8Array(p(e,t,n,r,a,i))}};e.exports=b}()}).call(this,n(274).setImmediate)},function(e,t,n){"use strict";(function(e,r){var a=n(142).default,i=n(449).default,o=n(33).default,s=n(59).default,u=n(63).default,c=n(159).default,f=n(279).default,d=n(281).default,l=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]}),p=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),b=this&&this.__decorate||function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},h=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&l(t,e,n);return p(t,e),t},y=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;var m=y(n(140)),v=y(n(73)),g=h(n(457)),w=new("function"!==typeof e.TextDecoder?g.TextDecoder:e.TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"===typeof e&&(e=r.from(e,"utf8")),v.default.encode(r.from(e))},t.baseDecode=function(e){return r.from(v.default.decode(e))};var T=1024,k=function(e){c(n,e);var t=f(n);function n(e){var r;return s(this,n),(r=t.call(this,e)).fieldPath=[],r.originalMessage=e,r}return u(n,[{key:"addToFieldPath",value:function(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}]),n}(d(Error));t.BorshError=k;var _=function(){function e(){s(this,e),this.buf=r.alloc(T),this.length=0}return u(e,[{key:"maybeResize",value:function(){this.buf.length<16+this.length&&(this.buf=r.concat([this.buf,r.alloc(T)]))}},{key:"writeU8",value:function(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}},{key:"writeU16",value:function(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}},{key:"writeU32",value:function(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}},{key:"writeU64",value:function(e){this.maybeResize(),this.writeBuffer(r.from(new m.default(e).toArray("le",8)))}},{key:"writeU128",value:function(e){this.maybeResize(),this.writeBuffer(r.from(new m.default(e).toArray("le",16)))}},{key:"writeU256",value:function(e){this.maybeResize(),this.writeBuffer(r.from(new m.default(e).toArray("le",32)))}},{key:"writeU512",value:function(e){this.maybeResize(),this.writeBuffer(r.from(new m.default(e).toArray("le",64)))}},{key:"writeBuffer",value:function(e){this.buf=r.concat([r.from(this.buf.subarray(0,this.length)),e,r.alloc(T)]),this.length+=e.length}},{key:"writeString",value:function(e){this.maybeResize();var t=r.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}},{key:"writeFixedArray",value:function(e){this.writeBuffer(r.from(e))}},{key:"writeArray",value:function(e,t){this.maybeResize(),this.writeU32(e.length);var n,r=o(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;this.maybeResize(),t(a)}}catch(i){r.e(i)}finally{r.f()}}},{key:"toArray",value:function(){return this.buf.subarray(0,this.length)}}]),e}();function O(e,t,n){var r=n.value;n.value=function(){try{for(var e=arguments.length,t=new Array(e),n=0;n=0)throw new k("Reached the end of buffer when deserializing")}throw i}}}t.BinaryWriter=_;var S=function(){function e(t){s(this,e),this.buf=t,this.offset=0}return u(e,[{key:"readU8",value:function(){var e=this.buf.readUInt8(this.offset);return this.offset+=1,e}},{key:"readU16",value:function(){var e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}},{key:"readU32",value:function(){var e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readU64",value:function(){var e=this.readBuffer(8);return new m.default(e,"le")}},{key:"readU128",value:function(){var e=this.readBuffer(16);return new m.default(e,"le")}},{key:"readU256",value:function(){var e=this.readBuffer(32);return new m.default(e,"le")}},{key:"readU512",value:function(){var e=this.readBuffer(64);return new m.default(e,"le")}},{key:"readBuffer",value:function(e){if(this.offset+e>this.buf.length)throw new k("Expected buffer length ".concat(e," isn't within bounds"));var t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readString",value:function(){var e=this.readU32(),t=this.readBuffer(e);try{return w.decode(t)}catch(n){throw new k("Error decoding UTF-8 string: ".concat(n))}}},{key:"readFixedArray",value:function(e){return new Uint8Array(this.readBuffer(e))}},{key:"readArray",value:function(e){for(var t=this.readU32(),n=Array(),r=0;r=r.values.length)throw new k("Enum index: ".concat(p," is out of range"));var b=i(r.values[p],2),h=b[0],y=E(e,h,b[1],n);return new t(a({},h,y))}throw new k("Unexpected schema kind: ".concat(r.kind," for ").concat(t.constructor.name))}b([O],S.prototype,"readU8",null),b([O],S.prototype,"readU16",null),b([O],S.prototype,"readU32",null),b([O],S.prototype,"readU64",null),b([O],S.prototype,"readU128",null),b([O],S.prototype,"readU256",null),b([O],S.prototype,"readU512",null),b([O],S.prototype,"readString",null),b([O],S.prototype,"readFixedArray",null),b([O],S.prototype,"readArray",null),t.BinaryReader=S,t.serialize=function(e,t){var n=new _;return M(e,t,n),n.toArray()},t.deserialize=function(e,t,n){var r=new S(n),a=P(e,t,r);if(r.offset0&&u>0)){for(o=u%a||a,f=c.substr(0,o);o0&&(f+=p+c.slice(o)),this.s<0&&(f="-"+f)}return d?((y=n.fractionGroupSeparator)==s&&(y=v.fractionGroupSeparator)==s&&(y=g.fractionGroupSeparator),y&&((m=n.fractionGroupSize)==s&&(m=v.fractionGroupSize)==s&&(m=g.fractionGroupSize)==s&&(m=0),(m=+m)&&(d=d.replace(new RegExp("\\d{"+m+"}\\B","g"),"$&"+y))),f+l+d):f},e.format={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},e})},,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,t){for(var n,s,u=o(e),c=1;c31)throw new Error("bytes32 string must be less than 32 bytes");return Object(a.hexlify)(Object(a.concat)([t,r.a]).slice(0,32))}function s(e){var t=Object(a.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var n=31;0===t[n-1];)n--;return Object(i.h)(t.slice(0,n))}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t){return e.exports=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.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r,a=t,i=n(66),o=n(286),s=n(92).assert;function u(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:n}),n}})}a.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(471)}catch(f){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Msg=void 0;var r=n(290),a=n(293),i=n(294),o=n(298),s=n(306),u=n(308),c=n(312),f=n(315),d=n(316),l=n(321),p=n(322),b=n(323),h=n(324),y=n(327);!function(e){e.fromAmino=function(e){switch(e.type){case"bank/MsgSend":return r.MsgSend.fromAmino(e);case"bank/MsgMultiSend":return r.MsgMultiSend.fromAmino(e);case"distribution/MsgModifyWithdrawAddress":return a.MsgSetWithdrawAddress.fromAmino(e);case"distribution/MsgWithdrawDelegationReward":return a.MsgWithdrawDelegatorReward.fromAmino(e);case"distribution/MsgWithdrawValidatorCommission":return a.MsgWithdrawValidatorCommission.fromAmino(e);case"distribution/MsgFundCommunityPool":return a.MsgFundCommunityPool.fromAmino(e);case"feegrant/MsgGrantAllowance":return i.MsgGrantAllowance.fromAmino(e);case"feegrant/MsgRevokeAllowance":return i.MsgRevokeAllowance.fromAmino(e);case"gov/MsgDeposit":return o.MsgDeposit.fromAmino(e);case"gov/MsgSubmitProposal":return o.MsgSubmitProposal.fromAmino(e);case"gov/MsgVote":return o.MsgVote.fromAmino(e);case"gov/MsgVoteWeighted":return o.MsgVoteWeighted.fromAmino(e);case"market/MsgSwap":return s.MsgSwap.fromAmino(e);case"market/MsgSwapSend":return s.MsgSwapSend.fromAmino(e);case"msgauth/MsgGrantAuthorization":return u.MsgGrantAuthorization.fromAmino(e);case"msgauth/MsgRevokeAuthorization":return u.MsgRevokeAuthorization.fromAmino(e);case"msgauth/MsgExecAuthorized":return u.MsgExecAuthorized.fromAmino(e);case"oracle/MsgDelegateFeedConsent":return c.MsgDelegateFeedConsent.fromAmino(e);case"oracle/MsgAggregateExchangeRatePrevote":return c.MsgAggregateExchangeRatePrevote.fromAmino(e);case"oracle/MsgAggregateExchangeRateVote":return c.MsgAggregateExchangeRateVote.fromAmino(e);case"slashing/MsgUnjail":return f.MsgUnjail.fromAmino(e);case"staking/MsgDelegate":return d.MsgDelegate.fromAmino(e);case"staking/MsgUndelegate":return d.MsgUndelegate.fromAmino(e);case"staking/MsgBeginRedelegate":return d.MsgBeginRedelegate.fromAmino(e);case"staking/MsgCreateValidator":return d.MsgCreateValidator.fromAmino(e);case"staking/MsgEditValidator":return d.MsgEditValidator.fromAmino(e);case"wasm/MsgStoreCode":return l.MsgStoreCode.fromAmino(e);case"wasm/MsgMigrateCode":return l.MsgMigrateCode.fromAmino(e);case"wasm/MsgInstantiateContract":return l.MsgInstantiateContract.fromAmino(e);case"wasm/MsgExecuteContract":return l.MsgExecuteContract.fromAmino(e);case"wasm/MsgMigrateContract":return l.MsgMigrateContract.fromAmino(e);case"wasm/MsgUpdateContractAdmin":return l.MsgUpdateContractAdmin.fromAmino(e);case"wasm/MsgClearContractAdmin":return l.MsgClearContractAdmin.fromAmino(e);case"cosmos-sdk/MsgTransfer":return p.MsgTransfer.fromAmino(e)}},e.fromData=function(e){switch(e["@type"]){case"/cosmos.bank.v1beta1.MsgSend":return r.MsgSend.fromData(e);case"/cosmos.bank.v1beta1.MsgMultiSend":return r.MsgMultiSend.fromData(e);case"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress":return a.MsgSetWithdrawAddress.fromData(e);case"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward":return a.MsgWithdrawDelegatorReward.fromData(e);case"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission":return a.MsgWithdrawValidatorCommission.fromData(e);case"/cosmos.distribution.v1beta1.MsgFundCommunityPool":return a.MsgFundCommunityPool.fromData(e);case"/cosmos.feegrant.v1beta1.MsgGrantAllowance":return i.MsgGrantAllowance.fromData(e);case"/cosmos.feegrant.v1beta1.MsgRevokeAllowance":return i.MsgRevokeAllowance.fromData(e);case"/cosmos.gov.v1beta1.MsgDeposit":return o.MsgDeposit.fromData(e);case"/cosmos.gov.v1beta1.MsgSubmitProposal":return o.MsgSubmitProposal.fromData(e);case"/cosmos.gov.v1beta1.MsgVote":return o.MsgVote.fromData(e);case"/cosmos.gov.v1beta1.MsgVoteWeighted":return o.MsgVoteWeighted.fromData(e);case"/terra.market.v1beta1.MsgSwap":return s.MsgSwap.fromData(e);case"/terra.market.v1beta1.MsgSwapSend":return s.MsgSwapSend.fromData(e);case"/cosmos.authz.v1beta1.MsgGrant":return u.MsgGrantAuthorization.fromData(e);case"/cosmos.authz.v1beta1.MsgRevoke":return u.MsgRevokeAuthorization.fromData(e);case"/cosmos.authz.v1beta1.MsgExec":return u.MsgExecAuthorized.fromData(e);case"/terra.oracle.v1beta1.MsgDelegateFeedConsent":return c.MsgDelegateFeedConsent.fromData(e);case"/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote":return c.MsgAggregateExchangeRatePrevote.fromData(e);case"/terra.oracle.v1beta1.MsgAggregateExchangeRateVote":return c.MsgAggregateExchangeRateVote.fromData(e);case"/cosmos.slashing.v1beta1.MsgUnjail":return f.MsgUnjail.fromData(e);case"/cosmos.staking.v1beta1.MsgDelegate":return d.MsgDelegate.fromData(e);case"/cosmos.staking.v1beta1.MsgUndelegate":return d.MsgUndelegate.fromData(e);case"/cosmos.staking.v1beta1.MsgBeginRedelegate":return d.MsgBeginRedelegate.fromData(e);case"/cosmos.staking.v1beta1.MsgCreateValidator":return d.MsgCreateValidator.fromData(e);case"/cosmos.staking.v1beta1.MsgEditValidator":return d.MsgEditValidator.fromData(e);case"/terra.wasm.v1beta1.MsgStoreCode":return l.MsgStoreCode.fromData(e);case"/terra.wasm.v1beta1.MsgMigrateCode":return l.MsgMigrateCode.fromData(e);case"/terra.wasm.v1beta1.MsgInstantiateContract":return l.MsgInstantiateContract.fromData(e);case"/terra.wasm.v1beta1.MsgExecuteContract":return l.MsgExecuteContract.fromData(e);case"/terra.wasm.v1beta1.MsgMigrateContract":return l.MsgMigrateContract.fromData(e);case"/terra.wasm.v1beta1.MsgUpdateContractAdmin":return l.MsgUpdateContractAdmin.fromData(e);case"/terra.wasm.v1beta1.MsgClearContractAdmin":return l.MsgClearContractAdmin.fromData(e);case"/ibc.applications.transfer.v1.MsgTransfer":return p.MsgTransfer.fromData(e);case"/ibc.core.client.v1.MsgCreateClient":return b.MsgCreateClient.fromData(e);case"/ibc.core.client.v1.MsgUpdateClient":return b.MsgUpdateClient.fromData(e);case"/ibc.core.client.v1.MsgUpgradeClient":return b.MsgUpgradeClient.fromData(e);case"/ibc.core.client.v1.MsgSubmitMisbehaviour":return b.MsgSubmitMisbehaviour.fromData(e);case"/ibc.core.connection.v1.MsgConnectionOpenInit":return h.MsgConnectionOpenInit.fromData(e);case"/ibc.core.connection.v1.MsgConnectionOpenTry":return h.MsgConnectionOpenTry.fromData(e);case"/ibc.core.connection.v1.MsgConnectionOpenConfirm":return h.MsgConnectionOpenConfirm.fromData(e);case"/ibc.core.connection.v1.MsgConnectionOpenAck":return h.MsgConnectionOpenAck.fromData(e);case"/ibc.core.channel.v1.MsgChannelOpenInit":return y.MsgChannelOpenInit.fromData(e);case"/ibc.core.channel.v1.MsgChannelOpenTry":return y.MsgChannelOpenTry.fromData(e);case"/ibc.core.channel.v1.MsgChannelOpenConfirm":return y.MsgChannelOpenConfirm.fromData(e);case"/ibc.core.channel.v1.MsgChannelOpenAck":return y.MsgChannelOpenAck.fromData(e);case"/ibc.core.channel.v1.MsgChannelCloseInit":return y.MsgChannelCloseInit.fromData(e);case"/ibc.core.channel.v1.MsgChannelCloseConfirm":return y.MsgChannelCloseConfirm.fromData(e);case"/ibc.core.channel.v1.MsgRecvPacket":return y.MsgRecvPacket.fromData(e);case"/ibc.core.channel.v1.MsgAcknowledgement":return y.MsgAcknowledgement.fromData(e);case"/ibc.core.channel.v1.MsgTimeout":return y.MsgTimeout.fromData(e);case"/ibc.core.channel.v1.MsgTimeoutOnClose":return y.MsgTimeoutOnClose.fromData(e)}},e.fromProto=function(e){switch(e.typeUrl){case"/cosmos.bank.v1beta1.MsgSend":return r.MsgSend.unpackAny(e);case"/cosmos.bank.v1beta1.MsgMultiSend":return r.MsgMultiSend.unpackAny(e);case"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress":return a.MsgSetWithdrawAddress.unpackAny(e);case"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward":return a.MsgWithdrawDelegatorReward.unpackAny(e);case"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission":return a.MsgWithdrawValidatorCommission.unpackAny(e);case"/cosmos.distribution.v1beta1.MsgFundCommunityPool":return a.MsgFundCommunityPool.unpackAny(e);case"/cosmos.feegrant.v1beta1.MsgGrantAllowance":return i.MsgGrantAllowance.unpackAny(e);case"/cosmos.feegrant.v1beta1.MsgRevokeAllowance":return i.MsgRevokeAllowance.unpackAny(e);case"/cosmos.gov.v1beta1.MsgDeposit":return o.MsgDeposit.unpackAny(e);case"/cosmos.gov.v1beta1.MsgSubmitProposal":return o.MsgSubmitProposal.unpackAny(e);case"/cosmos.gov.v1beta1.MsgVote":return o.MsgVote.unpackAny(e);case"/terra.market.v1beta1.MsgSwap":return s.MsgSwap.unpackAny(e);case"/terra.market.v1beta1.MsgSwapSend":return s.MsgSwapSend.unpackAny(e);case"/cosmos.authz.v1beta1.MsgGrant":return u.MsgGrantAuthorization.unpackAny(e);case"/cosmos.authz.v1beta1.MsgRevoke":return u.MsgRevokeAuthorization.unpackAny(e);case"/cosmos.authz.v1beta1.MsgExec":return u.MsgExecAuthorized.unpackAny(e);case"/terra.oracle.v1beta1.MsgDelegateFeedConsent":return c.MsgDelegateFeedConsent.unpackAny(e);case"/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote":return c.MsgAggregateExchangeRatePrevote.unpackAny(e);case"/terra.oracle.v1beta1.MsgAggregateExchangeRateVote":return c.MsgAggregateExchangeRateVote.unpackAny(e);case"/cosmos.slashing.v1beta1.MsgUnjail":return f.MsgUnjail.unpackAny(e);case"/cosmos.staking.v1beta1.MsgDelegate":return d.MsgDelegate.unpackAny(e);case"/cosmos.staking.v1beta1.MsgUndelegate":return d.MsgUndelegate.unpackAny(e);case"/cosmos.staking.v1beta1.MsgBeginRedelegate":return d.MsgBeginRedelegate.unpackAny(e);case"/cosmos.staking.v1beta1.MsgCreateValidator":return d.MsgCreateValidator.unpackAny(e);case"/cosmos.staking.v1beta1.MsgEditValidator":return d.MsgEditValidator.unpackAny(e);case"/terra.wasm.v1beta1.MsgStoreCode":return l.MsgStoreCode.unpackAny(e);case"/terra.wasm.v1beta1.MsgMigrateCode":return l.MsgMigrateCode.unpackAny(e);case"/terra.wasm.v1beta1.MsgInstantiateContract":return l.MsgInstantiateContract.unpackAny(e);case"/terra.wasm.v1beta1.MsgExecuteContract":return l.MsgExecuteContract.unpackAny(e);case"/terra.wasm.v1beta1.MsgMigrateContract":return l.MsgMigrateContract.unpackAny(e);case"/terra.wasm.v1beta1.MsgUpdateContractAdmin":return l.MsgUpdateContractAdmin.unpackAny(e);case"/terra.wasm.v1beta1.MsgClearContractAdmin":return l.MsgClearContractAdmin.unpackAny(e);case"/ibc.applications.transfer.v1.MsgTransfer":return p.MsgTransfer.unpackAny(e);case"/ibc.core.client.v1.MsgCreateClient":return b.MsgCreateClient.unpackAny(e);case"/ibc.core.client.v1.MsgUpdateClient":return b.MsgUpdateClient.unpackAny(e);case"/ibc.core.client.v1.MsgUpgradeClient":return b.MsgUpgradeClient.unpackAny(e);case"/ibc.core.client.v1.MsgSubmitMisbehaviour":return b.MsgSubmitMisbehaviour.unpackAny(e);case"/ibc.core.connection.v1.MsgConnectionOpenInit":return h.MsgConnectionOpenInit.unpackAny(e);case"/ibc.core.connection.v1.MsgConnectionOpenTry":return h.MsgConnectionOpenTry.unpackAny(e);case"/ibc.core.connection.v1.MsgConnectionOpenConfirm":return h.MsgConnectionOpenConfirm.unpackAny(e);case"/ibc.core.connection.v1.MsgConnectionOpenAck":return h.MsgConnectionOpenAck.unpackAny(e);case"/ibc.core.channel.v1.MsgChannelOpenInit":return y.MsgChannelOpenInit.unpackAny(e);case"/ibc.core.channel.v1.MsgChannelOpenTry":return y.MsgChannelOpenTry.unpackAny(e);case"/ibc.core.channel.v1.MsgChannelOpenConfirm":return y.MsgChannelOpenConfirm.unpackAny(e);case"/ibc.core.channel.v1.MsgChannelOpenAck":return y.MsgChannelOpenAck.unpackAny(e);case"/ibc.core.channel.v1.MsgChannelCloseInit":return y.MsgChannelCloseInit.unpackAny(e);case"/ibc.core.channel.v1.MsgChannelCloseConfirm":return y.MsgChannelCloseConfirm.unpackAny(e);case"/ibc.core.channel.v1.MsgRecvPacket":return y.MsgRecvPacket.unpackAny(e);case"/ibc.core.channel.v1.MsgAcknowledgement":return y.MsgAcknowledgement.unpackAny(e);case"/ibc.core.channel.v1.MsgTimeout":return y.MsgTimeout.unpackAny(e);case"/ibc.core.channel.v1.MsgTimeoutOnClose":return y.MsgTimeoutOnClose.unpackAny(e);default:throw Error("not supported msg "+e.typeUrl)}}}(t.Msg||(t.Msg={}))},function(e,t,n){"use strict";var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Grant=t.AllowedMsgAllowance=t.PeriodicAllowance=t.BasicAllowance=t.protobufPackage=void 0;var i=a(n(24)),o=a(n(20)),s=n(181),u=n(25),c=n(114),f=n(68);t.protobufPackage="cosmos.feegrant.v1beta1";var d={};t.BasicAllowance={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.spendLimit);try{for(a.s();!(t=a.n()).done;){var i=t.value;f.Coin.encode(i,n.uint32(10).fork()).ldelim()}}catch(s){a.e(s)}finally{a.f()}return void 0!==e.expiration&&c.Timestamp.encode(h(e.expiration),n.uint32(18).fork()).ldelim(),n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},d);for(a.spendLimit=[];n.pos>>3){case 1:a.spendLimit.push(f.Coin.decode(n,n.uint32()));break;case 2:a.expiration=y(c.Timestamp.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},d);if(t.spendLimit=[],void 0!==e.spendLimit&&null!==e.spendLimit){var n,a=r(e.spendLimit);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.spendLimit.push(f.Coin.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return void 0!==e.expiration&&null!==e.expiration?t.expiration=m(e.expiration):t.expiration=void 0,t},toJSON:function(e){var t={};return e.spendLimit?t.spendLimit=e.spendLimit.map((function(e){return e?f.Coin.toJSON(e):void 0})):t.spendLimit=[],void 0!==e.expiration&&(t.expiration=e.expiration.toISOString()),t},fromPartial:function(e){var t=Object.assign({},d);if(t.spendLimit=[],void 0!==e.spendLimit&&null!==e.spendLimit){var n,a=r(e.spendLimit);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.spendLimit.push(f.Coin.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return void 0!==e.expiration&&null!==e.expiration?t.expiration=e.expiration:t.expiration=void 0,t}};var l={};t.PeriodicAllowance={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==e.basic&&t.BasicAllowance.encode(e.basic,n.uint32(10).fork()).ldelim(),void 0!==e.period&&s.Duration.encode(e.period,n.uint32(18).fork()).ldelim();var a,i=r(e.periodSpendLimit);try{for(i.s();!(a=i.n()).done;){var u=a.value;f.Coin.encode(u,n.uint32(26).fork()).ldelim()}}catch(b){i.e(b)}finally{i.f()}var d,l=r(e.periodCanSpend);try{for(l.s();!(d=l.n()).done;){var p=d.value;f.Coin.encode(p,n.uint32(34).fork()).ldelim()}}catch(b){l.e(b)}finally{l.f()}return void 0!==e.periodReset&&c.Timestamp.encode(h(e.periodReset),n.uint32(42).fork()).ldelim(),n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},l);for(i.periodSpendLimit=[],i.periodCanSpend=[];r.pos>>3){case 1:i.basic=t.BasicAllowance.decode(r,r.uint32());break;case 2:i.period=s.Duration.decode(r,r.uint32());break;case 3:i.periodSpendLimit.push(f.Coin.decode(r,r.uint32()));break;case 4:i.periodCanSpend.push(f.Coin.decode(r,r.uint32()));break;case 5:i.periodReset=y(c.Timestamp.decode(r,r.uint32()));break;default:r.skipType(7&u)}}return i},fromJSON:function(e){var n=Object.assign({},l);if(n.periodSpendLimit=[],n.periodCanSpend=[],void 0!==e.basic&&null!==e.basic?n.basic=t.BasicAllowance.fromJSON(e.basic):n.basic=void 0,void 0!==e.period&&null!==e.period?n.period=s.Duration.fromJSON(e.period):n.period=void 0,void 0!==e.periodSpendLimit&&null!==e.periodSpendLimit){var a,i=r(e.periodSpendLimit);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.periodSpendLimit.push(f.Coin.fromJSON(o))}}catch(p){i.e(p)}finally{i.f()}}if(void 0!==e.periodCanSpend&&null!==e.periodCanSpend){var u,c=r(e.periodCanSpend);try{for(c.s();!(u=c.n()).done;){var d=u.value;n.periodCanSpend.push(f.Coin.fromJSON(d))}}catch(p){c.e(p)}finally{c.f()}}return void 0!==e.periodReset&&null!==e.periodReset?n.periodReset=m(e.periodReset):n.periodReset=void 0,n},toJSON:function(e){var n={};return void 0!==e.basic&&(n.basic=e.basic?t.BasicAllowance.toJSON(e.basic):void 0),void 0!==e.period&&(n.period=e.period?s.Duration.toJSON(e.period):void 0),e.periodSpendLimit?n.periodSpendLimit=e.periodSpendLimit.map((function(e){return e?f.Coin.toJSON(e):void 0})):n.periodSpendLimit=[],e.periodCanSpend?n.periodCanSpend=e.periodCanSpend.map((function(e){return e?f.Coin.toJSON(e):void 0})):n.periodCanSpend=[],void 0!==e.periodReset&&(n.periodReset=e.periodReset.toISOString()),n},fromPartial:function(e){var n=Object.assign({},l);if(n.periodSpendLimit=[],n.periodCanSpend=[],void 0!==e.basic&&null!==e.basic?n.basic=t.BasicAllowance.fromPartial(e.basic):n.basic=void 0,void 0!==e.period&&null!==e.period?n.period=s.Duration.fromPartial(e.period):n.period=void 0,void 0!==e.periodSpendLimit&&null!==e.periodSpendLimit){var a,i=r(e.periodSpendLimit);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.periodSpendLimit.push(f.Coin.fromPartial(o))}}catch(p){i.e(p)}finally{i.f()}}if(void 0!==e.periodCanSpend&&null!==e.periodCanSpend){var u,c=r(e.periodCanSpend);try{for(c.s();!(u=c.n()).done;){var d=u.value;n.periodCanSpend.push(f.Coin.fromPartial(d))}}catch(p){c.e(p)}finally{c.f()}}return void 0!==e.periodReset&&null!==e.periodReset?n.periodReset=e.periodReset:n.periodReset=void 0,n}};var p={allowedMessages:""};t.AllowedMsgAllowance={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==e.allowance&&u.Any.encode(e.allowance,t.uint32(10).fork()).ldelim();var n,a=r(e.allowedMessages);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.uint32(18).string(i)}}catch(s){a.e(s)}finally{a.f()}return t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);for(a.allowedMessages=[];n.pos>>3){case 1:a.allowance=u.Any.decode(n,n.uint32());break;case 2:a.allowedMessages.push(n.string());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);if(t.allowedMessages=[],void 0!==e.allowance&&null!==e.allowance?t.allowance=u.Any.fromJSON(e.allowance):t.allowance=void 0,void 0!==e.allowedMessages&&null!==e.allowedMessages){var n,a=r(e.allowedMessages);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.allowedMessages.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.allowance&&(t.allowance=e.allowance?u.Any.toJSON(e.allowance):void 0),e.allowedMessages?t.allowedMessages=e.allowedMessages.map((function(e){return e})):t.allowedMessages=[],t},fromPartial:function(e){var t=Object.assign({},p);if(t.allowedMessages=[],void 0!==e.allowance&&null!==e.allowance?t.allowance=u.Any.fromPartial(e.allowance):t.allowance=void 0,void 0!==e.allowedMessages&&null!==e.allowedMessages){var n,a=r(e.allowedMessages);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.allowedMessages.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var b={granter:"",grantee:""};function h(e){var t;return{seconds:(t=e.getTime()/1e3,i.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function y(e){var t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function m(e){return e instanceof Date?e:"string"===typeof e?new Date(e):y(c.Timestamp.fromJSON(e))}t.Grant={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.granter&&t.uint32(10).string(e.granter),""!==e.grantee&&t.uint32(18).string(e.grantee),void 0!==e.allowance&&u.Any.encode(e.allowance,t.uint32(26).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},b);n.pos>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.allowance=u.Any.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);return void 0!==e.granter&&null!==e.granter?t.granter=String(e.granter):t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=String(e.grantee):t.grantee="",void 0!==e.allowance&&null!==e.allowance?t.allowance=u.Any.fromJSON(e.allowance):t.allowance=void 0,t},toJSON:function(e){var t={};return void 0!==e.granter&&(t.granter=e.granter),void 0!==e.grantee&&(t.grantee=e.grantee),void 0!==e.allowance&&(t.allowance=e.allowance?u.Any.toJSON(e.allowance):void 0),t},fromPartial:function(e){var t=Object.assign({},b);return void 0!==e.granter&&null!==e.granter?t.granter=e.granter:t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=e.grantee:t.grantee="",void 0!==e.allowance&&null!==e.allowance?t.allowance=u.Any.fromPartial(e.allowance):t.allowance=void 0,t}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PeriodicAllowance=void 0;var s=n(23),u=n(69),c=n(180),f=n(25),d=n(235),l=o(n(24)),p=function(e){function t(t,n,r,a,i){var o=e.call(this)||this;return o.basic=t,o.period=n,o.period_reset=i,o.period_spend_limit=new u.Coins(r),o.period_can_spend=new u.Coins(a),o}return r(t,e),t.fromAmino=function(e){var n=e.value,r=n.basic,a=n.period,i=n.period_spend_limit,o=n.period_can_spend,s=n.period_reset;return new t(c.BasicAllowance.fromAmino(r),Number.parseInt(a),u.Coins.fromAmino(i),u.Coins.fromAmino(o),new Date(s))},t.prototype.toAmino=function(){var e=this,t=e.basic,n=e.period,r=e.period_spend_limit,a=e.period_can_spend,i=e.period_reset;return{type:"feegrant/PeriodicAllowance",value:{basic:t.toAmino(),period:n.toString(),period_spend_limit:r.toAmino(),period_can_spend:a.toAmino(),period_reset:i.toISOString().replace(/\.000Z$/,"Z")}}},t.fromData=function(e){var n=e.basic,r=e.period,a=e.period_spend_limit,i=e.period_can_spend,o=e.period_reset;return new t(c.BasicAllowance.fromData(n),Number.parseInt(r),u.Coins.fromData(a),u.Coins.fromData(i),new Date(o))},t.prototype.toData=function(){var e=this,t=e.basic,n=e.period,r=e.period_spend_limit,a=e.period_can_spend,i=e.period_reset;return{"@type":"/cosmos.feegrant.v1beta1.PeriodicAllowance",basic:t.toData(),period:n.toString(),period_spend_limit:r.toData(),period_can_spend:a.toData(),period_reset:i.toISOString().replace(/\.000Z$/,"Z")}},t.fromProto=function(e){var n;return new t(c.BasicAllowance.fromProto(e.basic),null===(n=e.period)||void 0===n?void 0:n.seconds.toNumber(),u.Coins.fromProto(e.periodSpendLimit),u.Coins.fromProto(e.periodCanSpend),e.periodReset)},t.prototype.toProto=function(){var e=this,t=e.basic,n=e.period,r=e.period_spend_limit,a=e.period_can_spend,i=e.period_reset;return d.PeriodicAllowance.fromPartial({basic:t,period:{seconds:l.fromNumber(n)},periodCanSpend:a.toProto(),periodReset:i,periodSpendLimit:r.toProto()})},t.prototype.packAny=function(){return f.Any.fromPartial({typeUrl:"/cosmos.feegrant.v1beta1.PeriodicAllowance",value:d.PeriodicAllowance.encode(this.toProto()).finish()})},t.unpackAny=function(e){return t.fromProto(d.PeriodicAllowance.decode(e.value))},t}(s.JSONSerializable);t.PeriodicAllowance=p},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]}),a=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}),a(n(309),t),a(n(310),t),a(n(311),t),a(n(521),t)},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.Grant=t.GenericAuthorization=t.protobufPackage=void 0;var a=r(n(24)),i=r(n(20)),o=n(25),s=n(114);t.protobufPackage="cosmos.authz.v1beta1";var u={msg:""};t.GenericAuthorization={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.msg&&t.uint32(10).string(e.msg),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,a=Object.assign({},u);n.pos>>3===1)a.msg=n.string();else n.skipType(7&o)}return a},fromJSON:function(e){var t=Object.assign({},u);return void 0!==e.msg&&null!==e.msg?t.msg=String(e.msg):t.msg="",t},toJSON:function(e){var t={};return void 0!==e.msg&&(t.msg=e.msg),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.msg&&null!==e.msg?t.msg=e.msg:t.msg="",t}};var c={};function f(e){var t;return{seconds:(t=e.getTime()/1e3,a.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function d(e){var t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}t.Grant={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return void 0!==e.authorization&&o.Any.encode(e.authorization,t.uint32(10).fork()).ldelim(),void 0!==e.expiration&&s.Timestamp.encode(f(e.expiration),t.uint32(18).fork()).ldelim(),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,a=Object.assign({},c);n.pos>>3){case 1:a.authorization=o.Any.decode(n,n.uint32());break;case 2:a.expiration=d(s.Timestamp.decode(n,n.uint32()));break;default:n.skipType(7&u)}}return a},fromJSON:function(e){var t,n=Object.assign({},c);return void 0!==e.authorization&&null!==e.authorization?n.authorization=o.Any.fromJSON(e.authorization):n.authorization=void 0,void 0!==e.expiration&&null!==e.expiration?n.expiration=(t=e.expiration)instanceof Date?t:"string"===typeof t?new Date(t):d(s.Timestamp.fromJSON(t)):n.expiration=void 0,n},toJSON:function(e){var t={};return void 0!==e.authorization&&(t.authorization=e.authorization?o.Any.toJSON(e.authorization):void 0),void 0!==e.expiration&&(t.expiration=e.expiration.toISOString()),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.authorization&&null!==e.authorization?t.authorization=o.Any.fromPartial(e.authorization):t.authorization=void 0,void 0!==e.expiration&&null!==e.expiration?t.expiration=e.expiration:t.expiration=void 0,t}},i.default.util.Long!==a.default&&(i.default.util.Long=a.default,i.default.configure())},function(e,t,n){"use strict";(function(e){var r=n(59).default,a=n(63).default,i=n(33).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgRevokeResponse=t.MsgRevoke=t.MsgGrantResponse=t.MsgExec=t.MsgExecResponse=t.MsgGrant=t.protobufPackage=void 0;var s=o(n(24)),u=o(n(20)),c=n(238),f=n(25);t.protobufPackage="cosmos.authz.v1beta1";var d={granter:"",grantee:""};t.MsgGrant={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.granter&&t.uint32(10).string(e.granter),""!==e.grantee&&t.uint32(18).string(e.grantee),void 0!==e.grant&&c.Grant.encode(e.grant,t.uint32(26).fork()).ldelim(),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,a=Object.assign({},d);n.pos>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.grant=c.Grant.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},d);return void 0!==e.granter&&null!==e.granter?t.granter=String(e.granter):t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=String(e.grantee):t.grantee="",void 0!==e.grant&&null!==e.grant?t.grant=c.Grant.fromJSON(e.grant):t.grant=void 0,t},toJSON:function(e){var t={};return void 0!==e.granter&&(t.granter=e.granter),void 0!==e.grantee&&(t.grantee=e.grantee),void 0!==e.grant&&(t.grant=e.grant?c.Grant.toJSON(e.grant):void 0),t},fromPartial:function(e){var t=Object.assign({},d);return void 0!==e.granter&&null!==e.granter?t.granter=e.granter:t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=e.grantee:t.grantee="",void 0!==e.grant&&null!==e.grant?t.grant=c.Grant.fromPartial(e.grant):t.grant=void 0,t}};var l={};t.MsgExecResponse={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create(),r=i(e.results);try{for(r.s();!(t=r.n()).done;){var a=t.value;n.uint32(10).bytes(a)}}catch(o){r.e(o)}finally{r.f()}return n},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,a=Object.assign({},l);for(a.results=[];n.pos>>3===1)a.results.push(n.bytes());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},l);if(t.results=[],void 0!==e.results&&null!==e.results){var n,r=i(e.results);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.results.push(w(a))}}catch(o){r.e(o)}finally{r.f()}}return t},toJSON:function(e){var t={};return e.results?t.results=e.results.map((function(e){return function(e){var t,n=[],r=i(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;n.push(String.fromCharCode(a))}}catch(o){r.e(o)}finally{r.f()}return T(n.join(""))}(void 0!==e?e:new Uint8Array)})):t.results=[],t},fromPartial:function(e){var t=Object.assign({},l);if(t.results=[],void 0!==e.results&&null!==e.results){var n,r=i(e.results);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.results.push(a)}}catch(o){r.e(o)}finally{r.f()}}return t}};var p={grantee:""};t.MsgExec={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();""!==e.grantee&&t.uint32(10).string(e.grantee);var n,r=i(e.msgs);try{for(r.s();!(n=r.n()).done;){var a=n.value;f.Any.encode(a,t.uint32(18).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return 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,a=Object.assign({},p);for(a.msgs=[];n.pos>>3){case 1:a.grantee=n.string();break;case 2:a.msgs.push(f.Any.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);if(t.msgs=[],void 0!==e.grantee&&null!==e.grantee?t.grantee=String(e.grantee):t.grantee="",void 0!==e.msgs&&null!==e.msgs){var n,r=i(e.msgs);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.msgs.push(f.Any.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return t},toJSON:function(e){var t={};return void 0!==e.grantee&&(t.grantee=e.grantee),e.msgs?t.msgs=e.msgs.map((function(e){return e?f.Any.toJSON(e):void 0})):t.msgs=[],t},fromPartial:function(e){var t=Object.assign({},p);if(t.msgs=[],void 0!==e.grantee&&null!==e.grantee?t.grantee=e.grantee:t.grantee="",void 0!==e.msgs&&null!==e.msgs){var n,r=i(e.msgs);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.msgs.push(f.Any.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return t}};var b={};t.MsgGrantResponse={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,a=Object.assign({},b);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.granter&&t.uint32(10).string(e.granter),""!==e.grantee&&t.uint32(18).string(e.grantee),""!==e.msgTypeUrl&&t.uint32(26).string(e.msgTypeUrl),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,a=Object.assign({},h);n.pos>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.msgTypeUrl=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},h);return void 0!==e.granter&&null!==e.granter?t.granter=String(e.granter):t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=String(e.grantee):t.grantee="",void 0!==e.msgTypeUrl&&null!==e.msgTypeUrl?t.msgTypeUrl=String(e.msgTypeUrl):t.msgTypeUrl="",t},toJSON:function(e){var t={};return void 0!==e.granter&&(t.granter=e.granter),void 0!==e.grantee&&(t.grantee=e.grantee),void 0!==e.msgTypeUrl&&(t.msgTypeUrl=e.msgTypeUrl),t},fromPartial:function(e){var t=Object.assign({},h);return void 0!==e.granter&&null!==e.granter?t.granter=e.granter:t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=e.grantee:t.grantee="",void 0!==e.msgTypeUrl&&null!==e.msgTypeUrl?t.msgTypeUrl=e.msgTypeUrl:t.msgTypeUrl="",t}};var y={};t.MsgRevokeResponse={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,a=Object.assign({},y);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.hash&&t.uint32(10).string(e.hash),""!==e.feeder&&t.uint32(18).string(e.feeder),""!==e.validator&&t.uint32(26).string(e.validator),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},u);n.pos>>3){case 1:a.hash=n.string();break;case 2:a.feeder=n.string();break;case 3:a.validator=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},u);return void 0!==e.hash&&null!==e.hash?t.hash=String(e.hash):t.hash="",void 0!==e.feeder&&null!==e.feeder?t.feeder=String(e.feeder):t.feeder="",void 0!==e.validator&&null!==e.validator?t.validator=String(e.validator):t.validator="",t},toJSON:function(e){var t={};return void 0!==e.hash&&(t.hash=e.hash),void 0!==e.feeder&&(t.feeder=e.feeder),void 0!==e.validator&&(t.validator=e.validator),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.hash&&null!==e.hash?t.hash=e.hash:t.hash="",void 0!==e.feeder&&null!==e.feeder?t.feeder=e.feeder:t.feeder="",void 0!==e.validator&&null!==e.validator?t.validator=e.validator:t.validator="",t}};var c={};t.MsgAggregateExchangeRatePrevoteResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.salt&&t.uint32(10).string(e.salt),""!==e.exchangeRates&&t.uint32(18).string(e.exchangeRates),""!==e.feeder&&t.uint32(26).string(e.feeder),""!==e.validator&&t.uint32(34).string(e.validator),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},f);n.pos>>3){case 1:a.salt=n.string();break;case 2:a.exchangeRates=n.string();break;case 3:a.feeder=n.string();break;case 4:a.validator=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);return void 0!==e.salt&&null!==e.salt?t.salt=String(e.salt):t.salt="",void 0!==e.exchangeRates&&null!==e.exchangeRates?t.exchangeRates=String(e.exchangeRates):t.exchangeRates="",void 0!==e.feeder&&null!==e.feeder?t.feeder=String(e.feeder):t.feeder="",void 0!==e.validator&&null!==e.validator?t.validator=String(e.validator):t.validator="",t},toJSON:function(e){var t={};return void 0!==e.salt&&(t.salt=e.salt),void 0!==e.exchangeRates&&(t.exchangeRates=e.exchangeRates),void 0!==e.feeder&&(t.feeder=e.feeder),void 0!==e.validator&&(t.validator=e.validator),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.salt&&null!==e.salt?t.salt=e.salt:t.salt="",void 0!==e.exchangeRates&&null!==e.exchangeRates?t.exchangeRates=e.exchangeRates:t.exchangeRates="",void 0!==e.feeder&&null!==e.feeder?t.feeder=e.feeder:t.feeder="",void 0!==e.validator&&null!==e.validator?t.validator=e.validator:t.validator="",t}};var d={};t.MsgAggregateExchangeRateVoteResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},d);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.operator&&t.uint32(10).string(e.operator),""!==e.delegate&&t.uint32(18).string(e.delegate),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);n.pos>>3){case 1:a.operator=n.string();break;case 2:a.delegate=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.operator&&null!==e.operator?t.operator=String(e.operator):t.operator="",void 0!==e.delegate&&null!==e.delegate?t.delegate=String(e.delegate):t.delegate="",t},toJSON:function(e){var t={};return void 0!==e.operator&&(t.operator=e.operator),void 0!==e.delegate&&(t.delegate=e.delegate),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.operator&&null!==e.operator?t.operator=e.operator:t.operator="",void 0!==e.delegate&&null!==e.delegate?t.delegate=e.delegate:t.delegate="",t}};var p={};t.MsgDelegateFeedConsentResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();""!==e.clientId&&n.uint32(10).string(e.clientId);var a,i=r(e.versions);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.Version.encode(o,n.uint32(18).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return 0!==e.state&&n.uint32(24).int32(e.state),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(34).fork()).ldelim(),e.delayPeriod.isZero()||n.uint32(40).uint64(e.delayPeriod),n},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},d);for(i.versions=[];r.pos>>3){case 1:i.clientId=r.string();break;case 2:i.versions.push(t.Version.decode(r,r.uint32()));break;case 3:i.state=r.int32();break;case 4:i.counterparty=t.Counterparty.decode(r,r.uint32());break;case 5:i.delayPeriod=r.uint64();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},d);if(n.versions=[],void 0!==e.clientId&&null!==e.clientId?n.clientId=String(e.clientId):n.clientId="",void 0!==e.versions&&null!==e.versions){var a,i=r(e.versions);try{for(i.s();!(a=i.n()).done;){var s=a.value;n.versions.push(t.Version.fromJSON(s))}}catch(u){i.e(u)}finally{i.f()}}return void 0!==e.state&&null!==e.state?n.state=c(e.state):n.state=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromJSON(e.counterparty):n.counterparty=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?n.delayPeriod=o.default.fromString(e.delayPeriod):n.delayPeriod=o.default.UZERO,n},toJSON:function(e){var n={};return void 0!==e.clientId&&(n.clientId=e.clientId),e.versions?n.versions=e.versions.map((function(e){return e?t.Version.toJSON(e):void 0})):n.versions=[],void 0!==e.state&&(n.state=f(e.state)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.delayPeriod&&(n.delayPeriod=(e.delayPeriod||o.default.UZERO).toString()),n},fromPartial:function(e){var n=Object.assign({},d);if(n.versions=[],void 0!==e.clientId&&null!==e.clientId?n.clientId=e.clientId:n.clientId="",void 0!==e.versions&&null!==e.versions){var a,i=r(e.versions);try{for(i.s();!(a=i.n()).done;){var s=a.value;n.versions.push(t.Version.fromPartial(s))}}catch(u){i.e(u)}finally{i.f()}}return void 0!==e.state&&null!==e.state?n.state=e.state:n.state=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromPartial(e.counterparty):n.counterparty=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?n.delayPeriod=e.delayPeriod:n.delayPeriod=o.default.UZERO,n}};var l={id:"",clientId:"",state:0,delayPeriod:o.default.UZERO};t.IdentifiedConnection={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();""!==e.id&&n.uint32(10).string(e.id),""!==e.clientId&&n.uint32(18).string(e.clientId);var a,i=r(e.versions);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.Version.encode(o,n.uint32(26).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return 0!==e.state&&n.uint32(32).int32(e.state),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(42).fork()).ldelim(),e.delayPeriod.isZero()||n.uint32(48).uint64(e.delayPeriod),n},decode:function(e,n){var r=e instanceof s.default.Reader?e:new s.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},l);for(i.versions=[];r.pos>>3){case 1:i.id=r.string();break;case 2:i.clientId=r.string();break;case 3:i.versions.push(t.Version.decode(r,r.uint32()));break;case 4:i.state=r.int32();break;case 5:i.counterparty=t.Counterparty.decode(r,r.uint32());break;case 6:i.delayPeriod=r.uint64();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},l);if(n.versions=[],void 0!==e.id&&null!==e.id?n.id=String(e.id):n.id="",void 0!==e.clientId&&null!==e.clientId?n.clientId=String(e.clientId):n.clientId="",void 0!==e.versions&&null!==e.versions){var a,i=r(e.versions);try{for(i.s();!(a=i.n()).done;){var s=a.value;n.versions.push(t.Version.fromJSON(s))}}catch(u){i.e(u)}finally{i.f()}}return void 0!==e.state&&null!==e.state?n.state=c(e.state):n.state=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromJSON(e.counterparty):n.counterparty=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?n.delayPeriod=o.default.fromString(e.delayPeriod):n.delayPeriod=o.default.UZERO,n},toJSON:function(e){var n={};return void 0!==e.id&&(n.id=e.id),void 0!==e.clientId&&(n.clientId=e.clientId),e.versions?n.versions=e.versions.map((function(e){return e?t.Version.toJSON(e):void 0})):n.versions=[],void 0!==e.state&&(n.state=f(e.state)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.delayPeriod&&(n.delayPeriod=(e.delayPeriod||o.default.UZERO).toString()),n},fromPartial:function(e){var n=Object.assign({},l);if(n.versions=[],void 0!==e.id&&null!==e.id?n.id=e.id:n.id="",void 0!==e.clientId&&null!==e.clientId?n.clientId=e.clientId:n.clientId="",void 0!==e.versions&&null!==e.versions){var a,i=r(e.versions);try{for(i.s();!(a=i.n()).done;){var s=a.value;n.versions.push(t.Version.fromPartial(s))}}catch(u){i.e(u)}finally{i.f()}}return void 0!==e.state&&null!==e.state?n.state=e.state:n.state=0,void 0!==e.counterparty&&null!==e.counterparty?n.counterparty=t.Counterparty.fromPartial(e.counterparty):n.counterparty=void 0,void 0!==e.delayPeriod&&null!==e.delayPeriod?n.delayPeriod=e.delayPeriod:n.delayPeriod=o.default.UZERO,n}};var p={clientId:"",connectionId:""};t.Counterparty={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.clientId&&t.uint32(10).string(e.clientId),""!==e.connectionId&&t.uint32(18).string(e.connectionId),void 0!==e.prefix&&u.MerklePrefix.encode(e.prefix,t.uint32(26).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.connectionId=n.string();break;case 3:a.prefix=u.MerklePrefix.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);return void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.connectionId&&null!==e.connectionId?t.connectionId=String(e.connectionId):t.connectionId="",void 0!==e.prefix&&null!==e.prefix?t.prefix=u.MerklePrefix.fromJSON(e.prefix):t.prefix=void 0,t},toJSON:function(e){var t={};return void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.connectionId&&(t.connectionId=e.connectionId),void 0!==e.prefix&&(t.prefix=e.prefix?u.MerklePrefix.toJSON(e.prefix):void 0),t},fromPartial:function(e){var t=Object.assign({},p);return void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.connectionId&&null!==e.connectionId?t.connectionId=e.connectionId:t.connectionId="",void 0!==e.prefix&&null!==e.prefix?t.prefix=u.MerklePrefix.fromPartial(e.prefix):t.prefix=void 0,t}};var b={paths:""};t.ClientPaths={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create(),a=r(e.paths);try{for(a.s();!(t=a.n()).done;){var i=t.value;n.uint32(10).string(i)}}catch(o){a.e(o)}finally{a.f()}return n},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,a=Object.assign({},b);for(a.paths=[];n.pos>>3===1)a.paths.push(n.string());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},b);if(t.paths=[],void 0!==e.paths&&null!==e.paths){var n,a=r(e.paths);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.paths.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.paths?t.paths=e.paths.map((function(e){return e})):t.paths=[],t},fromPartial:function(e){var t=Object.assign({},b);if(t.paths=[],void 0!==e.paths&&null!==e.paths){var n,a=r(e.paths);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.paths.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var h={clientId:"",paths:""};t.ConnectionPaths={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();""!==e.clientId&&t.uint32(10).string(e.clientId);var n,a=r(e.paths);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.uint32(18).string(i)}}catch(o){a.e(o)}finally{a.f()}return 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,a=Object.assign({},h);for(a.paths=[];n.pos>>3){case 1:a.clientId=n.string();break;case 2:a.paths.push(n.string());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},h);if(t.paths=[],void 0!==e.clientId&&null!==e.clientId?t.clientId=String(e.clientId):t.clientId="",void 0!==e.paths&&null!==e.paths){var n,a=r(e.paths);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.paths.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.clientId&&(t.clientId=e.clientId),e.paths?t.paths=e.paths.map((function(e){return e})):t.paths=[],t},fromPartial:function(e){var t=Object.assign({},h);if(t.paths=[],void 0!==e.clientId&&null!==e.clientId?t.clientId=e.clientId:t.clientId="",void 0!==e.paths&&null!==e.paths){var n,a=r(e.paths);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.paths.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var y={identifier:"",features:""};t.Version={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();""!==e.identifier&&t.uint32(10).string(e.identifier);var n,a=r(e.features);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.uint32(18).string(i)}}catch(o){a.e(o)}finally{a.f()}return 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,a=Object.assign({},y);for(a.features=[];n.pos>>3){case 1:a.identifier=n.string();break;case 2:a.features.push(n.string());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);if(t.features=[],void 0!==e.identifier&&null!==e.identifier?t.identifier=String(e.identifier):t.identifier="",void 0!==e.features&&null!==e.features){var n,a=r(e.features);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.features.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.identifier&&(t.identifier=e.identifier),e.features?t.features=e.features.map((function(e){return e})):t.features=[],t},fromPartial:function(e){var t=Object.assign({},y);if(t.features=[],void 0!==e.identifier&&null!==e.identifier?t.identifier=e.identifier:t.identifier="",void 0!==e.features&&null!==e.features){var n,a=r(e.features);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.features.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var m={maxExpectedTimePerBlock:o.default.UZERO};t.Params={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return e.maxExpectedTimePerBlock.isZero()||t.uint32(8).uint64(e.maxExpectedTimePerBlock),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},m);n.pos>>3===1)a.maxExpectedTimePerBlock=n.uint64();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},m);return void 0!==e.maxExpectedTimePerBlock&&null!==e.maxExpectedTimePerBlock?t.maxExpectedTimePerBlock=o.default.fromString(e.maxExpectedTimePerBlock):t.maxExpectedTimePerBlock=o.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.maxExpectedTimePerBlock&&(t.maxExpectedTimePerBlock=(e.maxExpectedTimePerBlock||o.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},m);return void 0!==e.maxExpectedTimePerBlock&&null!==e.maxExpectedTimePerBlock?t.maxExpectedTimePerBlock=e.maxExpectedTimePerBlock:t.maxExpectedTimePerBlock=o.default.UZERO,t}},s.default.util.Long!==o.default&&(s.default.util.Long=o.default,s.default.configure())},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Version=void 0;var a=n(241),i=function(e){function t(t,n){var r=e.call(this)||this;return r.identifier=t,r.features=n,r}return r(t,e),t.fromAmino=function(e){return new t(e.identifier,e.features)},t.prototype.toAmino=function(){return{identifier:this.identifier,features:this.features}},t.fromData=function(e){return new t(e.identifier,e.features)},t.prototype.toData=function(){return{identifier:this.identifier,features:this.features}},t.fromProto=function(e){return new t(e.identifier,e.features)},t.prototype.toProto=function(){var e=this.identifier,t=this.features;return a.Version.fromPartial({identifier:e,features:t})},t}(n(23).JSONSerializable);t.Version=i},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.CompactBitArray=void 0;var r=n(192),a=function(){function t(e,t){this.extra_bits_stored=e,this.elems=t}return t.fromBits=function(n){if(n<=0)throw new Error("CompactBitArray bits must be bigger than 0");var r=(n+7)/8;if(r<=0||r>Math.pow(2,32)-1)throw new Error("CompactBitArray overflow");return new t(n%8,e.alloc(r))},t.prototype.count=function(){return 0==this.extra_bits_stored?8*this.elems.length:8*(this.elems.length-1)+this.extra_bits_stored},t.prototype.getIndex=function(e){return!(e<0||e>=this.count())&&(this.elems.readUInt8(e>>3)&1<<7-e%8)>0},t.prototype.setIndex=function(e,t){return!(e<0||e>=this.count())&&(t?this.elems[e>>3]|=1<<7-e%8:this.elems[e>>3]&=~(1<<7-e%8),!0)},t.prototype.numTrueBitsBefore=function(e){var t=function(e){return e.toString(2).split("0").join("").length},n=0,r=this.count();e>r&&(e=r);for(var a=0;;a++){if(8*a+7>=e)return n+=t(this.elems[a]>>7-e%8+1);n+=t(this.elems[a])}},t.fromData=function(n){return new t(n.extra_bits_stored,e.from(n.elems,"base64"))},t.prototype.toData=function(){return{elems:this.elems.toString("base64"),extra_bits_stored:this.extra_bits_stored}},t.fromProto=function(n){return new t(n.extraBitsStored,e.from(n.elems))},t.prototype.toProto=function(){return r.CompactBitArray.fromPartial({elems:this.elems,extraBitsStored:this.extra_bits_stored})},t}();t.CompactBitArray=a}).call(this,n(21).Buffer)},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseAccount=void 0;var s=n(115),u=n(23),c=n(331),f=n(25),d=o(n(24)),l=function(e){function t(t,n,r,a){var i=e.call(this)||this;return i.address=t,i.public_key=n,i.account_number=r,i.sequence=a,i}return r(t,e),t.prototype.getAccountNumber=function(){return this.account_number},t.prototype.getSequenceNumber=function(){return this.sequence},t.prototype.getPublicKey=function(){return this.public_key},t.prototype.toAmino=function(){var e=this,t=e.address,n=e.public_key,r=e.account_number,a=e.sequence;return{type:"core/Account",value:{address:t,public_key:n?n.toAmino():null,account_number:r.toFixed(),sequence:a.toFixed()}}},t.fromAmino=function(e){var n=e.value,r=n.address,a=n.public_key,i=n.account_number,o=n.sequence;return new t(r||"",a?s.PublicKey.fromAmino(a):null,Number.parseInt(i)||0,Number.parseInt(o)||0)},t.fromData=function(e){var n=e.address,r=e.pub_key,a=e.account_number,i=e.sequence;return new t(n||"",r?s.PublicKey.fromData(r):null,Number.parseInt(a)||0,Number.parseInt(i)||0)},t.prototype.toData=function(){var e=this,t=e.address,n=e.public_key,r=e.account_number,a=e.sequence;return{"@type":"/cosmos.auth.v1beta1.BaseAccount",address:t,pub_key:n?n.toData():null,account_number:r.toFixed(),sequence:a.toFixed()}},t.prototype.toProto=function(){var e=this,t=e.address,n=e.public_key,r=e.account_number,a=e.sequence;return c.BaseAccount.fromPartial({address:t,pubKey:null===n||void 0===n?void 0:n.packAny(),accountNumber:d.fromNumber(r),sequence:d.fromNumber(a)})},t.fromProto=function(e){var n=e.pubKey;return new t(e.address,n?s.PublicKey.fromProto(n):null,e.accountNumber.toNumber(),e.sequence.toNumber())},t.prototype.packAny=function(){return f.Any.fromPartial({typeUrl:"/cosmos.auth.v1beta1.BaseAccount",value:c.BaseAccount.encode(this.toProto()).finish()})},t.unpackAny=function(e){return t.fromProto(c.BaseAccount.decode(e.value))},t}(u.JSONSerializable);t.BaseAccount=l},function(e,t,n){"use strict";var r=n(51),a=n(339),i=n(247),o=n(248),s=n(249);function u(e){s.call(this,"digest"),this._hash=e}r(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new a:"rmd160"===e||"ripemd160"===e?new i:new u(o(e))}},function(e,t,n){"use strict";var r=n(146).codes.ERR_STREAM_PREMATURE_CLOSE;function a(){}e.exports=function e(t,n,i){if("function"===typeof n)return e(t,null,n);n||(n={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),a=0;a>>32-t}function h(e,t,n,r,a,i,o,s){return b(e+(t^n^r)+i+o|0,s)+a|0}function y(e,t,n,r,a,i,o,s){return b(e+(t&n|~t&r)+i+o|0,s)+a|0}function m(e,t,n,r,a,i,o,s){return b(e+((t|~n)^r)+i+o|0,s)+a|0}function v(e,t,n,r,a,i,o,s){return b(e+(t&r|n&~r)+i+o|0,s)+a|0}function g(e,t,n,r,a,i,o,s){return b(e+(t^(n|~r))+i+o|0,s)+a|0}a(p,i),p.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,a=0|this._c,i=0|this._d,p=0|this._e,w=0|this._a,T=0|this._b,k=0|this._c,_=0|this._d,O=0|this._e,S=0;S<80;S+=1){var x,A;S<16?(x=h(n,r,a,i,p,e[s[S]],d[0],c[S]),A=g(w,T,k,_,O,e[u[S]],l[0],f[S])):S<32?(x=y(n,r,a,i,p,e[s[S]],d[1],c[S]),A=v(w,T,k,_,O,e[u[S]],l[1],f[S])):S<48?(x=m(n,r,a,i,p,e[s[S]],d[2],c[S]),A=m(w,T,k,_,O,e[u[S]],l[2],f[S])):S<64?(x=v(n,r,a,i,p,e[s[S]],d[3],c[S]),A=y(w,T,k,_,O,e[u[S]],l[3],f[S])):(x=g(n,r,a,i,p,e[s[S]],d[4],c[S]),A=h(w,T,k,_,O,e[u[S]],l[4],f[S])),n=p,p=i,i=b(a,10),a=r,r=x,w=O,O=_,_=b(k,10),k=T,T=A}var M=this._b+a+_|0;this._b=this._c+i+O|0,this._c=this._d+p+w|0,this._d=this._e+n+T|0,this._e=this._a+r+k|0,this._a=M},p.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=p},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(598),t.sha1=n(599),t.sha224=n(600),t.sha256=n(349),t.sha384=n(601),t.sha512=n(350)},function(e,t,n){var r=n(67).Buffer,a=n(602).Transform,i=n(166).StringDecoder;function o(e){a.call(this),this.hashMode="string"===typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(51)(o,a),o.prototype.update=function(e,t,n){"string"===typeof e&&(e=r.from(e,t));var a=this._update(e);return this.hashMode?this:(n&&(a=this._toString(a,n)),a)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(a){r=a}finally{n(r)}},o.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(n){t=n}e(t)},o.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},o.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},e.exports=o},function(e,t,n){(t=e.exports=n(351)).Stream=t,t.Readable=t,t.Writable=n(252),t.Duplex=n(133),t.Transform=n(354),t.PassThrough=n(606)},function(e,t,n){var r=n(21),a=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),i(a,o),o.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return a(e)},o.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";(function(t,r,a){var i=n(195);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var a=r.callback;t.pendingcb--,a(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;v.WritableState=m;var c=Object.create(n(167));c.inherits=n(51);var f={deprecate:n(347)},d=n(352),l=n(251).Buffer,p=a.Uint8Array||function(){};var b,h=n(353);function y(){}function m(e,t){s=s||n(133),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var a=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===e.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,a=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,a){--t.pendingcb,n?(i.nextTick(a,r),i.nextTick(O,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(a(r),e._writableState.errorEmitted=!0,e.emit("error",r),O(e,t))}(e,n,r,t,a);else{var o=k(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||T(e,n),r?u(w,e,n,o,a):w(e,n,o,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function v(e){if(s=s||n(133),!b.call(v,this)&&!(this instanceof s))return new v(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),d.call(this)}function g(e,t,n,r,a,i,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(a,t.onwrite):e._write(a,i,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),O(e,t)}function T(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,a=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)a[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;a.allBuffers=u,g(e,t,!0,t.length,a,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,f=n.encoding,d=n.callback;if(g(e,t,!1,t.objectMode?1:c.length,c,f,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),O(e,t)}))}function O(e,t){var n=k(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"===typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(v,d),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!b.call(this,e)||this===v&&(e&&e._writableState instanceof m)}})):b=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,a=this._writableState,o=!1,s=!a.objectMode&&(r=e,l.isBuffer(r)||r instanceof p);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"===typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!==typeof n&&(n=y),a.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var a=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(r,o),a=!1),a}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,n,r,a,i){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=l.from(t,n));return t}(t,r,a);r!==o&&(n=!0,a="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,O(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=h.destroy,v.prototype._undestroy=h.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(78),n(274).setImmediate,n(35))},function(e,t){var n={Array:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return null!==e&&void 0!==e&&e.constructor===Array})),Boolean:function(e){return"boolean"===typeof e},Function:function(e){return"function"===typeof e},Nil:function(e){return void 0===e||null===e},Number:function(e){return"number"===typeof e},Object:function(e){return"object"===typeof e},String:function(e){return"string"===typeof e},"":function(){return!0}};for(var r in n.Null=n.Nil,n)n[r].toJSON=function(e){return e}.bind(null,r);e.exports=n},function(e,t,n){"use strict";(function(t){var r=n(86),a=n(642),i=n(368),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t))&&(e=n(369)),e}(),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(a){if("SyntaxError"!==a.name)throw a}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||a&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(o){if("SyntaxError"===s.name)throw i(s,this,"E_JSON_PARSE");throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(o)})),e.exports=u}).call(this,n(78))},function(e,t,n){"use strict";e.exports=n(701)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="0x0000000000000000000000000000000000000000000000000000000000000000"},function(e,t,n){"use strict";for(var r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",a={},i=0;i>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function u(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=s(t)^r>>5}for(t=s(t),n=0;nt)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),c=e.slice(i+1);if(c.length<6)return"Data too short";var f=u(o);if("string"===typeof f)return f;for(var d=[],l=0;l=c.length||d.push(b)}return 1!==f?"Invalid checksum for "+e:{prefix:o,words:d}}function f(e,t,n,r){for(var a=0,i=0,o=(1<=n;)i-=n,s.push(a>>i&o);if(r)i>0&&s.push(a<=t)return"Excess padding";if(a<n)throw new TypeError("Exceeds length limit");var a=u(e=e.toLowerCase());if("string"===typeof a)throw new Error(a);for(var i=e+"1",o=0;o>5!==0)throw new Error("Non 5-bit word");a=s(a)^c,i+=r.charAt(c)}for(o=0;o<6;++o)a=s(a);for(a^=1,o=0;o<6;++o){i+=r.charAt(a>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return N})),n.d(t,"a",(function(){return z}));var r,a=n(24),i=n.n(a),o=n(259),s=n(20),u=n.n(s),c=n(397),f=n(156),d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=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(e){e[e.CHAIN_ID_UNSPECIFIED=0]="CHAIN_ID_UNSPECIFIED",e[e.CHAIN_ID_SOLANA=1]="CHAIN_ID_SOLANA",e[e.CHAIN_ID_ETHEREUM=2]="CHAIN_ID_ETHEREUM",e[e.CHAIN_ID_TERRA=3]="CHAIN_ID_TERRA",e[e.CHAIN_ID_BSC=4]="CHAIN_ID_BSC",e[e.CHAIN_ID_POLYGON=5]="CHAIN_ID_POLYGON",e[e.CHAIN_ID_AVALANCHE=6]="CHAIN_ID_AVALANCHE",e[e.CHAIN_ID_OASIS=7]="CHAIN_ID_OASIS",e[e.CHAIN_ID_ALGORAND=8]="CHAIN_ID_ALGORAND",e[e.CHAIN_ID_ETHEREUM_ROPSTEN=10001]="CHAIN_ID_ETHEREUM_ROPSTEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(r||(r={}));var p={emitterChain:0,emitterAddress:"",sequence:"0"},b=function(e,t){return void 0===t&&(t=u.a.Writer.create()),0!==e.emitterChain&&t.uint32(8).int32(e.emitterChain),""!==e.emitterAddress&&t.uint32(18).string(e.emitterAddress),"0"!==e.sequence&&t.uint32(24).uint64(e.sequence),t},h=function(e){var t=d({},p);return void 0!==e.emitterChain&&null!==e.emitterChain?t.emitterChain=e.emitterChain:t.emitterChain=0,void 0!==e.emitterAddress&&null!==e.emitterAddress?t.emitterAddress=e.emitterAddress:t.emitterAddress="",void 0!==e.sequence&&null!==e.sequence?t.sequence=e.sequence:t.sequence="0",t},y={},m=function(e,t){return void 0===t&&(t=u.a.Writer.create()),void 0!==e.messageId&&b(e.messageId,t.uint32(10).fork()).ldelim(),t},v=function(e){var t=d({},y);return void 0!==e.messageId&&null!==e.messageId?t.messageId=h(e.messageId):t.messageId=void 0,t},g={},w=function(e,t){var n=e instanceof u.a.Reader?e:new u.a.Reader(e),r=void 0===t?n.len:n.pos+t,a=d({},g);for(a.vaaBytes=new Uint8Array;n.pos>>3===1)a.vaaBytes=n.bytes();else n.skipType(7&i)}return a},T={},k=function(e,t){return void 0===t&&(t=u.a.Writer.create()),t},_=function(e){return d({},T)},O={},S=function(e,t){var n=e instanceof u.a.Reader?e:new u.a.Reader(e),r=void 0===t?n.len:n.pos+t,a=d({},O);for(a.entries=[];n.pos>>3===1)a.entries.push(A.decode(n,n.uint32()));else n.skipType(7&i)}return a},x={verifiedGuardianAddr:"",p2pNodeAddr:""},A={encode:function(e,t){return void 0===t&&(t=u.a.Writer.create()),""!==e.verifiedGuardianAddr&&t.uint32(10).string(e.verifiedGuardianAddr),""!==e.p2pNodeAddr&&t.uint32(18).string(e.p2pNodeAddr),void 0!==e.rawHeartbeat&&f.a.encode(e.rawHeartbeat,t.uint32(26).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof u.a.Reader?e:new u.a.Reader(e),r=void 0===t?n.len:n.pos+t,a=d({},x);n.pos>>3){case 1:a.verifiedGuardianAddr=n.string();break;case 2:a.p2pNodeAddr=n.string();break;case 3:a.rawHeartbeat=f.a.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=d({},x);return void 0!==e.verifiedGuardianAddr&&null!==e.verifiedGuardianAddr?t.verifiedGuardianAddr=String(e.verifiedGuardianAddr):t.verifiedGuardianAddr="",void 0!==e.p2pNodeAddr&&null!==e.p2pNodeAddr?t.p2pNodeAddr=String(e.p2pNodeAddr):t.p2pNodeAddr="",void 0!==e.rawHeartbeat&&null!==e.rawHeartbeat?t.rawHeartbeat=f.a.fromJSON(e.rawHeartbeat):t.rawHeartbeat=void 0,t},toJSON:function(e){var t={};return void 0!==e.verifiedGuardianAddr&&(t.verifiedGuardianAddr=e.verifiedGuardianAddr),void 0!==e.p2pNodeAddr&&(t.p2pNodeAddr=e.p2pNodeAddr),void 0!==e.rawHeartbeat&&(t.rawHeartbeat=e.rawHeartbeat?f.a.toJSON(e.rawHeartbeat):void 0),t},fromPartial:function(e){var t=d({},x);return void 0!==e.verifiedGuardianAddr&&null!==e.verifiedGuardianAddr?t.verifiedGuardianAddr=e.verifiedGuardianAddr:t.verifiedGuardianAddr="",void 0!==e.p2pNodeAddr&&null!==e.p2pNodeAddr?t.p2pNodeAddr=e.p2pNodeAddr:t.p2pNodeAddr="",void 0!==e.rawHeartbeat&&null!==e.rawHeartbeat?t.rawHeartbeat=f.a.fromPartial(e.rawHeartbeat):t.rawHeartbeat=void 0,t}},M={},E=function(e,t){return void 0===t&&(t=u.a.Writer.create()),t},P=function(e){return d({},M)},j={},I=function(e,t){for(var n=e instanceof u.a.Reader?e:new u.a.Reader(e),r=void 0===t?n.len:n.pos+t,a=d({},j);n.pos>>3===1)a.guardianSet=R.decode(n,n.uint32());else n.skipType(7&i)}return a},C={index:0,addresses:""},R={encode:function(e,t){var n,r;void 0===t&&(t=u.a.Writer.create()),0!==e.index&&t.uint32(8).uint32(e.index);try{for(var a=l(e.addresses),i=a.next();!i.done;i=a.next()){var o=i.value;t.uint32(18).string(o)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return t},decode:function(e,t){var n=e instanceof u.a.Reader?e:new u.a.Reader(e),r=void 0===t?n.len:n.pos+t,a=d({},C);for(a.addresses=[];n.pos>>3){case 1:a.index=n.uint32();break;case 2:a.addresses.push(n.string());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t,n,r=d({},C);if(r.addresses=[],void 0!==e.index&&null!==e.index?r.index=Number(e.index):r.index=0,void 0!==e.addresses&&null!==e.addresses)try{for(var a=l(e.addresses),i=a.next();!i.done;i=a.next()){var o=i.value;r.addresses.push(String(o))}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r},toJSON:function(e){var t={};return void 0!==e.index&&(t.index=e.index),e.addresses?t.addresses=e.addresses.map((function(e){return e})):t.addresses=[],t},fromPartial:function(e){var t,n,r=d({},C);if(r.addresses=[],void 0!==e.index&&null!==e.index?r.index=e.index:r.index=0,void 0!==e.addresses&&null!==e.addresses)try{for(var a=l(e.addresses),i=a.next();!i.done;i=a.next()){var o=i.value;r.addresses.push(o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r}},N=function(){function e(e){this.rpc=e,this.GetLastHeartbeats=this.GetLastHeartbeats.bind(this),this.GetSignedVAA=this.GetSignedVAA.bind(this),this.GetCurrentGuardianSet=this.GetCurrentGuardianSet.bind(this)}return e.prototype.GetLastHeartbeats=function(e,t){return this.rpc.unary(B,_(e),t)},e.prototype.GetSignedVAA=function(e,t){return this.rpc.unary(U,v(e),t)},e.prototype.GetCurrentGuardianSet=function(e,t){return this.rpc.unary(L,P(e),t)},e}(),D={serviceName:"publicrpc.v1.PublicRPCService"},B={methodName:"GetLastHeartbeats",service:D,requestStream:!1,responseStream:!1,requestType:{serializeBinary:function(){return k(this).finish()}},responseType:{deserializeBinary:function(e){return d(d({},S(e)),{toObject:function(){return this}})}}},U={methodName:"GetSignedVAA",service:D,requestStream:!1,responseStream:!1,requestType:{serializeBinary:function(){return m(this).finish()}},responseType:{deserializeBinary:function(e){return d(d({},w(e)),{toObject:function(){return this}})}}},L={methodName:"GetCurrentGuardianSet",service:D,requestStream:!1,responseStream:!1,requestType:{serializeBinary:function(){return E(this).finish()}},responseType:{deserializeBinary:function(e){return d(d({},I(e)),{toObject:function(){return this}})}}},z=function(){function e(e,t){this.host=e,this.options=t}return e.prototype.unary=function(e,t,n){var r,a=this,i=d(d({},t),e.requestType),s=n&&this.options.metadata?new c.BrowserHeaders(d(d({},null===(r=this.options)||void 0===r?void 0:r.metadata.headersMap),null===n||void 0===n?void 0:n.headersMap)):n||this.options.metadata;return new Promise((function(t,n){o.grpc.unary(e,{request:i,host:a.host,metadata:s,transport:a.options.transport,debug:a.options.debug,onEnd:function(e){if(e.status===o.grpc.Code.OK)t(e.message);else{var r=new Error(e.statusMessage);r.code=e.status,r.metadata=e.trailers,n(r)}}})}))},e}(),F=function(){if("undefined"!==typeof F)return F;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}();F.atob;F.btoa;u.a.util.Long!==i.a&&(u.a.util.Long=i.a,u.a.configure())}).call(this,n(35))},function(e,t,n){e.exports=function(){return e={418:function(e,t){!function(e,t){for(var n in t)e[n]=t[n]}(t,function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get: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=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),a=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={splitValues:!1});var n,a=this;this.headersMap={},e&&("undefined"!=typeof Headers&&e instanceof Headers?r.getHeaderKeys(e).forEach((function(n){r.getHeaderValues(e,n).forEach((function(e){t.splitValues?a.append(n,r.splitHeaderValue(e)):a.append(n,e)}))})):"object"==typeof(n=e)&&"object"==typeof n.headersMap&&"function"==typeof n.forEach?e.forEach((function(e,t){a.append(e,t)})):"undefined"!=typeof Map&&e instanceof Map?e.forEach((function(e,t){a.append(t,e)})):"string"==typeof e?this.appendFromString(e):"object"==typeof e&&Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];Array.isArray(n)?n.forEach((function(e){a.append(t,e)})):a.append(t,n)})))}return e.prototype.appendFromString=function(e){for(var t=e.split("\r\n"),n=0;n0){var i=r.substring(0,a).trim(),o=r.substring(a+1).trim();this.append(i,o)}}},e.prototype.delete=function(e,t){var n=r.normalizeName(e);if(void 0===t)delete this.headersMap[n];else{var a=this.headersMap[n];if(a){var i=a.indexOf(t);i>=0&&a.splice(i,1),0===a.length&&delete this.headersMap[n]}}},e.prototype.append=function(e,t){var n=this,a=r.normalizeName(e);Array.isArray(this.headersMap[a])||(this.headersMap[a]=[]),Array.isArray(t)?t.forEach((function(e){n.headersMap[a].push(r.normalizeValue(e))})):this.headersMap[a].push(r.normalizeValue(t))},e.prototype.set=function(e,t){var n=r.normalizeName(e);if(Array.isArray(t)){var a=[];t.forEach((function(e){a.push(r.normalizeValue(e))})),this.headersMap[n]=a}else this.headersMap[n]=[r.normalizeValue(t)]},e.prototype.has=function(e,t){var n=this.headersMap[r.normalizeName(e)];if(!Array.isArray(n))return!1;if(void 0!==t){var a=r.normalizeValue(t);return n.indexOf(a)>=0}return!0},e.prototype.get=function(e){var t=this.headersMap[r.normalizeName(e)];return void 0!==t?t.concat():[]},e.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.headersMap).forEach((function(n){e(n,t.headersMap[n])}),this)},e.prototype.toHeaders=function(){if("undefined"!=typeof Headers){var e=new Headers;return this.forEach((function(t,n){n.forEach((function(n){e.append(t,n)}))})),e}throw new Error("Headers class is not defined")},e}();t.BrowserHeaders=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.BrowserHeaders=r.BrowserHeaders},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterateHeaders=function(e,t){for(var n=e[Symbol.iterator](),r=n.next();!r.done;)t(r.value[0]),r=n.next()},t.iterateHeadersKeys=function(e,t){for(var n=e.keys(),r=n.next();!r.done;)t(r.value),r=n.next()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.normalizeName=function(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()},t.normalizeValue=function(e){return"string"!=typeof e&&(e=String(e)),e},t.getHeaderValues=function(e,t){var n=e;if(n instanceof Headers&&n.getAll)return n.getAll(t);var r=n.get(t);return r&&"string"==typeof r?[r]:r},t.getHeaderKeys=function(e){var t=e,n={},a=[];return t.keys?r.iterateHeadersKeys(t,(function(e){n[e]||(n[e]=!0,a.push(e))})):t.forEach?t.forEach((function(e,t){n[t]||(n[t]=!0,a.push(t))})):r.iterateHeaders(t,(function(e){var t=e[0];n[t]||(n[t]=!0,a.push(t))})),a},t.splitHeaderValue=function(e){var t=[];return e.split(", ").forEach((function(e){e.split(",").forEach((function(e){t.push(e)}))})),t}}]))},617:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkParser=t.ChunkType=t.encodeASCII=t.decodeASCII=void 0;var r,a=n(65);function i(e){return 9===(t=e)||10===t||13===t||e>=32&&e<=126;var t}function o(e){for(var t=0;t!==e.length;++t)if(!i(e[t]))throw new Error("Metadata is not valid (printable) ASCII");return String.fromCharCode.apply(String,Array.prototype.slice.call(e))}function s(e){return 128==(128&e.getUint8(0))}function u(e){return e.getUint32(1,!1)}function c(e,t,n){return e.byteLength-t>=n}function f(e,t,n){if(e.slice)return e.slice(t,n);var r=e.length;void 0!==n&&(r=n);for(var a=new Uint8Array(r-t),i=0,o=t;o=0?n:i.httpStatusToCode(t);this.props.debug&&o.debug("onHeaders.code",r);var a=e.get("grpc-message")||[];if(this.props.debug&&o.debug("onHeaders.gRPCMessage",a),this.rawOnHeaders(e),r!==i.Code.OK){var s=this.decodeGRPCStatus(a[0]);this.rawOnError(r,s,e)}}},e.prototype.onTransportChunk=function(e){var t=this;if(this.closed)this.props.debug&&o.debug("grpc.onChunk received after request was closed - ignoring");else{var n=[];try{n=this.parser.parse(e)}catch(e){return this.props.debug&&o.debug("onChunk.parsing error",e,e.message),void this.rawOnError(i.Code.Internal,"parsing error: "+e.message)}n.forEach((function(e){if(e.chunkType===a.ChunkType.MESSAGE){var n=t.methodDefinition.responseType.deserializeBinary(e.data);t.rawOnMessage(n)}else e.chunkType===a.ChunkType.TRAILERS&&(t.responseHeaders?(t.responseTrailers=new r.Metadata(e.trailers),t.props.debug&&o.debug("onChunk.trailers",t.responseTrailers)):(t.responseHeaders=new r.Metadata(e.trailers),t.rawOnHeaders(t.responseHeaders)))}))}},e.prototype.onTransportEnd=function(){if(this.props.debug&&o.debug("grpc.onEnd"),this.closed)this.props.debug&&o.debug("grpc.onEnd received after request was closed - ignoring");else if(void 0!==this.responseTrailers){var e=f(this.responseTrailers);if(null!==e){var t=this.responseTrailers.get("grpc-message"),n=this.decodeGRPCStatus(t[0]);this.rawOnEnd(e,n,this.responseTrailers)}else this.rawOnError(i.Code.Internal,"Response closed without grpc-status (Trailers provided)")}else{if(void 0===this.responseHeaders)return void this.rawOnError(i.Code.Unknown,"Response closed without headers");var r=f(this.responseHeaders),a=this.responseHeaders.get("grpc-message");if(this.props.debug&&o.debug("grpc.headers only response ",r,a),null===r)return void this.rawOnEnd(i.Code.Unknown,"Response closed without grpc-status (Headers only)",this.responseHeaders);var s=this.decodeGRPCStatus(a[0]);this.rawOnEnd(r,s,this.responseHeaders)}},e.prototype.decodeGRPCStatus=function(e){if(!e)return"";try{return decodeURIComponent(e)}catch(t){return e}},e.prototype.rawOnEnd=function(e,t,n){var r=this;this.props.debug&&o.debug("rawOnEnd",e,t,n),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(a){if(!r.closed)try{a(e,t,n)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnHeaders=function(e){this.props.debug&&o.debug("rawOnHeaders",e),this.completed||this.onHeadersCallbacks.forEach((function(t){try{t(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.rawOnError=function(e,t,n){var a=this;void 0===n&&(n=new r.Metadata),this.props.debug&&o.debug("rawOnError",e,t),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(r){if(!a.closed)try{r(e,t,n)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnMessage=function(e){var t=this;this.props.debug&&o.debug("rawOnMessage",e.toObject()),this.completed||this.closed||this.onMessageCallbacks.forEach((function(n){if(!t.closed)try{n(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.onHeaders=function(e){this.onHeadersCallbacks.push(e)},e.prototype.onMessage=function(e){this.onMessageCallbacks.push(e)},e.prototype.onEnd=function(e){this.onEndCallbacks.push(e)},e.prototype.start=function(e){if(this.started)throw new Error("Client already started - cannot .start()");this.started=!0;var t=new r.Metadata(e||{});t.set("content-type","application/grpc-web+proto"),t.set("x-grpc-web","1"),this.transport.start(t)},e.prototype.send=function(e){if(!this.started)throw new Error("Client not started - .start() must be called before .send()");if(this.closed)throw new Error("Client already closed - cannot .send()");if(this.finishedSending)throw new Error("Client already finished sending - cannot .send()");if(!this.methodDefinition.requestStream&&this.sentFirstMessage)throw new Error("Message already sent for non-client-streaming method - cannot .send()");this.sentFirstMessage=!0;var t=u.frameRequest(e);this.transport.sendMessage(t)},e.prototype.finishSend=function(){if(!this.started)throw new Error("Client not started - .finishSend() must be called before .close()");if(this.closed)throw new Error("Client already closed - cannot .send()");if(this.finishedSending)throw new Error("Client already finished sending - cannot .finishSend()");this.finishedSending=!0,this.transport.finishSend()},e.prototype.close=function(){if(!this.started)throw new Error("Client not started - .start() must be called before .close()");if(this.closed)throw new Error("Client already closed - cannot .close()");this.closed=!0,this.props.debug&&o.debug("request.abort aborting request"),this.transport.cancel()},e}();function f(e){var t=e.get("grpc-status")||[];if(t.length>0)try{var n=t[0];return parseInt(n,10)}catch(e){return null}return null}},346:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debug=void 0,t.debug=function(){for(var e=[],t=0;t=55296&&n<=56319){var r=e.charCodeAt(t+1);r>=56320&&r<=57343&&(n=65536+(n-55296<<10)+(r-56320))}return n}function d(e){for(var t=new Uint8Array(e.length),n=0,r=0;r=5;else if(2===n)r=a[i]>5||5==a[i]&&(r||i<0||a[i+1]!==b||1&a[i-1]);else if(3===n)r=r||!!a[0];else if(r=!1,0!==n)throw Error(d);if(i<1)a.length=1,r?(e.e=-t,a[0]=1):a[0]=e.e=0;else{if(a.length=i--,r)for(;++a[i]>9;)a[i]=0,i--||(++e.e,a.unshift(1));for(i=a.length;!a[--i];)a.pop()}}else if(n<0||n>3||n!==~~n)throw Error(d);return e}function m(e,t,n,r){var a,i,s=e.constructor,u=!e.c[0];if(n!==b){if(n!==~~n||n<(3==t)||n>o)throw Error(3==t?c+"precision":f);for(n=r-(e=new s(e)).e,e.c.length>++r&&y(e,n,s.RM),2==t&&(r=e.e+n+1);e.c.length=s.PE))i=i.charAt(0)+(n>1?"."+i.slice(1):"")+(a<0?"e":"e+")+a;else if(a<0){for(;++a;)i="0"+i;i="0."+i}else if(a>0)if(++a>n)for(a-=n;a--;)i+="0";else a1&&(i=i.charAt(0)+"."+i.slice(1));return e.s<0&&(!u||4==t)?"-"+i:i}p.abs=function(){var e=new this.constructor(this);return e.s=1,e},p.cmp=function(e){var t,n=this,r=n.c,a=(e=new n.constructor(e)).c,i=n.s,o=e.s,s=n.e,u=e.e;if(!r[0]||!a[0])return r[0]?i:a[0]?-o:0;if(i!=o)return i;if(t=i<0,s!=u)return s>u^t?1:-1;for(o=(s=r.length)<(u=a.length)?s:u,i=-1;++ia[i]^t?1:-1;return s==u?0:s>u^t?1:-1},p.div=function(e){var t=this,n=t.constructor,r=t.c,a=(e=new n(e)).c,i=t.s==e.s?1:-1,s=n.DP;if(s!==~~s||s<0||s>o)throw Error(f);if(!a[0])throw Error(l);if(!r[0])return new n(0*i);var u,c,d,p,h,m=a.slice(),v=u=a.length,g=r.length,w=r.slice(0,u),T=w.length,k=e,_=k.c=[],O=0,S=s+(k.e=t.e-e.e)+1;for(k.s=i,i=S<0?0:S,m.unshift(0);T++T?1:-1;else for(h=-1,p=0;++hw[h]?1:-1;break}if(!(p<0))break;for(c=T==u?a:m;T;){if(w[--T]S&&y(k,s,n.RM,w[0]!==b),k},p.eq=function(e){return!this.cmp(e)},p.gt=function(e){return this.cmp(e)>0},p.gte=function(e){return this.cmp(e)>-1},p.lt=function(e){return this.cmp(e)<0},p.lte=function(e){return this.cmp(e)<1},p.minus=p.sub=function(e){var t,n,r,a,i=this,o=i.constructor,s=i.s,u=(e=new o(e)).s;if(s!=u)return e.s=-u,i.plus(e);var c=i.c.slice(),f=i.e,d=e.c,l=e.e;if(!c[0]||!d[0])return d[0]?(e.s=-u,e):new o(c[0]?i:0);if(s=f-l){for((a=s<0)?(s=-s,r=c):(l=f,r=d),r.reverse(),u=s;u--;)r.push(0);r.reverse()}else for(n=((a=c.length0)for(;u--;)c[t++]=0;for(u=t;n>s;){if(c[--n]0?(u=o,t=c):(a=-a,t=s),t.reverse();a--;)t.push(0);t.reverse()}for(s.length-c.length<0&&(t=c,c=s,s=t),a=c.length,i=0;a;s[a]%=10)i=(s[--a]=s[a]+c[a]+i)/10|0;for(i&&(s.unshift(i),++u),a=s.length;0===s[--a];)s.pop();return e.c=s,e.e=u,e},p.pow=function(e){var t=this,n=new t.constructor(1),r=n,a=e<0;if(e!==~~e||e<-1e6||e>s)throw Error(c+"exponent");for(a&&(e=-e);1&e&&(r=r.times(t)),e>>=1;)t=t.times(t);return a?n.div(r):r},p.round=function(e,t){var n=this.constructor;if(e===b)e=0;else if(e!==~~e||e<-o||e>o)throw Error(f);return y(new n(this),e,t===b?n.RM:t)},p.sqrt=function(){var e,t,n,r=this,a=r.constructor,i=r.s,o=r.e,s=new a(.5);if(!r.c[0])return new a(r);if(i<0)throw Error(u+"No square root");0===(i=Math.sqrt(r+""))||i===1/0?((t=r.c.join("")).length+o&1||(t+="0"),o=((o+1)/2|0)-(o<0||1&o),e=new a(((i=Math.sqrt(t))==1/0?"1e":(i=i.toExponential()).slice(0,i.indexOf("e")+1))+o)):e=new a(i),o=e.e+(a.DP+=4);do{n=e,e=s.times(n.plus(r.div(n)))}while(n.c.slice(0,o).join("")!==e.c.slice(0,o).join(""));return y(e,a.DP-=4,a.RM)},p.times=p.mul=function(e){var t,n=this,r=n.constructor,a=n.c,i=(e=new r(e)).c,o=a.length,s=i.length,u=n.e,c=e.e;if(e.s=n.s==e.s?1:-1,!a[0]||!i[0])return new r(0*e.s);for(e.e=u+c,ou;)s=t[c]+i[u]*a[c-u-1]+s,t[c--]=s%10,s=s/10|0;t[c]=(t[c]+s)%10}for(s?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},p.toExponential=function(e){return m(this,1,e,e)},p.toFixed=function(e){return m(this,2,e,this.e+e)},p.toPrecision=function(e){return m(this,3,e,e-1)},p.toString=function(){return m(this)},p.valueOf=p.toJSON=function(){return m(this,4)},i=function e(){function t(n){var r=this;if(!(r instanceof t))return n===b?e():new t(n);n instanceof t?(r.s=n.s,r.e=n.e,r.c=n.c.slice()):function(e,t){var n,r,a;if(0===t&&1/t<0)t="-0";else if(!h.test(t+=""))throw Error(c+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(n=t.indexOf("."))>-1&&(t=t.replace(".",""));(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length);for(a=t.length,r=0;r0&&"0"==t.charAt(--a););for(e.e=n-r-1,e.c=[],n=0;r<=a;)e.c[n++]=+t.charAt(r++)}}(r,n),r.constructor=t}return t.prototype=p,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.version="5.2.2",t}(),i.default=i.Big=i,void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},function(e){e.exports=JSON.parse('{"a":[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"_reserve0","type":"uint112"},{"internalType":"uint112","name":"_reserve1","type":"uint112"},{"internalType":"uint32","name":"_blockTimestampLast","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"kLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"sync","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]}')},function(e){e.exports=JSON.parse('{"a":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount0","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amount1","type":"uint128"}],"name":"Collect","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint128","name":"amount0","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amount1","type":"uint128"}],"name":"CollectProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paid0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paid1","type":"uint256"}],"name":"Flash","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"observationCardinalityNextOld","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"observationCardinalityNextNew","type":"uint16"}],"name":"IncreaseObservationCardinalityNext","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"feeProtocol0Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol0New","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1New","type":"uint8"}],"name":"SetFeeProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"int256","name":"amount0","type":"int256"},{"indexed":false,"internalType":"int256","name":"amount1","type":"int256"},{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Swap","type":"event"},{"inputs":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount","type":"uint128"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount0Requested","type":"uint128"},{"internalType":"uint128","name":"amount1Requested","type":"uint128"}],"name":"collect","outputs":[{"internalType":"uint128","name":"amount0","type":"uint128"},{"internalType":"uint128","name":"amount1","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint128","name":"amount0Requested","type":"uint128"},{"internalType":"uint128","name":"amount1Requested","type":"uint128"}],"name":"collectProtocol","outputs":[{"internalType":"uint128","name":"amount0","type":"uint128"},{"internalType":"uint128","name":"amount1","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeGrowthGlobal0X128","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeGrowthGlobal1X128","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"observationCardinalityNext","type":"uint16"}],"name":"increaseObservationCardinalityNext","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidity","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLiquidityPerTick","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"observations","outputs":[{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"int56","name":"tickCumulative","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityCumulativeX128","type":"uint160"},{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"secondsAgos","type":"uint32[]"}],"name":"observe","outputs":[{"internalType":"int56[]","name":"tickCumulatives","type":"int56[]"},{"internalType":"uint160[]","name":"secondsPerLiquidityCumulativeX128s","type":"uint160[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"positions","outputs":[{"internalType":"uint128","name":"_liquidity","type":"uint128"},{"internalType":"uint256","name":"feeGrowthInside0LastX128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthInside1LastX128","type":"uint256"},{"internalType":"uint128","name":"tokensOwed0","type":"uint128"},{"internalType":"uint128","name":"tokensOwed1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFees","outputs":[{"internalType":"uint128","name":"token0","type":"uint128"},{"internalType":"uint128","name":"token1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"feeProtocol0","type":"uint8"},{"internalType":"uint8","name":"feeProtocol1","type":"uint8"}],"name":"setFeeProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slot0","outputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint16","name":"observationIndex","type":"uint16"},{"internalType":"uint16","name":"observationCardinality","type":"uint16"},{"internalType":"uint16","name":"observationCardinalityNext","type":"uint16"},{"internalType":"uint8","name":"feeProtocol","type":"uint8"},{"internalType":"bool","name":"unlocked","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"}],"name":"snapshotCumulativesInside","outputs":[{"internalType":"int56","name":"tickCumulativeInside","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityInsideX128","type":"uint160"},{"internalType":"uint32","name":"secondsInside","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"int256","name":"amountSpecified","type":"int256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[{"internalType":"int256","name":"amount0","type":"int256"},{"internalType":"int256","name":"amount1","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int16","name":"wordPosition","type":"int16"}],"name":"tickBitmap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tickSpacing","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"tick","type":"int24"}],"name":"ticks","outputs":[{"internalType":"uint128","name":"liquidityGross","type":"uint128"},{"internalType":"int128","name":"liquidityNet","type":"int128"},{"internalType":"uint256","name":"feeGrowthOutside0X128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthOutside1X128","type":"uint256"},{"internalType":"int56","name":"tickCumulativeOutside","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityOutsideX128","type":"uint160"},{"internalType":"uint32","name":"secondsOutside","type":"uint32"},{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]}')},,,,,,,,function(e,t,n){"use strict";var r=n(99).rotr32;function a(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function o(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?a(t,n,r):1===e||3===e?o(t,n,r):2===e?i(t,n,r):void 0},t.ch32=a,t.maj32=i,t.p32=o,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,n){"use strict";var r=n(99),a=n(158),i=n(270),o=n(128),s=r.sum32,u=r.sum32_4,c=r.sum32_5,f=i.ch32,d=i.maj32,l=i.s0_256,p=i.s1_256,b=i.g0_256,h=i.g1_256,y=a.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}r.inherits(v,y),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r256||t[2]&&t[2]!==String(r))&&y.throwArgumentError("invalid numeric width","type",e);var a=T.mask(n?r-1:r),i=n?a.add(w).mul(v):g;return function(t){var n=u.a.from(t);return(n.lt(i)||n.gt(a))&&y.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(c.hexZeroPad)(n.toTwos(256).toHexString(),32)}}var o=e.match(/^bytes(\d+)$/);if(o){var d=parseInt(o[1]);return(0===d||d>32||o[1]!==String(d))&&y.throwArgumentError("invalid bytes width","type",e),function(t){return Object(c.arrayify)(t).length!==d&&y.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(c.arrayify)(e),n=t.length%32;return n?Object(c.hexConcat)([t,m.slice(n)]):Object(c.hexlify)(t)}(t)}}switch(e){case"address":return function(e){return Object(c.hexZeroPad)(Object(s.getAddress)(e),32)};case"bool":return function(e){return e?k:_};case"bytes":return function(e){return Object(f.keccak256)(e)};case"string":return function(e){return Object(b.a)(e)}}return null}function E(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var P=function(){function e(t){Object(r.a)(this,e),Object(d.defineReadOnly)(this,"types",Object.freeze(Object(d.deepCopy)(t))),Object(d.defineReadOnly)(this,"_encoderCache",{}),Object(d.defineReadOnly)(this,"_types",{});var n={},a={},i={};Object.keys(t).forEach((function(e){n[e]={},a[e]=[],i[e]={}}));var o=function(e){var r={};t[e].forEach((function(i){r[i.name]&&y.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(e)),"types",t),r[i.name]=!0;var o=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===e&&y.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),M(o)||(a[o]||y.throwArgumentError("unknown type ".concat(JSON.stringify(o)),"types",t),a[o].push(e),n[e][o]=!0)}))};for(var s in t)o(s);var u=Object.keys(a).filter((function(e){return 0===a[e].length}));for(var c in 0===u.length?y.throwArgumentError("missing primary type","types",t):u.length>1&&y.throwArgumentError("ambiguous primary types or unused types: ".concat(u.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),Object(d.defineReadOnly)(this,"primaryType",u[0]),function e(r,o){o[r]&&y.throwArgumentError("circular type reference to ".concat(JSON.stringify(r)),"types",t),o[r]=!0,Object.keys(n[r]).forEach((function(t){a[t]&&(e(t,o),Object.keys(o).forEach((function(e){i[e][t]=!0})))})),delete o[r]}(this.primaryType,{}),i){var f=Object.keys(i[c]);f.sort(),this._types[c]=E(c,t[c])+f.map((function(e){return E(e,t[e])})).join("")}}return Object(a.a)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,n=M(e);if(n)return n;var r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){var a=r[1],i=this.getEncoder(a),o=parseInt(r[3]);return function(e){o>=0&&e.length!==o&&y.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var n=e.map(i);return t._types[a]&&(n=n.map(f.keccak256)),Object(f.keccak256)(Object(c.hexConcat)(n))}}var s=this.types[e];if(s){var u=Object(b.a)(this._types[e]);return function(e){var n=s.map((function(n){var r=n.name,a=n.type,i=t.getEncoder(a)(e[r]);return t._types[a]?Object(f.keccak256)(i):i}));return n.unshift(u),Object(c.hexConcat)(n)}}return y.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||y.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return Object(f.keccak256)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,n){var r=this;if(M(e))return n(e,t);var a=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(a){var i=a[1],o=parseInt(a[3]);return o>=0&&t.length!==o&&y.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return r._visit(i,e,n)}))}var s=this.types[e];return s?s.reduce((function(e,a){var i=a.name,o=a.type;return e[i]=r._visit(o,t[i],n),e}),{}):y.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,n,r){return e.from(n).hashStruct(t,r)}},{key:"hashDomain",value:function(t){var n=[];for(var r in t){var a=O[r];a||y.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",t),n.push({name:r,type:a})}return n.sort((function(e,t){return S.indexOf(e.name)-S.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:n},t)}},{key:"encode",value:function(t,n,r){return Object(c.hexConcat)(["0x1901",e.hashDomain(t),e.from(n).hash(r)])}},{key:"hash",value:function(t,n,r){return Object(f.keccak256)(e.encode(t,n,r))}},{key:"resolveNames",value:function(t,n,r,a){return h(this,void 0,void 0,o.a.mark((function i(){var s,u,f;return o.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t=Object(d.shallowCopy)(t),s={},t.verifyingContract&&!Object(c.isHexString)(t.verifyingContract,20)&&(s[t.verifyingContract]="0x"),(u=e.from(n)).visit(r,(function(e,t){return"address"!==e||Object(c.isHexString)(t,20)||(s[t]="0x"),t})),i.t0=o.a.keys(s);case 6:if((i.t1=i.t0()).done){i.next=13;break}return f=i.t1.value,i.next=10,a(f);case 10:s[f]=i.sent,i.next=6;break;case 13:return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),r=u.visit(r,(function(e,t){return"address"===e&&s[t]?s[t]:t})),i.abrupt("return",{domain:t,value:r});case 16:case"end":return i.stop()}}),i)})))}},{key:"getPayload",value:function(t,n,r){e.hashDomain(t);var a={},i=[];S.forEach((function(e){var n=t[e];null!=n&&(a[e]=A[e](n),i.push({name:e,type:O[e]}))}));var o=e.from(n),s=Object(d.shallowCopy)(n);return s.EIP712Domain?y.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",n):s.EIP712Domain=i,o.encode(r),{types:s,domain:a,primaryType:o.primaryType,message:o.visit(r,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(c.hexlify)(Object(c.arrayify)(t));if(e.match(/^u?int/))return u.a.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&y.throwArgumentError("invalid string","value",t),t}return y.throwArgumentError("unsupported type","type",e)}))}}}]),e}()},function(e,t,n){(function(e){var r="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(442),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(35))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="0x0000000000000000000000000000000000000000"},function(e,t,n){"use strict";function r(e){for(var t=(e=e.slice()).length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}n.d(t,"a",(function(){return r}))},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(452);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(160),a=n(280),i=n(161);e.exports=function(e){var t=a();return function(){var n,a=r(e);if(t){var o=r(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return i(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(160),a=n(231),i=n(455),o=n(456);function s(t){var n="function"===typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,a="~";function i(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,i){if("function"!==typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||e,i),u=a?a+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(a=!1)),c.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(a?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},c.prototype.listeners=function(e){var t=a?a+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,o=new Array(i);r>8,o=255&a;i?n.push(i,o):n.push(o)}return n},r.zero2=a,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},function(e,t,n){var r;function a(e){this.rand=e}if(e.exports=function(e){return r||(r=new a(null)),r.generate(e)},e.exports.Rand=a,a.prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=l(),d.alloc=function(e){return new a.Array(e)},a.Array!==Array&&(d.alloc=a.pool(d.alloc,a.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},b.prototype=Object.create(u.prototype),b.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new b((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},d.prototype.bool=function(e){return this._push(p,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=i.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(a.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(a.float.writeDoubleLE,8,e)};var m=a.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r>>0;if(!t)return this._push(p,1,0);if(a.isString(e)){var n=d.alloc(t=o.length(e));o.decode(e,n,0),e=n}return this.uint32(t)._push(m,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new u(c,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=l(),r._configure()}},function(e,t,n){"use strict";e.exports=u;var r,a=n(129),i=a.LongBits,o=a.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c="undefined"!==typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},f=function(){return a.Buffer?function(e){return(u.create=function(e){return a.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};function d(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new i(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=a.Array.prototype.subarray||a.Array.prototype.slice,u.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return e}}(),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return l(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|l(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=a.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=a.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},u.prototype.skip=function(e){if("number"===typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!==(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){r=e,u.create=f(),r._configure();var t=a.Long?"toLong":"toNumber";a.merge(u.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));n(11),n(98);var r=n(58);n(30);function a(t){return e.from(Object(r.zeroPad)(Object(r.arrayify)(t),32)).toString("hex")}}).call(this,n(21).Buffer)},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]}),a=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}),a(n(496),t),a(n(497),t)},function(e,t,n){"use strict";var r=n(59).default,a=n(63).default,i=n(33).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgMultiSendResponse=t.MsgMultiSend=t.MsgSendResponse=t.MsgSend=t.protobufPackage=void 0;var s=o(n(24)),u=o(n(20)),c=n(68),f=n(292);t.protobufPackage="cosmos.bank.v1beta1";var d={fromAddress:"",toAddress:""};t.MsgSend={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();""!==e.fromAddress&&t.uint32(10).string(e.fromAddress),""!==e.toAddress&&t.uint32(18).string(e.toAddress);var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;c.Coin.encode(a,t.uint32(26).fork()).ldelim()}}catch(o){r.e(o)}finally{r.f()}return 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,a=Object.assign({},d);for(a.amount=[];n.pos>>3){case 1:a.fromAddress=n.string();break;case 2:a.toAddress=n.string();break;case 3:a.amount.push(c.Coin.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},d);if(t.amount=[],void 0!==e.fromAddress&&null!==e.fromAddress?t.fromAddress=String(e.fromAddress):t.fromAddress="",void 0!==e.toAddress&&null!==e.toAddress?t.toAddress=String(e.toAddress):t.toAddress="",void 0!==e.amount&&null!==e.amount){var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.amount.push(c.Coin.fromJSON(a))}}catch(o){r.e(o)}finally{r.f()}}return t},toJSON:function(e){var t={};return void 0!==e.fromAddress&&(t.fromAddress=e.fromAddress),void 0!==e.toAddress&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map((function(e){return e?c.Coin.toJSON(e):void 0})):t.amount=[],t},fromPartial:function(e){var t=Object.assign({},d);if(t.amount=[],void 0!==e.fromAddress&&null!==e.fromAddress?t.fromAddress=e.fromAddress:t.fromAddress="",void 0!==e.toAddress&&null!==e.toAddress?t.toAddress=e.toAddress:t.toAddress="",void 0!==e.amount&&null!==e.amount){var n,r=i(e.amount);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.amount.push(c.Coin.fromPartial(a))}}catch(o){r.e(o)}finally{r.f()}}return t}};var l={};t.MsgSendResponse={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,a=Object.assign({},l);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create(),r=i(e.inputs);try{for(r.s();!(t=r.n()).done;){var a=t.value;f.Input.encode(a,n.uint32(10).fork()).ldelim()}}catch(d){r.e(d)}finally{r.f()}var o,s=i(e.outputs);try{for(s.s();!(o=s.n()).done;){var c=o.value;f.Output.encode(c,n.uint32(18).fork()).ldelim()}}catch(d){s.e(d)}finally{s.f()}return n},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,a=Object.assign({},p);for(a.inputs=[],a.outputs=[];n.pos>>3){case 1:a.inputs.push(f.Input.decode(n,n.uint32()));break;case 2:a.outputs.push(f.Output.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);if(t.inputs=[],t.outputs=[],void 0!==e.inputs&&null!==e.inputs){var n,r=i(e.inputs);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.inputs.push(f.Input.fromJSON(a))}}catch(c){r.e(c)}finally{r.f()}}if(void 0!==e.outputs&&null!==e.outputs){var o,s=i(e.outputs);try{for(s.s();!(o=s.n()).done;){var u=o.value;t.outputs.push(f.Output.fromJSON(u))}}catch(c){s.e(c)}finally{s.f()}}return t},toJSON:function(e){var t={};return e.inputs?t.inputs=e.inputs.map((function(e){return e?f.Input.toJSON(e):void 0})):t.inputs=[],e.outputs?t.outputs=e.outputs.map((function(e){return e?f.Output.toJSON(e):void 0})):t.outputs=[],t},fromPartial:function(e){var t=Object.assign({},p);if(t.inputs=[],t.outputs=[],void 0!==e.inputs&&null!==e.inputs){var n,r=i(e.inputs);try{for(r.s();!(n=r.n()).done;){var a=n.value;t.inputs.push(f.Input.fromPartial(a))}}catch(c){r.e(c)}finally{r.f()}}if(void 0!==e.outputs&&null!==e.outputs){var o,s=i(e.outputs);try{for(s.s();!(o=s.n()).done;){var u=o.value;t.outputs.push(f.Output.fromPartial(u))}}catch(c){s.e(c)}finally{s.f()}}return t}};var b={};t.MsgMultiSendResponse={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,a=Object.assign({},b);n.pos1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),i=r(e.sendEnabled);try{for(i.s();!(n=i.n()).done;){var s=n.value;t.SendEnabled.encode(s,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return!0===e.defaultSendEnabled&&a.uint32(16).bool(e.defaultSendEnabled),a},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},u);for(i.sendEnabled=[];r.pos>>3){case 1:i.sendEnabled.push(t.SendEnabled.decode(r,r.uint32()));break;case 2:i.defaultSendEnabled=r.bool();break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},u);if(n.sendEnabled=[],void 0!==e.sendEnabled&&null!==e.sendEnabled){var a,i=r(e.sendEnabled);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.sendEnabled.push(t.SendEnabled.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.defaultSendEnabled&&null!==e.defaultSendEnabled?n.defaultSendEnabled=Boolean(e.defaultSendEnabled):n.defaultSendEnabled=!1,n},toJSON:function(e){var n={};return e.sendEnabled?n.sendEnabled=e.sendEnabled.map((function(e){return e?t.SendEnabled.toJSON(e):void 0})):n.sendEnabled=[],void 0!==e.defaultSendEnabled&&(n.defaultSendEnabled=e.defaultSendEnabled),n},fromPartial:function(e){var n=Object.assign({},u);if(n.sendEnabled=[],void 0!==e.sendEnabled&&null!==e.sendEnabled){var a,i=r(e.sendEnabled);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.sendEnabled.push(t.SendEnabled.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.defaultSendEnabled&&null!==e.defaultSendEnabled?n.defaultSendEnabled=e.defaultSendEnabled:n.defaultSendEnabled=!1,n}};var c={denom:"",enabled:!1};t.SendEnabled={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.denom&&t.uint32(10).string(e.denom),!0===e.enabled&&t.uint32(16).bool(e.enabled),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);n.pos>>3){case 1:a.denom=n.string();break;case 2:a.enabled=n.bool();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},c);return void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.enabled&&null!==e.enabled?t.enabled=Boolean(e.enabled):t.enabled=!1,t},toJSON:function(e){var t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.enabled&&(t.enabled=e.enabled),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.enabled&&null!==e.enabled?t.enabled=e.enabled:t.enabled=!1,t}};var f={address:""};t.Input={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();""!==e.address&&t.uint32(10).string(e.address);var n,a=r(e.coins);try{for(a.s();!(n=a.n()).done;){var i=n.value;s.Coin.encode(i,t.uint32(18).fork()).ldelim()}}catch(u){a.e(u)}finally{a.f()}return t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},f);for(a.coins=[];n.pos>>3){case 1:a.address=n.string();break;case 2:a.coins.push(s.Coin.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=String(e.address):t.address="",void 0!==e.coins&&null!==e.coins){var n,a=r(e.coins);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.coins.push(s.Coin.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map((function(e){return e?s.Coin.toJSON(e):void 0})):t.coins=[],t},fromPartial:function(e){var t=Object.assign({},f);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=e.address:t.address="",void 0!==e.coins&&null!==e.coins){var n,a=r(e.coins);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.coins.push(s.Coin.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return t}};var d={address:""};t.Output={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();""!==e.address&&t.uint32(10).string(e.address);var n,a=r(e.coins);try{for(a.s();!(n=a.n()).done;){var i=n.value;s.Coin.encode(i,t.uint32(18).fork()).ldelim()}}catch(u){a.e(u)}finally{a.f()}return t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},d);for(a.coins=[];n.pos>>3){case 1:a.address=n.string();break;case 2:a.coins.push(s.Coin.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},d);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=String(e.address):t.address="",void 0!==e.coins&&null!==e.coins){var n,a=r(e.coins);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.coins.push(s.Coin.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map((function(e){return e?s.Coin.toJSON(e):void 0})):t.coins=[],t},fromPartial:function(e){var t=Object.assign({},d);if(t.coins=[],void 0!==e.address&&null!==e.address?t.address=e.address:t.address="",void 0!==e.coins&&null!==e.coins){var n,a=r(e.coins);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.coins.push(s.Coin.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return t}};var l={};t.Supply={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.total);try{for(a.s();!(t=a.n()).done;){var i=t.value;s.Coin.encode(i,n.uint32(10).fork()).ldelim()}}catch(u){a.e(u)}finally{a.f()}return n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);for(a.total=[];n.pos>>3===1)a.total.push(s.Coin.decode(n,n.uint32()));else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},l);if(t.total=[],void 0!==e.total&&null!==e.total){var n,a=r(e.total);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.total.push(s.Coin.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.total?t.total=e.total.map((function(e){return e?s.Coin.toJSON(e):void 0})):t.total=[],t},fromPartial:function(e){var t=Object.assign({},l);if(t.total=[],void 0!==e.total&&null!==e.total){var n,a=r(e.total);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.total.push(s.Coin.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return t}};var p={denom:"",exponent:0,aliases:""};t.DenomUnit={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();""!==e.denom&&t.uint32(10).string(e.denom),0!==e.exponent&&t.uint32(16).uint32(e.exponent);var n,a=r(e.aliases);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.uint32(26).string(i)}}catch(s){a.e(s)}finally{a.f()}return t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);for(a.aliases=[];n.pos>>3){case 1:a.denom=n.string();break;case 2:a.exponent=n.uint32();break;case 3:a.aliases.push(n.string());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);if(t.aliases=[],void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.exponent&&null!==e.exponent?t.exponent=Number(e.exponent):t.exponent=0,void 0!==e.aliases&&null!==e.aliases){var n,a=r(e.aliases);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.aliases.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.exponent&&(t.exponent=e.exponent),e.aliases?t.aliases=e.aliases.map((function(e){return e})):t.aliases=[],t},fromPartial:function(e){var t=Object.assign({},p);if(t.aliases=[],void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.exponent&&null!==e.exponent?t.exponent=e.exponent:t.exponent=0,void 0!==e.aliases&&null!==e.aliases){var n,a=r(e.aliases);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.aliases.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var b={description:"",base:"",display:"",name:"",symbol:""};t.Metadata={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();""!==e.description&&n.uint32(10).string(e.description);var a,i=r(e.denomUnits);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.DenomUnit.encode(s,n.uint32(18).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return""!==e.base&&n.uint32(26).string(e.base),""!==e.display&&n.uint32(34).string(e.display),""!==e.name&&n.uint32(42).string(e.name),""!==e.symbol&&n.uint32(50).string(e.symbol),n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},b);for(i.denomUnits=[];r.pos>>3){case 1:i.description=r.string();break;case 2:i.denomUnits.push(t.DenomUnit.decode(r,r.uint32()));break;case 3:i.base=r.string();break;case 4:i.display=r.string();break;case 5:i.name=r.string();break;case 6:i.symbol=r.string();break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},b);if(n.denomUnits=[],void 0!==e.description&&null!==e.description?n.description=String(e.description):n.description="",void 0!==e.denomUnits&&null!==e.denomUnits){var a,i=r(e.denomUnits);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.denomUnits.push(t.DenomUnit.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.base&&null!==e.base?n.base=String(e.base):n.base="",void 0!==e.display&&null!==e.display?n.display=String(e.display):n.display="",void 0!==e.name&&null!==e.name?n.name=String(e.name):n.name="",void 0!==e.symbol&&null!==e.symbol?n.symbol=String(e.symbol):n.symbol="",n},toJSON:function(e){var n={};return void 0!==e.description&&(n.description=e.description),e.denomUnits?n.denomUnits=e.denomUnits.map((function(e){return e?t.DenomUnit.toJSON(e):void 0})):n.denomUnits=[],void 0!==e.base&&(n.base=e.base),void 0!==e.display&&(n.display=e.display),void 0!==e.name&&(n.name=e.name),void 0!==e.symbol&&(n.symbol=e.symbol),n},fromPartial:function(e){var n=Object.assign({},b);if(n.denomUnits=[],void 0!==e.description&&null!==e.description?n.description=e.description:n.description="",void 0!==e.denomUnits&&null!==e.denomUnits){var a,i=r(e.denomUnits);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.denomUnits.push(t.DenomUnit.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.base&&null!==e.base?n.base=e.base:n.base="",void 0!==e.display&&null!==e.display?n.display=e.display:n.display="",void 0!==e.name&&null!==e.name?n.name=e.name:n.name="",void 0!==e.symbol&&null!==e.symbol?n.symbol=e.symbol:n.symbol="",n}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},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]}),a=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}),a(n(498),t),a(n(499),t),a(n(500),t),a(n(501),t)},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]}),a=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}),a(n(502),t),a(n(503),t)},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]}),a=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}),t.Allowance=void 0;var i=n(180),o=n(236),s=n(296);a(n(180),t),a(n(236),t),a(n(296),t),function(e){e.fromAmino=function(e){switch(e.type){case"feegrant/BasicAllowance":return i.BasicAllowance.fromAmino(e);case"feegrant/PeriodicAllowance":return o.PeriodicAllowance.fromAmino(e);case"feegrant/AllowedMsgAllowance":return s.AllowedMsgAllowance.fromAmino(e)}},e.fromData=function(e){switch(e["@type"]){case"/cosmos.feegrant.v1beta1.PeriodicAllowance":return o.PeriodicAllowance.fromData(e);case"/cosmos.feegrant.v1beta1.BasicAllowance":return i.BasicAllowance.fromData(e);case"/cosmos.feegrant.v1beta1.AllowedMsgAllowance":return s.AllowedMsgAllowance.fromData(e)}},e.fromProto=function(e){switch(e.typeUrl){case"/cosmos.feegrant.v1beta1.PeriodicAllowance":return o.PeriodicAllowance.unpackAny(e);case"/cosmos.feegrant.v1beta1.BasicAllowance":return i.BasicAllowance.unpackAny(e);case"/cosmos.feegrant.v1beta1.AllowedMsgAllowance":return s.AllowedMsgAllowance.unpackAny(e)}throw new Error("not supported allowance "+e.typeUrl)}}(t.Allowance||(t.Allowance={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedMsgAllowance=void 0;var a=n(23),i=n(180),o=n(236),s=n(25),u=n(235),c=function(e){function t(t,n){var r=e.call(this)||this;return r.allowance=t,r.allowed_messages=n,r}return r(t,e),t.fromAmino=function(e){var n=e.value,r=n.allowance,a=n.allowed_messages;return new t("feegrant/BasicAllowance"===r.type?i.BasicAllowance.fromAmino(r):o.PeriodicAllowance.fromAmino(r),a)},t.prototype.toAmino=function(){var e=this.allowance,t=this.allowed_messages;return{type:"feegrant/AllowedMsgAllowance",value:{allowance:e.toAmino(),allowed_messages:t}}},t.fromData=function(e){var n=e.allowance,r=e.allowed_messages;return new t("/cosmos.feegrant.v1beta1.BasicAllowance"===n["@type"]?i.BasicAllowance.fromData(n):o.PeriodicAllowance.fromData(n),r)},t.prototype.toData=function(){var e=this.allowance,t=this.allowed_messages;return{"@type":"/cosmos.feegrant.v1beta1.AllowedMsgAllowance",allowance:e.toData(),allowed_messages:t}},t.fromProto=function(e){var n=e.allowance;return new t("/cosmos.feegrant.v1beta1.BasicAllowance"===(null===n||void 0===n?void 0:n.typeUrl)?i.BasicAllowance.unpackAny(n):o.PeriodicAllowance.unpackAny(n),e.allowedMessages)},t.prototype.toProto=function(){var e=this.allowance,t=this.allowed_messages;return u.AllowedMsgAllowance.fromPartial({allowance:e.packAny(),allowedMessages:t})},t.prototype.packAny=function(){return s.Any.fromPartial({typeUrl:"/cosmos.feegrant.v1beta1.AllowedMsgAllowance",value:u.AllowedMsgAllowance.encode(this.toProto()).finish()})},t.unpackAny=function(e){return t.fromProto(u.AllowedMsgAllowance.decode(e.value))},t}(a.JSONSerializable);t.AllowedMsgAllowance=c},function(e,t,n){"use strict";var r=n(59).default,a=n(63).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgRevokeAllowanceResponse=t.MsgRevokeAllowance=t.MsgGrantAllowanceResponse=t.MsgGrantAllowance=t.protobufPackage=void 0;var o=i(n(24)),s=i(n(20)),u=n(25);t.protobufPackage="cosmos.feegrant.v1beta1";var c={granter:"",grantee:""};t.MsgGrantAllowance={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.granter&&t.uint32(10).string(e.granter),""!==e.grantee&&t.uint32(18).string(e.grantee),void 0!==e.allowance&&u.Any.encode(e.allowance,t.uint32(26).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);n.pos>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.allowance=u.Any.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},c);return void 0!==e.granter&&null!==e.granter?t.granter=String(e.granter):t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=String(e.grantee):t.grantee="",void 0!==e.allowance&&null!==e.allowance?t.allowance=u.Any.fromJSON(e.allowance):t.allowance=void 0,t},toJSON:function(e){var t={};return void 0!==e.granter&&(t.granter=e.granter),void 0!==e.grantee&&(t.grantee=e.grantee),void 0!==e.allowance&&(t.allowance=e.allowance?u.Any.toJSON(e.allowance):void 0),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.granter&&null!==e.granter?t.granter=e.granter:t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=e.grantee:t.grantee="",void 0!==e.allowance&&null!==e.allowance?t.allowance=u.Any.fromPartial(e.allowance):t.allowance=void 0,t}};var f={};t.MsgGrantAllowanceResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},f);n.pos1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.granter&&t.uint32(10).string(e.granter),""!==e.grantee&&t.uint32(18).string(e.grantee),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},d);n.pos>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},d);return void 0!==e.granter&&null!==e.granter?t.granter=String(e.granter):t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=String(e.grantee):t.grantee="",t},toJSON:function(e){var t={};return void 0!==e.granter&&(t.granter=e.granter),void 0!==e.grantee&&(t.grantee=e.grantee),t},fromPartial:function(e){var t=Object.assign({},d);return void 0!==e.granter&&null!==e.granter?t.granter=e.granter:t.granter="",void 0!==e.grantee&&null!==e.grantee?t.grantee=e.grantee:t.grantee="",t}};var l={};t.MsgRevokeAllowanceResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);n.pos1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();""!==e.title&&n.uint32(10).string(e.title),""!==e.description&&n.uint32(18).string(e.description);var a,i=r(e.changes);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.ParamChange.encode(s,n.uint32(26).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},s);for(i.changes=[];r.pos>>3){case 1:i.title=r.string();break;case 2:i.description=r.string();break;case 3:i.changes.push(t.ParamChange.decode(r,r.uint32()));break;default:r.skipType(7&u)}}return i},fromJSON:function(e){var n=Object.assign({},s);if(n.changes=[],void 0!==e.title&&null!==e.title?n.title=String(e.title):n.title="",void 0!==e.description&&null!==e.description?n.description=String(e.description):n.description="",void 0!==e.changes&&null!==e.changes){var a,i=r(e.changes);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.changes.push(t.ParamChange.fromJSON(o))}}catch(u){i.e(u)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.title&&(n.title=e.title),void 0!==e.description&&(n.description=e.description),e.changes?n.changes=e.changes.map((function(e){return e?t.ParamChange.toJSON(e):void 0})):n.changes=[],n},fromPartial:function(e){var n=Object.assign({},s);if(n.changes=[],void 0!==e.title&&null!==e.title?n.title=e.title:n.title="",void 0!==e.description&&null!==e.description?n.description=e.description:n.description="",void 0!==e.changes&&null!==e.changes){var a,i=r(e.changes);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.changes.push(t.ParamChange.fromPartial(o))}}catch(u){i.e(u)}finally{i.f()}}return n}};var u={subspace:"",key:"",value:""};t.ParamChange={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.subspace&&t.uint32(10).string(e.subspace),""!==e.key&&t.uint32(18).string(e.key),""!==e.value&&t.uint32(26).string(e.value),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},u);n.pos>>3){case 1:a.subspace=n.string();break;case 2:a.key=n.string();break;case 3:a.value=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},u);return void 0!==e.subspace&&null!==e.subspace?t.subspace=String(e.subspace):t.subspace="",void 0!==e.key&&null!==e.key?t.key=String(e.key):t.key="",void 0!==e.value&&null!==e.value?t.value=String(e.value):t.value="",t},toJSON:function(e){var t={};return void 0!==e.subspace&&(t.subspace=e.subspace),void 0!==e.key&&(t.key=e.key),void 0!==e.value&&(t.value=e.value),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.subspace&&null!==e.subspace?t.subspace=e.subspace:t.subspace="",void 0!==e.key&&null!==e.key?t.key=e.key:t.key="",void 0!==e.value&&null!==e.value?t.value=e.value:t.value="",t}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},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]}),a=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}),a(n(509),t)},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WeightedVoteOption=t.Vote=void 0;var s=n(23),u=n(131),c=n(75),f=o(n(24)),d=function(e){function t(t,n,r){var a=e.call(this)||this;return a.proposal_id=t,a.voter=n,a.options=r,a.Option=u.VoteOption,a}return r(t,e),t.fromAmino=function(e){var n=e.proposal_id,r=e.voter,a=e.options;return new t(Number.parseInt(n),r,a.map((function(e){return l.fromAmino(e)})))},t.prototype.toAmino=function(){var e=this,t=e.proposal_id,n=e.voter,r=e.options;return{proposal_id:t.toFixed(),voter:n,options:r.map((function(e){return e.toAmino()}))}},t.fromData=function(e){var n=e.proposal_id,r=e.voter,a=e.options;return new t(Number.parseInt(n),r,a.map((function(e){return l.fromData(e)})))},t.prototype.toData=function(){var e=this,t=e.proposal_id,n=e.voter,r=e.options;return{proposal_id:t.toFixed(),voter:n,options:r.map((function(e){return e.toData()}))}},t.fromProto=function(e){return new t(e.proposalId.toNumber(),e.voter,e.options.map((function(e){return l.fromProto(e)})))},t.prototype.toProto=function(){var e=this,t=e.proposal_id,n=e.voter,r=e.options;return u.Vote.fromPartial({options:r.map((function(e){return e.toProto()})),proposalId:f.fromNumber(t),voter:n})},t}(s.JSONSerializable);t.Vote=d,function(e){e.Option=u.VoteOption}(d=t.Vote||(t.Vote={})),t.Vote=d;var l=function(e){function t(t,n){var r=e.call(this)||this;return r.option=t,r.weight=new c.Dec(n),r}return r(t,e),t.fromAmino=function(e){return new t(e.option,e.weight)},t.prototype.toAmino=function(){return{option:this.option,weight:this.weight.toString()}},t.fromData=function(e){return new t(e.option,e.weight)},t.prototype.toData=function(){return{option:this.option,weight:this.weight.toString()}},t.fromProto=function(e){return new t(e.option,e.weight)},t.prototype.toProto=function(){var e=this.option,t=this.weight;return u.WeightedVoteOption.fromPartial({option:e,weight:t.toString()})},t}(s.JSONSerializable);t.WeightedVoteOption=l},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]}),a=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}),a(n(516),t),a(n(517),t)},function(e,t,n){"use strict";var r=n(59).default,a=n(63).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgSwapSendResponse=t.MsgSwapSend=t.MsgSwapResponse=t.MsgSwap=t.protobufPackage=void 0;var o=i(n(24)),s=i(n(20)),u=n(68);t.protobufPackage="terra.market.v1beta1";var c={trader:"",askDenom:""};t.MsgSwap={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.trader&&t.uint32(10).string(e.trader),void 0!==e.offerCoin&&u.Coin.encode(e.offerCoin,t.uint32(18).fork()).ldelim(),""!==e.askDenom&&t.uint32(26).string(e.askDenom),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);n.pos>>3){case 1:a.trader=n.string();break;case 2:a.offerCoin=u.Coin.decode(n,n.uint32());break;case 3:a.askDenom=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},c);return void 0!==e.trader&&null!==e.trader?t.trader=String(e.trader):t.trader="",void 0!==e.offerCoin&&null!==e.offerCoin?t.offerCoin=u.Coin.fromJSON(e.offerCoin):t.offerCoin=void 0,void 0!==e.askDenom&&null!==e.askDenom?t.askDenom=String(e.askDenom):t.askDenom="",t},toJSON:function(e){var t={};return void 0!==e.trader&&(t.trader=e.trader),void 0!==e.offerCoin&&(t.offerCoin=e.offerCoin?u.Coin.toJSON(e.offerCoin):void 0),void 0!==e.askDenom&&(t.askDenom=e.askDenom),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.trader&&null!==e.trader?t.trader=e.trader:t.trader="",void 0!==e.offerCoin&&null!==e.offerCoin?t.offerCoin=u.Coin.fromPartial(e.offerCoin):t.offerCoin=void 0,void 0!==e.askDenom&&null!==e.askDenom?t.askDenom=e.askDenom:t.askDenom="",t}};var f={};t.MsgSwapResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.swapCoin&&u.Coin.encode(e.swapCoin,t.uint32(10).fork()).ldelim(),void 0!==e.swapFee&&u.Coin.encode(e.swapFee,t.uint32(18).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},f);n.pos>>3){case 1:a.swapCoin=u.Coin.decode(n,n.uint32());break;case 2:a.swapFee=u.Coin.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);return void 0!==e.swapCoin&&null!==e.swapCoin?t.swapCoin=u.Coin.fromJSON(e.swapCoin):t.swapCoin=void 0,void 0!==e.swapFee&&null!==e.swapFee?t.swapFee=u.Coin.fromJSON(e.swapFee):t.swapFee=void 0,t},toJSON:function(e){var t={};return void 0!==e.swapCoin&&(t.swapCoin=e.swapCoin?u.Coin.toJSON(e.swapCoin):void 0),void 0!==e.swapFee&&(t.swapFee=e.swapFee?u.Coin.toJSON(e.swapFee):void 0),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.swapCoin&&null!==e.swapCoin?t.swapCoin=u.Coin.fromPartial(e.swapCoin):t.swapCoin=void 0,void 0!==e.swapFee&&null!==e.swapFee?t.swapFee=u.Coin.fromPartial(e.swapFee):t.swapFee=void 0,t}};var d={fromAddress:"",toAddress:"",askDenom:""};t.MsgSwapSend={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.fromAddress&&t.uint32(10).string(e.fromAddress),""!==e.toAddress&&t.uint32(18).string(e.toAddress),void 0!==e.offerCoin&&u.Coin.encode(e.offerCoin,t.uint32(26).fork()).ldelim(),""!==e.askDenom&&t.uint32(34).string(e.askDenom),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},d);n.pos>>3){case 1:a.fromAddress=n.string();break;case 2:a.toAddress=n.string();break;case 3:a.offerCoin=u.Coin.decode(n,n.uint32());break;case 4:a.askDenom=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},d);return void 0!==e.fromAddress&&null!==e.fromAddress?t.fromAddress=String(e.fromAddress):t.fromAddress="",void 0!==e.toAddress&&null!==e.toAddress?t.toAddress=String(e.toAddress):t.toAddress="",void 0!==e.offerCoin&&null!==e.offerCoin?t.offerCoin=u.Coin.fromJSON(e.offerCoin):t.offerCoin=void 0,void 0!==e.askDenom&&null!==e.askDenom?t.askDenom=String(e.askDenom):t.askDenom="",t},toJSON:function(e){var t={};return void 0!==e.fromAddress&&(t.fromAddress=e.fromAddress),void 0!==e.toAddress&&(t.toAddress=e.toAddress),void 0!==e.offerCoin&&(t.offerCoin=e.offerCoin?u.Coin.toJSON(e.offerCoin):void 0),void 0!==e.askDenom&&(t.askDenom=e.askDenom),t},fromPartial:function(e){var t=Object.assign({},d);return void 0!==e.fromAddress&&null!==e.fromAddress?t.fromAddress=e.fromAddress:t.fromAddress="",void 0!==e.toAddress&&null!==e.toAddress?t.toAddress=e.toAddress:t.toAddress="",void 0!==e.offerCoin&&null!==e.offerCoin?t.offerCoin=u.Coin.fromPartial(e.offerCoin):t.offerCoin=void 0,void 0!==e.askDenom&&null!==e.askDenom?t.askDenom=e.askDenom:t.askDenom="",t}};var l={};t.MsgSwapSendResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return void 0!==e.swapCoin&&u.Coin.encode(e.swapCoin,t.uint32(10).fork()).ldelim(),void 0!==e.swapFee&&u.Coin.encode(e.swapFee,t.uint32(18).fork()).ldelim(),t},decode:function(e,t){for(var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);n.pos>>3){case 1:a.swapCoin=u.Coin.decode(n,n.uint32());break;case 2:a.swapFee=u.Coin.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.swapCoin&&null!==e.swapCoin?t.swapCoin=u.Coin.fromJSON(e.swapCoin):t.swapCoin=void 0,void 0!==e.swapFee&&null!==e.swapFee?t.swapFee=u.Coin.fromJSON(e.swapFee):t.swapFee=void 0,t},toJSON:function(e){var t={};return void 0!==e.swapCoin&&(t.swapCoin=e.swapCoin?u.Coin.toJSON(e.swapCoin):void 0),void 0!==e.swapFee&&(t.swapFee=e.swapFee?u.Coin.toJSON(e.swapFee):void 0),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.swapCoin&&null!==e.swapCoin?t.swapCoin=u.Coin.fromPartial(e.swapCoin):t.swapCoin=void 0,void 0!==e.swapFee&&null!==e.swapFee?t.swapFee=u.Coin.fromPartial(e.swapFee):t.swapFee=void 0,t}};var p=function(){function e(t){r(this,e),this.rpc=t,this.Swap=this.Swap.bind(this),this.SwapSend=this.SwapSend.bind(this)}return a(e,[{key:"Swap",value:function(e){var n=t.MsgSwap.encode(e).finish();return this.rpc.request("terra.market.v1beta1.Msg","Swap",n).then((function(e){return t.MsgSwapResponse.decode(new s.default.Reader(e))}))}},{key:"SwapSend",value:function(e){var n=t.MsgSwapSend.encode(e).finish();return this.rpc.request("terra.market.v1beta1.Msg","SwapSend",n).then((function(e){return t.MsgSwapSendResponse.decode(new s.default.Reader(e))}))}}]),e}();t.MsgClientImpl=p,s.default.util.Long!==o.default&&(s.default.util.Long=o.default,s.default.configure())},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]}),a=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}),a(n(518),t),a(n(522),t),a(n(523),t)},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.StakeAuthorizationValidators=t.StakeAuthorization=void 0;var a=n(23),i=n(84),o=n(519),s=n(25),u=function(e){function t(t,n,r,a){var i=e.call(this)||this;return i.authorization_type=t,i.max_tokens=n,i.allow_list=r,i.deny_list=a,i}return r(t,e),t.fromAmino=function(e){throw new Error("Amino not supported")},t.prototype.toAmino=function(){throw new Error("Amino not supported")},t.fromData=function(e){return new t((0,o.authorizationTypeFromJSON)(e.authorization_type),e.max_tokens?i.Coin.fromProto(e.max_tokens):void 0,e.allow_list?c.fromData(e.allow_list):void 0,e.deny_list?c.fromData(e.deny_list):void 0)},t.prototype.toData=function(){var e=this,t=e.max_tokens,n=e.allow_list,r=e.deny_list,a=e.authorization_type;return{"@type":"/cosmos.staking.v1beta1.StakeAuthorization",authorization_type:(0,o.authorizationTypeToJSON)(a),max_tokens:null===t||void 0===t?void 0:t.toData(),allow_list:null===n||void 0===n?void 0:n.toData(),deny_list:null===r||void 0===r?void 0:r.toData()}},t.fromProto=function(e){return new t(e.authorizationType,e.maxTokens?i.Coin.fromProto(e.maxTokens):void 0,e.allowList?c.fromProto(e.allowList):void 0,e.denyList?c.fromProto(e.denyList):void 0)},t.prototype.toProto=function(){var e=this,t=e.max_tokens,n=e.allow_list,r=e.deny_list,a=e.authorization_type;return o.StakeAuthorization.fromPartial({allowList:null===n||void 0===n?void 0:n.toProto(),authorizationType:a,denyList:null===r||void 0===r?void 0:r.toProto(),maxTokens:null===t||void 0===t?void 0:t.toProto()})},t.prototype.packAny=function(){return s.Any.fromPartial({typeUrl:"/cosmos.staking.v1beta1.StakeAuthorization",value:o.StakeAuthorization.encode(this.toProto()).finish()})},t.unpackAny=function(e){return t.fromProto(o.StakeAuthorization.decode(e.value))},t}(a.JSONSerializable);t.StakeAuthorization=u;var c=function(e){function t(t){var n=e.call(this)||this;return n.address=t,n}return r(t,e),t.fromAmino=function(e){throw new Error("Amino not supported")},t.prototype.toAmino=function(){throw new Error("Amino not supported")},t.fromData=function(e){return new t(e.address)},t.prototype.toData=function(){return{address:this.address}},t.fromProto=function(e){return new t(e.address)},t.prototype.toProto=function(){return o.StakeAuthorization_Validators.fromPartial({address:this.address})},t}(a.JSONSerializable);t.StakeAuthorizationValidators=c,function(e){e.Type=o.AuthorizationType}(u=t.StakeAuthorization||(t.StakeAuthorization={})),t.StakeAuthorization=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.SendAuthorization=void 0;var a=n(23),i=n(69),o=n(520),s=n(25),u=function(e){function t(t){var n=e.call(this)||this;return n.spend_limit=new i.Coins(t),n}return r(t,e),t.fromAmino=function(e){return new t(i.Coins.fromAmino(e.value.spend_limit))},t.prototype.toAmino=function(){return{type:"msgauth/SendAuthorization",value:{spend_limit:this.spend_limit.toAmino()}}},t.fromData=function(e){return new t(i.Coins.fromData(e.spend_limit))},t.prototype.toData=function(){return{"@type":"/cosmos.bank.v1beta1.SendAuthorization",spend_limit:this.spend_limit.toAmino()}},t.fromProto=function(e){return new t(i.Coins.fromProto(e.spendLimit))},t.prototype.toProto=function(){return o.SendAuthorization.fromPartial({spendLimit:this.spend_limit.toProto()})},t.prototype.packAny=function(){return s.Any.fromPartial({typeUrl:"/cosmos.bank.v1beta1.SendAuthorization",value:o.SendAuthorization.encode(this.toProto()).finish()})},t.unpackAny=function(e){return t.fromProto(o.SendAuthorization.decode(e.value))},t}(a.JSONSerializable);t.SendAuthorization=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GenericAuthorization=void 0;var a=n(23),i=n(238),o=n(25),s=function(e){function t(t){var n=e.call(this)||this;return n.msg=t,n}return r(t,e),t.fromAmino=function(e){return new t(e.value.msg)},t.prototype.toAmino=function(){return{type:"msgauth/GenericAuthorization",value:{msg:this.msg}}},t.fromData=function(e){return new t(e.msg)},t.prototype.toData=function(){return{"@type":"/cosmos.authz.v1beta1.GenericAuthorization",msg:this.msg}},t.fromProto=function(e){return new t(e.msg)},t.prototype.toProto=function(){return i.GenericAuthorization.fromPartial({msg:this.msg})},t.prototype.packAny=function(){return o.Any.fromPartial({typeUrl:"/cosmos.authz.v1beta1.GenericAuthorization",value:i.GenericAuthorization.encode(this.toProto()).finish()})},t.unpackAny=function(e){return t.fromProto(i.GenericAuthorization.decode(e.value))},t}(a.JSONSerializable);t.GenericAuthorization=s},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]}),a=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}),a(n(524),t),a(n(525),t),a(n(314),t)},function(e,t,n){e.exports=function(){"use strict";var e={3354:function(e,t,n){n.d(t,{e:function(){return i}});var r=n(5720),a=n(9054),i=function(){function e(t,n){if(Array.isArray(t)||!t)return this.t=Array.isArray(t)?t:[],void(this.i="number"==typeof n?n:4*this.t.length);if(t instanceof e)return this.t=t.words.slice(),void(this.i=t.nSigBytes);var r;try{t instanceof ArrayBuffer?r=new Uint8Array(t):(t instanceof Uint8Array||t instanceof Int8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}catch(e){throw new Error("Invalid argument")}if(!r)throw new Error("Invalid argument");for(var a=r.byteLength,i=[],o=0;o>>2]|=r[o]<<24-o%4*8;this.t=i,this.i=a}return Object.defineProperty(e.prototype,"nSigBytes",{get:function(){return this.i},set:function(e){this.i=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"words",{get:function(){return this.t},enumerable:!1,configurable:!0}),e.prototype.toString=function(e){return e?e.stringify(this):r.p.stringify(this)},e.prototype.toUint8Array=function(){for(var e=this.t,t=this.i,n=new Uint8Array(t),r=0;r>>2]>>>24-r%4*8&255;return n},e.prototype.concat=function(e){var t=e.words.slice(),n=e.nSigBytes;if(this.clamp(),this.i%4)for(var r=0;r>>2]>>>24-r%4*8&255;this.t[this.i+r>>>2]|=a<<24-(this.i+r)%4*8}else for(r=0;r>>2]=t[r>>>2];return this.i+=n,this},e.prototype.clamp=function(){var e=this.i;this.t[e>>>2]&=4294967295<<32-e%4*8,this.t.length=Math.ceil(e/4)},e.prototype.clone=function(){return new e(this.t.slice(),this.i)},e.random=function(t){for(var n=[],r=0;r"===e?i>t:">="===e?i>=t:i===t))}},5720:function(e,t,n){n.d(t,{p:function(){return a}});var r=n(3354),a={stringify:function(e){for(var t=e.nSigBytes,n=e.words,r=[],a=0;a>>2]>>>24-a%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){var t=e.length;if(t%2!=0)throw new Error("Hex string count must be even");if(!/^[a-fA-F0-9]+$/.test(e))throw new Error("Invalid Hex string: "+e);for(var n=[],a=0;a>>3]|=parseInt(e.substr(a,2),16)<<24-a%8*4;return new r.e(n,t/2)}}},8702:function(e,t,n){n.d(t,{m:function(){return a}});var r=n(3354),a={stringify:function(e){for(var t=e.nSigBytes,n=e.words,r=[],a=0;a>>2]>>>24-a%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a>>2]|=(255&e.charCodeAt(a))<<24-a%4*8;return new r.e(n,t)}}},4768:function(e,t,n){n.d(t,{d:function(){return a}});var r=n(8702),a={stringify:function(e){try{return decodeURIComponent(escape(r.m.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return r.m.parse(unescape(encodeURIComponent(e)))}}},9054:function(e,t,r){r.d(t,{M:function(){return i}});var a=r(1756),i=function(){if("undefined"!=typeof window){var e=window.crypto||window.msCrypto;if(!e){if((0,a.w)("<",11))return console.warn("IE <= 10 uses insecure random generator. Please consider to use IE11 or another modern browser"),function(){return Math.floor(512*Math.random())%256};throw new Error("Crypto module not found")}return function(){return e.getRandomValues(new Uint32Array(1))[0]}}return void 0!==r.g&&r.g.crypto?function(){return r.g.crypto.randomBytes(4).readInt32LE()}:function(){return n(184).randomBytes(4).readInt32LE()}}()}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"S",{value:!0})};var a={};return function(){r.r(a),r.d(a,{SHA256:function(){return d}});var e,t=r(1868),n=r(3354),i=(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),o=[],s=[];function u(e){for(var t=Math.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function c(e){return 4294967296*(e-(0|e))|0}!function(){for(var e=2,t=0;t<64;)u(e)&&(t<8&&(o[t]=c(Math.pow(e,.5))),s[t]=c(Math.pow(e,1/3)),t++),e++}();var f=[],d=function(e){function t(t){var r=e.call(this,t)||this;return r.N=new n.e(o.slice(0)),r.v=t,t&&void 0!==t.hash&&(r.N=t.hash.clone()),r}return i(t,e),t.prototype.U=function(){this.N=new n.e(o.slice(0))},t.prototype.I=function(e,t){for(var n=this.N.words,r=n[0],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)f[p]=0|e[t+p];else{var b=f[p-15],h=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,y=f[p-2],m=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;f[p]=h+f[p-7]+m+f[p-16]}var v=r&a^r&i^a&i,g=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&d)+s[p]+f[p];l=d,d=c,c=u,u=o+w|0,o=i,i=a,a=r,r=w+(g+v)|0}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+i|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},t.prototype._=function(){var e=this.l.words,t=8*this.A,n=8*this.l.nSigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(t/4294967296),e[15+(n+64>>>9<<4)]=t,this.l.nSigBytes=4*e.length,this.O(),this.N},t.prototype.clone=function(){return new t({hash:this.N,blockSize:this.h,data:this.l,nBytes:this.A})},t.hash=function(e,n){return new t(n).finalize(e)},t}(t.P)}(),a}()},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.MsgAggregateExchangeRatePrevote=void 0;var a=n(23),i=n(25),o=n(240),s=function(e){function t(t,n,r){var a=e.call(this)||this;return a.hash=t,a.feeder=n,a.validator=r,a}return r(t,e),t.fromAmino=function(e){var n=e.value;return new t(n.hash,n.feeder,n.validator)},t.prototype.toAmino=function(){var e=this;return{type:"oracle/MsgAggregateExchangeRatePrevote",value:{hash:e.hash,feeder:e.feeder,validator:e.validator}}},t.fromData=function(e){return new t(e.hash,e.feeder,e.validator)},t.prototype.toData=function(){var e=this;return{"@type":"/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote",hash:e.hash,feeder:e.feeder,validator:e.validator}},t.fromProto=function(e){return new t(e.hash,e.feeder,e.validator)},t.prototype.toProto=function(){var e=this,t=e.hash,n=e.feeder,r=e.validator;return o.MsgAggregateExchangeRatePrevote.fromPartial({hash:t,feeder:n,validator:r})},t.prototype.packAny=function(){return i.Any.fromPartial({typeUrl:"/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote",value:o.MsgAggregateExchangeRatePrevote.encode(this.toProto()).finish()})},t.unpackAny=function(e){return t.fromProto(o.MsgAggregateExchangeRatePrevote.decode(e.value))},t}(a.JSONSerializable);t.MsgAggregateExchangeRatePrevote=s},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]}),a=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}),a(n(526),t)},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]}),a=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}),a(n(528),t),a(n(531),t),a(n(532),t),a(n(533),t),a(n(539),t)},function(e,t,n){"use strict";(function(e){var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TxProof=t.BlockMeta=t.LightBlock=t.SignedHeader=t.Proposal=t.CommitSig=t.Commit=t.Vote=t.Data=t.Header=t.BlockID=t.Part=t.PartSetHeader=t.signedMsgTypeToJSON=t.signedMsgTypeFromJSON=t.SignedMsgType=t.blockIDFlagToJSON=t.blockIDFlagFromJSON=t.BlockIDFlag=t.protobufPackage=void 0;var i,o,s=a(n(24)),u=a(n(20)),c=n(318),f=n(529),d=n(530),l=n(114);function p(e){switch(e){case 0:case"BLOCK_ID_FLAG_UNKNOWN":return i.BLOCK_ID_FLAG_UNKNOWN;case 1:case"BLOCK_ID_FLAG_ABSENT":return i.BLOCK_ID_FLAG_ABSENT;case 2:case"BLOCK_ID_FLAG_COMMIT":return i.BLOCK_ID_FLAG_COMMIT;case 3:case"BLOCK_ID_FLAG_NIL":return i.BLOCK_ID_FLAG_NIL;default:return i.UNRECOGNIZED}}function b(e){switch(e){case i.BLOCK_ID_FLAG_UNKNOWN:return"BLOCK_ID_FLAG_UNKNOWN";case i.BLOCK_ID_FLAG_ABSENT:return"BLOCK_ID_FLAG_ABSENT";case i.BLOCK_ID_FLAG_COMMIT:return"BLOCK_ID_FLAG_COMMIT";case i.BLOCK_ID_FLAG_NIL:return"BLOCK_ID_FLAG_NIL";default:return"UNKNOWN"}}function h(e){switch(e){case 0:case"SIGNED_MSG_TYPE_UNKNOWN":return o.SIGNED_MSG_TYPE_UNKNOWN;case 1:case"SIGNED_MSG_TYPE_PREVOTE":return o.SIGNED_MSG_TYPE_PREVOTE;case 2:case"SIGNED_MSG_TYPE_PRECOMMIT":return o.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case"SIGNED_MSG_TYPE_PROPOSAL":return o.SIGNED_MSG_TYPE_PROPOSAL;default:return o.UNRECOGNIZED}}function y(e){switch(e){case o.SIGNED_MSG_TYPE_UNKNOWN:return"SIGNED_MSG_TYPE_UNKNOWN";case o.SIGNED_MSG_TYPE_PREVOTE:return"SIGNED_MSG_TYPE_PREVOTE";case o.SIGNED_MSG_TYPE_PRECOMMIT:return"SIGNED_MSG_TYPE_PRECOMMIT";case o.SIGNED_MSG_TYPE_PROPOSAL:return"SIGNED_MSG_TYPE_PROPOSAL";default:return"UNKNOWN"}}t.protobufPackage="tendermint.types",function(e){e[e.BLOCK_ID_FLAG_UNKNOWN=0]="BLOCK_ID_FLAG_UNKNOWN",e[e.BLOCK_ID_FLAG_ABSENT=1]="BLOCK_ID_FLAG_ABSENT",e[e.BLOCK_ID_FLAG_COMMIT=2]="BLOCK_ID_FLAG_COMMIT",e[e.BLOCK_ID_FLAG_NIL=3]="BLOCK_ID_FLAG_NIL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(i=t.BlockIDFlag||(t.BlockIDFlag={})),t.blockIDFlagFromJSON=p,t.blockIDFlagToJSON=b,function(e){e[e.SIGNED_MSG_TYPE_UNKNOWN=0]="SIGNED_MSG_TYPE_UNKNOWN",e[e.SIGNED_MSG_TYPE_PREVOTE=1]="SIGNED_MSG_TYPE_PREVOTE",e[e.SIGNED_MSG_TYPE_PRECOMMIT=2]="SIGNED_MSG_TYPE_PRECOMMIT",e[e.SIGNED_MSG_TYPE_PROPOSAL=32]="SIGNED_MSG_TYPE_PROPOSAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(o=t.SignedMsgType||(t.SignedMsgType={})),t.signedMsgTypeFromJSON=h,t.signedMsgTypeToJSON=y;var m={total:0};t.PartSetHeader={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.total&&t.uint32(8).uint32(e.total),0!==e.hash.length&&t.uint32(18).bytes(e.hash),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,a=Object.assign({},m);for(a.hash=new Uint8Array;n.pos>>3){case 1:a.total=n.uint32();break;case 2:a.hash=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},m);return t.hash=new Uint8Array,void 0!==e.total&&null!==e.total?t.total=Number(e.total):t.total=0,void 0!==e.hash&&null!==e.hash&&(t.hash=I(e.hash)),t},toJSON:function(e){var t={};return void 0!==e.total&&(t.total=e.total),void 0!==e.hash&&(t.hash=R(void 0!==e.hash?e.hash:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},m);return void 0!==e.total&&null!==e.total?t.total=e.total:t.total=0,void 0!==e.hash&&null!==e.hash?t.hash=e.hash:t.hash=new Uint8Array,t}};var v={index:0};t.Part={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.index&&t.uint32(8).uint32(e.index),0!==e.bytes.length&&t.uint32(18).bytes(e.bytes),void 0!==e.proof&&c.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),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,a=Object.assign({},v);for(a.bytes=new Uint8Array;n.pos>>3){case 1:a.index=n.uint32();break;case 2:a.bytes=n.bytes();break;case 3:a.proof=c.Proof.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},v);return t.bytes=new Uint8Array,void 0!==e.index&&null!==e.index?t.index=Number(e.index):t.index=0,void 0!==e.bytes&&null!==e.bytes&&(t.bytes=I(e.bytes)),void 0!==e.proof&&null!==e.proof?t.proof=c.Proof.fromJSON(e.proof):t.proof=void 0,t},toJSON:function(e){var t={};return void 0!==e.index&&(t.index=e.index),void 0!==e.bytes&&(t.bytes=R(void 0!==e.bytes?e.bytes:new Uint8Array)),void 0!==e.proof&&(t.proof=e.proof?c.Proof.toJSON(e.proof):void 0),t},fromPartial:function(e){var t=Object.assign({},v);return void 0!==e.index&&null!==e.index?t.index=e.index:t.index=0,void 0!==e.bytes&&null!==e.bytes?t.bytes=e.bytes:t.bytes=new Uint8Array,void 0!==e.proof&&null!==e.proof?t.proof=c.Proof.fromPartial(e.proof):t.proof=void 0,t}};var g={};t.BlockID={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.hash.length&&n.uint32(10).bytes(e.hash),void 0!==e.partSetHeader&&t.PartSetHeader.encode(e.partSetHeader,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},g);for(i.hash=new Uint8Array;r.pos>>3){case 1:i.hash=r.bytes();break;case 2:i.partSetHeader=t.PartSetHeader.decode(r,r.uint32());break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},g);return n.hash=new Uint8Array,void 0!==e.hash&&null!==e.hash&&(n.hash=I(e.hash)),void 0!==e.partSetHeader&&null!==e.partSetHeader?n.partSetHeader=t.PartSetHeader.fromJSON(e.partSetHeader):n.partSetHeader=void 0,n},toJSON:function(e){var n={};return void 0!==e.hash&&(n.hash=R(void 0!==e.hash?e.hash:new Uint8Array)),void 0!==e.partSetHeader&&(n.partSetHeader=e.partSetHeader?t.PartSetHeader.toJSON(e.partSetHeader):void 0),n},fromPartial:function(e){var n=Object.assign({},g);return void 0!==e.hash&&null!==e.hash?n.hash=e.hash:n.hash=new Uint8Array,void 0!==e.partSetHeader&&null!==e.partSetHeader?n.partSetHeader=t.PartSetHeader.fromPartial(e.partSetHeader):n.partSetHeader=void 0,n}};var w={chainId:"",height:s.default.ZERO};t.Header={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.version&&f.Consensus.encode(e.version,n.uint32(10).fork()).ldelim(),""!==e.chainId&&n.uint32(18).string(e.chainId),e.height.isZero()||n.uint32(24).int64(e.height),void 0!==e.time&&l.Timestamp.encode(N(e.time),n.uint32(34).fork()).ldelim(),void 0!==e.lastBlockId&&t.BlockID.encode(e.lastBlockId,n.uint32(42).fork()).ldelim(),0!==e.lastCommitHash.length&&n.uint32(50).bytes(e.lastCommitHash),0!==e.dataHash.length&&n.uint32(58).bytes(e.dataHash),0!==e.validatorsHash.length&&n.uint32(66).bytes(e.validatorsHash),0!==e.nextValidatorsHash.length&&n.uint32(74).bytes(e.nextValidatorsHash),0!==e.consensusHash.length&&n.uint32(82).bytes(e.consensusHash),0!==e.appHash.length&&n.uint32(90).bytes(e.appHash),0!==e.lastResultsHash.length&&n.uint32(98).bytes(e.lastResultsHash),0!==e.evidenceHash.length&&n.uint32(106).bytes(e.evidenceHash),0!==e.proposerAddress.length&&n.uint32(114).bytes(e.proposerAddress),n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},w);for(i.lastCommitHash=new Uint8Array,i.dataHash=new Uint8Array,i.validatorsHash=new Uint8Array,i.nextValidatorsHash=new Uint8Array,i.consensusHash=new Uint8Array,i.appHash=new Uint8Array,i.lastResultsHash=new Uint8Array,i.evidenceHash=new Uint8Array,i.proposerAddress=new Uint8Array;r.pos>>3){case 1:i.version=f.Consensus.decode(r,r.uint32());break;case 2:i.chainId=r.string();break;case 3:i.height=r.int64();break;case 4:i.time=D(l.Timestamp.decode(r,r.uint32()));break;case 5:i.lastBlockId=t.BlockID.decode(r,r.uint32());break;case 6:i.lastCommitHash=r.bytes();break;case 7:i.dataHash=r.bytes();break;case 8:i.validatorsHash=r.bytes();break;case 9:i.nextValidatorsHash=r.bytes();break;case 10:i.consensusHash=r.bytes();break;case 11:i.appHash=r.bytes();break;case 12:i.lastResultsHash=r.bytes();break;case 13:i.evidenceHash=r.bytes();break;case 14:i.proposerAddress=r.bytes();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},w);return n.lastCommitHash=new Uint8Array,n.dataHash=new Uint8Array,n.validatorsHash=new Uint8Array,n.nextValidatorsHash=new Uint8Array,n.consensusHash=new Uint8Array,n.appHash=new Uint8Array,n.lastResultsHash=new Uint8Array,n.evidenceHash=new Uint8Array,n.proposerAddress=new Uint8Array,void 0!==e.version&&null!==e.version?n.version=f.Consensus.fromJSON(e.version):n.version=void 0,void 0!==e.chainId&&null!==e.chainId?n.chainId=String(e.chainId):n.chainId="",void 0!==e.height&&null!==e.height?n.height=s.default.fromString(e.height):n.height=s.default.ZERO,void 0!==e.time&&null!==e.time?n.time=B(e.time):n.time=void 0,void 0!==e.lastBlockId&&null!==e.lastBlockId?n.lastBlockId=t.BlockID.fromJSON(e.lastBlockId):n.lastBlockId=void 0,void 0!==e.lastCommitHash&&null!==e.lastCommitHash&&(n.lastCommitHash=I(e.lastCommitHash)),void 0!==e.dataHash&&null!==e.dataHash&&(n.dataHash=I(e.dataHash)),void 0!==e.validatorsHash&&null!==e.validatorsHash&&(n.validatorsHash=I(e.validatorsHash)),void 0!==e.nextValidatorsHash&&null!==e.nextValidatorsHash&&(n.nextValidatorsHash=I(e.nextValidatorsHash)),void 0!==e.consensusHash&&null!==e.consensusHash&&(n.consensusHash=I(e.consensusHash)),void 0!==e.appHash&&null!==e.appHash&&(n.appHash=I(e.appHash)),void 0!==e.lastResultsHash&&null!==e.lastResultsHash&&(n.lastResultsHash=I(e.lastResultsHash)),void 0!==e.evidenceHash&&null!==e.evidenceHash&&(n.evidenceHash=I(e.evidenceHash)),void 0!==e.proposerAddress&&null!==e.proposerAddress&&(n.proposerAddress=I(e.proposerAddress)),n},toJSON:function(e){var n={};return void 0!==e.version&&(n.version=e.version?f.Consensus.toJSON(e.version):void 0),void 0!==e.chainId&&(n.chainId=e.chainId),void 0!==e.height&&(n.height=(e.height||s.default.ZERO).toString()),void 0!==e.time&&(n.time=e.time.toISOString()),void 0!==e.lastBlockId&&(n.lastBlockId=e.lastBlockId?t.BlockID.toJSON(e.lastBlockId):void 0),void 0!==e.lastCommitHash&&(n.lastCommitHash=R(void 0!==e.lastCommitHash?e.lastCommitHash:new Uint8Array)),void 0!==e.dataHash&&(n.dataHash=R(void 0!==e.dataHash?e.dataHash:new Uint8Array)),void 0!==e.validatorsHash&&(n.validatorsHash=R(void 0!==e.validatorsHash?e.validatorsHash:new Uint8Array)),void 0!==e.nextValidatorsHash&&(n.nextValidatorsHash=R(void 0!==e.nextValidatorsHash?e.nextValidatorsHash:new Uint8Array)),void 0!==e.consensusHash&&(n.consensusHash=R(void 0!==e.consensusHash?e.consensusHash:new Uint8Array)),void 0!==e.appHash&&(n.appHash=R(void 0!==e.appHash?e.appHash:new Uint8Array)),void 0!==e.lastResultsHash&&(n.lastResultsHash=R(void 0!==e.lastResultsHash?e.lastResultsHash:new Uint8Array)),void 0!==e.evidenceHash&&(n.evidenceHash=R(void 0!==e.evidenceHash?e.evidenceHash:new Uint8Array)),void 0!==e.proposerAddress&&(n.proposerAddress=R(void 0!==e.proposerAddress?e.proposerAddress:new Uint8Array)),n},fromPartial:function(e){var n=Object.assign({},w);return void 0!==e.version&&null!==e.version?n.version=f.Consensus.fromPartial(e.version):n.version=void 0,void 0!==e.chainId&&null!==e.chainId?n.chainId=e.chainId:n.chainId="",void 0!==e.height&&null!==e.height?n.height=e.height:n.height=s.default.ZERO,void 0!==e.time&&null!==e.time?n.time=e.time:n.time=void 0,void 0!==e.lastBlockId&&null!==e.lastBlockId?n.lastBlockId=t.BlockID.fromPartial(e.lastBlockId):n.lastBlockId=void 0,void 0!==e.lastCommitHash&&null!==e.lastCommitHash?n.lastCommitHash=e.lastCommitHash:n.lastCommitHash=new Uint8Array,void 0!==e.dataHash&&null!==e.dataHash?n.dataHash=e.dataHash:n.dataHash=new Uint8Array,void 0!==e.validatorsHash&&null!==e.validatorsHash?n.validatorsHash=e.validatorsHash:n.validatorsHash=new Uint8Array,void 0!==e.nextValidatorsHash&&null!==e.nextValidatorsHash?n.nextValidatorsHash=e.nextValidatorsHash:n.nextValidatorsHash=new Uint8Array,void 0!==e.consensusHash&&null!==e.consensusHash?n.consensusHash=e.consensusHash:n.consensusHash=new Uint8Array,void 0!==e.appHash&&null!==e.appHash?n.appHash=e.appHash:n.appHash=new Uint8Array,void 0!==e.lastResultsHash&&null!==e.lastResultsHash?n.lastResultsHash=e.lastResultsHash:n.lastResultsHash=new Uint8Array,void 0!==e.evidenceHash&&null!==e.evidenceHash?n.evidenceHash=e.evidenceHash:n.evidenceHash=new Uint8Array,void 0!==e.proposerAddress&&null!==e.proposerAddress?n.proposerAddress=e.proposerAddress:n.proposerAddress=new Uint8Array,n}};var T={};t.Data={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create(),a=r(e.txs);try{for(a.s();!(t=a.n()).done;){var i=t.value;n.uint32(10).bytes(i)}}catch(o){a.e(o)}finally{a.f()}return n},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,a=Object.assign({},T);for(a.txs=[];n.pos>>3===1)a.txs.push(n.bytes());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},T);if(t.txs=[],void 0!==e.txs&&null!==e.txs){var n,a=r(e.txs);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.txs.push(I(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.txs?t.txs=e.txs.map((function(e){return R(void 0!==e?e:new Uint8Array)})):t.txs=[],t},fromPartial:function(e){var t=Object.assign({},T);if(t.txs=[],void 0!==e.txs&&null!==e.txs){var n,a=r(e.txs);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.txs.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var k={type:0,height:s.default.ZERO,round:0,validatorIndex:0};t.Vote={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.type&&n.uint32(8).int32(e.type),e.height.isZero()||n.uint32(16).int64(e.height),0!==e.round&&n.uint32(24).int32(e.round),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(34).fork()).ldelim(),void 0!==e.timestamp&&l.Timestamp.encode(N(e.timestamp),n.uint32(42).fork()).ldelim(),0!==e.validatorAddress.length&&n.uint32(50).bytes(e.validatorAddress),0!==e.validatorIndex&&n.uint32(56).int32(e.validatorIndex),0!==e.signature.length&&n.uint32(66).bytes(e.signature),n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},k);for(i.validatorAddress=new Uint8Array,i.signature=new Uint8Array;r.pos>>3){case 1:i.type=r.int32();break;case 2:i.height=r.int64();break;case 3:i.round=r.int32();break;case 4:i.blockId=t.BlockID.decode(r,r.uint32());break;case 5:i.timestamp=D(l.Timestamp.decode(r,r.uint32()));break;case 6:i.validatorAddress=r.bytes();break;case 7:i.validatorIndex=r.int32();break;case 8:i.signature=r.bytes();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},k);return n.validatorAddress=new Uint8Array,n.signature=new Uint8Array,void 0!==e.type&&null!==e.type?n.type=h(e.type):n.type=0,void 0!==e.height&&null!==e.height?n.height=s.default.fromString(e.height):n.height=s.default.ZERO,void 0!==e.round&&null!==e.round?n.round=Number(e.round):n.round=0,void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromJSON(e.blockId):n.blockId=void 0,void 0!==e.timestamp&&null!==e.timestamp?n.timestamp=B(e.timestamp):n.timestamp=void 0,void 0!==e.validatorAddress&&null!==e.validatorAddress&&(n.validatorAddress=I(e.validatorAddress)),void 0!==e.validatorIndex&&null!==e.validatorIndex?n.validatorIndex=Number(e.validatorIndex):n.validatorIndex=0,void 0!==e.signature&&null!==e.signature&&(n.signature=I(e.signature)),n},toJSON:function(e){var n={};return void 0!==e.type&&(n.type=y(e.type)),void 0!==e.height&&(n.height=(e.height||s.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.timestamp&&(n.timestamp=e.timestamp.toISOString()),void 0!==e.validatorAddress&&(n.validatorAddress=R(void 0!==e.validatorAddress?e.validatorAddress:new Uint8Array)),void 0!==e.validatorIndex&&(n.validatorIndex=e.validatorIndex),void 0!==e.signature&&(n.signature=R(void 0!==e.signature?e.signature:new Uint8Array)),n},fromPartial:function(e){var n=Object.assign({},k);return void 0!==e.type&&null!==e.type?n.type=e.type:n.type=0,void 0!==e.height&&null!==e.height?n.height=e.height:n.height=s.default.ZERO,void 0!==e.round&&null!==e.round?n.round=e.round:n.round=0,void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromPartial(e.blockId):n.blockId=void 0,void 0!==e.timestamp&&null!==e.timestamp?n.timestamp=e.timestamp:n.timestamp=void 0,void 0!==e.validatorAddress&&null!==e.validatorAddress?n.validatorAddress=e.validatorAddress:n.validatorAddress=new Uint8Array,void 0!==e.validatorIndex&&null!==e.validatorIndex?n.validatorIndex=e.validatorIndex:n.validatorIndex=0,void 0!==e.signature&&null!==e.signature?n.signature=e.signature:n.signature=new Uint8Array,n}};var _={height:s.default.ZERO,round:0};t.Commit={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();e.height.isZero()||n.uint32(8).int64(e.height),0!==e.round&&n.uint32(16).int32(e.round),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(26).fork()).ldelim();var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;t.CommitSig.encode(o,n.uint32(34).fork()).ldelim()}}catch(s){i.e(s)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},_);for(i.signatures=[];r.pos>>3){case 1:i.height=r.int64();break;case 2:i.round=r.int32();break;case 3:i.blockId=t.BlockID.decode(r,r.uint32());break;case 4:i.signatures.push(t.CommitSig.decode(r,r.uint32()));break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},_);if(n.signatures=[],void 0!==e.height&&null!==e.height?n.height=s.default.fromString(e.height):n.height=s.default.ZERO,void 0!==e.round&&null!==e.round?n.round=Number(e.round):n.round=0,void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromJSON(e.blockId):n.blockId=void 0,void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(t.CommitSig.fromJSON(o))}}catch(u){i.e(u)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.height&&(n.height=(e.height||s.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),e.signatures?n.signatures=e.signatures.map((function(e){return e?t.CommitSig.toJSON(e):void 0})):n.signatures=[],n},fromPartial:function(e){var n=Object.assign({},_);if(n.signatures=[],void 0!==e.height&&null!==e.height?n.height=e.height:n.height=s.default.ZERO,void 0!==e.round&&null!==e.round?n.round=e.round:n.round=0,void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromPartial(e.blockId):n.blockId=void 0,void 0!==e.signatures&&null!==e.signatures){var a,i=r(e.signatures);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.signatures.push(t.CommitSig.fromPartial(o))}}catch(u){i.e(u)}finally{i.f()}}return n}};var O={blockIdFlag:0};t.CommitSig={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.blockIdFlag&&t.uint32(8).int32(e.blockIdFlag),0!==e.validatorAddress.length&&t.uint32(18).bytes(e.validatorAddress),void 0!==e.timestamp&&l.Timestamp.encode(N(e.timestamp),t.uint32(26).fork()).ldelim(),0!==e.signature.length&&t.uint32(34).bytes(e.signature),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,a=Object.assign({},O);for(a.validatorAddress=new Uint8Array,a.signature=new Uint8Array;n.pos>>3){case 1:a.blockIdFlag=n.int32();break;case 2:a.validatorAddress=n.bytes();break;case 3:a.timestamp=D(l.Timestamp.decode(n,n.uint32()));break;case 4:a.signature=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},O);return t.validatorAddress=new Uint8Array,t.signature=new Uint8Array,void 0!==e.blockIdFlag&&null!==e.blockIdFlag?t.blockIdFlag=p(e.blockIdFlag):t.blockIdFlag=0,void 0!==e.validatorAddress&&null!==e.validatorAddress&&(t.validatorAddress=I(e.validatorAddress)),void 0!==e.timestamp&&null!==e.timestamp?t.timestamp=B(e.timestamp):t.timestamp=void 0,void 0!==e.signature&&null!==e.signature&&(t.signature=I(e.signature)),t},toJSON:function(e){var t={};return void 0!==e.blockIdFlag&&(t.blockIdFlag=b(e.blockIdFlag)),void 0!==e.validatorAddress&&(t.validatorAddress=R(void 0!==e.validatorAddress?e.validatorAddress:new Uint8Array)),void 0!==e.timestamp&&(t.timestamp=e.timestamp.toISOString()),void 0!==e.signature&&(t.signature=R(void 0!==e.signature?e.signature:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},O);return void 0!==e.blockIdFlag&&null!==e.blockIdFlag?t.blockIdFlag=e.blockIdFlag:t.blockIdFlag=0,void 0!==e.validatorAddress&&null!==e.validatorAddress?t.validatorAddress=e.validatorAddress:t.validatorAddress=new Uint8Array,void 0!==e.timestamp&&null!==e.timestamp?t.timestamp=e.timestamp:t.timestamp=void 0,void 0!==e.signature&&null!==e.signature?t.signature=e.signature:t.signature=new Uint8Array,t}};var S={type:0,height:s.default.ZERO,round:0,polRound:0};t.Proposal={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.type&&n.uint32(8).int32(e.type),e.height.isZero()||n.uint32(16).int64(e.height),0!==e.round&&n.uint32(24).int32(e.round),0!==e.polRound&&n.uint32(32).int32(e.polRound),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(42).fork()).ldelim(),void 0!==e.timestamp&&l.Timestamp.encode(N(e.timestamp),n.uint32(50).fork()).ldelim(),0!==e.signature.length&&n.uint32(58).bytes(e.signature),n},decode:function(e,n){var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},S);for(i.signature=new Uint8Array;r.pos>>3){case 1:i.type=r.int32();break;case 2:i.height=r.int64();break;case 3:i.round=r.int32();break;case 4:i.polRound=r.int32();break;case 5:i.blockId=t.BlockID.decode(r,r.uint32());break;case 6:i.timestamp=D(l.Timestamp.decode(r,r.uint32()));break;case 7:i.signature=r.bytes();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},S);return n.signature=new Uint8Array,void 0!==e.type&&null!==e.type?n.type=h(e.type):n.type=0,void 0!==e.height&&null!==e.height?n.height=s.default.fromString(e.height):n.height=s.default.ZERO,void 0!==e.round&&null!==e.round?n.round=Number(e.round):n.round=0,void 0!==e.polRound&&null!==e.polRound?n.polRound=Number(e.polRound):n.polRound=0,void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromJSON(e.blockId):n.blockId=void 0,void 0!==e.timestamp&&null!==e.timestamp?n.timestamp=B(e.timestamp):n.timestamp=void 0,void 0!==e.signature&&null!==e.signature&&(n.signature=I(e.signature)),n},toJSON:function(e){var n={};return void 0!==e.type&&(n.type=y(e.type)),void 0!==e.height&&(n.height=(e.height||s.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.polRound&&(n.polRound=e.polRound),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.timestamp&&(n.timestamp=e.timestamp.toISOString()),void 0!==e.signature&&(n.signature=R(void 0!==e.signature?e.signature:new Uint8Array)),n},fromPartial:function(e){var n=Object.assign({},S);return void 0!==e.type&&null!==e.type?n.type=e.type:n.type=0,void 0!==e.height&&null!==e.height?n.height=e.height:n.height=s.default.ZERO,void 0!==e.round&&null!==e.round?n.round=e.round:n.round=0,void 0!==e.polRound&&null!==e.polRound?n.polRound=e.polRound:n.polRound=0,void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromPartial(e.blockId):n.blockId=void 0,void 0!==e.timestamp&&null!==e.timestamp?n.timestamp=e.timestamp:n.timestamp=void 0,void 0!==e.signature&&null!==e.signature?n.signature=e.signature:n.signature=new Uint8Array,n}};var x={};t.SignedHeader={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.header&&t.Header.encode(e.header,n.uint32(10).fork()).ldelim(),void 0!==e.commit&&t.Commit.encode(e.commit,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},x);r.pos>>3){case 1:i.header=t.Header.decode(r,r.uint32());break;case 2:i.commit=t.Commit.decode(r,r.uint32());break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},x);return void 0!==e.header&&null!==e.header?n.header=t.Header.fromJSON(e.header):n.header=void 0,void 0!==e.commit&&null!==e.commit?n.commit=t.Commit.fromJSON(e.commit):n.commit=void 0,n},toJSON:function(e){var n={};return void 0!==e.header&&(n.header=e.header?t.Header.toJSON(e.header):void 0),void 0!==e.commit&&(n.commit=e.commit?t.Commit.toJSON(e.commit):void 0),n},fromPartial:function(e){var n=Object.assign({},x);return void 0!==e.header&&null!==e.header?n.header=t.Header.fromPartial(e.header):n.header=void 0,void 0!==e.commit&&null!==e.commit?n.commit=t.Commit.fromPartial(e.commit):n.commit=void 0,n}};var A={};t.LightBlock={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.signedHeader&&t.SignedHeader.encode(e.signedHeader,n.uint32(10).fork()).ldelim(),void 0!==e.validatorSet&&d.ValidatorSet.encode(e.validatorSet,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},A);r.pos>>3){case 1:i.signedHeader=t.SignedHeader.decode(r,r.uint32());break;case 2:i.validatorSet=d.ValidatorSet.decode(r,r.uint32());break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},A);return void 0!==e.signedHeader&&null!==e.signedHeader?n.signedHeader=t.SignedHeader.fromJSON(e.signedHeader):n.signedHeader=void 0,void 0!==e.validatorSet&&null!==e.validatorSet?n.validatorSet=d.ValidatorSet.fromJSON(e.validatorSet):n.validatorSet=void 0,n},toJSON:function(e){var n={};return void 0!==e.signedHeader&&(n.signedHeader=e.signedHeader?t.SignedHeader.toJSON(e.signedHeader):void 0),void 0!==e.validatorSet&&(n.validatorSet=e.validatorSet?d.ValidatorSet.toJSON(e.validatorSet):void 0),n},fromPartial:function(e){var n=Object.assign({},A);return void 0!==e.signedHeader&&null!==e.signedHeader?n.signedHeader=t.SignedHeader.fromPartial(e.signedHeader):n.signedHeader=void 0,void 0!==e.validatorSet&&null!==e.validatorSet?n.validatorSet=d.ValidatorSet.fromPartial(e.validatorSet):n.validatorSet=void 0,n}};var M={blockSize:s.default.ZERO,numTxs:s.default.ZERO};t.BlockMeta={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(10).fork()).ldelim(),e.blockSize.isZero()||n.uint32(16).int64(e.blockSize),void 0!==e.header&&t.Header.encode(e.header,n.uint32(26).fork()).ldelim(),e.numTxs.isZero()||n.uint32(32).int64(e.numTxs),n},decode:function(e,n){for(var r=e instanceof u.default.Reader?e:new u.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},M);r.pos>>3){case 1:i.blockId=t.BlockID.decode(r,r.uint32());break;case 2:i.blockSize=r.int64();break;case 3:i.header=t.Header.decode(r,r.uint32());break;case 4:i.numTxs=r.int64();break;default:r.skipType(7&o)}}return i},fromJSON:function(e){var n=Object.assign({},M);return void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromJSON(e.blockId):n.blockId=void 0,void 0!==e.blockSize&&null!==e.blockSize?n.blockSize=s.default.fromString(e.blockSize):n.blockSize=s.default.ZERO,void 0!==e.header&&null!==e.header?n.header=t.Header.fromJSON(e.header):n.header=void 0,void 0!==e.numTxs&&null!==e.numTxs?n.numTxs=s.default.fromString(e.numTxs):n.numTxs=s.default.ZERO,n},toJSON:function(e){var n={};return void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.blockSize&&(n.blockSize=(e.blockSize||s.default.ZERO).toString()),void 0!==e.header&&(n.header=e.header?t.Header.toJSON(e.header):void 0),void 0!==e.numTxs&&(n.numTxs=(e.numTxs||s.default.ZERO).toString()),n},fromPartial:function(e){var n=Object.assign({},M);return void 0!==e.blockId&&null!==e.blockId?n.blockId=t.BlockID.fromPartial(e.blockId):n.blockId=void 0,void 0!==e.blockSize&&null!==e.blockSize?n.blockSize=e.blockSize:n.blockSize=s.default.ZERO,void 0!==e.header&&null!==e.header?n.header=t.Header.fromPartial(e.header):n.header=void 0,void 0!==e.numTxs&&null!==e.numTxs?n.numTxs=e.numTxs:n.numTxs=s.default.ZERO,n}};var E={};t.TxProof={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return 0!==e.rootHash.length&&t.uint32(10).bytes(e.rootHash),0!==e.data.length&&t.uint32(18).bytes(e.data),void 0!==e.proof&&c.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),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,a=Object.assign({},E);for(a.rootHash=new Uint8Array,a.data=new Uint8Array;n.pos>>3){case 1:a.rootHash=n.bytes();break;case 2:a.data=n.bytes();break;case 3:a.proof=c.Proof.decode(n,n.uint32());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},E);return t.rootHash=new Uint8Array,t.data=new Uint8Array,void 0!==e.rootHash&&null!==e.rootHash&&(t.rootHash=I(e.rootHash)),void 0!==e.data&&null!==e.data&&(t.data=I(e.data)),void 0!==e.proof&&null!==e.proof?t.proof=c.Proof.fromJSON(e.proof):t.proof=void 0,t},toJSON:function(e){var t={};return void 0!==e.rootHash&&(t.rootHash=R(void 0!==e.rootHash?e.rootHash:new Uint8Array)),void 0!==e.data&&(t.data=R(void 0!==e.data?e.data:new Uint8Array)),void 0!==e.proof&&(t.proof=e.proof?c.Proof.toJSON(e.proof):void 0),t},fromPartial:function(e){var t=Object.assign({},E);return void 0!==e.rootHash&&null!==e.rootHash?t.rootHash=e.rootHash:t.rootHash=new Uint8Array,void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,void 0!==e.proof&&null!==e.proof?t.proof=c.Proof.fromPartial(e.proof):t.proof=void 0,t}};var P=function(){if("undefined"!==typeof P)return P;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),j=P.atob||function(e){return P.Buffer.from(e,"base64").toString("binary")};function I(e){for(var t=j(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();e.total.isZero()||t.uint32(8).int64(e.total),e.index.isZero()||t.uint32(16).int64(e.index),0!==e.leafHash.length&&t.uint32(26).bytes(e.leafHash);var n,a=r(e.aunts);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.uint32(34).bytes(i)}}catch(s){a.e(s)}finally{a.f()}return t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},s);for(a.aunts=[],a.leafHash=new Uint8Array;n.pos>>3){case 1:a.total=n.int64();break;case 2:a.index=n.int64();break;case 3:a.leafHash=n.bytes();break;case 4:a.aunts.push(n.bytes());break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},s);if(t.aunts=[],t.leafHash=new Uint8Array,void 0!==e.total&&null!==e.total?t.total=i.default.fromString(e.total):t.total=i.default.ZERO,void 0!==e.index&&null!==e.index?t.index=i.default.fromString(e.index):t.index=i.default.ZERO,void 0!==e.leafHash&&null!==e.leafHash&&(t.leafHash=b(e.leafHash)),void 0!==e.aunts&&null!==e.aunts){var n,a=r(e.aunts);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.aunts.push(b(o))}}catch(u){a.e(u)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.total&&(t.total=(e.total||i.default.ZERO).toString()),void 0!==e.index&&(t.index=(e.index||i.default.ZERO).toString()),void 0!==e.leafHash&&(t.leafHash=y(void 0!==e.leafHash?e.leafHash:new Uint8Array)),e.aunts?t.aunts=e.aunts.map((function(e){return y(void 0!==e?e:new Uint8Array)})):t.aunts=[],t},fromPartial:function(e){var t=Object.assign({},s);if(t.aunts=[],void 0!==e.total&&null!==e.total?t.total=e.total:t.total=i.default.ZERO,void 0!==e.index&&null!==e.index?t.index=e.index:t.index=i.default.ZERO,void 0!==e.leafHash&&null!==e.leafHash?t.leafHash=e.leafHash:t.leafHash=new Uint8Array,void 0!==e.aunts&&null!==e.aunts){var n,a=r(e.aunts);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.aunts.push(o)}}catch(u){a.e(u)}finally{a.f()}}return t}};var u={};t.ValueOp={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.key.length&&n.uint32(10).bytes(e.key),void 0!==e.proof&&t.Proof.encode(e.proof,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},u);for(i.key=new Uint8Array;r.pos>>3){case 1:i.key=r.bytes();break;case 2:i.proof=t.Proof.decode(r,r.uint32());break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},u);return n.key=new Uint8Array,void 0!==e.key&&null!==e.key&&(n.key=b(e.key)),void 0!==e.proof&&null!==e.proof?n.proof=t.Proof.fromJSON(e.proof):n.proof=void 0,n},toJSON:function(e){var n={};return void 0!==e.key&&(n.key=y(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.proof&&(n.proof=e.proof?t.Proof.toJSON(e.proof):void 0),n},fromPartial:function(e){var n=Object.assign({},u);return void 0!==e.key&&null!==e.key?n.key=e.key:n.key=new Uint8Array,void 0!==e.proof&&null!==e.proof?n.proof=t.Proof.fromPartial(e.proof):n.proof=void 0,n}};var c={key:"",input:"",output:""};t.DominoOp={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.key&&t.uint32(10).string(e.key),""!==e.input&&t.uint32(18).string(e.input),""!==e.output&&t.uint32(26).string(e.output),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);n.pos>>3){case 1:a.key=n.string();break;case 2:a.input=n.string();break;case 3:a.output=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},c);return void 0!==e.key&&null!==e.key?t.key=String(e.key):t.key="",void 0!==e.input&&null!==e.input?t.input=String(e.input):t.input="",void 0!==e.output&&null!==e.output?t.output=String(e.output):t.output="",t},toJSON:function(e){var t={};return void 0!==e.key&&(t.key=e.key),void 0!==e.input&&(t.input=e.input),void 0!==e.output&&(t.output=e.output),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.key&&null!==e.key?t.key=e.key:t.key="",void 0!==e.input&&null!==e.input?t.input=e.input:t.input="",void 0!==e.output&&null!==e.output?t.output=e.output:t.output="",t}};var f={type:""};t.ProofOp={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.type&&t.uint32(10).string(e.type),0!==e.key.length&&t.uint32(18).bytes(e.key),0!==e.data.length&&t.uint32(26).bytes(e.data),t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},f);for(a.key=new Uint8Array,a.data=new Uint8Array;n.pos>>3){case 1:a.type=n.string();break;case 2:a.key=n.bytes();break;case 3:a.data=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);return t.key=new Uint8Array,t.data=new Uint8Array,void 0!==e.type&&null!==e.type?t.type=String(e.type):t.type="",void 0!==e.key&&null!==e.key&&(t.key=b(e.key)),void 0!==e.data&&null!==e.data&&(t.data=b(e.data)),t},toJSON:function(e){var t={};return void 0!==e.type&&(t.type=e.type),void 0!==e.key&&(t.key=y(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.data&&(t.data=y(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.type&&null!==e.type?t.type=e.type:t.type="",void 0!==e.key&&null!==e.key?t.key=e.key:t.key=new Uint8Array,void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,t}};var d={};t.ProofOps={encode:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),i=r(e.ops);try{for(i.s();!(n=i.n()).done;){var s=n.value;t.ProofOp.encode(s,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return a},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},d);for(i.ops=[];r.pos>>3===1)i.ops.push(t.ProofOp.decode(r,r.uint32()));else r.skipType(7&s)}return i},fromJSON:function(e){var n=Object.assign({},d);if(n.ops=[],void 0!==e.ops&&null!==e.ops){var a,i=r(e.ops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.ops.push(t.ProofOp.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return e.ops?n.ops=e.ops.map((function(e){return e?t.ProofOp.toJSON(e):void 0})):n.ops=[],n},fromPartial:function(e){var n=Object.assign({},d);if(n.ops=[],void 0!==e.ops&&null!==e.ops){var a,i=r(e.ops);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.ops.push(t.ProofOp.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var l=function(){if("undefined"!==typeof l)return l;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),p=l.atob||function(e){return l.Buffer.from(e,"base64").toString("binary")};function b(e){for(var t=p(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return void 0!==e.ed25519&&t.uint32(10).bytes(e.ed25519),void 0!==e.secp256k1&&t.uint32(18).bytes(e.secp256k1),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},s);n.pos>>3){case 1:a.ed25519=n.bytes();break;case 2:a.secp256k1=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},s);return void 0!==e.ed25519&&null!==e.ed25519&&(t.ed25519=f(e.ed25519)),void 0!==e.secp256k1&&null!==e.secp256k1&&(t.secp256k1=f(e.secp256k1)),t},toJSON:function(e){var t={};return void 0!==e.ed25519&&(t.ed25519=void 0!==e.ed25519?l(e.ed25519):void 0),void 0!==e.secp256k1&&(t.secp256k1=void 0!==e.secp256k1?l(e.secp256k1):void 0),t},fromPartial:function(e){var t=Object.assign({},s);return void 0!==e.ed25519&&null!==e.ed25519?t.ed25519=e.ed25519:t.ed25519=void 0,void 0!==e.secp256k1&&null!==e.secp256k1?t.secp256k1=e.secp256k1:t.secp256k1=void 0,t}};var u=function(){if("undefined"!==typeof u)return u;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),c=u.atob||function(e){return u.Buffer.from(e,"base64").toString("binary")};function f(e){for(var t=c(e),n=new Uint8Array(t.length),r=0;r>>8^255&a^99,f[n]=a,d[a]=n;var i=e[n],o=e[i],s=e[o],u=257*e[a]^16843008*a;l[n]=u<<24|u>>>8,p[n]=u<<16|u>>>16,b[n]=u<<8|u>>>24,h[n]=u,u=16843009*s^65537*o^257*i^16843008*n,y[a]=u<<24|u>>>8,m[a]=u<<16|u>>>16,v[a]=u<<8|u>>>24,g[a]=u,n?(n=i^e[e[e[s^i]]],r^=e[e[r]]):n=r=1}}();var w=[0,1,2,4,8,16,32,64,128,27,54],T=function(e){function t(t){var n=e.call(this,t)||this;return n.u=0,n.h=[],n.v=[],n.O=t,n.A(),n}return u(t,e),t.prototype.A=function(){var e;if(!this.u||this.k!==this.H){for(var t=this.k=this.H,n=t.words,r=t.nSigBytes/4,a=4*((this.u=r+6)+1),i=this.h=[],o=0;o6&&o%r==4&&(e=f[e>>>24]<<24|f[e>>>16&255]<<16|f[e>>>8&255]<<8|f[255&e]):(e=f[(e=e<<8|e>>>24)>>>24]<<24|f[e>>>16&255]<<16|f[e>>>8&255]<<8|f[255&e],e^=w[o/r|0]<<24),i[o]=i[o-r]^e);this.v=[];for(var s=0;s>>24]]^m[f[e>>>16&255]]^v[f[e>>>8&255]]^g[f[255&e]]}},t.prototype.encryptBlock=function(e,t){this.B(e,t,this.h,l,p,b,h,f)},t.prototype.decryptBlock=function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this.B(e,t,this.v,y,m,v,g,d),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},t.prototype.B=function(e,t,n,r,a,i,o,s){for(var u=this.u,c=e[t]^n[0],f=e[t+1]^n[1],d=e[t+2]^n[2],l=e[t+3]^n[3],p=4,b=1;b>>24]^a[f>>>16&255]^i[d>>>8&255]^o[255&l]^n[p++],y=r[f>>>24]^a[d>>>16&255]^i[l>>>8&255]^o[255&c]^n[p++],m=r[d>>>24]^a[l>>>16&255]^i[c>>>8&255]^o[255&f]^n[p++],v=r[l>>>24]^a[c>>>16&255]^i[f>>>8&255]^o[255&d]^n[p++];c=h,f=y,d=m,l=v}var g=(s[c>>>24]<<24|s[f>>>16&255]<<16|s[d>>>8&255]<<8|s[255&l])^n[p++],w=(s[f>>>24]<<24|s[d>>>16&255]<<16|s[l>>>8&255]<<8|s[255&c])^n[p++],T=(s[d>>>24]<<24|s[l>>>16&255]<<16|s[c>>>8&255]<<8|s[255&f])^n[p++],k=(s[l>>>24]<<24|s[c>>>16&255]<<16|s[f>>>8&255]<<8|s[255&d])^n[p++];e[t]=g,e[t+1]=w,e[t+2]=T,e[t+3]=k},t.createEncryptor=function(e,n){return new t(c(c({},n=void 0===n?{}:n),{key:e,transformMode:a.t.ENC_TRANSFORM_MODE}))},t.createDecryptor=function(e,n){return new t(c(c({},n=void 0===n?{}:n),{key:e,transformMode:a.t.DEC_TRANSFORM_MODE}))},t.encrypt=function(e,n,r){if("string"==typeof n)return o.E.encrypt(t,e,n,r);if(n.nSigBytes%4!=0)throw new Error("Key size must be multiple of 32bit/4byte/1word");return s.D.encrypt(t,e,n,r)},t.decrypt=function(e,n,r){if("string"==typeof n)return o.E.decrypt(t,e,n,r);if(n.nSigBytes%4!=0)throw new Error("Key size must be multiple of 32bit/4byte/1word");return s.D.decrypt(t,e,n,r)},t.keySize=8,t}(i.G)},3967:function(e,t,n){n.d(t,{CBCMAC:function(){return s}});var r=n(4768),a=n(3354),i=n(9691),o=n(3664);function s(e,t,n,s,u,c){var f=c&&c.Cipher?c.Cipher:i.AES,d="string"==typeof n?r.d.parse(n):n,l=s||new a.e([0,0]),p="string"==typeof t?r.d.parse(t):t,b="string"==typeof e?r.d.parse(e):e,h=u||16;return o.K.mac(f,d,l,p,b,h)}},9910:function(e,t,n){n.d(t,{DES:function(){return h}});var r,a=n(787),i=n(9456),o=n(5693),s=n(9109),u=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n>>5]>>>31-r%32&1}for(var a=this.I=[],i=0;i<16;i++){var o=a[i]=[],s=l[i];for(n=0;n<24;n++)o[n/6|0]|=t[(d[n]-1+s)%28]<<31-n%6,o[4+(n/6|0)]|=t[28+(d[n+24]-1+s)%28]<<31-n%6;for(o[0]=o[0]<<1|o[0]>>>31,n=1;n<7;n++)o[n]=o[n]>>>4*(n-1)+3;o[7]=o[7]<<5|o[7]>>>27}for(this.U=[],n=0;n<16;n++)this.U[n]=a[15-n]},t.prototype.encryptBlock=function(e,t){this.R(e,t,this.I)},t.prototype.decryptBlock=function(e,t){this.R(e,t,this.U)},t.prototype.R=function(e,t,n){this.L=e[t],this.F=e[t+1],this.X(4,252645135),this.X(16,65535),this.Z(2,858993459),this.Z(8,16711935),this.X(1,1431655765);for(var r=0;r<16;r++){for(var a=n[r],i=this.L,o=this.F,s=0,u=0;u<8;u++){var c=(o^a[u])&b[u];s|=p[u][c>>>0]}this.L=o,this.F=i^s}var f=this.L;this.L=this.F,this.F=f,this.X(1,1431655765),this.Z(8,16711935),this.Z(2,858993459),this.X(16,65535),this.X(4,252645135),e[t]=this.L,e[t+1]=this.F},t.prototype.X=function(e,t){var n=(this.L>>>e^this.F)&t;this.F^=n,this.L^=n<>>e^this.L)&t;this.L^=n,this.F^=n<192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),r=e.length<6?e.slice(0,2):e.slice(4,6);return[s.DES.createEncryptor(new u.e(t)),s.DES.createEncryptor(new u.e(n)),s.DES.createEncryptor(new u.e(r))]},t.prototype.A=function(){var e=this.J();this.Y=e[0],this.$=e[1],this.nn=e[2]},t.prototype.encryptBlock=function(e,t){this.Y.encryptBlock(e,t),this.$.decryptBlock(e,t),this.nn.encryptBlock(e,t)},t.prototype.decryptBlock=function(e,t){this.nn.decryptBlock(e,t),this.$.encryptBlock(e,t),this.Y.decryptBlock(e,t)},t.createEncryptor=function(e,n){return new t(d(d({},n=void 0===n?{}:n),{key:e,transformMode:o.t.ENC_TRANSFORM_MODE}))},t.createDecryptor=function(e,n){return new t(d(d({},n=void 0===n?{}:n),{key:e,transformMode:o.t.DEC_TRANSFORM_MODE}))},t.encrypt=function(e,n,r){return"string"==typeof n?c.E.encrypt(t,e,n,r):a.D.encrypt(t,e,n,r)},t.decrypt=function(e,n,r){return"string"==typeof n?c.E.decrypt(t,e,n,r):a.D.decrypt(t,e,n,r)},t.keySize=6,t.ivSize=2,t}(i.G)},7753:function(e,t,n){n.d(t,{GMAC:function(){return s}});var r=n(4768),a=n(3354),i=n(9691),o=n(5607);function s(e,t,n,s,u){var c="string"==typeof e?r.d.parse(e):e,f=n||new a.e([0,0,0,0]),d=u&&u.Cipher?u.Cipher:i.AES,l="string"==typeof t?r.d.parse(t):t,p=s||16;return o.V.mac(d,l,f,c,void 0,p)}},6367:function(e,t,n){n.d(t,{Hmac:function(){return a}});var r=n(4768),a=function(){function e(e,t){this.tn=e,"string"==typeof t&&(t=r.d.parse(t));var n=e.blockSize,a=4*n;t.nSigBytes>a&&(t=e.finalize(t)),t.clamp();for(var i=this.rn=t.clone(),o=this.en=t.clone(),s=i.words,u=o.words,c=0;c>>32-i)+t}function c(e,t,n,r,a,i,o){var s=e+(t&r|n&~r)+a+o;return(s<>>32-i)+t}function f(e,t,n,r,a,i,o){var s=e+(t^n^r)+a+o;return(s<>>32-i)+t}function d(e,t,n,r,a,i,o){var s=e+(n^(t|~r))+a+o;return(s<>>32-i)+t}!function(){for(var e=0;e<64;e++)s[e]=4294967296*Math.abs(Math.sin(e+1))|0}();var l=function(e){function t(t){var n=e.call(this,t)||this;return n.on=new a.e([1732584193,4023233417,2562383102,271733878]),t&&void 0!==t.hash&&(n.on=t.hash.clone()),n}return o(t,e),t.prototype.A=function(){this.on=new a.e([1732584193,4023233417,2562383102,271733878])},t.prototype.un=function(e,t){for(var n=0;n<16;n++){var r=t+n,a=e[r];e[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var i=this.on.words,o=e[t],l=e[t+1],p=e[t+2],b=e[t+3],h=e[t+4],y=e[t+5],m=e[t+6],v=e[t+7],g=e[t+8],w=e[t+9],T=e[t+10],k=e[t+11],_=e[t+12],O=e[t+13],S=e[t+14],x=e[t+15],A=i[0],M=i[1],E=i[2],P=i[3];A=u(A,M,E,P,o,7,s[0]),P=u(P,A,M,E,l,12,s[1]),E=u(E,P,A,M,p,17,s[2]),M=u(M,E,P,A,b,22,s[3]),A=u(A,M,E,P,h,7,s[4]),P=u(P,A,M,E,y,12,s[5]),E=u(E,P,A,M,m,17,s[6]),M=u(M,E,P,A,v,22,s[7]),A=u(A,M,E,P,g,7,s[8]),P=u(P,A,M,E,w,12,s[9]),E=u(E,P,A,M,T,17,s[10]),M=u(M,E,P,A,k,22,s[11]),A=u(A,M,E,P,_,7,s[12]),P=u(P,A,M,E,O,12,s[13]),E=u(E,P,A,M,S,17,s[14]),A=c(A,M=u(M,E,P,A,x,22,s[15]),E,P,l,5,s[16]),P=c(P,A,M,E,m,9,s[17]),E=c(E,P,A,M,k,14,s[18]),M=c(M,E,P,A,o,20,s[19]),A=c(A,M,E,P,y,5,s[20]),P=c(P,A,M,E,T,9,s[21]),E=c(E,P,A,M,x,14,s[22]),M=c(M,E,P,A,h,20,s[23]),A=c(A,M,E,P,w,5,s[24]),P=c(P,A,M,E,S,9,s[25]),E=c(E,P,A,M,b,14,s[26]),M=c(M,E,P,A,g,20,s[27]),A=c(A,M,E,P,O,5,s[28]),P=c(P,A,M,E,p,9,s[29]),E=c(E,P,A,M,v,14,s[30]),A=f(A,M=c(M,E,P,A,_,20,s[31]),E,P,y,4,s[32]),P=f(P,A,M,E,g,11,s[33]),E=f(E,P,A,M,k,16,s[34]),M=f(M,E,P,A,S,23,s[35]),A=f(A,M,E,P,l,4,s[36]),P=f(P,A,M,E,h,11,s[37]),E=f(E,P,A,M,v,16,s[38]),M=f(M,E,P,A,T,23,s[39]),A=f(A,M,E,P,O,4,s[40]),P=f(P,A,M,E,o,11,s[41]),E=f(E,P,A,M,b,16,s[42]),M=f(M,E,P,A,m,23,s[43]),A=f(A,M,E,P,w,4,s[44]),P=f(P,A,M,E,_,11,s[45]),E=f(E,P,A,M,x,16,s[46]),A=d(A,M=f(M,E,P,A,p,23,s[47]),E,P,o,6,s[48]),P=d(P,A,M,E,v,10,s[49]),E=d(E,P,A,M,S,15,s[50]),M=d(M,E,P,A,y,21,s[51]),A=d(A,M,E,P,_,6,s[52]),P=d(P,A,M,E,b,10,s[53]),E=d(E,P,A,M,T,15,s[54]),M=d(M,E,P,A,l,21,s[55]),A=d(A,M,E,P,g,6,s[56]),P=d(P,A,M,E,x,10,s[57]),E=d(E,P,A,M,m,15,s[58]),M=d(M,E,P,A,O,21,s[59]),A=d(A,M,E,P,h,6,s[60]),P=d(P,A,M,E,k,10,s[61]),E=d(E,P,A,M,p,15,s[62]),M=d(M,E,P,A,w,21,s[63]),i[0]=i[0]+A|0,i[1]=i[1]+M|0,i[2]=i[2]+E|0,i[3]=i[3]+P|0},t.prototype.fn=function(){var e=this.cn,t=e.words,n=8*this.sn,r=8*e.nSigBytes;t[r>>>5]|=128<<24-r%32;var a=Math.floor(n/4294967296),i=n;t[15+(r+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t[14+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.nSigBytes=4*(t.length+1),this.an();for(var o=this.on,s=o.words,u=0;u<4;u++){var c=s[u];s[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return o},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e){return(new t).finalize(e)},t}(i.P)},4615:function(e,t,n){n.d(t,{RC4:function(){return c}});var r,a=n(30),i=n(5693),o=n(9109),s=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n>>2]>>>24-i%4*8&255;a=(a+this.S[r]+o)%256;var s=this.S[r];this.S[r]=this.S[a],this.S[a]=s}this.i=this.j=0},t.prototype.un=function(e,t){e[t]^=this.generateKeyStreamWord()},t.prototype.generateKeyStreamWord=function(){for(var e=this.S,t=this.i,n=this.j,r=0,a=0;a<4;a++){n=(n+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*a}return this.i=t,this.j=n,r},t.createEncryptor=function(e,n){return new t(u(u({},n=void 0===n?{}:n),{key:e}))},t.createDecryptor=function(e,n){return new t(u(u({},n=void 0===n?{}:n),{key:e}))},t.encrypt=function(e,n,r){return"string"==typeof n?i.E.encrypt(t,e,n,r):o.D.encrypt(t,e,n,r)},t.decrypt=function(e,n,r){return"string"==typeof n?i.E.decrypt(t,e,n,r):o.D.decrypt(t,e,n,r)},t.ivSize=0,t.keySize=8,t}(a.q)},9639:function(e,t,n){n.d(t,{RC4Drop:function(){return c}});var r,a=n(5693),i=n(9109),o=n(4615),s=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0;t--)this.generateKeyStreamWord()},t.createEncryptor=function(e,n){return new t(u(u({},n=void 0===n?{}:n),{key:e}))},t.createDecryptor=function(e,n){return new t(u(u({},n=void 0===n?{}:n),{key:e}))},t.encrypt=function(e,n,r){return"string"==typeof n?a.E.encrypt(t,e,n,r):i.D.encrypt(t,e,n,r)},t.decrypt=function(e,n,r){return"string"==typeof n?a.E.decrypt(t,e,n,r):i.D.decrypt(t,e,n,r)},t}(o.RC4)},7104:function(e,t,n){n.d(t,{RIPEMD160:function(){return g}});var r,a=n(1868),i=n(3354),o=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=new i.e([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=new i.e([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=new i.e([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=new i.e([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=new i.e([0,1518500249,1859775393,2400959708,2840853838]),l=new i.e([1352829926,1548603684,1836072691,2053994217,0]);function p(e,t,n){return e^t^n}function b(e,t,n){return e&t|~e&n}function h(e,t,n){return(e|~t)^n}function y(e,t,n){return e&n|t&~n}function m(e,t,n){return e^(t|~n)}function v(e,t){return e<>>32-t}var g=function(e){function t(t){var n=e.call(this,t)||this;return n.on=new i.e([1732584193,4023233417,2562383102,271733878,3285377520]),n.O=t,t&&void 0!==t.hash&&(n.on=t.hash.clone()),n}return o(t,e),t.prototype.A=function(){this.on=new i.e([1732584193,4023233417,2562383102,271733878,3285377520])},t.prototype.un=function(e,t){for(var n=0;n<16;n++){var r=t+n,a=e[r];e[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var i,o,g,w,T,k,_,O,S,x,A,M=this.on.words,E=d.words,P=l.words,j=s.words,I=u.words,C=c.words,R=f.words;for(k=i=M[0],_=o=M[1],O=g=M[2],S=w=M[3],x=T=M[4],n=0;n<80;n+=1)A=i+e[t+j[n]]|0,A+=n<16?p(o,g,w)+E[0]:n<32?b(o,g,w)+E[1]:n<48?h(o,g,w)+E[2]:n<64?y(o,g,w)+E[3]:m(o,g,w)+E[4],A=(A=v(A|=0,C[n]))+T|0,i=T,T=w,w=v(g,10),g=o,o=A,A=k+e[t+I[n]]|0,A+=n<16?m(_,O,S)+P[0]:n<32?y(_,O,S)+P[1]:n<48?h(_,O,S)+P[2]:n<64?b(_,O,S)+P[3]:p(_,O,S)+P[4],A=(A=v(A|=0,R[n]))+x|0,k=x,x=S,S=v(O,10),O=_,_=A;A=M[1]+g+S|0,M[1]=M[2]+w+x|0,M[2]=M[3]+T+k|0,M[3]=M[4]+i+_|0,M[4]=M[0]+o+O|0,M[0]=A},t.prototype.fn=function(){var e=this.cn,t=e.words,n=8*this.sn,r=8*e.nSigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.nSigBytes=4*(t.length+1),this.an();for(var a=this.on,i=a.words,o=0;o<5;o++){var s=i[o];i[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return a},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e,n){return new t(n).finalize(e)},t}(a.P)},5187:function(e,t,n){n.d(t,{Rabbit:function(){return c}});var r,a=n(30),i=n(5693),o=n(9109),s=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this.hn=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],a=this.vn=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this.wn=0,n=0;n<4;n++)this.nextState();for(n=0;n<8;n++)a[n]^=r[n+4&7];if(t){var i=t.words,o=i[0],s=i[1],u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=u>>>16|4294901760&c,d=c<<16|65535&u;for(a[0]^=u,a[1]^=f,a[2]^=c,a[3]^=d,a[4]^=u,a[5]^=f,a[6]^=c,a[7]^=d,n=0;n<4;n++)this.nextState()}},t.prototype.un=function(e,t){var n=this.hn;this.nextState(),this.S[0]=n[0]^n[5]>>>16^n[3]<<16,this.S[1]=n[2]^n[7]>>>16^n[5]<<16,this.S[2]=n[4]^n[1]>>>16^n[7]<<16,this.S[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)this.S[r]=16711935&(this.S[r]<<8|this.S[r]>>>24)|4278255360&(this.S[r]<<24|this.S[r]>>>8),e[t+r]^=this.S[r]},t.prototype.nextState=function(){for(var e=this.hn,t=this.vn,n=0;n<8;n++)this.C[n]=t[n];for(t[0]=t[0]+1295307597+this.wn|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this.wn=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],a=65535&r,i=r>>>16,o=((a*a>>>17)+a*i>>>15)+i*i,s=((4294901760&r)*r|0)+((65535&r)*r|0);this.G[n]=o^s}var u=this.G;e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0},t.createEncryptor=function(e,n){return new t(u(u({},n=void 0===n?{}:n),{key:e}))},t.createDecryptor=function(e,n){return new t(u(u({},n=void 0===n?{}:n),{key:e}))},t.encrypt=function(e,n,r){return"string"==typeof n?i.E.encrypt(t,e,n,r):o.D.encrypt(t,e,n,r)},t.decrypt=function(e,n,r){return"string"==typeof n?i.E.decrypt(t,e,n,r):o.D.decrypt(t,e,n,r)},t.ivSize=4,t}(a.q)},3173:function(e,t,n){n.d(t,{SHA1:function(){return u}});var r,a=n(1868),i=n(3354),o=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=[],u=function(e){function t(t){var n=e.call(this,t)||this;return n.on=new i.e([1732584193,4023233417,2562383102,271733878,3285377520]),n.O=t,t&&void 0!==t.hash&&(n.on=t.hash.clone()),n}return o(t,e),t.prototype.A=function(){this.on=new i.e([1732584193,4023233417,2562383102,271733878,3285377520])},t.prototype.un=function(e,t){for(var n=this.on.words,r=n[0],a=n[1],i=n[2],o=n[3],u=n[4],c=0;c<80;c++){if(c<16)s[c]=0|e[t+c];else{var f=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=f<<1|f>>>31}var d=(r<<5|r>>>27)+u+s[c];d+=c<20?1518500249+(a&i|~a&o):c<40?1859775393+(a^i^o):c<60?(a&i|a&o|i&o)-1894007588:(a^i^o)-899497514,u=o,o=i,i=a<<30|a>>>2,a=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+i|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0},t.prototype.fn=function(){var e=this.cn.words,t=8*this.sn,n=8*this.cn.nSigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(t/4294967296),e[15+(n+64>>>9<<4)]=t,this.cn.nSigBytes=4*e.length,this.an(),this.on},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e,n){return new t(n).finalize(e)},t}(a.P)},766:function(e,t,n){n.d(t,{SHA224:function(){return s}});var r,a=n(3354),i=n(5561),o=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=function(e){function t(t){var n=e.call(this,t)||this;return n.on=new a.e([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),n.O=t,t&&void 0!==t.hash&&(n.on=t.hash.clone()),n}return o(t,e),t.prototype.A=function(){this.on=new a.e([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},t.prototype.fn=function(){var t=e.prototype.fn.call(this);return t.nSigBytes-=4,t},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e,n){return new t(n).finalize(e)},t}(i.SHA256)},5561:function(e,t,n){n.d(t,{SHA256:function(){return l}});var r,a=n(1868),i=n(3354),o=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=[],u=[];function c(e){for(var t=Math.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function f(e){return 4294967296*(e-(0|e))|0}!function(){for(var e=2,t=0;t<64;)c(e)&&(t<8&&(s[t]=f(Math.pow(e,.5))),u[t]=f(Math.pow(e,1/3)),t++),e++}();var d=[],l=function(e){function t(t){var n=e.call(this,t)||this;return n.on=new i.e(s.slice(0)),n.O=t,t&&void 0!==t.hash&&(n.on=t.hash.clone()),n}return o(t,e),t.prototype.A=function(){this.on=new i.e(s.slice(0))},t.prototype.un=function(e,t){for(var n=this.on.words,r=n[0],a=n[1],i=n[2],o=n[3],s=n[4],c=n[5],f=n[6],l=n[7],p=0;p<64;p++){if(p<16)d[p]=0|e[t+p];else{var b=d[p-15],h=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,y=d[p-2],m=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;d[p]=h+d[p-7]+m+d[p-16]}var v=r&a^r&i^a&i,g=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&f)+u[p]+d[p];l=f,f=c,c=s,s=o+w|0,o=i,i=a,a=r,r=w+(g+v)|0}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+i|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+f|0,n[7]=n[7]+l|0},t.prototype.fn=function(){var e=this.cn.words,t=8*this.sn,n=8*this.cn.nSigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(t/4294967296),e[15+(n+64>>>9<<4)]=t,this.cn.nSigBytes=4*e.length,this.an(),this.on},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e,n){return new t(n).finalize(e)},t}(a.P)},3408:function(e,t,n){n.d(t,{SHA3:function(){return l}});var r,a=n(6957),i=n(1868),o=n(3354),s=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=[],c=[],f=[];!function(){for(var e=1,t=0,n=0;n<24;n++){u[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(var i=0;i<5;i++)for(var o=0;o<5;o++)c[i+5*o]=o+(2*i+3*o)%5*5;for(var s=1,d=0;d<24;d++){for(var l=0,p=0,b=0;b<7;b++){if(1&s){var h=(1<>>24)|4278255360&(i<<24|i>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[a].high^=o,n[a].low^=i}for(var s=0;s<24;s++){for(var l=0;l<5;l++){for(var p=0,b=0,h=0;h<5;h++)p^=(M=n[l+5*h]).high,b^=M.low;var y=d[l];y.high=p,y.low=b}for(l=0;l<5;l++){var m=d[(l+4)%5],v=d[(l+1)%5],g=v.high,w=v.low;for(p=m.high^(g<<1|w>>>31),b=m.low^(w<<1|g>>>31),h=0;h<5;h++)(M=n[l+5*h]).high^=p,M.low^=b}for(var T=1;T<25;T++){p=void 0,b=void 0;var k=n[T].high,_=n[T].low,O=u[T];O<32?(p=k<>>32-O,b=_<>>32-O):(p=_<>>64-O,b=k<>>64-O);var S=d[c[T]];S.high=p,S.low=b}var x=d[0],A=n[0];for(x.high=A.high,x.low=A.low,l=0;l<5;l++)for(h=0;h<5;h++){var M=n[T=l+5*h],E=d[T],P=d[(l+1)%5+5*h],j=d[(l+2)%5+5*h];M.high=E.high^~P.high&j.high,M.low=E.low^~P.low&j.low}var I=n[0],C=f[s];I.high^=C.high,I.low^=C.low}},t.prototype.fn=function(){var e=this.cn,t=e.words,n=8*e.nSigBytes,r=32*this.blockSize;t[n>>>5]|=1<<24-n%32,t[(Math.ceil((n+1)/r)*r>>>5)-1]|=128,e.nSigBytes=4*t.length,this.an();for(var a=this.bn,i=this.dn/8,s=i/8,u=[],c=0;c>>24)|4278255360&(d<<24|d>>>8),l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),u.push(l),u.push(d)}return new o.e(u,i)},t.prototype.clone=function(){return new t({outputLength:this.dn,state:this.bn,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e,n){return new t(n).finalize(e)},t}(i.P)},6324:function(e,t,n){n.d(t,{SHA384:function(){return s}});var r,a=n(6957),i=n(7491),o=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=function(e){function t(t){var n=e.call(this,t)||this;return n.on=new a.m([new a.r(3418070365,3238371032),new a.r(1654270250,914150663),new a.r(2438529370,812702999),new a.r(355462360,4144912697),new a.r(1731405415,4290775857),new a.r(2394180231,1750603025),new a.r(3675008525,1694076839),new a.r(1203062813,3204075428)]),n.O=t,t&&void 0!==t.hash&&(n.on=t.hash.clone()),n}return o(t,e),t.prototype.A=function(){this.on=new a.m([new a.r(3418070365,3238371032),new a.r(1654270250,914150663),new a.r(2438529370,812702999),new a.r(355462360,4144912697),new a.r(1731405415,4290775857),new a.r(2394180231,1750603025),new a.r(3675008525,1694076839),new a.r(1203062813,3204075428)])},t.prototype.fn=function(){var t=e.prototype.fn.call(this);return t.nSigBytes-=16,t},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e,n){return new t(n).finalize(e)},t}(i.SHA512)},7491:function(e,t,n){n.d(t,{SHA512:function(){return c}});var r,a=n(1868),i=n(6957),o=(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){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=[new i.r(1116352408,3609767458),new i.r(1899447441,602891725),new i.r(3049323471,3964484399),new i.r(3921009573,2173295548),new i.r(961987163,4081628472),new i.r(1508970993,3053834265),new i.r(2453635748,2937671579),new i.r(2870763221,3664609560),new i.r(3624381080,2734883394),new i.r(310598401,1164996542),new i.r(607225278,1323610764),new i.r(1426881987,3590304994),new i.r(1925078388,4068182383),new i.r(2162078206,991336113),new i.r(2614888103,633803317),new i.r(3248222580,3479774868),new i.r(3835390401,2666613458),new i.r(4022224774,944711139),new i.r(264347078,2341262773),new i.r(604807628,2007800933),new i.r(770255983,1495990901),new i.r(1249150122,1856431235),new i.r(1555081692,3175218132),new i.r(1996064986,2198950837),new i.r(2554220882,3999719339),new i.r(2821834349,766784016),new i.r(2952996808,2566594879),new i.r(3210313671,3203337956),new i.r(3336571891,1034457026),new i.r(3584528711,2466948901),new i.r(113926993,3758326383),new i.r(338241895,168717936),new i.r(666307205,1188179964),new i.r(773529912,1546045734),new i.r(1294757372,1522805485),new i.r(1396182291,2643833823),new i.r(1695183700,2343527390),new i.r(1986661051,1014477480),new i.r(2177026350,1206759142),new i.r(2456956037,344077627),new i.r(2730485921,1290863460),new i.r(2820302411,3158454273),new i.r(3259730800,3505952657),new i.r(3345764771,106217008),new i.r(3516065817,3606008344),new i.r(3600352804,1432725776),new i.r(4094571909,1467031594),new i.r(275423344,851169720),new i.r(430227734,3100823752),new i.r(506948616,1363258195),new i.r(659060556,3750685593),new i.r(883997877,3785050280),new i.r(958139571,3318307427),new i.r(1322822218,3812723403),new i.r(1537002063,2003034995),new i.r(1747873779,3602036899),new i.r(1955562222,1575990012),new i.r(2024104815,1125592928),new i.r(2227730452,2716904306),new i.r(2361852424,442776044),new i.r(2428436474,593698344),new i.r(2756734187,3733110249),new i.r(3204031479,2999351573),new i.r(3329325298,3815920427),new i.r(3391569614,3928383900),new i.r(3515267271,566280711),new i.r(3940187606,3454069534),new i.r(4118630271,4000239992),new i.r(116418474,1914138554),new i.r(174292421,2731055270),new i.r(289380356,3203993006),new i.r(460393269,320620315),new i.r(685471733,587496836),new i.r(852142971,1086792851),new i.r(1017036298,365543100),new i.r(1126000580,2618297676),new i.r(1288033470,3409855158),new i.r(1501505948,4234509866),new i.r(1607167915,987167468),new i.r(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=new i.r(0,0)}();var c=function(e){function t(t){var n=e.call(this,t)||this;return n.N=32,n.on=new i.m([new i.r(1779033703,4089235720),new i.r(3144134277,2227873595),new i.r(1013904242,4271175723),new i.r(2773480762,1595750129),new i.r(1359893119,2917565137),new i.r(2600822924,725511199),new i.r(528734635,4215389547),new i.r(1541459225,327033209)]),n.O=t,t&&void 0!==t.hash&&(n.on=t.hash.clone()),n}return o(t,e),t.prototype.A=function(){this.on=new i.m([new i.r(1779033703,4089235720),new i.r(3144134277,2227873595),new i.r(1013904242,4271175723),new i.r(2773480762,1595750129),new i.r(1359893119,2917565137),new i.r(2600822924,725511199),new i.r(528734635,4215389547),new i.r(1541459225,327033209)])},t.prototype.un=function(e,t){for(var n=this.on.words,r=n[0],a=n[1],i=n[2],o=n[3],c=n[4],f=n[5],d=n[6],l=n[7],p=r.high,b=r.low,h=a.high,y=a.low,m=i.high,v=i.low,g=o.high,w=o.low,T=c.high,k=c.low,_=f.high,O=f.low,S=d.high,x=d.low,A=l.high,M=l.low,E=p,P=b,j=h,I=y,C=m,R=v,N=g,D=w,B=T,U=k,L=_,z=O,F=S,q=x,H=A,J=M,V=0;V<80;V++){var W=void 0,K=void 0,G=u[V];if(V<16)K=G.high=0|e[t+2*V],W=G.low=0|e[t+2*V+1];else{var Z=u[V-15],X=Z.high,Y=Z.low,$=(X>>>1|Y<<31)^(X>>>8|Y<<24)^X>>>7,Q=(Y>>>1|X<<31)^(Y>>>8|X<<24)^(Y>>>7|X<<25),ee=u[V-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ae=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=u[V-7],oe=ie.high,se=ie.low,ue=u[V-16],ce=ue.high,fe=ue.low;K=(K=(K=$+oe+((W=Q+se)>>>0>>0?1:0))+re+((W+=ae)>>>0>>0?1:0))+ce+((W+=fe)>>>0>>0?1:0),G.high=K,G.low=W}var de=B&L^~B&F,le=U&z^~U&q,pe=E&j^E&C^j&C,be=P&I^P&R^I&R,he=(E>>>28|P<<4)^(E<<30|P>>>2)^(E<<25|P>>>7),ye=(P>>>28|E<<4)^(P<<30|E>>>2)^(P<<25|E>>>7),me=(B>>>14|U<<18)^(B>>>18|U<<14)^(B<<23|U>>>9),ve=(U>>>14|B<<18)^(U>>>18|B<<14)^(U<<23|B>>>9),ge=s[V],we=ge.high,Te=ge.low,ke=J+ve,_e=H+me+(ke>>>0>>0?1:0),Oe=ye+be;H=F,J=q,F=L,q=z,L=B,z=U,B=N+(_e=(_e=(_e=_e+de+((ke+=le)>>>0>>0?1:0))+we+((ke+=Te)>>>0>>0?1:0))+K+((ke+=W)>>>0>>0?1:0))+((U=D+ke|0)>>>0>>0?1:0)|0,N=C,D=R,C=j,R=I,j=E,I=P,E=_e+(he+pe+(Oe>>>0>>0?1:0))+((P=ke+Oe|0)>>>0>>0?1:0)|0}b=r.low=b+P,r.high=p+E+(b>>>0

>>0?1:0),y=a.low=y+I,a.high=h+j+(y>>>0>>0?1:0),v=i.low=v+R,i.high=m+C+(v>>>0>>0?1:0),w=o.low=w+D,o.high=g+N+(w>>>0>>0?1:0),k=c.low=k+U,c.high=T+B+(k>>>0>>0?1:0),O=f.low=O+z,f.high=_+L+(O>>>0>>0?1:0),x=d.low=x+q,d.high=S+F+(x>>>0>>0?1:0),M=l.low=M+J,l.high=A+H+(M>>>0>>0?1:0)},t.prototype.fn=function(){var e=this.cn,t=e.words,n=8*this.sn,r=8*e.nSigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.nSigBytes=4*t.length,this.an(),this.on.to32()},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(e,n){return new t(n).finalize(e)},t}(a.P)},3354:function(e,t,n){n.d(t,{e:function(){return i}});var r=n(5720),a=n(9054),i=function(){function e(t,n){if(Array.isArray(t)||!t)return this.yn=Array.isArray(t)?t:[],void(this.pn="number"==typeof n?n:4*this.yn.length);if(t instanceof e)return this.yn=t.words.slice(),void(this.pn=t.nSigBytes);var r;try{t instanceof ArrayBuffer?r=new Uint8Array(t):(t instanceof Uint8Array||t instanceof Int8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}catch(e){throw new Error("Invalid argument")}if(!r)throw new Error("Invalid argument");for(var a=r.byteLength,i=[],o=0;o>>2]|=r[o]<<24-o%4*8;this.yn=i,this.pn=a}return Object.defineProperty(e.prototype,"nSigBytes",{get:function(){return this.pn},set:function(e){this.pn=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"words",{get:function(){return this.yn},enumerable:!1,configurable:!0}),e.prototype.toString=function(e){return e?e.stringify(this):r.p.stringify(this)},e.prototype.toUint8Array=function(){for(var e=this.yn,t=this.pn,n=new Uint8Array(t),r=0;r>>2]>>>24-r%4*8&255;return n},e.prototype.concat=function(e){var t=e.words.slice(),n=e.nSigBytes;if(this.clamp(),this.pn%4)for(var r=0;r>>2]>>>24-r%4*8&255;this.yn[this.pn+r>>>2]|=a<<24-(this.pn+r)%4*8}else for(r=0;r>>2]=t[r>>>2];return this.pn+=n,this},e.prototype.clamp=function(){var e=this.pn;this.yn[e>>>2]&=4294967295<<32-e%4*8,this.yn.length=Math.ceil(e/4)},e.prototype.clone=function(){return new e(this.yn.slice(),this.pn)},e.random=function(t){for(var n=[],r=0;r0&&a.push(0),e.concat(new r.e(a,n))}}function i(e,t){return new r.e(e.words.slice(),t)}function o(e,t){for(var n=e.nSigBytes-t,a=[],i=0;i>>2,s=n+i,u=s>>>2,c=e.words[u]>>>24-s%4*8&255;a[o]=0|a[o]|c<<24-i%4*8}var f=new r.e(a,t);return f.clamp(),f}},7919:function(e,t,n){n.d(t,{l:function(){return a}});var r=n(3354),a={pad:function(e,t){for(var n=4*t,a=n-e.nSigBytes%n,i=a<<24|a<<16|a<<8|a,o=[],s=0;s>>2];e.nSigBytes-=t}}},1756:function(e,t,n){n.d(t,{w:function(){return o}});var r,a="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i=(r=parseInt((/msie (\d+)/.exec(a)||[])[1],10),isNaN(r)?(r=parseInt((/trident\/.*; rv:(\d+)/.exec(a)||[])[1],10),!isNaN(r)&&r):r);function o(e,t){return!1!==i&&(!t||("<"===e?i"===e?i>t:">="===e?i>=t:i===t))}},1773:function(e,t,n){n.d(t,{D:function(){return s}});for(var r=n(3354),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=[],o=0;o>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s>>6*(3-s)&63));var u=a.charAt(64);if(u)for(;r.length%4;)r.push(u);return r.join("")},parse:function(e){var t=e.length,n=a.charAt(64);if(n){var o=e.indexOf(n);-1!==o&&(t=o)}for(var s=[],u=0,c=0;c>>6-c%4*2;s[u>>>2]|=f<<24-u%4*8,u++}return new r.e(s,u)}}},5720:function(e,t,n){n.d(t,{p:function(){return a}});var r=n(3354),a={stringify:function(e){for(var t=e.nSigBytes,n=e.words,r=[],a=0;a>>2]>>>24-a%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){var t=e.length;if(t%2!=0)throw new Error("Hex string count must be even");if(!/^[a-fA-F0-9]+$/.test(e))throw new Error("Invalid Hex string: "+e);for(var n=[],a=0;a>>3]|=parseInt(e.substr(a,2),16)<<24-a%8*4;return new r.e(n,t/2)}}},8702:function(e,t,n){n.d(t,{m:function(){return a}});var r=n(3354),a={stringify:function(e){for(var t=e.nSigBytes,n=e.words,r=[],a=0;a>>2]>>>24-a%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a>>2]|=(255&e.charCodeAt(a))<<24-a%4*8;return new r.e(n,t)}}},4768:function(e,t,n){n.d(t,{d:function(){return a}});var r=n(8702),a={stringify:function(e){try{return decodeURIComponent(escape(r.m.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return r.m.parse(unescape(encodeURIComponent(e)))}}},2688:function(e,t,n){n.d(t,{Base64:function(){return i.D},EvpKDF:function(){return g},Hex:function(){return u.p},Latin1:function(){return s.m},OpenSSLKDF:function(){return b.s},PBKDF2:function(){return h.E},Utf16:function(){return p},Utf16BE:function(){return c},Utf16LE:function(){return l},Utf8:function(){return o.d},Word32Array:function(){return r.e},Word64:function(){return a.r},Word64Array:function(){return a.m}}),n(9054);var r=n(3354),a=n(6957),i=(n(1756),n(1773)),o=n(4768),s=n(8702),u=n(5720),c={stringify:function(e){for(var t=e.words,n=e.nSigBytes,r=[],a=0;a>>2]>>>16-a%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a>>1]|=e.charCodeAt(a)<<16-a%2*16;return new r.e(n,2*t)}};function f(e){return e<<8&4278255360|e>>>8&16711935}var d,l={stringify:function(e){for(var t=e.words,n=e.nSigBytes,r=[],a=0;a>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a>>1]|=f(e.charCodeAt(a)<<16-a%2*16);return new r.e(n,2*t)}},p=c,b=n(2214),h=n(7008),y=n(670),m=n(9541),v=(d=function(e,t){return(d=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){function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),g=function(e){function t(t){var n=e.call(this,t)||this;return n.Sn=4,n.Mn=y.MD5,n.kn=1,t&&(n.Sn=void 0!==t.keySize?t.keySize:n.Sn,n.Mn=void 0!==t.Hasher?t.Hasher:n.Mn,n.kn=void 0!==t.iterations?t.iterations:n.kn),n}return v(t,e),t.prototype.compute=function(e,t){for(var n,a=new this.Mn,i=new r.e,o=i.words,s=this.Sn,u=this.kn;o.length13||a.nSigBytes<7))throw new Error("Byte size of iv must be between 7 and 13");return n.Nn=a||new i.e([0,0],8),n.In=15-n.Nn.nSigBytes,n}return s(t,e),t.getB0=function(e,t,n,r){if(n.nSigBytes+r.nSigBytes!==15)throw new Error("LEN(Q)+LEN(N) must be 15");var a=255&(0|(e?1:0)<<6|(t-2)/2<<3|n.nSigBytes-1),o=r.clone().concat(n);return new i.e([a<<24],1).concat(o)},t.formatAssociatedDataAndPayload=function(e,t){var n,r=e.nSigBytes;if(0===r)n=new i.e([0],0);else if(r4?(a.concat(new i.e([0],e%4)),a.concat(new i.e([n],4))):a.concat(new i.e([n<<32-8*e],e)):a.concat(new i.e([n],4)),r.concat(t).concat(a)},t.mac=function(e,n,r,a,s,u){var c=new e({key:n,iv:r});if(4!==c.blockSize)throw new Error("In CCM, cipher block size must be 128bit");if(r&&(r.nSigBytes>13||r.nSigBytes<7))throw new Error("Byte size of iv must be between 7 and 13");var f=r||new i.e([0,0],8),d=(null==a?void 0:a.clone())||new i.e,l=d.nSigBytes,p=(null==s?void 0:s.clone())||new i.e,b=p.nSigBytes;if(b>>>0>4294967295)throw new Error("Byte length of Payload(plainText) larger than 2^32-1 (4,294,967,295byte) is not supported at this time.");var h=15-f.nSigBytes,y=(0,o.ur)(new i.e([0,b],8),h),m=u||16,v=t.getB0(Boolean(l),m,y,f),g=t.formatAssociatedDataAndPayload(d,p),w=v.words.slice();c.encryptBlock(w,0);for(var T=g.nSigBytes/16,k=g.words,_=w,O=0;O0?4-n.length%4:0,i=n.slice(),o=0;o>>0,r=n+1>>>0>>0,i=a+1>>>0>>5]>>>31-i%32&1)>0&&(r[0]=r[0]^a[0],r[1]=r[1]^a[1],r[2]=r[2]^a[2],r[3]=r[3]^a[3]);var o=(1&a[3])>>>0,s=(1&a[0])>>>0,u=(1&a[1])>>>0,c=(1&a[2])>>>0;a[0]=a[0]>>>1,a[1]=a[1]>>>1|(s?2147483648:0),a[2]=a[2]>>>1|(u?2147483648:0),a[3]=a[3]>>>1|(c?2147483648:0),o>0&&(a[0]^=n[0],a[1]^=n[1],a[2]^=n[2],a[3]^=n[3])}return r},t.GHASH=function(e,n){if(e.length%4!=0)throw new Error("Length of 32bit word array 'H' must be multiple of 4(128bit)");if(n.length%4!=0)throw new Error("Length of 32bit word array 'X' must be multiple of 4(128bit)");for(var r=n.length,a=[0,0,0,0],i=0;i0){var _=a[4*u+g]<<32-8*k^s[u][g];m.push(_),v+=k}var O=new i.e(m,v);f.concat(O)}}return f.nSigBytes=r.nSigBytes,f.clamp(),f},t.mac=function(e,n,r,a,s,u){var c=new e({key:n,iv:r}),f=[0,0,0,0];c.encryptBlock(f,0);var d=t.getJ0(f,r.words),l=(null==a?void 0:a.clone())||new i.e,p=[0,8*l.nSigBytes],b=(null==s?void 0:s.clone())||new i.e,h=[0,8*b.nSigBytes],y=u||16;(0,o.I4)(l),(0,o.I4)(b);var m=l.words.concat(b.words).concat(p).concat(h),v=t.GHASH(f,m),g=t.GCTR(c,d,new i.e(v));return(0,o.z6)(g,y)},t.createEncryptor=function(e){return new t.Encryptor(e)},t.createDecryptor=function(e){return new t.Decryptor(e)},t.Encryptor=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.processBlock=function(e,n){var r=this.Hn.blockSize;this.Un=t.inc32(this.Un);for(var a=new i.e(e.slice(n,n+r)),o=t.GCTR(this.Hn,this.Un,a),s=0;s>>2]|=a<<24-i%4*8,e.nSigBytes+=a},unpad:function(e){var t=255&e.words[e.nSigBytes-1>>>2];e.nSigBytes-=t}},H=r(3354),J={pad:function(e,t){var n=4*t,r=n-e.nSigBytes%n;e.concat(H.e.random(r-1)).concat(new H.e([r<<24],1))},unpad:function(e){var t=255&e.words[e.nSigBytes-1>>>2];e.nSigBytes-=t}},V={pad:function(e,t){var n=4*t;e.clamp(),e.nSigBytes+=n-(e.nSigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.nSigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.nSigBytes=n+1;break}}},W={pad:function(e,t){e.concat(new H.e([2147483648],1)),V.pad(e,t)},unpad:function(e){V.unpad(e),e.nSigBytes-=1}},K=r(7919),G={pad:function(e,t){},unpad:function(e){}},Z=r(1232),X={CBC:P.n,CFB:C,CTR:N,ECB:B,OFB:L,GCM:z.V,CCM:F.K},Y={AnsiX923:q,ISO10126:J,ISO97971:W,Pkcs7:K.l,NoPadding:G,Zero:V},$={OpenSSLFormatter:Z.w}}(),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]}),a=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}),a(n(540),t),a(n(541),t),a(n(542),t),a(n(543),t),a(n(544),t),a(n(545),t),a(n(546),t)},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]}),a=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}),a(n(547),t)},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]}),a=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}),a(n(549),t),a(n(550),t),a(n(551),t),a(n(552),t)},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]}),a=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}),a(n(553),t),a(n(556),t),a(n(557),t),a(n(558),t)},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Counterparty=void 0;var a=n(241),i=n(23),o=n(555),s=function(e){function t(t,n,r){var a=e.call(this)||this;return a.client_id=t,a.connection_id=n,a.prefix=r,a}return r(t,e),t.fromAmino=function(e){var n=e.client_id,r=e.connection_id,a=e.prefix;return new t(n,r,a?o.MerklePrefix.fromAmino(a):void 0)},t.prototype.toAmino=function(){var e=this;return{client_id:e.client_id,connection_id:e.connection_id,prefix:e.prefix}},t.fromData=function(e){var n=e.client_id,r=e.connection_id,a=e.prefix;return new t(n,r,a?o.MerklePrefix.fromData(a):void 0)},t.prototype.toData=function(){var e=this,t=e.client_id,n=e.connection_id,r=e.prefix;return{client_id:t,connection_id:n,prefix:r?r.toData():void 0}},t.fromProto=function(e){return new t(e.clientId,e.connectionId,e.prefix?o.MerklePrefix.fromProto(e.prefix):void 0)},t.prototype.toProto=function(){var e=this,t=e.client_id,n=e.connection_id,r=e.prefix;return a.Counterparty.fromPartial({clientId:t,connectionId:n,prefix:r?r.toProto():void 0})},t}(i.JSONSerializable);t.Counterparty=s},function(e,t,n){"use strict";(function(e){var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleProof=t.MerklePath=t.MerklePrefix=t.MerkleRoot=t.protobufPackage=void 0;var i=a(n(24)),o=a(n(20)),s=n(554);t.protobufPackage="ibc.core.commitment.v1";var u={};t.MerkleRoot={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.hash.length&&t.uint32(10).bytes(e.hash),t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},u);for(a.hash=new Uint8Array;n.pos>>3===1)a.hash=n.bytes();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},u);return t.hash=new Uint8Array,void 0!==e.hash&&null!==e.hash&&(t.hash=b(e.hash)),t},toJSON:function(e){var t={};return void 0!==e.hash&&(t.hash=y(void 0!==e.hash?e.hash:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.hash&&null!==e.hash?t.hash=e.hash:t.hash=new Uint8Array,t}};var c={};t.MerklePrefix={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.keyPrefix.length&&t.uint32(10).bytes(e.keyPrefix),t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);for(a.keyPrefix=new Uint8Array;n.pos>>3===1)a.keyPrefix=n.bytes();else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},c);return t.keyPrefix=new Uint8Array,void 0!==e.keyPrefix&&null!==e.keyPrefix&&(t.keyPrefix=b(e.keyPrefix)),t},toJSON:function(e){var t={};return void 0!==e.keyPrefix&&(t.keyPrefix=y(void 0!==e.keyPrefix?e.keyPrefix:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.keyPrefix&&null!==e.keyPrefix?t.keyPrefix=e.keyPrefix:t.keyPrefix=new Uint8Array,t}};var f={keyPath:""};t.MerklePath={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.keyPath);try{for(a.s();!(t=a.n()).done;){var i=t.value;n.uint32(10).string(i)}}catch(s){a.e(s)}finally{a.f()}return n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},f);for(a.keyPath=[];n.pos>>3===1)a.keyPath.push(n.string());else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},f);if(t.keyPath=[],void 0!==e.keyPath&&null!==e.keyPath){var n,a=r(e.keyPath);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.keyPath.push(String(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.keyPath?t.keyPath=e.keyPath.map((function(e){return e})):t.keyPath=[],t},fromPartial:function(e){var t=Object.assign({},f);if(t.keyPath=[],void 0!==e.keyPath&&null!==e.keyPath){var n,a=r(e.keyPath);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.keyPath.push(i)}}catch(o){a.e(o)}finally{a.f()}}return t}};var d={};t.MerkleProof={encode:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),a=r(e.proofs);try{for(a.s();!(t=a.n()).done;){var i=t.value;s.CommitmentProof.encode(i,n.uint32(10).fork()).ldelim()}}catch(u){a.e(u)}finally{a.f()}return n},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},d);for(a.proofs=[];n.pos>>3===1)a.proofs.push(s.CommitmentProof.decode(n,n.uint32()));else n.skipType(7&i)}return a},fromJSON:function(e){var t=Object.assign({},d);if(t.proofs=[],void 0!==e.proofs&&null!==e.proofs){var n,a=r(e.proofs);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.proofs.push(s.CommitmentProof.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return e.proofs?t.proofs=e.proofs.map((function(e){return e?s.CommitmentProof.toJSON(e):void 0})):t.proofs=[],t},fromPartial:function(e){var t=Object.assign({},d);if(t.proofs=[],void 0!==e.proofs&&null!==e.proofs){var n,a=r(e.proofs);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.proofs.push(s.CommitmentProof.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return t}};var l=function(){if("undefined"!==typeof l)return l;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),p=l.atob||function(e){return l.Buffer.from(e,"base64").toString("binary")};function b(e){for(var t=p(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();e.height.isZero()||n.uint32(8).int64(e.height),""!==e.txhash&&n.uint32(18).string(e.txhash),""!==e.codespace&&n.uint32(26).string(e.codespace),0!==e.code&&n.uint32(32).uint32(e.code),""!==e.data&&n.uint32(42).string(e.data),""!==e.rawLog&&n.uint32(50).string(e.rawLog);var a,i=r(e.logs);try{for(i.s();!(a=i.n()).done;){var u=a.value;t.ABCIMessageLog.encode(u,n.uint32(58).fork()).ldelim()}}catch(c){i.e(c)}finally{i.f()}return""!==e.info&&n.uint32(66).string(e.info),e.gasWanted.isZero()||n.uint32(72).int64(e.gasWanted),e.gasUsed.isZero()||n.uint32(80).int64(e.gasUsed),void 0!==e.tx&&s.Any.encode(e.tx,n.uint32(90).fork()).ldelim(),""!==e.timestamp&&n.uint32(98).string(e.timestamp),n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},c);for(i.logs=[];r.pos>>3){case 1:i.height=r.int64();break;case 2:i.txhash=r.string();break;case 3:i.codespace=r.string();break;case 4:i.code=r.uint32();break;case 5:i.data=r.string();break;case 6:i.rawLog=r.string();break;case 7:i.logs.push(t.ABCIMessageLog.decode(r,r.uint32()));break;case 8:i.info=r.string();break;case 9:i.gasWanted=r.int64();break;case 10:i.gasUsed=r.int64();break;case 11:i.tx=s.Any.decode(r,r.uint32());break;case 12:i.timestamp=r.string();break;default:r.skipType(7&u)}}return i},fromJSON:function(e){var n=Object.assign({},c);if(n.logs=[],void 0!==e.height&&null!==e.height?n.height=i.default.fromString(e.height):n.height=i.default.ZERO,void 0!==e.txhash&&null!==e.txhash?n.txhash=String(e.txhash):n.txhash="",void 0!==e.codespace&&null!==e.codespace?n.codespace=String(e.codespace):n.codespace="",void 0!==e.code&&null!==e.code?n.code=Number(e.code):n.code=0,void 0!==e.data&&null!==e.data?n.data=String(e.data):n.data="",void 0!==e.rawLog&&null!==e.rawLog?n.rawLog=String(e.rawLog):n.rawLog="",void 0!==e.logs&&null!==e.logs){var a,o=r(e.logs);try{for(o.s();!(a=o.n()).done;){var u=a.value;n.logs.push(t.ABCIMessageLog.fromJSON(u))}}catch(f){o.e(f)}finally{o.f()}}return void 0!==e.info&&null!==e.info?n.info=String(e.info):n.info="",void 0!==e.gasWanted&&null!==e.gasWanted?n.gasWanted=i.default.fromString(e.gasWanted):n.gasWanted=i.default.ZERO,void 0!==e.gasUsed&&null!==e.gasUsed?n.gasUsed=i.default.fromString(e.gasUsed):n.gasUsed=i.default.ZERO,void 0!==e.tx&&null!==e.tx?n.tx=s.Any.fromJSON(e.tx):n.tx=void 0,void 0!==e.timestamp&&null!==e.timestamp?n.timestamp=String(e.timestamp):n.timestamp="",n},toJSON:function(e){var n={};return void 0!==e.height&&(n.height=(e.height||i.default.ZERO).toString()),void 0!==e.txhash&&(n.txhash=e.txhash),void 0!==e.codespace&&(n.codespace=e.codespace),void 0!==e.code&&(n.code=e.code),void 0!==e.data&&(n.data=e.data),void 0!==e.rawLog&&(n.rawLog=e.rawLog),e.logs?n.logs=e.logs.map((function(e){return e?t.ABCIMessageLog.toJSON(e):void 0})):n.logs=[],void 0!==e.info&&(n.info=e.info),void 0!==e.gasWanted&&(n.gasWanted=(e.gasWanted||i.default.ZERO).toString()),void 0!==e.gasUsed&&(n.gasUsed=(e.gasUsed||i.default.ZERO).toString()),void 0!==e.tx&&(n.tx=e.tx?s.Any.toJSON(e.tx):void 0),void 0!==e.timestamp&&(n.timestamp=e.timestamp),n},fromPartial:function(e){var n=Object.assign({},c);if(n.logs=[],void 0!==e.height&&null!==e.height?n.height=e.height:n.height=i.default.ZERO,void 0!==e.txhash&&null!==e.txhash?n.txhash=e.txhash:n.txhash="",void 0!==e.codespace&&null!==e.codespace?n.codespace=e.codespace:n.codespace="",void 0!==e.code&&null!==e.code?n.code=e.code:n.code=0,void 0!==e.data&&null!==e.data?n.data=e.data:n.data="",void 0!==e.rawLog&&null!==e.rawLog?n.rawLog=e.rawLog:n.rawLog="",void 0!==e.logs&&null!==e.logs){var a,o=r(e.logs);try{for(o.s();!(a=o.n()).done;){var u=a.value;n.logs.push(t.ABCIMessageLog.fromPartial(u))}}catch(f){o.e(f)}finally{o.f()}}return void 0!==e.info&&null!==e.info?n.info=e.info:n.info="",void 0!==e.gasWanted&&null!==e.gasWanted?n.gasWanted=e.gasWanted:n.gasWanted=i.default.ZERO,void 0!==e.gasUsed&&null!==e.gasUsed?n.gasUsed=e.gasUsed:n.gasUsed=i.default.ZERO,void 0!==e.tx&&null!==e.tx?n.tx=s.Any.fromPartial(e.tx):n.tx=void 0,void 0!==e.timestamp&&null!==e.timestamp?n.timestamp=e.timestamp:n.timestamp="",n}};var f={msgIndex:0,log:""};t.ABCIMessageLog={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();0!==e.msgIndex&&n.uint32(8).uint32(e.msgIndex),""!==e.log&&n.uint32(18).string(e.log);var a,i=r(e.events);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.StringEvent.encode(s,n.uint32(26).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},f);for(i.events=[];r.pos>>3){case 1:i.msgIndex=r.uint32();break;case 2:i.log=r.string();break;case 3:i.events.push(t.StringEvent.decode(r,r.uint32()));break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},f);if(n.events=[],void 0!==e.msgIndex&&null!==e.msgIndex?n.msgIndex=Number(e.msgIndex):n.msgIndex=0,void 0!==e.log&&null!==e.log?n.log=String(e.log):n.log="",void 0!==e.events&&null!==e.events){var a,i=r(e.events);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.events.push(t.StringEvent.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.msgIndex&&(n.msgIndex=e.msgIndex),void 0!==e.log&&(n.log=e.log),e.events?n.events=e.events.map((function(e){return e?t.StringEvent.toJSON(e):void 0})):n.events=[],n},fromPartial:function(e){var n=Object.assign({},f);if(n.events=[],void 0!==e.msgIndex&&null!==e.msgIndex?n.msgIndex=e.msgIndex:n.msgIndex=0,void 0!==e.log&&null!==e.log?n.log=e.log:n.log="",void 0!==e.events&&null!==e.events){var a,i=r(e.events);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.events.push(t.StringEvent.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var d={type:""};t.StringEvent={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();""!==e.type&&n.uint32(10).string(e.type);var a,i=r(e.attributes);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.Attribute.encode(s,n.uint32(18).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},d);for(i.attributes=[];r.pos>>3){case 1:i.type=r.string();break;case 2:i.attributes.push(t.Attribute.decode(r,r.uint32()));break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},d);if(n.attributes=[],void 0!==e.type&&null!==e.type?n.type=String(e.type):n.type="",void 0!==e.attributes&&null!==e.attributes){var a,i=r(e.attributes);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.attributes.push(t.Attribute.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.type&&(n.type=e.type),e.attributes?n.attributes=e.attributes.map((function(e){return e?t.Attribute.toJSON(e):void 0})):n.attributes=[],n},fromPartial:function(e){var n=Object.assign({},d);if(n.attributes=[],void 0!==e.type&&null!==e.type?n.type=e.type:n.type="",void 0!==e.attributes&&null!==e.attributes){var a,i=r(e.attributes);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.attributes.push(t.Attribute.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var l={key:"",value:""};t.Attribute={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.key&&t.uint32(10).string(e.key),""!==e.value&&t.uint32(18).string(e.value),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},l);n.pos>>3){case 1:a.key=n.string();break;case 2:a.value=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},l);return void 0!==e.key&&null!==e.key?t.key=String(e.key):t.key="",void 0!==e.value&&null!==e.value?t.value=String(e.value):t.value="",t},toJSON:function(e){var t={};return void 0!==e.key&&(t.key=e.key),void 0!==e.value&&(t.value=e.value),t},fromPartial:function(e){var t=Object.assign({},l);return void 0!==e.key&&null!==e.key?t.key=e.key:t.key="",void 0!==e.value&&null!==e.value?t.value=e.value:t.value="",t}};var p={gasWanted:i.default.UZERO,gasUsed:i.default.UZERO};t.GasInfo={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return e.gasWanted.isZero()||t.uint32(8).uint64(e.gasWanted),e.gasUsed.isZero()||t.uint32(16).uint64(e.gasUsed),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},p);n.pos>>3){case 1:a.gasWanted=n.uint64();break;case 2:a.gasUsed=n.uint64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},p);return void 0!==e.gasWanted&&null!==e.gasWanted?t.gasWanted=i.default.fromString(e.gasWanted):t.gasWanted=i.default.UZERO,void 0!==e.gasUsed&&null!==e.gasUsed?t.gasUsed=i.default.fromString(e.gasUsed):t.gasUsed=i.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.gasWanted&&(t.gasWanted=(e.gasWanted||i.default.UZERO).toString()),void 0!==e.gasUsed&&(t.gasUsed=(e.gasUsed||i.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},p);return void 0!==e.gasWanted&&null!==e.gasWanted?t.gasWanted=e.gasWanted:t.gasWanted=i.default.UZERO,void 0!==e.gasUsed&&null!==e.gasUsed?t.gasUsed=e.gasUsed:t.gasUsed=i.default.UZERO,t}};var b={log:""};t.Result={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();0!==e.data.length&&t.uint32(10).bytes(e.data),""!==e.log&&t.uint32(18).string(e.log);var n,a=r(e.events);try{for(a.s();!(n=a.n()).done;){var i=n.value;u.Event.encode(i,t.uint32(26).fork()).ldelim()}}catch(s){a.e(s)}finally{a.f()}return t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},b);for(a.events=[],a.data=new Uint8Array;n.pos>>3){case 1:a.data=n.bytes();break;case 2:a.log=n.string();break;case 3:a.events.push(u.Event.decode(n,n.uint32()));break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},b);if(t.events=[],t.data=new Uint8Array,void 0!==e.data&&null!==e.data&&(t.data=T(e.data)),void 0!==e.log&&null!==e.log?t.log=String(e.log):t.log="",void 0!==e.events&&null!==e.events){var n,a=r(e.events);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.events.push(u.Event.fromJSON(i))}}catch(o){a.e(o)}finally{a.f()}}return t},toJSON:function(e){var t={};return void 0!==e.data&&(t.data=_(void 0!==e.data?e.data:new Uint8Array)),void 0!==e.log&&(t.log=e.log),e.events?t.events=e.events.map((function(e){return e?u.Event.toJSON(e):void 0})):t.events=[],t},fromPartial:function(e){var t=Object.assign({},b);if(t.events=[],void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,void 0!==e.log&&null!==e.log?t.log=e.log:t.log="",void 0!==e.events&&null!==e.events){var n,a=r(e.events);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.events.push(u.Event.fromPartial(i))}}catch(o){a.e(o)}finally{a.f()}}return t}};var h={};t.SimulationResponse={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return void 0!==e.gasInfo&&t.GasInfo.encode(e.gasInfo,n.uint32(10).fork()).ldelim(),void 0!==e.result&&t.Result.encode(e.result,n.uint32(18).fork()).ldelim(),n},decode:function(e,n){for(var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},h);r.pos>>3){case 1:i.gasInfo=t.GasInfo.decode(r,r.uint32());break;case 2:i.result=t.Result.decode(r,r.uint32());break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},h);return void 0!==e.gasInfo&&null!==e.gasInfo?n.gasInfo=t.GasInfo.fromJSON(e.gasInfo):n.gasInfo=void 0,void 0!==e.result&&null!==e.result?n.result=t.Result.fromJSON(e.result):n.result=void 0,n},toJSON:function(e){var n={};return void 0!==e.gasInfo&&(n.gasInfo=e.gasInfo?t.GasInfo.toJSON(e.gasInfo):void 0),void 0!==e.result&&(n.result=e.result?t.Result.toJSON(e.result):void 0),n},fromPartial:function(e){var n=Object.assign({},h);return void 0!==e.gasInfo&&null!==e.gasInfo?n.gasInfo=t.GasInfo.fromPartial(e.gasInfo):n.gasInfo=void 0,void 0!==e.result&&null!==e.result?n.result=t.Result.fromPartial(e.result):n.result=void 0,n}};var y={msgType:""};t.MsgData={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.msgType&&t.uint32(10).string(e.msgType),0!==e.data.length&&t.uint32(18).bytes(e.data),t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},y);for(a.data=new Uint8Array;n.pos>>3){case 1:a.msgType=n.string();break;case 2:a.data=n.bytes();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},y);return t.data=new Uint8Array,void 0!==e.msgType&&null!==e.msgType?t.msgType=String(e.msgType):t.msgType="",void 0!==e.data&&null!==e.data&&(t.data=T(e.data)),t},toJSON:function(e){var t={};return void 0!==e.msgType&&(t.msgType=e.msgType),void 0!==e.data&&(t.data=_(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial:function(e){var t=Object.assign({},y);return void 0!==e.msgType&&null!==e.msgType?t.msgType=e.msgType:t.msgType="",void 0!==e.data&&null!==e.data?t.data=e.data:t.data=new Uint8Array,t}};var m={};t.TxMsgData={encode:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),i=r(e.data);try{for(i.s();!(n=i.n()).done;){var s=n.value;t.MsgData.encode(s,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return a},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},m);for(i.data=[];r.pos>>3===1)i.data.push(t.MsgData.decode(r,r.uint32()));else r.skipType(7&s)}return i},fromJSON:function(e){var n=Object.assign({},m);if(n.data=[],void 0!==e.data&&null!==e.data){var a,i=r(e.data);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.data.push(t.MsgData.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return e.data?n.data=e.data.map((function(e){return e?t.MsgData.toJSON(e):void 0})):n.data=[],n},fromPartial:function(e){var n=Object.assign({},m);if(n.data=[],void 0!==e.data&&null!==e.data){var a,i=r(e.data);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.data.push(t.MsgData.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return n}};var v={totalCount:i.default.UZERO,count:i.default.UZERO,pageNumber:i.default.UZERO,pageTotal:i.default.UZERO,limit:i.default.UZERO};t.SearchTxsResult={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();e.totalCount.isZero()||n.uint32(8).uint64(e.totalCount),e.count.isZero()||n.uint32(16).uint64(e.count),e.pageNumber.isZero()||n.uint32(24).uint64(e.pageNumber),e.pageTotal.isZero()||n.uint32(32).uint64(e.pageTotal),e.limit.isZero()||n.uint32(40).uint64(e.limit);var a,i=r(e.txs);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.TxResponse.encode(s,n.uint32(50).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},v);for(i.txs=[];r.pos>>3){case 1:i.totalCount=r.uint64();break;case 2:i.count=r.uint64();break;case 3:i.pageNumber=r.uint64();break;case 4:i.pageTotal=r.uint64();break;case 5:i.limit=r.uint64();break;case 6:i.txs.push(t.TxResponse.decode(r,r.uint32()));break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},v);if(n.txs=[],void 0!==e.totalCount&&null!==e.totalCount?n.totalCount=i.default.fromString(e.totalCount):n.totalCount=i.default.UZERO,void 0!==e.count&&null!==e.count?n.count=i.default.fromString(e.count):n.count=i.default.UZERO,void 0!==e.pageNumber&&null!==e.pageNumber?n.pageNumber=i.default.fromString(e.pageNumber):n.pageNumber=i.default.UZERO,void 0!==e.pageTotal&&null!==e.pageTotal?n.pageTotal=i.default.fromString(e.pageTotal):n.pageTotal=i.default.UZERO,void 0!==e.limit&&null!==e.limit?n.limit=i.default.fromString(e.limit):n.limit=i.default.UZERO,void 0!==e.txs&&null!==e.txs){var a,o=r(e.txs);try{for(o.s();!(a=o.n()).done;){var s=a.value;n.txs.push(t.TxResponse.fromJSON(s))}}catch(u){o.e(u)}finally{o.f()}}return n},toJSON:function(e){var n={};return void 0!==e.totalCount&&(n.totalCount=(e.totalCount||i.default.UZERO).toString()),void 0!==e.count&&(n.count=(e.count||i.default.UZERO).toString()),void 0!==e.pageNumber&&(n.pageNumber=(e.pageNumber||i.default.UZERO).toString()),void 0!==e.pageTotal&&(n.pageTotal=(e.pageTotal||i.default.UZERO).toString()),void 0!==e.limit&&(n.limit=(e.limit||i.default.UZERO).toString()),e.txs?n.txs=e.txs.map((function(e){return e?t.TxResponse.toJSON(e):void 0})):n.txs=[],n},fromPartial:function(e){var n=Object.assign({},v);if(n.txs=[],void 0!==e.totalCount&&null!==e.totalCount?n.totalCount=e.totalCount:n.totalCount=i.default.UZERO,void 0!==e.count&&null!==e.count?n.count=e.count:n.count=i.default.UZERO,void 0!==e.pageNumber&&null!==e.pageNumber?n.pageNumber=e.pageNumber:n.pageNumber=i.default.UZERO,void 0!==e.pageTotal&&null!==e.pageTotal?n.pageTotal=e.pageTotal:n.pageTotal=i.default.UZERO,void 0!==e.limit&&null!==e.limit?n.limit=e.limit:n.limit=i.default.UZERO,void 0!==e.txs&&null!==e.txs){var a,o=r(e.txs);try{for(o.s();!(a=o.n()).done;){var s=a.value;n.txs.push(t.TxResponse.fromPartial(s))}}catch(u){o.e(u)}finally{o.f()}}return n}};var g=function(){if("undefined"!==typeof g)return g;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw"Unable to locate global object"}(),w=g.atob||function(e){return g.Buffer.from(e,"base64").toString("binary")};function T(e){for(var t=w(e),n=new Uint8Array(t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.address&&t.uint32(10).string(e.address),void 0!==e.pubKey&&s.Any.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.accountNumber.isZero()||t.uint32(24).uint64(e.accountNumber),e.sequence.isZero()||t.uint32(32).uint64(e.sequence),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},u);n.pos>>3){case 1:a.address=n.string();break;case 2:a.pubKey=s.Any.decode(n,n.uint32());break;case 3:a.accountNumber=n.uint64();break;case 4:a.sequence=n.uint64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},u);return void 0!==e.address&&null!==e.address?t.address=String(e.address):t.address="",void 0!==e.pubKey&&null!==e.pubKey?t.pubKey=s.Any.fromJSON(e.pubKey):t.pubKey=void 0,void 0!==e.accountNumber&&null!==e.accountNumber?t.accountNumber=i.default.fromString(e.accountNumber):t.accountNumber=i.default.UZERO,void 0!==e.sequence&&null!==e.sequence?t.sequence=i.default.fromString(e.sequence):t.sequence=i.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.address&&(t.address=e.address),void 0!==e.pubKey&&(t.pubKey=e.pubKey?s.Any.toJSON(e.pubKey):void 0),void 0!==e.accountNumber&&(t.accountNumber=(e.accountNumber||i.default.UZERO).toString()),void 0!==e.sequence&&(t.sequence=(e.sequence||i.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.address&&null!==e.address?t.address=e.address:t.address="",void 0!==e.pubKey&&null!==e.pubKey?t.pubKey=s.Any.fromPartial(e.pubKey):t.pubKey=void 0,void 0!==e.accountNumber&&null!==e.accountNumber?t.accountNumber=e.accountNumber:t.accountNumber=i.default.UZERO,void 0!==e.sequence&&null!==e.sequence?t.sequence=e.sequence:t.sequence=i.default.UZERO,t}};var c={name:"",permissions:""};t.ModuleAccount={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==e.baseAccount&&t.BaseAccount.encode(e.baseAccount,n.uint32(10).fork()).ldelim(),""!==e.name&&n.uint32(18).string(e.name);var a,i=r(e.permissions);try{for(i.s();!(a=i.n()).done;){var s=a.value;n.uint32(26).string(s)}}catch(u){i.e(u)}finally{i.f()}return n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},c);for(i.permissions=[];r.pos>>3){case 1:i.baseAccount=t.BaseAccount.decode(r,r.uint32());break;case 2:i.name=r.string();break;case 3:i.permissions.push(r.string());break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},c);if(n.permissions=[],void 0!==e.baseAccount&&null!==e.baseAccount?n.baseAccount=t.BaseAccount.fromJSON(e.baseAccount):n.baseAccount=void 0,void 0!==e.name&&null!==e.name?n.name=String(e.name):n.name="",void 0!==e.permissions&&null!==e.permissions){var a,i=r(e.permissions);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.permissions.push(String(o))}}catch(s){i.e(s)}finally{i.f()}}return n},toJSON:function(e){var n={};return void 0!==e.baseAccount&&(n.baseAccount=e.baseAccount?t.BaseAccount.toJSON(e.baseAccount):void 0),void 0!==e.name&&(n.name=e.name),e.permissions?n.permissions=e.permissions.map((function(e){return e})):n.permissions=[],n},fromPartial:function(e){var n=Object.assign({},c);if(n.permissions=[],void 0!==e.baseAccount&&null!==e.baseAccount?n.baseAccount=t.BaseAccount.fromPartial(e.baseAccount):n.baseAccount=void 0,void 0!==e.name&&null!==e.name?n.name=e.name:n.name="",void 0!==e.permissions&&null!==e.permissions){var a,i=r(e.permissions);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.permissions.push(o)}}catch(s){i.e(s)}finally{i.f()}}return n}};var f={maxMemoCharacters:i.default.UZERO,txSigLimit:i.default.UZERO,txSizeCostPerByte:i.default.UZERO,sigVerifyCostEd25519:i.default.UZERO,sigVerifyCostSecp256k1:i.default.UZERO};t.Params={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return e.maxMemoCharacters.isZero()||t.uint32(8).uint64(e.maxMemoCharacters),e.txSigLimit.isZero()||t.uint32(16).uint64(e.txSigLimit),e.txSizeCostPerByte.isZero()||t.uint32(24).uint64(e.txSizeCostPerByte),e.sigVerifyCostEd25519.isZero()||t.uint32(32).uint64(e.sigVerifyCostEd25519),e.sigVerifyCostSecp256k1.isZero()||t.uint32(40).uint64(e.sigVerifyCostSecp256k1),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},f);n.pos>>3){case 1:a.maxMemoCharacters=n.uint64();break;case 2:a.txSigLimit=n.uint64();break;case 3:a.txSizeCostPerByte=n.uint64();break;case 4:a.sigVerifyCostEd25519=n.uint64();break;case 5:a.sigVerifyCostSecp256k1=n.uint64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},f);return void 0!==e.maxMemoCharacters&&null!==e.maxMemoCharacters?t.maxMemoCharacters=i.default.fromString(e.maxMemoCharacters):t.maxMemoCharacters=i.default.UZERO,void 0!==e.txSigLimit&&null!==e.txSigLimit?t.txSigLimit=i.default.fromString(e.txSigLimit):t.txSigLimit=i.default.UZERO,void 0!==e.txSizeCostPerByte&&null!==e.txSizeCostPerByte?t.txSizeCostPerByte=i.default.fromString(e.txSizeCostPerByte):t.txSizeCostPerByte=i.default.UZERO,void 0!==e.sigVerifyCostEd25519&&null!==e.sigVerifyCostEd25519?t.sigVerifyCostEd25519=i.default.fromString(e.sigVerifyCostEd25519):t.sigVerifyCostEd25519=i.default.UZERO,void 0!==e.sigVerifyCostSecp256k1&&null!==e.sigVerifyCostSecp256k1?t.sigVerifyCostSecp256k1=i.default.fromString(e.sigVerifyCostSecp256k1):t.sigVerifyCostSecp256k1=i.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.maxMemoCharacters&&(t.maxMemoCharacters=(e.maxMemoCharacters||i.default.UZERO).toString()),void 0!==e.txSigLimit&&(t.txSigLimit=(e.txSigLimit||i.default.UZERO).toString()),void 0!==e.txSizeCostPerByte&&(t.txSizeCostPerByte=(e.txSizeCostPerByte||i.default.UZERO).toString()),void 0!==e.sigVerifyCostEd25519&&(t.sigVerifyCostEd25519=(e.sigVerifyCostEd25519||i.default.UZERO).toString()),void 0!==e.sigVerifyCostSecp256k1&&(t.sigVerifyCostSecp256k1=(e.sigVerifyCostSecp256k1||i.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},f);return void 0!==e.maxMemoCharacters&&null!==e.maxMemoCharacters?t.maxMemoCharacters=e.maxMemoCharacters:t.maxMemoCharacters=i.default.UZERO,void 0!==e.txSigLimit&&null!==e.txSigLimit?t.txSigLimit=e.txSigLimit:t.txSigLimit=i.default.UZERO,void 0!==e.txSizeCostPerByte&&null!==e.txSizeCostPerByte?t.txSizeCostPerByte=e.txSizeCostPerByte:t.txSizeCostPerByte=i.default.UZERO,void 0!==e.sigVerifyCostEd25519&&null!==e.sigVerifyCostEd25519?t.sigVerifyCostEd25519=e.sigVerifyCostEd25519:t.sigVerifyCostEd25519=i.default.UZERO,void 0!==e.sigVerifyCostSecp256k1&&null!==e.sigVerifyCostSecp256k1?t.sigVerifyCostSecp256k1=e.sigVerifyCostSecp256k1:t.sigVerifyCostSecp256k1=i.default.UZERO,t}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==e.baseAccount&&s.BaseAccount.encode(e.baseAccount,t.uint32(10).fork()).ldelim();var n,a=r(e.originalVesting);try{for(a.s();!(n=a.n()).done;){var i=n.value;u.Coin.encode(i,t.uint32(18).fork()).ldelim()}}catch(h){a.e(h)}finally{a.f()}var c,f=r(e.delegatedFree);try{for(f.s();!(c=f.n()).done;){var d=c.value;u.Coin.encode(d,t.uint32(26).fork()).ldelim()}}catch(h){f.e(h)}finally{f.f()}var l,p=r(e.delegatedVesting);try{for(p.s();!(l=p.n()).done;){var b=l.value;u.Coin.encode(b,t.uint32(34).fork()).ldelim()}}catch(h){p.e(h)}finally{p.f()}return e.endTime.isZero()||t.uint32(40).int64(e.endTime),t},decode:function(e,t){var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);for(a.originalVesting=[],a.delegatedFree=[],a.delegatedVesting=[];n.pos>>3){case 1:a.baseAccount=s.BaseAccount.decode(n,n.uint32());break;case 2:a.originalVesting.push(u.Coin.decode(n,n.uint32()));break;case 3:a.delegatedFree.push(u.Coin.decode(n,n.uint32()));break;case 4:a.delegatedVesting.push(u.Coin.decode(n,n.uint32()));break;case 5:a.endTime=n.int64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},c);if(t.originalVesting=[],t.delegatedFree=[],t.delegatedVesting=[],void 0!==e.baseAccount&&null!==e.baseAccount?t.baseAccount=s.BaseAccount.fromJSON(e.baseAccount):t.baseAccount=void 0,void 0!==e.originalVesting&&null!==e.originalVesting){var n,a=r(e.originalVesting);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.originalVesting.push(u.Coin.fromJSON(o))}}catch(y){a.e(y)}finally{a.f()}}if(void 0!==e.delegatedFree&&null!==e.delegatedFree){var f,d=r(e.delegatedFree);try{for(d.s();!(f=d.n()).done;){var l=f.value;t.delegatedFree.push(u.Coin.fromJSON(l))}}catch(y){d.e(y)}finally{d.f()}}if(void 0!==e.delegatedVesting&&null!==e.delegatedVesting){var p,b=r(e.delegatedVesting);try{for(b.s();!(p=b.n()).done;){var h=p.value;t.delegatedVesting.push(u.Coin.fromJSON(h))}}catch(y){b.e(y)}finally{b.f()}}return void 0!==e.endTime&&null!==e.endTime?t.endTime=i.default.fromString(e.endTime):t.endTime=i.default.ZERO,t},toJSON:function(e){var t={};return void 0!==e.baseAccount&&(t.baseAccount=e.baseAccount?s.BaseAccount.toJSON(e.baseAccount):void 0),e.originalVesting?t.originalVesting=e.originalVesting.map((function(e){return e?u.Coin.toJSON(e):void 0})):t.originalVesting=[],e.delegatedFree?t.delegatedFree=e.delegatedFree.map((function(e){return e?u.Coin.toJSON(e):void 0})):t.delegatedFree=[],e.delegatedVesting?t.delegatedVesting=e.delegatedVesting.map((function(e){return e?u.Coin.toJSON(e):void 0})):t.delegatedVesting=[],void 0!==e.endTime&&(t.endTime=(e.endTime||i.default.ZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},c);if(t.originalVesting=[],t.delegatedFree=[],t.delegatedVesting=[],void 0!==e.baseAccount&&null!==e.baseAccount?t.baseAccount=s.BaseAccount.fromPartial(e.baseAccount):t.baseAccount=void 0,void 0!==e.originalVesting&&null!==e.originalVesting){var n,a=r(e.originalVesting);try{for(a.s();!(n=a.n()).done;){var o=n.value;t.originalVesting.push(u.Coin.fromPartial(o))}}catch(y){a.e(y)}finally{a.f()}}if(void 0!==e.delegatedFree&&null!==e.delegatedFree){var f,d=r(e.delegatedFree);try{for(d.s();!(f=d.n()).done;){var l=f.value;t.delegatedFree.push(u.Coin.fromPartial(l))}}catch(y){d.e(y)}finally{d.f()}}if(void 0!==e.delegatedVesting&&null!==e.delegatedVesting){var p,b=r(e.delegatedVesting);try{for(b.s();!(p=b.n()).done;){var h=p.value;t.delegatedVesting.push(u.Coin.fromPartial(h))}}catch(y){b.e(y)}finally{b.f()}}return void 0!==e.endTime&&null!==e.endTime?t.endTime=e.endTime:t.endTime=i.default.ZERO,t}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},function(e,t,n){"use strict";var r=n(33).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExchangeRateTuple=t.AggregateExchangeRateVote=t.AggregateExchangeRatePrevote=t.Denom=t.Params=t.protobufPackage=void 0;var i=a(n(24)),o=a(n(20));t.protobufPackage="terra.oracle.v1beta1";var s={votePeriod:i.default.UZERO,voteThreshold:"",rewardBand:"",rewardDistributionWindow:i.default.UZERO,slashFraction:"",slashWindow:i.default.UZERO,minValidPerWindow:""};t.Params={encode:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();e.votePeriod.isZero()||n.uint32(8).uint64(e.votePeriod),""!==e.voteThreshold&&n.uint32(18).string(e.voteThreshold),""!==e.rewardBand&&n.uint32(26).string(e.rewardBand),e.rewardDistributionWindow.isZero()||n.uint32(32).uint64(e.rewardDistributionWindow);var a,i=r(e.whitelist);try{for(i.s();!(a=i.n()).done;){var s=a.value;t.Denom.encode(s,n.uint32(42).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return""!==e.slashFraction&&n.uint32(50).string(e.slashFraction),e.slashWindow.isZero()||n.uint32(56).uint64(e.slashWindow),""!==e.minValidPerWindow&&n.uint32(66).string(e.minValidPerWindow),n},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},s);for(i.whitelist=[];r.pos>>3){case 1:i.votePeriod=r.uint64();break;case 2:i.voteThreshold=r.string();break;case 3:i.rewardBand=r.string();break;case 4:i.rewardDistributionWindow=r.uint64();break;case 5:i.whitelist.push(t.Denom.decode(r,r.uint32()));break;case 6:i.slashFraction=r.string();break;case 7:i.slashWindow=r.uint64();break;case 8:i.minValidPerWindow=r.string();break;default:r.skipType(7&u)}}return i},fromJSON:function(e){var n=Object.assign({},s);if(n.whitelist=[],void 0!==e.votePeriod&&null!==e.votePeriod?n.votePeriod=i.default.fromString(e.votePeriod):n.votePeriod=i.default.UZERO,void 0!==e.voteThreshold&&null!==e.voteThreshold?n.voteThreshold=String(e.voteThreshold):n.voteThreshold="",void 0!==e.rewardBand&&null!==e.rewardBand?n.rewardBand=String(e.rewardBand):n.rewardBand="",void 0!==e.rewardDistributionWindow&&null!==e.rewardDistributionWindow?n.rewardDistributionWindow=i.default.fromString(e.rewardDistributionWindow):n.rewardDistributionWindow=i.default.UZERO,void 0!==e.whitelist&&null!==e.whitelist){var a,o=r(e.whitelist);try{for(o.s();!(a=o.n()).done;){var u=a.value;n.whitelist.push(t.Denom.fromJSON(u))}}catch(c){o.e(c)}finally{o.f()}}return void 0!==e.slashFraction&&null!==e.slashFraction?n.slashFraction=String(e.slashFraction):n.slashFraction="",void 0!==e.slashWindow&&null!==e.slashWindow?n.slashWindow=i.default.fromString(e.slashWindow):n.slashWindow=i.default.UZERO,void 0!==e.minValidPerWindow&&null!==e.minValidPerWindow?n.minValidPerWindow=String(e.minValidPerWindow):n.minValidPerWindow="",n},toJSON:function(e){var n={};return void 0!==e.votePeriod&&(n.votePeriod=(e.votePeriod||i.default.UZERO).toString()),void 0!==e.voteThreshold&&(n.voteThreshold=e.voteThreshold),void 0!==e.rewardBand&&(n.rewardBand=e.rewardBand),void 0!==e.rewardDistributionWindow&&(n.rewardDistributionWindow=(e.rewardDistributionWindow||i.default.UZERO).toString()),e.whitelist?n.whitelist=e.whitelist.map((function(e){return e?t.Denom.toJSON(e):void 0})):n.whitelist=[],void 0!==e.slashFraction&&(n.slashFraction=e.slashFraction),void 0!==e.slashWindow&&(n.slashWindow=(e.slashWindow||i.default.UZERO).toString()),void 0!==e.minValidPerWindow&&(n.minValidPerWindow=e.minValidPerWindow),n},fromPartial:function(e){var n=Object.assign({},s);if(n.whitelist=[],void 0!==e.votePeriod&&null!==e.votePeriod?n.votePeriod=e.votePeriod:n.votePeriod=i.default.UZERO,void 0!==e.voteThreshold&&null!==e.voteThreshold?n.voteThreshold=e.voteThreshold:n.voteThreshold="",void 0!==e.rewardBand&&null!==e.rewardBand?n.rewardBand=e.rewardBand:n.rewardBand="",void 0!==e.rewardDistributionWindow&&null!==e.rewardDistributionWindow?n.rewardDistributionWindow=e.rewardDistributionWindow:n.rewardDistributionWindow=i.default.UZERO,void 0!==e.whitelist&&null!==e.whitelist){var a,o=r(e.whitelist);try{for(o.s();!(a=o.n()).done;){var u=a.value;n.whitelist.push(t.Denom.fromPartial(u))}}catch(c){o.e(c)}finally{o.f()}}return void 0!==e.slashFraction&&null!==e.slashFraction?n.slashFraction=e.slashFraction:n.slashFraction="",void 0!==e.slashWindow&&null!==e.slashWindow?n.slashWindow=e.slashWindow:n.slashWindow=i.default.UZERO,void 0!==e.minValidPerWindow&&null!==e.minValidPerWindow?n.minValidPerWindow=e.minValidPerWindow:n.minValidPerWindow="",n}};var u={name:"",tobinTax:""};t.Denom={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.name&&t.uint32(10).string(e.name),""!==e.tobinTax&&t.uint32(18).string(e.tobinTax),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},u);n.pos>>3){case 1:a.name=n.string();break;case 2:a.tobinTax=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},u);return void 0!==e.name&&null!==e.name?t.name=String(e.name):t.name="",void 0!==e.tobinTax&&null!==e.tobinTax?t.tobinTax=String(e.tobinTax):t.tobinTax="",t},toJSON:function(e){var t={};return void 0!==e.name&&(t.name=e.name),void 0!==e.tobinTax&&(t.tobinTax=e.tobinTax),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.name&&null!==e.name?t.name=e.name:t.name="",void 0!==e.tobinTax&&null!==e.tobinTax?t.tobinTax=e.tobinTax:t.tobinTax="",t}};var c={hash:"",voter:"",submitBlock:i.default.UZERO};t.AggregateExchangeRatePrevote={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.hash&&t.uint32(10).string(e.hash),""!==e.voter&&t.uint32(18).string(e.voter),e.submitBlock.isZero()||t.uint32(24).uint64(e.submitBlock),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},c);n.pos>>3){case 1:a.hash=n.string();break;case 2:a.voter=n.string();break;case 3:a.submitBlock=n.uint64();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},c);return void 0!==e.hash&&null!==e.hash?t.hash=String(e.hash):t.hash="",void 0!==e.voter&&null!==e.voter?t.voter=String(e.voter):t.voter="",void 0!==e.submitBlock&&null!==e.submitBlock?t.submitBlock=i.default.fromString(e.submitBlock):t.submitBlock=i.default.UZERO,t},toJSON:function(e){var t={};return void 0!==e.hash&&(t.hash=e.hash),void 0!==e.voter&&(t.voter=e.voter),void 0!==e.submitBlock&&(t.submitBlock=(e.submitBlock||i.default.UZERO).toString()),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.hash&&null!==e.hash?t.hash=e.hash:t.hash="",void 0!==e.voter&&null!==e.voter?t.voter=e.voter:t.voter="",void 0!==e.submitBlock&&null!==e.submitBlock?t.submitBlock=e.submitBlock:t.submitBlock=i.default.UZERO,t}};var f={voter:""};t.AggregateExchangeRateVote={encode:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create(),i=r(e.exchangeRateTuples);try{for(i.s();!(n=i.n()).done;){var s=n.value;t.ExchangeRateTuple.encode(s,a.uint32(10).fork()).ldelim()}}catch(u){i.e(u)}finally{i.f()}return""!==e.voter&&a.uint32(18).string(e.voter),a},decode:function(e,n){var r=e instanceof o.default.Reader?e:new o.default.Reader(e),a=void 0===n?r.len:r.pos+n,i=Object.assign({},f);for(i.exchangeRateTuples=[];r.pos>>3){case 1:i.exchangeRateTuples.push(t.ExchangeRateTuple.decode(r,r.uint32()));break;case 2:i.voter=r.string();break;default:r.skipType(7&s)}}return i},fromJSON:function(e){var n=Object.assign({},f);if(n.exchangeRateTuples=[],void 0!==e.exchangeRateTuples&&null!==e.exchangeRateTuples){var a,i=r(e.exchangeRateTuples);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.exchangeRateTuples.push(t.ExchangeRateTuple.fromJSON(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.voter&&null!==e.voter?n.voter=String(e.voter):n.voter="",n},toJSON:function(e){var n={};return e.exchangeRateTuples?n.exchangeRateTuples=e.exchangeRateTuples.map((function(e){return e?t.ExchangeRateTuple.toJSON(e):void 0})):n.exchangeRateTuples=[],void 0!==e.voter&&(n.voter=e.voter),n},fromPartial:function(e){var n=Object.assign({},f);if(n.exchangeRateTuples=[],void 0!==e.exchangeRateTuples&&null!==e.exchangeRateTuples){var a,i=r(e.exchangeRateTuples);try{for(i.s();!(a=i.n()).done;){var o=a.value;n.exchangeRateTuples.push(t.ExchangeRateTuple.fromPartial(o))}}catch(s){i.e(s)}finally{i.f()}}return void 0!==e.voter&&null!==e.voter?n.voter=e.voter:n.voter="",n}};var d={denom:"",exchangeRate:""};t.ExchangeRateTuple={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.denom&&t.uint32(10).string(e.denom),""!==e.exchangeRate&&t.uint32(18).string(e.exchangeRate),t},decode:function(e,t){for(var n=e instanceof o.default.Reader?e:new o.default.Reader(e),r=void 0===t?n.len:n.pos+t,a=Object.assign({},d);n.pos>>3){case 1:a.denom=n.string();break;case 2:a.exchangeRate=n.string();break;default:n.skipType(7&i)}}return a},fromJSON:function(e){var t=Object.assign({},d);return void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.exchangeRate&&null!==e.exchangeRate?t.exchangeRate=String(e.exchangeRate):t.exchangeRate="",t},toJSON:function(e){var t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.exchangeRate&&(t.exchangeRate=e.exchangeRate),t},fromPartial:function(e){var t=Object.assign({},d);return void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.exchangeRate&&null!==e.exchangeRate?t.exchangeRate=e.exchangeRate:t.exchangeRate="",t}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Delegation=void 0;var a=n(23),i=n(75),o=n(84),s=n(164),u=function(e){function t(t,n,r,a){var i=e.call(this)||this;return i.delegator_address=t,i.validator_address=n,i.shares=r,i.balance=a,i}return r(t,e),t.fromAmino=function(e){var n=e.delegation,r=n.delegator_address,a=n.validator_address,s=n.shares,u=e.balance;return new t(r,a,new i.Dec(s),o.Coin.fromAmino(u))},t.prototype.toAmino=function(){var e=this,t=e.delegator_address,n=e.validator_address,r=e.shares,a=e.balance;return{delegation:{delegator_address:t,validator_address:n,shares:r.toString()},balance:a.toAmino()}},t.fromData=function(e){var n=e.delegation,r=n.delegator_address,a=n.validator_address,s=n.shares,u=e.balance;return new t(r,a,new i.Dec(s),o.Coin.fromData(u))},t.prototype.toData=function(){var e=this,t=e.delegator_address,n=e.validator_address,r=e.shares,a=e.balance;return{delegation:{delegator_address:t,validator_address:n,shares:r.toString()},balance:a.toData()}},t.fromProto=function(e){var n=e.delegation;return new t(n.delegatorAddress,n.validatorAddress,new i.Dec(n.shares),o.Coin.fromProto(e.balance))},t.prototype.toProto=function(){var e=this,t=e.delegator_address,n=e.validator_address,r=e.shares,a=e.balance;return s.DelegationResponse.fromPartial({delegation:s.Delegation.fromPartial({delegatorAddress:t,shares:r.toString(),validatorAddress:n}),balance:a.toProto()})},t}(a.JSONSerializable);t.Delegation=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Redelegation=void 0;var s=n(23),u=n(75),c=n(164),f=o(n(24)),d=function(e){function t(t,n,r,a){var i=e.call(this)||this;return i.delegator_address=t,i.validator_src_address=n,i.validator_dst_address=r,i.entries=a,i}return r(t,e),t.fromAmino=function(e){var n=e.redelegation;return new t(n.delegator_address,n.validator_src_address,n.validator_dst_address,e.entries.map((function(e){return t.Entry.fromAmino(e)})))},t.prototype.toAmino=function(){var e=this;return{redelegation:{delegator_address:e.delegator_address,validator_src_address:e.validator_src_address,validator_dst_address:e.validator_dst_address},entries:e.entries.map((function(e){return e.toAmino()}))}},t.fromData=function(e){var n=e.redelegation;return new t(n.delegator_address,n.validator_src_address,n.validator_dst_address,e.entries.map((function(e){return t.Entry.fromData(e)})))},t.prototype.toData=function(){var e=this;return{redelegation:{delegator_address:e.delegator_address,validator_src_address:e.validator_src_address,validator_dst_address:e.validator_dst_address},entries:e.entries.map((function(e){return e.toData()}))}},t.fromProto=function(e){var n=e.redelegation;return new t(n.delegatorAddress,n.validatorDstAddress,n.validatorDstAddress,e.entries.map((function(e){return t.Entry.fromProto(e)})))},t.prototype.toProto=function(){var e=this,t=e.delegator_address,n=e.validator_src_address,r=e.validator_dst_address,a=e.entries;return c.RedelegationResponse.fromPartial({entries:a.map((function(e){return e.toProto()})),redelegation:c.Redelegation.fromPartial({delegatorAddress:t,entries:a.map((function(e){return e.toProto().redelegationEntry})),validatorDstAddress:r,validatorSrcAddress:n})})},t}(s.JSONSerializable);t.Redelegation=d,function(e){var t=function(e){function t(t,n,r,a,i){var o=e.call(this)||this;return o.initial_balance=t,o.balance=n,o.shares_dst=r,o.creation_height=a,o.completion_time=i,o}return r(t,e),t.prototype.toAmino=function(){return{redelegation_entry:{initial_balance:this.initial_balance.toString(),shares_dst:this.shares_dst.toString(),creation_height:this.creation_height,completion_time:this.completion_time.toISOString()},balance:this.balance.toString()}},t.fromAmino=function(e){var n=e.redelegation_entry,r=n.initial_balance,a=n.shares_dst,i=n.creation_height,o=n.completion_time,s=e.balance;return new t(new u.Int(r),new u.Int(s),new u.Dec(a),i,new Date(o))},t.prototype.toData=function(){return{redelegation_entry:{initial_balance:this.initial_balance.toString(),shares_dst:this.shares_dst.toString(),creation_height:this.creation_height,completion_time:this.completion_time.toISOString()},balance:this.balance.toString()}},t.fromData=function(e){var n=e.redelegation_entry,r=n.initial_balance,a=n.shares_dst,i=n.creation_height,o=n.completion_time,s=e.balance;return new t(new u.Int(r),new u.Int(s),new u.Dec(a),i,new Date(o))},t.prototype.toProto=function(){var e=this,t=e.initial_balance,n=e.balance,r=e.shares_dst,a=e.creation_height,i=e.completion_time;return c.RedelegationEntryResponse.fromPartial({balance:n.toString(),redelegationEntry:c.RedelegationEntry.fromPartial({completionTime:i,creationHeight:f.fromNumber(a),initialBalance:t.toString(),sharesDst:r.toString()})})},t.fromProto=function(e){var n=e.redelegationEntry;return new t(new u.Int(n.initialBalance),new u.Int(e.balance),new u.Dec(n.sharesDst),n.creationHeight.toNumber(),n.completionTime)},t}(s.JSONSerializable);e.Entry=t}(d=t.Redelegation||(t.Redelegation={})),t.Redelegation=d},function(e,t,n){"use strict";(function(e){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]>>32-t}function c(e,t,n,r,a,i,o){return u(e+(t&n|~t&r)+a+i|0,o)+t|0}function f(e,t,n,r,a,i,o){return u(e+(t&r|n&~r)+a+i|0,o)+t|0}function d(e,t,n,r,a,i,o){return u(e+(t^n^r)+a+i|0,o)+t|0}function l(e,t,n,r,a,i,o){return u(e+(n^(t|~r))+a+i|0,o)+t|0}r(s,a),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,a=this._c,i=this._d;n=c(n,r,a,i,e[0],3614090360,7),i=c(i,n,r,a,e[1],3905402710,12),a=c(a,i,n,r,e[2],606105819,17),r=c(r,a,i,n,e[3],3250441966,22),n=c(n,r,a,i,e[4],4118548399,7),i=c(i,n,r,a,e[5],1200080426,12),a=c(a,i,n,r,e[6],2821735955,17),r=c(r,a,i,n,e[7],4249261313,22),n=c(n,r,a,i,e[8],1770035416,7),i=c(i,n,r,a,e[9],2336552879,12),a=c(a,i,n,r,e[10],4294925233,17),r=c(r,a,i,n,e[11],2304563134,22),n=c(n,r,a,i,e[12],1804603682,7),i=c(i,n,r,a,e[13],4254626195,12),a=c(a,i,n,r,e[14],2792965006,17),n=f(n,r=c(r,a,i,n,e[15],1236535329,22),a,i,e[1],4129170786,5),i=f(i,n,r,a,e[6],3225465664,9),a=f(a,i,n,r,e[11],643717713,14),r=f(r,a,i,n,e[0],3921069994,20),n=f(n,r,a,i,e[5],3593408605,5),i=f(i,n,r,a,e[10],38016083,9),a=f(a,i,n,r,e[15],3634488961,14),r=f(r,a,i,n,e[4],3889429448,20),n=f(n,r,a,i,e[9],568446438,5),i=f(i,n,r,a,e[14],3275163606,9),a=f(a,i,n,r,e[3],4107603335,14),r=f(r,a,i,n,e[8],1163531501,20),n=f(n,r,a,i,e[13],2850285829,5),i=f(i,n,r,a,e[2],4243563512,9),a=f(a,i,n,r,e[7],1735328473,14),n=d(n,r=f(r,a,i,n,e[12],2368359562,20),a,i,e[5],4294588738,4),i=d(i,n,r,a,e[8],2272392833,11),a=d(a,i,n,r,e[11],1839030562,16),r=d(r,a,i,n,e[14],4259657740,23),n=d(n,r,a,i,e[1],2763975236,4),i=d(i,n,r,a,e[4],1272893353,11),a=d(a,i,n,r,e[7],4139469664,16),r=d(r,a,i,n,e[10],3200236656,23),n=d(n,r,a,i,e[13],681279174,4),i=d(i,n,r,a,e[0],3936430074,11),a=d(a,i,n,r,e[3],3572445317,16),r=d(r,a,i,n,e[6],76029189,23),n=d(n,r,a,i,e[9],3654602809,4),i=d(i,n,r,a,e[12],3873151461,11),a=d(a,i,n,r,e[15],530742520,16),n=l(n,r=d(r,a,i,n,e[2],3299628645,23),a,i,e[0],4096336452,6),i=l(i,n,r,a,e[7],1126891415,10),a=l(a,i,n,r,e[14],2878612391,15),r=l(r,a,i,n,e[5],4237533241,21),n=l(n,r,a,i,e[12],1700485571,6),i=l(i,n,r,a,e[3],2399980690,10),a=l(a,i,n,r,e[10],4293915773,15),r=l(r,a,i,n,e[1],2240044497,21),n=l(n,r,a,i,e[8],1873313359,6),i=l(i,n,r,a,e[15],4264355552,10),a=l(a,i,n,r,e[6],2734768916,15),r=l(r,a,i,n,e[13],1309151649,21),n=l(n,r,a,i,e[4],4149444226,6),i=l(i,n,r,a,e[11],3174756917,10),a=l(a,i,n,r,e[2],718787259,15),r=l(r,a,i,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+a|0,this._d=this._d+i|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,n){"use strict";var r=n(67).Buffer,a=n(341).Transform;function i(e){a.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(51)(i,a),i.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(a){r=a}n(r)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(n){t=n}e(t)},i.prototype.update=function(e,t){if(function(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));for(var n=this._block,a=0;this._blockOffset+e.length-a>=this._blockSize;){for(var i=this._blockOffset;i0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},function(e,t,n){(t=e.exports=n(342)).Stream=t,t.Readable=t,t.Writable=n(346),t.Duplex=n(147),t.Transform=n(348),t.PassThrough=n(596),t.finished=n(246),t.pipeline=n(597)},function(e,t,n){"use strict";(function(t,r){var a;e.exports=S,S.ReadableState=O;n(145).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=n(343),s=n(21).Buffer,u=t.Uint8Array||function(){};var c,f=n(590);c=f&&f.debuglog?f.debuglog("stream"):function(){};var d,l,p,b=n(591),h=n(344),y=n(345).getHighWaterMark,m=n(146).codes,v=m.ERR_INVALID_ARG_TYPE,g=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,T=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(51)(S,o);var k=h.errorOrDestroy,_=["error","close","destroy","pause","resume"];function O(e,t,r){a=a||n(147),e=e||{},"boolean"!==typeof r&&(r=t instanceof a),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",r),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(166).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function S(e){if(a=a||n(147),!(this instanceof S))return new S(e);var t=this instanceof a;this._readableState=new O(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function x(e,t,n,r,a){c("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?P(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}(e,o);else if(a||(i=function(e,t){var n;r=t,s.isBuffer(r)||r instanceof u||"string"===typeof t||void 0===t||e.objectMode||(n=new v("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(o,t)),i)k(e,i);else if(o.objectMode||t&&t.length>0)if("string"===typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)o.endEmitted?k(e,new T):A(e,o,t,!0);else if(o.ended)k(e,new g);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?A(e,o,t,!1):I(e,o)):A(e,o,t,!1)}else r||(o.reading=!1,I(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(j,e))}function j(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function I(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){c("readable nexttick read 0"),e.read(0)}function D(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function L(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(z,t,e))}function z(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function F(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):P(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&L(this),null;var r,a=t.needReadable;return c("need readable",a),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&L(this)),null!==r&&this.emit("data",r),r},S.prototype._read=function(e){k(this,new w("_read()"))},S.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:y;function s(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",b),e.removeListener("finish",h),e.removeListener("drain",f),e.removeListener("error",p),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",l),d=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function u(){c("onend"),e.end()}a.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);var f=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,B(e))}}(n);e.on("drain",f);var d=!1;function l(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==F(a.pipes,e))&&!d&&(c("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function p(t){c("onerror",t),y(),e.removeListener("error",p),0===i(e,"error")&&k(e,t)}function b(){e.removeListener("finish",h),y()}function h(){c("onfinish"),e.removeListener("close",b),y()}function y(){c("unpipe"),n.unpipe(e)}return n.on("data",l),function(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",p),e.once("close",b),e.once("finish",h),e.emit("pipe",n),a.flowing||(c("pipe resume"),n.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,c("on readable",a.length,a.reading),a.length?P(this):a.reading||r.nextTick(N,this))),n},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(R,this),n},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(R,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",(function(){if(c("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){(c("wrapped data"),n.decoder&&(a=n.decoder.write(a)),!n.objectMode||null!==a&&void 0!==a)&&((n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause())))})),e)void 0===this[a]&&"function"===typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i<_.length;i++)e.on(_[i],this.emit.bind(this,_[i]));return this._read=function(t){c("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"===typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=n(594)),l(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=U,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(S.from=function(e,t){return void 0===p&&(p=n(595)),p(S,e,t)})}).call(this,n(35),n(78))},function(e,t,n){e.exports=n(145).EventEmitter},function(e,t,n){"use strict";(function(t){function n(e,t){a(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var o=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(a,this,e)):t.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?o._writableState?o._writableState.errorEmitted?t.nextTick(r,o):(o._writableState.errorEmitted=!0,t.nextTick(n,o,e)):t.nextTick(n,o,e):i?(t.nextTick(r,o),i(e)):t.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,n(78))},function(e,t,n){"use strict";var r=n(146).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,a){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,a,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new r(a?n:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},function(e,t,n){"use strict";(function(t,r){function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var a=r.callback;t.pendingcb--,a(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=S,S.WritableState=O;var o={deprecate:n(347)},s=n(343),u=n(21).Buffer,c=t.Uint8Array||function(){};var f,d=n(344),l=n(345).getHighWaterMark,p=n(146).codes,b=p.ERR_INVALID_ARG_TYPE,h=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,m=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,g=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,T=p.ERR_UNKNOWN_ENCODING,k=d.errorOrDestroy;function _(){}function O(e,t,o){i=i||n(147),e=e||{},"boolean"!==typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=l(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,a=n.sync,i=n.writecb;if("function"!==typeof i)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,a,i){--t.pendingcb,n?(r.nextTick(i,a),r.nextTick(j,e,t),e._writableState.errorEmitted=!0,k(e,a)):(i(a),e._writableState.errorEmitted=!0,k(e,a),j(e,t))}(e,n,a,t,i);else{var o=E(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||M(e,n),a?r.nextTick(A,e,n,o,i):A(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function S(e){var t=this instanceof(i=i||n(147));if(!t&&!f.call(S,this))return new S(e);this._writableState=new O(e,this,t),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),s.call(this)}function x(e,t,n,r,a,i,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):n?e._writev(a,t.onwrite):e._write(a,i,t.onwrite),t.sync=!1}function A(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),j(e,t)}function M(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,x(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,f=n.encoding,d=n.callback;if(x(e,t,!1,t.objectMode?1:c.length,c,f,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function P(e,t){e._final((function(n){t.pendingcb--,n&&k(e,n),t.prefinished=!0,e.emit("prefinish"),j(e,t)}))}function j(e,t){var n=E(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!==typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(P,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var a=e._readableState;(!a||a.autoDestroy&&a.endEmitted)&&e.destroy()}return n}n(51)(S,s),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===S&&(e&&e._writableState instanceof O)}})):f=function(e){return e instanceof this},S.prototype.pipe=function(){k(this,new m)},S.prototype.write=function(e,t,n){var a,i=this._writableState,o=!1,s=!i.objectMode&&(a=e,u.isBuffer(a)||a instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"===typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!==typeof n&&(n=_),i.ending?function(e,t){var n=new w;k(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,a){var i;return null===n?i=new g:"string"===typeof n||t.objectMode||(i=new b("chunk",["string","Buffer"],n)),!i||(k(e,i),r.nextTick(a,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,a,i){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=u.from(t,n));return t}(t,r,a);r!==o&&(n=!0,a="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new T(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,n){n(new h("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,n){var a=this._writableState;return"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,n){t.ending=!0,j(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,a,n),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=d.destroy,S.prototype._undestroy=d.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,n(35),n(78))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(r){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(35))},function(e,t,n){"use strict";e.exports=f;var r=n(146).codes,a=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(147);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new i);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function p(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(u,a),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,a=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,b=0|this._f,h=0|this._g,y=0|this._h,m=0;m<16;++m)n[m]=e.readInt32BE(4*m);for(;m<64;++m)n[m]=0|(((t=n[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[m-7]+p(n[m-15])+n[m-16];for(var v=0;v<64;++v){var g=y+l(u)+c(u,b,h)+o[v]+n[v]|0,w=d(r)+f(r,a,i)|0;y=h,h=b,b=u,u=s+g|0,s=i,i=a,a=r,r=g+w|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=b+this._f|0,this._g=h+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,n){var r=n(51),a=n(148),i=n(67).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,a.call(this,128,112)}function c(e,t,n){return n^e&(t^n)}function f(e,t,n){return e&t|n&(e|t)}function d(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function l(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function b(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0>>0?1:0}r(u,a),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,a=0|this._ch,i=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,g=0|this._hh,w=0|this._al,T=0|this._bl,k=0|this._cl,_=0|this._dl,O=0|this._el,S=0|this._fl,x=0|this._gl,A=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var E=t[M-30],P=t[M-30+1],j=p(E,P),I=b(P,E),C=h(E=t[M-4],P=t[M-4+1]),R=y(P,E),N=t[M-14],D=t[M-14+1],B=t[M-32],U=t[M-32+1],L=I+D|0,z=j+N+m(L,I)|0;z=(z=z+C+m(L=L+R|0,R)|0)+B+m(L=L+U|0,U)|0,t[M]=z,t[M+1]=L}for(var F=0;F<160;F+=2){z=t[F],L=t[F+1];var q=f(n,r,a),H=f(w,T,k),J=d(n,w),V=d(w,n),W=l(s,O),K=l(O,s),G=o[F],Z=o[F+1],X=c(s,u,v),Y=c(O,S,x),$=A+K|0,Q=g+W+m($,A)|0;Q=(Q=(Q=Q+X+m($=$+Y|0,Y)|0)+G+m($=$+Z|0,Z)|0)+z+m($=$+L|0,L)|0;var ee=V+H|0,te=J+q+m(ee,V)|0;g=v,A=x,v=u,x=S,u=s,S=O,s=i+Q+m(O=_+$|0,_)|0,i=a,_=k,a=r,k=T,r=n,T=w,n=Q+te+m(w=$+ee|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+T|0,this._cl=this._cl+k|0,this._dl=this._dl+_|0,this._el=this._el+O|0,this._fl=this._fl+S|0,this._gl=this._gl+x|0,this._hl=this._hl+A|0,this._ah=this._ah+n+m(this._al,w)|0,this._bh=this._bh+r+m(this._bl,T)|0,this._ch=this._ch+a+m(this._cl,k)|0,this._dh=this._dh+i+m(this._dl,_)|0,this._eh=this._eh+s+m(this._el,O)|0,this._fh=this._fh+u+m(this._fl,S)|0,this._gh=this._gh+v+m(this._gl,x)|0,this._hh=this._hh+g+m(this._hl,A)|0},u.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,n){"use strict";(function(t,r){var a=n(195);e.exports=g;var i,o=n(277);g.ReadableState=v;n(145).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(352),c=n(251).Buffer,f=t.Uint8Array||function(){};var d=Object.create(n(167));d.inherits=n(51);var l=n(603),p=void 0;p=l&&l.debuglog?l.debuglog("stream"):function(){};var b,h=n(604),y=n(353);d.inherits(g,u);var m=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(133));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(b||(b=n(166).StringDecoder),this.decoder=new b(e.encoding),this.encoding=e.encoding)}function g(e){if(i=i||n(133),!(this instanceof g))return new g(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,a){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,O(e)}(e,o)):(a||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof f||"string"===typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"===typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):T(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):x(e,o)):T(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(S,e):S(e))}function S(e){p("emit readable"),e.emit("readable"),P(e)}function x(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(A,e,t))}function A(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(o===i.length?a+=i:a+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++r}return t.length-=r,a}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,a=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,o),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(C,t,e))}function C(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):O(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,a=t.needReadable;return p("need readable",a),(0===t.length||t.length-e0?j(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},g.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,p("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?f:g;function c(t,r){p("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),e.removeListener("close",m),e.removeListener("finish",v),e.removeListener("drain",d),e.removeListener("error",y),e.removeListener("unpipe",c),n.removeListener("end",f),n.removeListener("end",g),n.removeListener("data",h),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function f(){p("onend"),e.end()}i.endEmitted?a.nextTick(u):n.once("end",u),e.on("unpipe",c);var d=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(n);e.on("drain",d);var l=!1;var b=!1;function h(t){p("ondata"),b=!1,!1!==e.write(t)||b||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==R(i.pipes,e))&&!l&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,b=!0),n.pause())}function y(t){p("onerror",t),g(),e.removeListener("error",y),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",v),g()}function v(){p("onfinish"),e.removeListener("close",m),g()}function g(){p("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",y),e.once("close",m),e.once("finish",v),e.emit("pipe",n),i.flowing||(p("pipe resume"),n.resume()),e},g.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;in)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.lengthn||t!==t)throw new TypeError("Bad key length")}},function(e,t,n){(function(t,n){var r;if(t.process&&t.process.browser)r="utf-8";else if(t.process&&t.process.version){r=parseInt(n.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";e.exports=r}).call(this,n(35),n(78))},function(e,t,n){var r=n(356),a=n(247),i=n(248),o=n(67).Buffer,s=n(359),u=n(360),c=n(362),f=o.alloc(128),d={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,t,n){var s=function(e){function t(t){return i(e).update(t).digest()}function n(e){return(new a).update(e).digest()}return"rmd160"===e||"ripemd160"===e?n:"md5"===e?r:t}(e),u="sha512"===e||"sha384"===e?128:64;t.length>u?t=s(t):t.length0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&(u=c)),f=new s.TxBody(t.msgs,t.memo||""),d=new s.AuthInfo([],new s.Fee(0,new s.Coins)),(l=new s.Tx(f,d,[])).appendEmptySignatures(e),o&&"auto"!==o&&"0"!==o?[3,2]:[4,this.estimateGas(l,{gasAdjustment:r})];case 1:o=i.sent().toString(),i.label=2;case 2:return[4,this.computeTax(l)];case 3:return p=i.sent(),b=u?p.add(u.mul(o).toIntCeilCoins()):p,[2,new s.Fee(Number.parseInt(o),b,"","")]}}))}))},n.prototype.estimateGas=function(e,t){return a(this,void 0,void 0,(function(){var n,r;return i(this,(function(a){switch(a.label){case 0:return n=(null===t||void 0===t?void 0:t.gasAdjustment)||this.lcd.config.gasAdjustment,[4,this.c.post("/cosmos/tx/v1beta1/simulate",{tx_bytes:this.encode(e)}).then((function(e){return f.fromData(e)}))];case 1:return r=a.sent(),[2,new s.Dec(n).mul(r.gas_info.gas_used).toNumber()]}}))}))},n.prototype.computeTax=function(e){return a(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.c.post("/terra/tx/v1beta1/compute_tax",{tx_bytes:this.encode(e)}).then((function(e){return s.Coins.fromData(e.tax_amount)}))];case 1:return[2,t.sent()]}}))}))},n.prototype.encode=function(t){return e.from(t.toBytes()).toString("base64")},n.prototype.hash=function(e){return a(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.encode(e)];case 1:return t=n.sent(),[2,(0,u.hashToHex)(t)]}}))}))},n.prototype._broadcast=function(e,t){return a(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.c.post("/cosmos/tx/v1beta1/txs",{tx_bytes:this.encode(e),mode:t})];case 1:return[2,n.sent()]}}))}))},n.prototype.broadcast=function(e){return a(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._broadcast(e,"BROADCAST_MODE_BLOCK").then((function(e){var t=e.tx_response;return{txhash:t.txhash,raw_log:t.raw_log,gas_wanted:Number.parseInt(t.gas_wanted),gas_used:Number.parseInt(t.gas_used),height:+t.height,logs:t.logs.map((function(e){return c.TxLog.fromData(e)})),code:t.code,codespace:t.codespace,data:t.data,info:t.info,timestamp:t.timestamp}}))]}))}))},n.prototype.broadcastSync=function(e){return a(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._broadcast(e,"BROADCAST_MODE_SYNC").then((function(e){var t=e.tx_response,n={height:+t.height,txhash:t.txhash,raw_log:t.raw_log};return t.code&&(n.code=t.code),t.codespace&&(n.codespace=t.codespace),n}))]}))}))},n.prototype.broadcastAsync=function(e){return a(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._broadcast(e,"BROADCAST_MODE_ASYNC").then((function(e){var t=e.tx_response;return{height:+t.height,txhash:t.txhash}}))]}))}))},n.prototype.search=function(e){var t;return a(this,void 0,void 0,(function(){var n;return i(this,(function(r){return n=new URLSearchParams,null===(t=e.events)||void 0===t||t.forEach((function(e){return n.append("events","tx.height"===e.key?e.key+"="+e.value:e.key+"='"+e.value+"'")})),delete e.events,Object.entries(e).forEach((function(e){n.append(e[0],e[1])})),[2,this.c.getRaw("cosmos/tx/v1beta1/txs",n).then((function(e){return{txs:e.tx_responses.map((function(e){return s.TxInfo.fromData(e)})),pagination:e.pagination}}))]}))}))},n}(o.BaseAPI);t.TxAPI=d}).call(this,n(21).Buffer)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(t){i(t)}}function s(e){try{u(r.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n},p=0,b=0;var h=function(e,t,n){var r=t&&n||0,a=t||new Array(16),o=(e=e||{}).node||f,s=void 0!==e.clockseq?e.clockseq:d;if(null==o||null==s){var u=e.random||(e.rng||i)();null==o&&(o=f=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==s&&(s=d=16383&(u[6]<<8|u[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:b+1,y=c-p+(h-b)/1e4;if(y<0&&void 0===e.clockseq&&(s=s+1&16383),(y<0||c>p)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=c,b=h,d=s;var m=(1e4*(268435455&(c+=122192928e5))+h)%4294967296;a[r++]=m>>>24&255,a[r++]=m>>>16&255,a[r++]=m>>>8&255,a[r++]=255&m;var v=c/4294967296*1e4&268435455;a[r++]=v>>>8&255,a[r++]=255&v,a[r++]=v>>>24&15|16,a[r++]=v>>>16&255,a[r++]=s>>>8|128,a[r++]=255&s;for(var g=0;g<6;++g)a[r+g]=o[g];return t||l(a)};var y=function(e){if(!s(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};var m=function(e,t,n){function r(e,r,a,i){if("string"===typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n>>9<<4)+1}function g(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function w(e,t,n,r,a,i){return g((o=g(g(t,e),g(r,i)))<<(s=a)|o>>>32-s,n);var o,s}function T(e,t,n,r,a,i,o){return w(t&n|~t&r,e,t,a,i,o)}function k(e,t,n,r,a,i,o){return w(t&r|n&~r,e,t,a,i,o)}function _(e,t,n,r,a,i,o){return w(t^n^r,e,t,a,i,o)}function O(e,t,n,r,a,i,o){return w(n^(t|~r),e,t,a,i,o)}var S=m("v3",48,(function(e){if("string"===typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n>5]>>>a%32&255,o=parseInt(r.charAt(i>>>4&15)+r.charAt(15&i),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[r/8])<>>32-t}var E=m("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var a=0;a>>0;g=v,v=m,m=M(y,30)>>>0,y=h,h=k}n[0]=n[0]+h>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+g>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),P="00000000-0000-0000-0000-000000000000";var j=function(e){if(!s(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return q}));var r=n(37),a=n.n(r),i=n(66),o=n.n(i);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e||"undefined"!==typeof self&&self;function s(e,t,n){return n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&n.path)}},e(n,n.exports),n.exports}var u=c;function c(e,t){if(!e)throw new Error(t||"Assertion failed")}c.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var f=s((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",n=0;n>8,o=255&a;i?n.push(i,o):n.push(o)}return n},n.zero2=r,n.toHex=a,n.encode=function(e,t){return"hex"===t?a(e):e}})),d=s((function(e,t){var n=t;n.assert=u,n.toArray=f.toArray,n.zero2=f.zero2,n.toHex=f.toHex,n.encode=f.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var a=1<(a>>1)-1?(a>>1)-u:u,i.isubn(s)):s=0,r[o]=s,i.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,s,u=e.andln(3)+a&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),o=0===(1&u)?0:3!==(r=e.andln(7)+a&7)&&5!==r||2!==c?u:-u,n[0].push(o),s=0===(1&c)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*a===o+1&&(a=1-a),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new a.a(e,"hex","le")}})),l=d.getNAF,p=d.getJSF,b=d.assert;function h(e,t){this.type=e,this.p=new a.a(t.p,16),this.red=t.prime?a.a.red(t.prime):a.a.mont(this.p),this.zero=new a.a(0).toRed(this.red),this.one=new a.a(1).toRed(this.red),this.two=new a.a(2).toRed(this.red),this.n=t.n&&new a.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var y=h;function m(e,t){this.curve=e,this.type=t,this.precomputed=null}h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(e,t){b(e.precomputed);var n=e._getDoubles(),r=l(t,1,this._bitLength),a=(1<=i;u--)o=(o<<1)+r[u];s.push(o)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=a;d>0;d--){for(i=0;i=0;s--){for(var u=0;s>=0&&0===i[s];s--)u++;if(s>=0&&u++,o=o.dblp(u),s<0)break;var c=i[s];b(0!==c),o="affine"===e.type?c>0?o.mixedAdd(a[c-1>>1]):o.mixedAdd(a[-c-1>>1].neg()):c>0?o.add(a[c-1>>1]):o.add(a[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},h.prototype._wnafMulAdd=function(e,t,n,r,a){var i,o,s,u=this._wnafT1,c=this._wnafT2,f=this._wnafT3,d=0;for(i=0;i=1;i-=2){var h=i-1,y=i;if(1===u[h]&&1===u[y]){var m=[t[h],null,null,t[y]];0===t[h].y.cmp(t[y].y)?(m[1]=t[h].add(t[y]),m[2]=t[h].toJ().mixedAdd(t[y].neg())):0===t[h].y.cmp(t[y].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[y]),m[2]=t[h].add(t[y].neg())):(m[1]=t[h].toJ().mixedAdd(t[y]),m[2]=t[h].toJ().mixedAdd(t[y].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=p(n[h],n[y]);for(d=Math.max(g[0].length,d),f[h]=new Array(d),f[y]=new Array(d),o=0;o=0;i--){for(var O=0;i>=0;){var S=!0;for(o=0;o=0&&O++,k=k.dblp(O),i<0)break;for(o=0;o0?s=c[o][x-1>>1]:x<0&&(s=c[o][-x-1>>1].neg()),k="affine"===s.type?k.mixedAdd(s):k.add(s))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},m.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,a=0;a=0&&(o=t,s=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:r,b:i},{a:o,b:s}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],a=r.b.mul(e).divRound(this.n),i=n.b.neg().mul(e).divRound(this.n),o=a.mul(n.a),s=i.mul(r.a),u=a.mul(n.b),c=i.mul(r.b);return{k1:e.sub(o).sub(s),k2:u.add(c).neg()}},w.prototype.pointFromX=function(e,t){(e=new a.a(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(a).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,a=this._endoWnafT2,i=0;i":""},k.prototype.isInfinity=function(){return this.inf},k.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},k.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),i=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,o)},k.prototype.getX=function(){return this.x.fromRed()},k.prototype.getY=function(){return this.y.fromRed()},k.prototype.mul=function(e){return e=new a.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},k.prototype.mulAdd=function(e,t,n){var r=[this,t],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,a):this.curve._wnafMulAdd(1,r,a,2)},k.prototype.jmulAdd=function(e,t,n){var r=[this,t],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,a,!0):this.curve._wnafMulAdd(1,r,a,2,!0)},k.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},k.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},k.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},v(_,y.BasePoint),w.prototype.jpoint=function(e,t,n){return new _(this,e,t,n)},_.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},_.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),a=e.x.redMul(n),i=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),s=r.redSub(a),u=i.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),d=r.redMul(c),l=u.redSqr().redIAdd(f).redISub(d).redISub(d),p=u.redMul(d.redISub(l)).redISub(i.redMul(f)),b=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,p,b)},_.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),o=n.redSub(r),s=a.redSub(i);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),c=u.redMul(o),f=n.redMul(u),d=s.redSqr().redIAdd(c).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(a.redMul(c)),p=this.z.redMul(o);return this.curve.jpoint(d,l,p)},_.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(a),0===this.x.cmp(n))return!0}},_.prototype.inspect=function(){return this.isInfinity()?"":""},_.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var O=s((function(e,t){var n=t;n.base=y,n.short=T,n.mont=null,n.edwards=null})),S=s((function(e,t){var n,r=t,a=d.assert;function i(e){"short"===e.type?this.curve=new O.short(e):"edwards"===e.type?this.curve=new O.edwards(e):this.curve=new O.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new i(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=i,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(u){n=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function x(e){if(!(this instanceof x))return new x(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=f.toArray(e.entropy,e.entropyEnc||"hex"),n=f.toArray(e.nonce,e.nonceEnc||"hex"),r=f.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var A=x;x.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},x.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=f.toArray(n,r||"hex"),this._update(n));for(var a=[];a.length"};var j=d.assert;function I(e,t){if(e instanceof I)return e;this._importDER(e,t)||(j(e.r&&e.s,"Signature without r or s"),this.r=new a.a(e.r,16),this.s=new a.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var C=I;function R(){this.place=0}function N(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var a=0,i=0,o=t.place;i>>=0;return!(a<=127)&&(t.place=o,a)}function D(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}I.prototype._importDER=function(e,t){e=d.toArray(e,t);var n=new R;if(48!==e[n.place++])return!1;var r=N(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=N(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var s=N(e,n);if(!1===s)return!1;if(e.length!==s+n.place)return!1;var u=e.slice(n.place,s+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new a.a(o),this.s=new a.a(u),this.recoveryParam=null,!0},I.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=D(t),n=D(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];B(r,t.length),(r=r.concat(t)).push(2),B(r,n.length);var a=r.concat(n),i=[48];return B(i,a.length),i=i.concat(a),d.encode(i,e)};var U=function(){throw new Error("unsupported")},L=d.assert;function z(e){if(!(this instanceof z))return new z(e);"string"===typeof e&&(L(Object.prototype.hasOwnProperty.call(S,e),"Unknown curve "+e),e=S[e]),e instanceof S.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var F=z;z.prototype.keyPair=function(e){return new P(this,e)},z.prototype.keyFromPrivate=function(e,t){return P.fromPrivate(this,e,t)},z.prototype.keyFromPublic=function(e,t){return P.fromPublic(this,e,t)},z.prototype.genKeyPair=function(e){e||(e={});for(var t=new A({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||U(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new a.a(2));;){var i=new a.a(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},z.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},z.prototype.sign=function(e,t,n,r){"object"===typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new a.a(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),s=e.toArray("be",i),u=new A({hash:this.hash,entropy:o,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),c=this.n.sub(new a.a(1)),f=0;;f++){var d=r.k?r.k(f):new a.a(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(c)>=0)){var l=this.g.mul(d);if(!l.isInfinity()){var p=l.getX(),b=p.umod(this.n);if(0!==b.cmpn(0)){var h=d.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(h=h.umod(this.n)).cmpn(0)){var y=(l.getY().isOdd()?1:0)|(0!==p.cmp(b)?2:0);return r.canonical&&h.cmp(this.nh)>0&&(h=this.n.sub(h),y^=1),new C({r:b,s:h,recoveryParam:y})}}}}}},z.prototype.verify=function(e,t,n,r){e=this._truncateToN(new a.a(e,16)),n=this.keyFromPublic(n,r);var i=(t=new C(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,u=o.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,n.getPublic(),f)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(c,n.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},z.prototype.recoverPubKey=function(e,t,n,r){L((3&n)===n,"The recovery param is more than two bits"),t=new C(t,r);var i=this.n,o=new a.a(e),s=t.r,u=t.s,c=1&n,f=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var d=t.r.invm(i),l=i.sub(o).mul(d).umod(i),p=u.mul(d).umod(i);return this.g.mulAdd(l,s,p)},z.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new C(t,r)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var i;try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(n))return a}throw new Error("Unable to find valid recovery factor")};var q=s((function(e,t){var n=t;n.version="6.5.4",n.utils=d,n.rand=function(){throw new Error("unsupported")},n.curve=O,n.curves=S,n.ec=F,n.eddsa=null})).ec}).call(this,n(35))},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(441).Buffer}catch(S){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var a=0,i=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.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)a=u(e,t,r)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=t)r++;r--,a=a/t|0;for(var i=e.length-n,o=i%r,s=Math.min(i,i-o)+n,u=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var f=["","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"],d=[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],l=[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 p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,l=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=l;p++){var b=c-p|0;f+=(o=(a=0|e.words[b])*(i=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|f}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?f[6-u.length]+u+n:u+n,(a+=2)>=26&&(a-=26,o--)}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=d[e],p=l[e];n="";var b=this.clone();for(b.negative=0;!b.isZero();){var h=b.modn(p).toString(e);n=(b=b.idivn(p)).isZero()?h+n:f[c-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var a=this.byteLength(),i=n||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,c=new e(i),f=this.clone();if(u){for(s=0;!f.isZero();s++)o=f.andln(255),f.iushrn(8),c[s]=o;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},i.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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.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)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.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)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,a=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 a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,p=0|o[1],b=8191&p,h=p>>>13,y=0|o[2],m=8191&y,v=y>>>13,g=0|o[3],w=8191&g,T=g>>>13,k=0|o[4],_=8191&k,O=k>>>13,S=0|o[5],x=8191&S,A=S>>>13,M=0|o[6],E=8191&M,P=M>>>13,j=0|o[7],I=8191&j,C=j>>>13,R=0|o[8],N=8191&R,D=R>>>13,B=0|o[9],U=8191&B,L=B>>>13,z=0|s[0],F=8191&z,q=z>>>13,H=0|s[1],J=8191&H,V=H>>>13,W=0|s[2],K=8191&W,G=W>>>13,Z=0|s[3],X=8191&Z,Y=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ae=0|s[6],ie=8191&ae,oe=ae>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],be=8191&pe,he=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(c+(r=Math.imul(d,F))|0)+((8191&(a=(a=Math.imul(d,q))+Math.imul(l,F)|0))<<13)|0;c=((i=Math.imul(l,q))+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(b,F),a=(a=Math.imul(b,q))+Math.imul(h,F)|0,i=Math.imul(h,q);var me=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,V)|0)+Math.imul(l,J)|0))<<13)|0;c=((i=i+Math.imul(l,V)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,F),a=(a=Math.imul(m,q))+Math.imul(v,F)|0,i=Math.imul(v,q),r=r+Math.imul(b,J)|0,a=(a=a+Math.imul(b,V)|0)+Math.imul(h,J)|0,i=i+Math.imul(h,V)|0;var ve=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(l,K)|0))<<13)|0;c=((i=i+Math.imul(l,G)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,F),a=(a=Math.imul(w,q))+Math.imul(T,F)|0,i=Math.imul(T,q),r=r+Math.imul(m,J)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(v,J)|0,i=i+Math.imul(v,V)|0,r=r+Math.imul(b,K)|0,a=(a=a+Math.imul(b,G)|0)+Math.imul(h,K)|0,i=i+Math.imul(h,G)|0;var ge=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(l,X)|0))<<13)|0;c=((i=i+Math.imul(l,Y)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(_,F),a=(a=Math.imul(_,q))+Math.imul(O,F)|0,i=Math.imul(O,q),r=r+Math.imul(w,J)|0,a=(a=a+Math.imul(w,V)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,V)|0,r=r+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(v,K)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(b,X)|0,a=(a=a+Math.imul(b,Y)|0)+Math.imul(h,X)|0,i=i+Math.imul(h,Y)|0;var we=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,Q)|0))<<13)|0;c=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,F),a=(a=Math.imul(x,q))+Math.imul(A,F)|0,i=Math.imul(A,q),r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,V)|0,r=r+Math.imul(w,K)|0,a=(a=a+Math.imul(w,G)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(m,X)|0,a=(a=a+Math.imul(m,Y)|0)+Math.imul(v,X)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(h,Q)|0,i=i+Math.imul(h,ee)|0;var Te=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(a=(a=a+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;c=((i=i+Math.imul(l,re)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(E,F),a=(a=Math.imul(E,q))+Math.imul(P,F)|0,i=Math.imul(P,q),r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,V)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,V)|0,r=r+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(O,K)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(w,X)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(m,Q)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(b,ne)|0,a=(a=a+Math.imul(b,re)|0)+Math.imul(h,ne)|0,i=i+Math.imul(h,re)|0;var ke=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;c=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,F),a=(a=Math.imul(I,q))+Math.imul(C,F)|0,i=Math.imul(C,q),r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,V)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,V)|0,r=r+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,G)|0,r=r+Math.imul(_,X)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(O,X)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(m,ne)|0,a=(a=a+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(h,ie)|0,i=i+Math.imul(h,oe)|0;var _e=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(a=(a=a+Math.imul(d,ce)|0)+Math.imul(l,ue)|0))<<13)|0;c=((i=i+Math.imul(l,ce)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,F),a=(a=Math.imul(N,q))+Math.imul(D,F)|0,i=Math.imul(D,q),r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,V)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,V)|0,r=r+Math.imul(E,K)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,r=r+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,Y)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,r=r+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,re)|0)+Math.imul(T,ne)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,oe)|0,r=r+Math.imul(b,ue)|0,a=(a=a+Math.imul(b,ce)|0)+Math.imul(h,ue)|0,i=i+Math.imul(h,ce)|0;var Oe=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;c=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,F),a=(a=Math.imul(U,q))+Math.imul(L,F)|0,i=Math.imul(L,q),r=r+Math.imul(N,J)|0,a=(a=a+Math.imul(N,V)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,V)|0,r=r+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,r=r+Math.imul(E,X)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(_,ne)|0,a=(a=a+Math.imul(_,re)|0)+Math.imul(O,ne)|0,i=i+Math.imul(O,re)|0,r=r+Math.imul(w,ie)|0,a=(a=a+Math.imul(w,oe)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,oe)|0,r=r+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,r=r+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(h,de)|0,i=i+Math.imul(h,le)|0;var Se=(c+(r=r+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,he)|0)+Math.imul(l,be)|0))<<13)|0;c=((i=i+Math.imul(l,he)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(U,J),a=(a=Math.imul(U,V))+Math.imul(L,J)|0,i=Math.imul(L,V),r=r+Math.imul(N,K)|0,a=(a=a+Math.imul(N,G)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,G)|0,r=r+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(C,X)|0,i=i+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(x,ne)|0,a=(a=a+Math.imul(x,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,oe)|0,r=r+Math.imul(w,ue)|0,a=(a=a+Math.imul(w,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,r=r+Math.imul(m,de)|0,a=(a=a+Math.imul(m,le)|0)+Math.imul(v,de)|0,i=i+Math.imul(v,le)|0;var xe=(c+(r=r+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,he)|0)+Math.imul(h,be)|0))<<13)|0;c=((i=i+Math.imul(h,he)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(L,K)|0,i=Math.imul(L,G),r=r+Math.imul(N,X)|0,a=(a=a+Math.imul(N,Y)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,Y)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,r=r+Math.imul(E,ne)|0,a=(a=a+Math.imul(E,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,r=r+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,ce)|0)+Math.imul(O,ue)|0,i=i+Math.imul(O,ce)|0,r=r+Math.imul(w,de)|0,a=(a=a+Math.imul(w,le)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,le)|0;var Ae=(c+(r=r+Math.imul(m,be)|0)|0)+((8191&(a=(a=a+Math.imul(m,he)|0)+Math.imul(v,be)|0))<<13)|0;c=((i=i+Math.imul(v,he)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(L,X)|0,i=Math.imul(L,Y),r=r+Math.imul(N,Q)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,re)|0)+Math.imul(C,ne)|0,i=i+Math.imul(C,re)|0,r=r+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,r=r+Math.imul(_,de)|0,a=(a=a+Math.imul(_,le)|0)+Math.imul(O,de)|0,i=i+Math.imul(O,le)|0;var Me=(c+(r=r+Math.imul(w,be)|0)|0)+((8191&(a=(a=a+Math.imul(w,he)|0)+Math.imul(T,be)|0))<<13)|0;c=((i=i+Math.imul(T,he)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(L,Q)|0,i=Math.imul(L,ee),r=r+Math.imul(N,ne)|0,a=(a=a+Math.imul(N,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,r=r+Math.imul(E,ue)|0,a=(a=a+Math.imul(E,ce)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var Ee=(c+(r=r+Math.imul(_,be)|0)|0)+((8191&(a=(a=a+Math.imul(_,he)|0)+Math.imul(O,be)|0))<<13)|0;c=((i=i+Math.imul(O,he)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(U,ne),a=(a=Math.imul(U,re))+Math.imul(L,ne)|0,i=Math.imul(L,re),r=r+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,oe)|0,r=r+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,r=r+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Pe=(c+(r=r+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,he)|0)+Math.imul(A,be)|0))<<13)|0;c=((i=i+Math.imul(A,he)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(L,ie)|0,i=Math.imul(L,oe),r=r+Math.imul(N,ue)|0,a=(a=a+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,ce)|0,r=r+Math.imul(I,de)|0,a=(a=a+Math.imul(I,le)|0)+Math.imul(C,de)|0,i=i+Math.imul(C,le)|0;var je=(c+(r=r+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,he)|0)+Math.imul(P,be)|0))<<13)|0;c=((i=i+Math.imul(P,he)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(U,ue),a=(a=Math.imul(U,ce))+Math.imul(L,ue)|0,i=Math.imul(L,ce),r=r+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(D,de)|0,i=i+Math.imul(D,le)|0;var Ie=(c+(r=r+Math.imul(I,be)|0)|0)+((8191&(a=(a=a+Math.imul(I,he)|0)+Math.imul(C,be)|0))<<13)|0;c=((i=i+Math.imul(C,he)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,de),a=(a=Math.imul(U,le))+Math.imul(L,de)|0,i=Math.imul(L,le);var Ce=(c+(r=r+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,he)|0)+Math.imul(D,be)|0))<<13)|0;c=((i=i+Math.imul(D,he)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Re=(c+(r=Math.imul(U,be))|0)+((8191&(a=(a=Math.imul(U,he))+Math.imul(L,be)|0))<<13)|0;return c=((i=Math.imul(L,he))+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=ge,u[4]=we,u[5]=Te,u[6]=ke,u[7]=_e,u[8]=Oe,u[9]=Se,u[10]=xe,u[11]=Ae,u[12]=Me,u[13]=Ee,u[14]=Pe,u[15]=je,u[16]=Ie,u[17]=Ce,u[18]=Re,0!==c&&(u[19]=c,n.length++),n};function h(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(b=p),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?b(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}n.words[i]=s,r=o,o=a}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):h(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,n[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=a/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>a}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,a=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,c=0;c=0&&(0!==f||c>=a);c--){var d=0|this.words[c];this.words[c]=f<<26-i|d>>>i,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,a=1<=0);var t=e%26,n=(e-t)/26;if(r(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 a=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},i.prototype.isubn=function(e){if(r("number"===typeof e),r(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[a+n]=67108863&i}for(;a>26,this.words[a+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,u=r.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.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),a=e.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,a=this.length-1;a>=0;a--)n=(t*n+(0|this.words[a]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var a=(0|this.words[n])+67108864*t;this.words[n]=a/e|0,t=a%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0===(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,h=1;0===(n.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(n.iushrn(b);b-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,l=1;0===(n.words[0]&l)&&d<26;++d,l<<=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),o.isub(s)):(n.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.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 a=t.cmp(n);if(a<0){var i=t;t=n,n=i}else if(0===a||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.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),r(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;n--){var r=0|this.words[n],a=0|e.words[n];if(r!==a){ra&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.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},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},a(g,v),g.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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]=a,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new w;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return m[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.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)},_.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},_.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)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),b=o;0!==p.cmp(s);){for(var h=p,y=0;0!==h.cmp(s);y++)h=h.redSqr();r(y=0;r--){for(var c=t.words[r],f=u-1;f>=0;f--){var d=c>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new O(e)},a(O,_),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.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),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(157)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="random/5.5.1"},function(e,t,n){"use strict";var r=n(176);Object.defineProperty(t,"__esModule",{value:!0}),t.Client=void 0;var a=r(n(59)),i=r(n(159)),o=r(n(161)),s=r(n(160)),u=r(n(458));function c(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,s.default)(e);if(t){var a=(0,s.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}var f=function(e){(0,i.default)(n,e);var t=c(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ws://localhost:8080",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.autoconnect,o=void 0===i||i,s=r.reconnect,c=void 0===s||s,f=r.reconnect_interval,d=void 0===f?1e3:f,l=r.max_reconnects,p=void 0===l?5:l,b=arguments.length>2?arguments[2]:void 0;return(0,a.default)(this,n),t.call(this,u.default,e,{autoconnect:o,reconnect:c,reconnect_interval:d,max_reconnects:p},b)}return n}(r(n(459)).default);t.Client=f},function(e,t,n){"use strict";var r=n(391).v4,a=n(462),i=function e(t,n){if(!(this instanceof e))return new e(t,n);n||(n={}),this.options={reviver:"undefined"!==typeof n.reviver?n.reviver:null,replacer:"undefined"!==typeof n.replacer?n.replacer:null,generator:"undefined"!==typeof n.generator?n.generator:function(){return r()},version:"undefined"!==typeof n.version?n.version:2,notificationIdNull:"boolean"===typeof n.notificationIdNull&&n.notificationIdNull},this.callServer=t};e.exports=i,i.prototype.request=function(e,t,n,r){var i,o=this,s=null,u=Array.isArray(e)&&"function"===typeof t;if(1===this.options.version&&u)throw new TypeError("JSON-RPC 1.0 does not support batching");if(u||!u&&e&&"object"===typeof e&&"function"===typeof t)r=t,s=e;else{"function"===typeof n&&(r=n,n=void 0);var c="function"===typeof r;try{s=a(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(f){if(c)return r(f);throw f}if(!c)return s}try{i=JSON.stringify(s,this.options.replacer)}catch(f){return r(f)}return this.callServer(i,(function(e,t){o._parseResponse(e,t,r)})),s},i.prototype._parseResponse=function(e,t,n){if(e)n(e);else{if(!t)return n();var r;try{r=JSON.parse(t,this.options.reviver)}catch(e){return n(e)}if(3===n.length){if(Array.isArray(r)){var a=function(e){return"undefined"!==typeof e.error};return n(null,r.filter(a),r.filter((function(e){return!a(e)})))}return n(null,r.error,r.result)}n(null,r)}}},function(e,t,n){var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get: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=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),a=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={splitValues:!1});var n,a=this;this.headersMap={},e&&("undefined"!==typeof Headers&&e instanceof Headers?r.getHeaderKeys(e).forEach((function(n){r.getHeaderValues(e,n).forEach((function(e){t.splitValues?a.append(n,r.splitHeaderValue(e)):a.append(n,e)}))})):"object"===typeof(n=e)&&"object"===typeof n.headersMap&&"function"===typeof n.forEach?e.forEach((function(e,t){a.append(e,t)})):"undefined"!==typeof Map&&e instanceof Map?e.forEach((function(e,t){a.append(t,e)})):"string"===typeof e?this.appendFromString(e):"object"===typeof e&&Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];Array.isArray(n)?n.forEach((function(e){a.append(t,e)})):a.append(t,n)})))}return e.prototype.appendFromString=function(e){for(var t=e.split("\r\n"),n=0;n0){var i=r.substring(0,a).trim(),o=r.substring(a+1).trim();this.append(i,o)}}},e.prototype.delete=function(e,t){var n=r.normalizeName(e);if(void 0===t)delete this.headersMap[n];else{var a=this.headersMap[n];if(a){var i=a.indexOf(t);i>=0&&a.splice(i,1),0===a.length&&delete this.headersMap[n]}}},e.prototype.append=function(e,t){var n=this,a=r.normalizeName(e);Array.isArray(this.headersMap[a])||(this.headersMap[a]=[]),Array.isArray(t)?t.forEach((function(e){n.headersMap[a].push(r.normalizeValue(e))})):this.headersMap[a].push(r.normalizeValue(t))},e.prototype.set=function(e,t){var n=r.normalizeName(e);if(Array.isArray(t)){var a=[];t.forEach((function(e){a.push(r.normalizeValue(e))})),this.headersMap[n]=a}else this.headersMap[n]=[r.normalizeValue(t)]},e.prototype.has=function(e,t){var n=this.headersMap[r.normalizeName(e)];if(!Array.isArray(n))return!1;if(void 0!==t){var a=r.normalizeValue(t);return n.indexOf(a)>=0}return!0},e.prototype.get=function(e){var t=this.headersMap[r.normalizeName(e)];return void 0!==t?t.concat():[]},e.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.headersMap).forEach((function(n){e(n,t.headersMap[n])}),this)},e.prototype.toHeaders=function(){if("undefined"!==typeof Headers){var e=new Headers;return this.forEach((function(t,n){n.forEach((function(n){e.append(t,n)}))})),e}throw new Error("Headers class is not defined")},e}();t.BrowserHeaders=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.BrowserHeaders=r.BrowserHeaders},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterateHeaders=function(e,t){for(var n=e[Symbol.iterator](),r=n.next();!r.done;)t(r.value[0]),r=n.next()},t.iterateHeadersKeys=function(e,t){for(var n=e.keys(),r=n.next();!r.done;)t(r.value),r=n.next()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.normalizeName=function(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()},t.normalizeValue=function(e){return"string"!==typeof e&&(e=String(e)),e},t.getHeaderValues=function(e,t){var n=e;if(n instanceof Headers&&n.getAll)return n.getAll(t);var r=n.get(t);return r&&"string"===typeof r?[r]:r},t.getHeaderKeys=function(e){var t=e,n={},a=[];return t.keys?r.iterateHeadersKeys(t,(function(e){n[e]||(n[e]=!0,a.push(e))})):t.forEach?t.forEach((function(e,t){n[t]||(n[t]=!0,a.push(t))})):r.iterateHeaders(t,(function(e){var t=e[0];n[t]||(n[t]=!0,a.push(t))})),a},t.splitHeaderValue=function(e){var t=[];return e.split(", ").forEach((function(e){e.split(",").forEach((function(e){t.push(e)}))})),t}}])},e.exports=r()},function(e,t,n){"use strict";e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mustBeMetaMask,n=void 0!==t&&t,r=e.silent,a=void 0!==r&&r,i=e.timeout,o=void 0===i?3e3:i;u();var s=!1;return new Promise((function(e){function t(){if(!s){s=!0,window.removeEventListener("ethereum#initialized",t);var r=window.ethereum;if(!r||n&&!r.isMetaMask){var i=n&&r?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!a&&console.error("@metamask/detect-provider:",i),e(null)}else e(r)}}window.ethereum?t():(window.addEventListener("ethereum#initialized",t,{once:!0}),setTimeout((function(){t()}),o))}));function u(){if("boolean"!==typeof n)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!==typeof a)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!==typeof o)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}},function(e,t,n){"use strict";(function(e){var n="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();var a=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function i(e){return e&&"[object Function]"==={}.toString.call(e)}function o(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function u(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=o(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/(auto|scroll|overlay)/.test(n+a+r)?e:u(s(e))}function c(e){return e&&e.referenceNode?e.referenceNode:e}var f=n&&!(!window.MSInputMethodContext||!document.documentMode),d=n&&/MSIE 10/.test(navigator.userAgent);function l(e){return 11===e?f:10===e?d:f||d}function p(e){if(!e)return document.documentElement;for(var t=l(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===o(n,"position")?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function b(e){return null!==e.parentNode?b(e.parentNode):e}function h(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,a=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(a,0);var o=i.commonAncestorContainer;if(e!==o&&t!==o||r.contains(a))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||p(e.firstElementChild)===e)}(o)?o:p(o);var s=b(e);return s.host?h(s.host,t):h(e,b(t).host)}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var a=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||a;return i[n]}return e[n]}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=y(t,"top"),a=y(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=a*i,e.right+=a*i,e}function v(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function g(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],l(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function w(e){var t=e.body,n=e.documentElement,r=l(10)&&getComputedStyle(n);return{height:g("Height",t,n,r),width:g("Width",t,n,r)}}var T=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},k=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=l(10),a="HTML"===t.nodeName,i=x(e),s=x(t),c=u(e),f=o(t),d=parseFloat(f.borderTopWidth),p=parseFloat(f.borderLeftWidth);n&&a&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var b=S({top:i.top-s.top-d,left:i.left-s.left-p,width:i.width,height:i.height});if(b.marginTop=0,b.marginLeft=0,!r&&a){var h=parseFloat(f.marginTop),y=parseFloat(f.marginLeft);b.top-=d-h,b.bottom-=d-h,b.left-=p-y,b.right-=p-y,b.marginTop=h,b.marginLeft=y}return(r&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(b=m(b,t)),b}function M(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=A(e,n),a=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),o=t?0:y(n),s=t?0:y(n,"left"),u={top:o-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:a,height:i};return S(u)}function E(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===o(e,"position"))return!0;var n=s(e);return!!n&&E(n)}function P(e){if(!e||!e.parentElement||l())return document.documentElement;for(var t=e.parentElement;t&&"none"===o(t,"transform");)t=t.parentElement;return t||document.documentElement}function j(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},o=a?P(e):h(e,c(t));if("viewport"===r)i=M(o,a);else{var f=void 0;"scrollParent"===r?"BODY"===(f=u(s(t))).nodeName&&(f=e.ownerDocument.documentElement):f="window"===r?e.ownerDocument.documentElement:r;var d=A(f,o,a);if("HTML"!==f.nodeName||E(o))i=d;else{var l=w(e.ownerDocument),p=l.height,b=l.width;i.top+=d.top-d.marginTop,i.bottom=p+d.top,i.left+=d.left-d.marginLeft,i.right=b+d.left}}var y="number"===typeof(n=n||0);return i.left+=y?n:n.left||0,i.top+=y?n:n.top||0,i.right-=y?n:n.right||0,i.bottom-=y?n:n.bottom||0,i}function I(e){return e.width*e.height}function C(e,t,n,r,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var o=j(n,r,i,a),s={top:{width:o.width,height:t.top-o.top},right:{width:o.right-t.right,height:o.height},bottom:{width:o.width,height:o.bottom-t.bottom},left:{width:t.left-o.left,height:o.height}},u=Object.keys(s).map((function(e){return O({key:e},s[e],{area:I(s[e])})})).sort((function(e,t){return t.area-e.area})),c=u.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),f=c.length>0?c[0].key:u[0].key,d=e.split("-")[1];return f+(d?"-"+d:"")}function R(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=r?P(t):h(t,c(n));return A(n,a,r)}function N(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function D(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function B(e,t,n){n=n.split("-")[0];var r=N(e),a={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),o=i?"top":"left",s=i?"left":"top",u=i?"height":"width",c=i?"width":"height";return a[o]=t[o]+t[u]/2-r[u]/2,a[s]=n===s?t[s]-r[c]:t[D(s)],a}function U(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function L(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=U(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&i(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function z(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=R(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=C(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=B(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=L(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function F(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function q(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=ee.indexOf(e),r=ee.slice(n+1).concat(ee.slice(0,n));return t?r.reverse():r}var ne="flip",re="clockwise",ae="counterclockwise";function ie(e,t,n,r){var a=[0,0],i=-1!==["right","left"].indexOf(r),o=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=o.indexOf(U(o,(function(e){return-1!==e.search(/,|\s/)})));o[s]&&-1===o[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=-1!==s?[o.slice(0,s).concat([o[s].split(u)[0]]),[o[s].split(u)[1]].concat(o.slice(s+1))]:[o];return c=c.map((function(e,r){var a=(1===r?!i:i)?"height":"width",o=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,o=!0,e):o?(e[e.length-1]+=t,o=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var a=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+a[1],o=a[2];if(!i)return e;if(0===o.indexOf("%")){return S("%p"===o?n:r)[t]/100*i}if("vh"===o||"vw"===o)return("vh"===o?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;return i}(e,a,t,n)}))})),c.forEach((function(e,t){e.forEach((function(n,r){Z(n)&&(a[t]+=n*("-"===e[r-1]?-1:1))}))})),a}var oe={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var a=e.offsets,i=a.reference,o=a.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",c=s?"width":"height",f={start:_({},u,i[u]),end:_({},u,i[u]+i[c]-o[c])};e.offsets.popper=O({},o,f[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,a=e.offsets,i=a.popper,o=a.reference,s=r.split("-")[0],u=void 0;return u=Z(+n)?[+n,0]:ie(n,i,o,s),"left"===s?(i.top+=u[0],i.left-=u[1]):"right"===s?(i.top+=u[0],i.left+=u[1]):"top"===s?(i.left+=u[0],i.top-=u[1]):"bottom"===s&&(i.left+=u[0],i.top+=u[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||p(e.instance.popper);e.instance.reference===n&&(n=p(n));var r=q("transform"),a=e.instance.popper.style,i=a.top,o=a.left,s=a[r];a.top="",a.left="",a[r]="";var u=j(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);a.top=i,a.left=o,a[r]=s,t.boundaries=u;var c=t.priority,f=e.offsets.popper,d={primary:function(e){var n=f[e];return f[e]u[e]&&!t.escapeWithReference&&(r=Math.min(f[n],u[e]-("right"===e?f.width:f.height))),_({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";f=O({},f,d[t](e))})),e.offsets.popper=f,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,a=e.placement.split("-")[0],i=Math.floor,o=-1!==["top","bottom"].indexOf(a),s=o?"right":"bottom",u=o?"left":"top",c=o?"width":"height";return n[s]i(r[s])&&(e.offsets.popper[u]=i(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!$(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var a=e.placement.split("-")[0],i=e.offsets,s=i.popper,u=i.reference,c=-1!==["left","right"].indexOf(a),f=c?"height":"width",d=c?"Top":"Left",l=d.toLowerCase(),p=c?"left":"top",b=c?"bottom":"right",h=N(r)[f];u[b]-hs[b]&&(e.offsets.popper[l]+=u[l]+h-s[b]),e.offsets.popper=S(e.offsets.popper);var y=u[l]+u[f]/2-h/2,m=o(e.instance.popper),v=parseFloat(m["margin"+d]),g=parseFloat(m["border"+d+"Width"]),w=y-e.offsets.popper[l]-v-g;return w=Math.max(Math.min(s[f]-h,w),0),e.arrowElement=r,e.offsets.arrow=(_(n={},l,Math.round(w)),_(n,p,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(F(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=j(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],a=D(r),i=e.placement.split("-")[1]||"",o=[];switch(t.behavior){case ne:o=[r,a];break;case re:o=te(r);break;case ae:o=te(r,!0);break;default:o=t.behavior}return o.forEach((function(s,u){if(r!==s||o.length===u+1)return e;r=e.placement.split("-")[0],a=D(r);var c=e.offsets.popper,f=e.offsets.reference,d=Math.floor,l="left"===r&&d(c.right)>d(f.left)||"right"===r&&d(c.left)d(f.top)||"bottom"===r&&d(c.top)d(n.right),h=d(c.top)d(n.bottom),m="left"===r&&p||"right"===r&&b||"top"===r&&h||"bottom"===r&&y,v=-1!==["top","bottom"].indexOf(r),g=!!t.flipVariations&&(v&&"start"===i&&p||v&&"end"===i&&b||!v&&"start"===i&&h||!v&&"end"===i&&y),w=!!t.flipVariationsByContent&&(v&&"start"===i&&b||v&&"end"===i&&p||!v&&"start"===i&&y||!v&&"end"===i&&h),T=g||w;(l||m||T)&&(e.flipped=!0,(l||m)&&(r=o[u+1]),T&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=O({},e.offsets.popper,B(e.instance.popper,e.offsets.reference,e.placement)),e=L(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,a=r.popper,i=r.reference,o=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return a[o?"left":"top"]=i[n]-(s?a[o?"width":"height"]:0),e.placement=D(t),e.offsets.popper=S(a),e}},hide:{order:800,enabled:!0,fn:function(e){if(!$(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=U(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};T(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=a(this.update.bind(this)),this.options=O({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(O({},e.Defaults.modifiers,o.modifiers)).forEach((function(t){r.options.modifiers[t]=O({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return O({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&i(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return k(e,[{key:"update",value:function(){return z.call(this)}},{key:"destroy",value:function(){return H.call(this)}},{key:"enableEventListeners",value:function(){return K.call(this)}},{key:"disableEventListeners",value:function(){return G.call(this)}}]),e}();ue.Utils=("undefined"!==typeof window?window:e).PopperUtils,ue.placements=Q,ue.Defaults=se,t.a=ue}).call(this,n(35))},function(e,t,n){var r;!function(a){"use strict";var i,o=1e9,s={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},u=!0,c="[DecimalError] ",f=c+"Invalid argument: ",d=c+"Exponent out of range: ",l=Math.floor,p=Math.pow,b=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=1e7,y=9007199254740991,m=l(1286742750677284.5),v={};function g(e,t){var n,r,a,i,o,s,c,f,d=e.constructor,l=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),u?E(t,l):t;if(c=e.d,f=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a){for(i<0?(r=c,i=-i,s=f.length):(r=f,a=o,s=c.length),i>(s=(o=Math.ceil(l/7))>s?o+1:s+1)&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((s=c.length)-(i=f.length)<0&&(i=s,r=f,f=c,c=r),n=0;i;)n=(c[--i]=c[i]+f[i]+n)/h|0,c[i]%=h;for(n&&(c.unshift(n),++a),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=a,u?E(t,l):t}function w(e,t,n){if(e!==~~e||en)throw Error(f+e)}function T(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;te.e^i.s<0?1:-1;for(t=0,n=(r=i.d.length)<(a=e.d.length)?r:a;te.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1},v.decimalPlaces=v.dp=function(){var e=this,t=e.d.length-1,n=7*(t-e.e);if(t=e.d[t])for(;t%10==0;t/=10)n--;return n<0?0:n},v.dividedBy=v.div=function(e){return k(this,new this.constructor(e))},v.dividedToIntegerBy=v.idiv=function(e){var t=this.constructor;return E(k(this,new t(e),0,1),t.precision)},v.equals=v.eq=function(e){return!this.cmp(e)},v.exponent=function(){return O(this)},v.greaterThan=v.gt=function(e){return this.cmp(e)>0},v.greaterThanOrEqualTo=v.gte=function(e){return this.cmp(e)>=0},v.isInteger=v.isint=function(){return this.e>this.d.length-2},v.isNegative=v.isneg=function(){return this.s<0},v.isPositive=v.ispos=function(){return this.s>0},v.isZero=function(){return 0===this.s},v.lessThan=v.lt=function(e){return this.cmp(e)<0},v.lessThanOrEqualTo=v.lte=function(e){return this.cmp(e)<1},v.logarithm=v.log=function(e){var t,n=this,r=n.constructor,a=r.precision,o=a+5;if(void 0===e)e=new r(10);else if((e=new r(e)).s<1||e.eq(i))throw Error(c+"NaN");if(n.s<1)throw Error(c+(n.s?"NaN":"-Infinity"));return n.eq(i)?new r(0):(u=!1,t=k(A(n,o),A(e,o),o),u=!0,E(t,a))},v.minus=v.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?P(t,e):g(t,(e.s=-e.s,e))},v.modulo=v.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(!(e=new r(e)).s)throw Error(c+"NaN");return n.s?(u=!1,t=k(n,e,0,1).times(e),u=!0,n.minus(t)):E(new r(n),a)},v.naturalExponential=v.exp=function(){return _(this)},v.naturalLogarithm=v.ln=function(){return A(this)},v.negated=v.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},v.plus=v.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?g(t,e):P(t,(e.s=-e.s,e))},v.precision=v.sd=function(e){var t,n,r,a=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(f+e);if(t=O(a)+1,n=7*(r=a.d.length-1)+1,r=a.d[r]){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},v.squareRoot=v.sqrt=function(){var e,t,n,r,a,i,o,s=this,f=s.constructor;if(s.s<1){if(!s.s)return new f(0);throw Error(c+"NaN")}for(e=O(s),u=!1,0==(a=Math.sqrt(+s))||a==1/0?(((t=T(s.d)).length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=l((e+1)/2)-(e<0||e%2),r=new f(t=a==1/0?"5e"+e:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new f(a.toString()),a=o=(n=f.precision)+3;;)if(r=(i=r).plus(k(s,i,o+2)).times(.5),T(i.d).slice(0,o)===(t=T(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&"4999"==t){if(E(i,n+1,0),i.times(i).eq(s)){r=i;break}}else if("9999"!=t)break;o+=4}return u=!0,E(r,n)},v.times=v.mul=function(e){var t,n,r,a,i,o,s,c,f,d=this,l=d.constructor,p=d.d,b=(e=new l(e)).d;if(!d.s||!e.s)return new l(0);for(e.s*=d.s,n=d.e+e.e,(c=p.length)<(f=b.length)&&(i=p,p=b,b=i,o=c,c=f,f=o),i=[],r=o=c+f;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,a=c+r;a>r;)s=i[a]+b[r]*p[a-r-1]+t,i[a--]=s%h|0,t=s/h|0;i[a]=(i[a]+t)%h|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,u?E(e,l.precision):e},v.toDecimalPlaces=v.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(w(e,0,o),void 0===t?t=r.rounding:w(t,0,8),E(n,e+O(n)+1,t))},v.toExponential=function(e,t){var n,r=this,a=r.constructor;return void 0===e?n=j(r,!0):(w(e,0,o),void 0===t?t=a.rounding:w(t,0,8),n=j(r=E(new a(r),e+1,t),!0,e+1)),n},v.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return void 0===e?j(a):(w(e,0,o),void 0===t?t=i.rounding:w(t,0,8),n=j((r=E(new i(a),e+O(a)+1,t)).abs(),!1,e+O(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)},v.toInteger=v.toint=function(){var e=this,t=e.constructor;return E(new t(e),O(e)+1,t.rounding)},v.toNumber=function(){return+this},v.toPower=v.pow=function(e){var t,n,r,a,o,s,f=this,d=f.constructor,p=+(e=new d(e));if(!e.s)return new d(i);if(!(f=new d(f)).s){if(e.s<1)throw Error(c+"Infinity");return f}if(f.eq(i))return f;if(r=d.precision,e.eq(i))return E(f,r);if(s=(t=e.e)>=(n=e.d.length-1),o=f.s,s){if((n=p<0?-p:p)<=y){for(a=new d(i),t=Math.ceil(r/7+4),u=!1;n%2&&I((a=a.times(f)).d,t),0!==(n=l(n/2));)I((f=f.times(f)).d,t);return u=!0,e.s<0?new d(i).div(a):E(a,r)}}else if(o<0)throw Error(c+"NaN");return o=o<0&&1&e.d[Math.max(t,n)]?-1:1,f.s=1,u=!1,a=e.times(A(f,r+12)),u=!0,(a=_(a)).s=o,a},v.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return void 0===e?r=j(a,(n=O(a))<=i.toExpNeg||n>=i.toExpPos):(w(e,1,o),void 0===t?t=i.rounding:w(t,0,8),r=j(a=E(new i(a),e,t),e<=(n=O(a))||n<=i.toExpNeg,e)),r},v.toSignificantDigits=v.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(w(e,1,o),void 0===t?t=n.rounding:w(t,0,8)),E(new n(this),e,t)},v.toString=v.valueOf=v.val=v.toJSON=function(){var e=this,t=O(e),n=e.constructor;return j(e,t<=n.toExpNeg||t>=n.toExpPos)};var k=function(){function e(e,t){var n,r=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+r,e[a]=n%h|0,r=n/h|0;return r&&e.unshift(r),e}function t(e,t,n,r){var a,i;if(n!=r)i=n>r?1:-1;else for(a=i=0;at[a]?1:-1;break}return i}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]1;)e.shift()}return function(r,a,i,o){var s,u,f,d,l,p,b,y,m,v,g,w,T,k,_,S,x,A,M=r.constructor,P=r.s==a.s?1:-1,j=r.d,I=a.d;if(!r.s)return new M(r);if(!a.s)throw Error(c+"Division by zero");for(u=r.e-a.e,x=I.length,_=j.length,y=(b=new M(P)).d=[],f=0;I[f]==(j[f]||0);)++f;if(I[f]>(j[f]||0)&&--u,(w=null==i?i=M.precision:o?i+(O(r)-O(a))+1:i)<0)return new M(0);if(w=w/7+2|0,f=0,1==x)for(d=0,I=I[0],w++;(f<_||d)&&w--;f++)T=d*h+(j[f]||0),y[f]=T/I|0,d=T%I|0;else{for((d=h/(I[0]+1)|0)>1&&(I=e(I,d),j=e(j,d),x=I.length,_=j.length),k=x,v=(m=j.slice(0,x)).length;v=h/2&&++S;do{d=0,(s=t(I,m,x,v))<0?(g=m[0],x!=v&&(g=g*h+(m[1]||0)),(d=g/S|0)>1?(d>=h&&(d=h-1),1==(s=t(l=e(I,d),m,p=l.length,v=m.length))&&(d--,n(l,x16)throw Error(d+O(e));if(!e.s)return new l(i);for(null==t?(u=!1,s=b):s=t,o=new l(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(s+=Math.log(p(2,f))/Math.LN10*2+5|0,n=r=a=new l(i),l.precision=s;;){if(r=E(r.times(e),s),n=n.times(++c),T((o=a.plus(k(r,n,s))).d).slice(0,s)===T(a.d).slice(0,s)){for(;f--;)a=E(a.times(a),s);return l.precision=b,null==t?(u=!0,E(a,b)):a}a=o}}function O(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function S(e,t,n){if(t>e.LN10.sd())throw u=!0,n&&(e.precision=n),Error(c+"LN10 precision limit exceeded");return E(new e(e.LN10),t)}function x(e){for(var t="";e--;)t+="0";return t}function A(e,t){var n,r,a,o,s,f,d,l,p,b=1,h=e,y=h.d,m=h.constructor,v=m.precision;if(h.s<1)throw Error(c+(h.s?"NaN":"-Infinity"));if(h.eq(i))return new m(0);if(null==t?(u=!1,l=v):l=t,h.eq(10))return null==t&&(u=!0),S(m,l);if(l+=10,m.precision=l,r=(n=T(y)).charAt(0),o=O(h),!(Math.abs(o)<15e14))return d=S(m,l+2,v).times(o+""),h=A(new m(r+"."+n.slice(1)),l-10).plus(d),m.precision=v,null==t?(u=!0,E(h,v)):h;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=T((h=h.times(e)).d)).charAt(0),b++;for(o=O(h),r>1?(h=new m("0."+n),o++):h=new m(r+"."+n.slice(1)),f=s=h=k(h.minus(i),h.plus(i),l),p=E(h.times(h),l),a=3;;){if(s=E(s.times(p),l),T((d=f.plus(k(s,new m(a),l))).d).slice(0,l)===T(f.d).slice(0,l))return f=f.times(2),0!==o&&(f=f.plus(S(m,l+2,v).times(o+""))),f=k(f,new m(b),l),m.precision=v,null==t?(u=!0,E(f,v)):f;f=d,a+=2}}function M(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(a=t.length;48===t.charCodeAt(a-1);)--a;if(t=t.slice(r,a)){if(a-=r,n=n-r-1,e.e=l(n/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),rm||e.e<-m))throw Error(d+n)}else e.s=0,e.e=0,e.d=[0];return e}function E(e,t,n){var r,a,i,o,s,c,f,b,y=e.d;for(o=1,i=y[0];i>=10;i/=10)o++;if((r=t-o)<0)r+=7,a=t,f=y[b=0];else{if((b=Math.ceil((r+1)/7))>=(i=y.length))return e;for(f=i=y[b],o=1;i>=10;i/=10)o++;a=(r%=7)-7+o}if(void 0!==n&&(s=f/(i=p(10,o-a-1))%10|0,c=t<0||void 0!==y[b+1]||f%i,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?a>0?f/p(10,o-a):0:y[b-1])%10&1||n==(e.s<0?8:7))),t<1||!y[0])return c?(i=O(e),y.length=1,t=t-i-1,y[0]=p(10,(7-t%7)%7),e.e=l(-t/7)||0):(y.length=1,y[0]=e.e=e.s=0),e;if(0==r?(y.length=b,i=1,b--):(y.length=b+1,i=p(10,7-r),y[b]=a>0?(f/p(10,o-a)%p(10,a)|0)*i:0),c)for(;;){if(0==b){(y[0]+=i)==h&&(y[0]=1,++e.e);break}if(y[b]+=i,y[b]!=h)break;y[b--]=0,i=1}for(r=y.length;0===y[--r];)y.pop();if(u&&(e.e>m||e.e<-m))throw Error(d+O(e));return e}function P(e,t){var n,r,a,i,o,s,c,f,d,l,p=e.constructor,b=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),u?E(t,b):t;if(c=e.d,l=t.d,r=t.e,f=e.e,c=c.slice(),o=f-r){for((d=o<0)?(n=c,o=-o,s=l.length):(n=l,r=f,s=c.length),o>(a=Math.max(Math.ceil(b/7),s)+2)&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for((d=(a=c.length)<(s=l.length))&&(s=a),a=0;a0;--a)c[s++]=0;for(a=l.length;a>o;){if(c[--a]0?i=i.charAt(0)+"."+i.slice(1)+x(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+x(-a-1)+i,n&&(r=n-o)>0&&(i+=x(r))):a>=o?(i+=x(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+x(r))):((r=a+1)0&&(a+1===o&&(i+="."),i+=x(r))),e.s<0?"-"+i:i}function I(e,t){if(e.length>t)return e.length=t,!0}function C(e){if(!e||"object"!==typeof e)throw Error(c+"Object expected");var t,n,r,a=["precision",1,o,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t=a[t+1]&&r<=a[t+2]))throw Error(f+n+": "+r);this[n]=r}if(void 0!==(r=e[n="LN10"])){if(r!=Math.LN10)throw Error(f+n+": "+r);this[n]=new this(r)}return this}s=function e(t){var n,r,a;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i)return t.s=e.s,t.e=e.e,void(t.d=(e=e.d)?e.slice():e);if("number"===typeof e){if(0*e!==0)throw Error(f+e);if(e>0)t.s=1;else{if(!(e<0))return t.s=0,t.e=0,void(t.d=[0]);e=-e,t.s=-1}return e===~~e&&e<1e7?(t.e=0,void(t.d=[e])):M(t,e.toString())}if("string"!==typeof e)throw Error(f+e);if(45===e.charCodeAt(0)?(e=e.slice(1),t.s=-1):t.s=1,!b.test(e))throw Error(f+e);M(t,e)}if(i.prototype=v,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=e,i.config=i.set=C,void 0===t&&(t={}),t)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n0?r:e)-c/100).concat(i,")")},between:l,only:function(e){return l(e,e)},width:function(e){return n[e]}},f)}function c(e,t,n){var a;return Object(o.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),Object(o.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(o.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(a={minHeight:56},Object(r.a)(a,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(a,e.up("sm"),{minHeight:64}),a)},n)}var f=n(414),d={black:"#000",white:"#fff"},l={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},p={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},b={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},h={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},y={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},m={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},v={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},g=n(62),w={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:d.white,default:l[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},T={text:{primary:d.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:l[800],default:"#303030"},action:{active:d.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function k(e,t,n,r){var a=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(g.e)(e.main,a):"dark"===t&&(e.dark=Object(g.b)(e.main,i)))}function _(e){var t=e.primary,n=void 0===t?{light:p[300],main:p[500],dark:p[700]}:t,r=e.secondary,s=void 0===r?{light:b.A200,main:b.A400,dark:b.A700}:r,u=e.error,c=void 0===u?{light:h[300],main:h[500],dark:h[700]}:u,_=e.warning,O=void 0===_?{light:y[300],main:y[500],dark:y[700]}:_,S=e.info,x=void 0===S?{light:m[300],main:m[500],dark:m[700]}:S,A=e.success,M=void 0===A?{light:v[300],main:v[500],dark:v[700]}:A,E=e.type,P=void 0===E?"light":E,j=e.contrastThreshold,I=void 0===j?3:j,C=e.tonalOffset,R=void 0===C?.2:C,N=Object(a.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function D(e){return Object(g.d)(e,T.text.primary)>=I?T.text.primary:w.text.primary}var B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(o.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(f.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(f.a)(5,JSON.stringify(e.main)));return k(e,"light",n,R),k(e,"dark",r,R),e.contrastText||(e.contrastText=D(e.main)),e},U={dark:T,light:w};return Object(i.a)(Object(o.a)({common:d,type:P,primary:B(n),secondary:B(s,"A400","A200","A700"),error:B(c),warning:B(O),info:B(x),success:B(M),grey:l,contrastThreshold:I,getContrastText:D,augmentColor:B,tonalOffset:R},U[P]),N)}function O(e){return Math.round(1e5*e)/1e5}function S(e){return O(e)}var x={textTransform:"uppercase"},A='"Roboto", "Helvetica", "Arial", sans-serif';function M(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?A:r,u=n.fontSize,c=void 0===u?14:u,f=n.fontWeightLight,d=void 0===f?300:f,l=n.fontWeightRegular,p=void 0===l?400:l,b=n.fontWeightMedium,h=void 0===b?500:b,y=n.fontWeightBold,m=void 0===y?700:y,v=n.htmlFontSize,g=void 0===v?16:v,w=n.allVariants,T=n.pxToRem,k=Object(a.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var _=c/14,M=T||function(e){return"".concat(e/g*_,"rem")},E=function(e,t,n,r,a){return Object(o.a)({fontFamily:s,fontWeight:e,fontSize:M(t),lineHeight:n},s===A?{letterSpacing:"".concat(O(r/t),"em")}:{},a,w)},P={h1:E(d,96,1.167,-1.5),h2:E(d,60,1.2,-.5),h3:E(p,48,1.167,0),h4:E(p,34,1.235,.25),h5:E(p,24,1.334,0),h6:E(h,20,1.6,.15),subtitle1:E(p,16,1.75,.15),subtitle2:E(h,14,1.57,.1),body1:E(p,16,1.5,.15),body2:E(p,14,1.43,.15),button:E(h,14,1.75,.4,x),caption:E(p,12,1.66,.4),overline:E(p,12,2.66,1,x)};return Object(i.a)(Object(o.a)({htmlFontSize:g,pxToRem:M,round:S,fontFamily:s,fontSize:c,fontWeightLight:d,fontWeightRegular:p,fontWeightMedium:h,fontWeightBold:m},P),k,{clone:!1})}function E(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var P=["none",E(0,2,1,-1,0,1,1,0,0,1,3,0),E(0,3,1,-2,0,2,2,0,0,1,5,0),E(0,3,3,-2,0,3,4,0,0,1,8,0),E(0,2,4,-1,0,4,5,0,0,1,10,0),E(0,3,5,-1,0,5,8,0,0,1,14,0),E(0,3,5,-1,0,6,10,0,0,1,18,0),E(0,4,5,-2,0,7,10,1,0,2,16,1),E(0,5,5,-3,0,8,10,1,0,3,14,2),E(0,5,6,-3,0,9,12,1,0,3,16,2),E(0,6,6,-3,0,10,14,1,0,4,18,3),E(0,6,7,-4,0,11,15,1,0,4,20,3),E(0,7,8,-4,0,12,17,2,0,5,22,4),E(0,7,8,-4,0,13,19,2,0,5,24,4),E(0,7,9,-4,0,14,21,2,0,5,26,4),E(0,8,9,-5,0,15,22,2,0,6,28,5),E(0,8,10,-5,0,16,24,2,0,6,30,5),E(0,8,11,-5,0,17,26,2,0,6,32,5),E(0,9,11,-5,0,18,28,2,0,7,34,6),E(0,9,12,-6,0,19,29,2,0,7,36,6),E(0,10,13,-6,0,20,31,3,0,8,38,7),E(0,10,13,-6,0,21,33,3,0,8,40,7),E(0,10,14,-6,0,22,35,3,0,8,42,7),E(0,11,14,-7,0,23,36,3,0,9,44,8),E(0,11,15,-7,0,24,38,3,0,9,46,8)],j={borderRadius:4},I=n(28),C=(n(40),n(110));var R=function(e,t){return t?Object(i.a)(e,t,{clone:!1}):e},N={xs:0,sm:600,md:960,lg:1280,xl:1920},D={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(N[e],"px)")}};var B={m:"margin",p:"padding"},U={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},L={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},z=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!L[e])return[e];e=L[e]}var t=e.split(""),n=Object(I.a)(t,2),r=n[0],a=n[1],i=B[r],o=U[a]||"";return Array.isArray(o)?o.map((function(e){return i+e})):[i+o]})),F=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function q(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function H(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function J(e){var t=q(e.theme);return Object.keys(e).map((function(n){if(-1===F.indexOf(n))return null;var r=H(z(n),t),a=e[n];return function(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||D;return t.reduce((function(e,a,i){return e[r.up(r.keys[i])]=n(t[i]),e}),{})}if("object"===Object(C.a)(t)){var a=e.theme.breakpoints||D;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}(e,a,r)})).reduce(R,{})}J.propTypes={},J.filterProps=F;function V(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=q({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,o=void 0===r?{}:r,s=e.palette,f=void 0===s?{}:s,d=e.spacing,l=e.typography,p=void 0===l?{}:l,b=Object(a.a)(e,["breakpoints","mixins","palette","spacing","typography"]),h=_(f),y=u(n),m=V(d),v=Object(i.a)({breakpoints:y,direction:"ltr",mixins:c(y,m,o),overrides:{},palette:h,props:{},shadows:P,typography:M(h,p),spacing:m,shape:j,transitions:W.a,zIndex:K.a},b),g=arguments.length,w=new Array(g>1?g-1:0),T=1;T

\n *   'processed': Query the most recent block which has reached 1 confirmation by the connected node\n *   'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n *   'finalized': Query the most recent block which has been finalized by the cluster\n * 
\n */\nexport type Commitment =\n | 'processed'\n | 'confirmed'\n | 'finalized'\n | 'recent' // Deprecated as of v1.5.5\n | 'single' // Deprecated as of v1.5.5\n | 'singleGossip' // Deprecated as of v1.5.5\n | 'root' // Deprecated as of v1.5.5\n | 'max'; // Deprecated as of v1.5.5\n\n/**\n * A subset of Commitment levels, which are at least optimistically confirmed\n *
\n *   'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n *   'finalized': Query the most recent block which has been finalized by the cluster\n * 
\n */\nexport type Finality = 'confirmed' | 'finalized';\n\n/**\n * Filter for largest accounts query\n *
\n *   'circulating':    Return the largest accounts that are part of the circulating supply\n *   'nonCirculating': Return the largest accounts that are not part of the circulating supply\n * 
\n */\nexport type LargestAccountsFilter = 'circulating' | 'nonCirculating';\n\n/**\n * Configuration object for changing `getLargestAccounts` query behavior\n */\nexport type GetLargestAccountsConfig = {\n /** The level of commitment desired */\n commitment?: Commitment;\n /** Filter largest accounts by whether they are part of the circulating supply */\n filter?: LargestAccountsFilter;\n};\n\n/**\n * Configuration object for changing `getSupply` request behavior\n */\nexport type GetSupplyConfig = {\n /** The level of commitment desired */\n commitment?: Commitment;\n /** Exclude non circulating accounts list from response */\n excludeNonCirculatingAccountsList?: boolean;\n};\n\n/**\n * Configuration object for changing query behavior\n */\nexport type SignatureStatusConfig = {\n /** enable searching status history, not needed for recent transactions */\n searchTransactionHistory: boolean;\n};\n\n/**\n * Information describing a cluster node\n */\nexport type ContactInfo = {\n /** Identity public key of the node */\n pubkey: string;\n /** Gossip network address for the node */\n gossip: string | null;\n /** TPU network address for the node (null if not available) */\n tpu: string | null;\n /** JSON RPC network address for the node (null if not available) */\n rpc: string | null;\n /** Software version of the node (null if not available) */\n version: string | null;\n};\n\n/**\n * Information describing a vote account\n */\nexport type VoteAccountInfo = {\n /** Public key of the vote account */\n votePubkey: string;\n /** Identity public key of the node voting with this account */\n nodePubkey: string;\n /** The stake, in lamports, delegated to this vote account and activated */\n activatedStake: number;\n /** Whether the vote account is staked for this epoch */\n epochVoteAccount: boolean;\n /** Recent epoch voting credit history for this voter */\n epochCredits: Array<[number, number, number]>;\n /** A percentage (0-100) of rewards payout owed to the voter */\n commission: number;\n /** Most recent slot voted on by this vote account */\n lastVote: number;\n};\n\n/**\n * A collection of cluster vote accounts\n */\nexport type VoteAccountStatus = {\n /** Active vote accounts */\n current: Array;\n /** Inactive vote accounts */\n delinquent: Array;\n};\n\n/**\n * Network Inflation\n * (see https://docs.solana.com/implemented-proposals/ed_overview)\n */\nexport type InflationGovernor = {\n foundation: number;\n foundationTerm: number;\n initial: number;\n taper: number;\n terminal: number;\n};\n\nconst GetInflationGovernorResult = pick({\n foundation: number(),\n foundationTerm: number(),\n initial: number(),\n taper: number(),\n terminal: number(),\n});\n\n/**\n * The inflation reward for an epoch\n */\nexport type InflationReward = {\n /** epoch for which the reward occurs */\n epoch: number;\n /** the slot in which the rewards are effective */\n effectiveSlot: number;\n /** reward amount in lamports */\n amount: number;\n /** post balance of the account in lamports */\n postBalance: number;\n};\n\n/**\n * Expected JSON RPC response for the \"getInflationReward\" message\n */\nconst GetInflationRewardResult = jsonRpcResult(\n array(\n nullable(\n pick({\n epoch: number(),\n effectiveSlot: number(),\n amount: number(),\n postBalance: number(),\n }),\n ),\n ),\n);\n\n/**\n * Information about the current epoch\n */\nexport type EpochInfo = {\n epoch: number;\n slotIndex: number;\n slotsInEpoch: number;\n absoluteSlot: number;\n blockHeight?: number;\n transactionCount?: number;\n};\n\nconst GetEpochInfoResult = pick({\n epoch: number(),\n slotIndex: number(),\n slotsInEpoch: number(),\n absoluteSlot: number(),\n blockHeight: optional(number()),\n transactionCount: optional(number()),\n});\n\nconst GetEpochScheduleResult = pick({\n slotsPerEpoch: number(),\n leaderScheduleSlotOffset: number(),\n warmup: boolean(),\n firstNormalEpoch: number(),\n firstNormalSlot: number(),\n});\n\n/**\n * Leader schedule\n * (see https://docs.solana.com/terminology#leader-schedule)\n */\nexport type LeaderSchedule = {\n [address: string]: number[];\n};\n\nconst GetLeaderScheduleResult = record(string(), array(number()));\n\n/**\n * Transaction error or null\n */\nconst TransactionErrorResult = nullable(union([pick({}), string()]));\n\n/**\n * Signature status for a transaction\n */\nconst SignatureStatusResult = pick({\n err: TransactionErrorResult,\n});\n\n/**\n * Transaction signature received notification\n */\nconst SignatureReceivedResult = literal('receivedSignature');\n\n/**\n * Version info for a node\n */\nexport type Version = {\n /** Version of solana-core */\n 'solana-core': string;\n 'feature-set'?: number;\n};\n\nconst VersionResult = pick({\n 'solana-core': string(),\n 'feature-set': optional(number()),\n});\n\nexport type SimulatedTransactionAccountInfo = {\n /** `true` if this account's data contains a loaded program */\n executable: boolean;\n /** Identifier of the program that owns the account */\n owner: string;\n /** Number of lamports assigned to the account */\n lamports: number;\n /** Optional data assigned to the account */\n data: string[];\n /** Optional rent epoch info for account */\n rentEpoch?: number;\n};\n\nexport type SimulatedTransactionResponse = {\n err: TransactionError | string | null;\n logs: Array | null;\n accounts?: SimulatedTransactionAccountInfo[] | null;\n unitsConsumed?: number;\n};\n\nconst SimulatedTransactionResponseStruct = jsonRpcResultAndContext(\n pick({\n err: nullable(union([pick({}), string()])),\n logs: nullable(array(string())),\n accounts: optional(\n nullable(\n array(\n pick({\n executable: boolean(),\n owner: string(),\n lamports: number(),\n data: array(string()),\n rentEpoch: optional(number()),\n }),\n ),\n ),\n ),\n unitsConsumed: optional(number()),\n }),\n);\n\nexport type ParsedInnerInstruction = {\n index: number;\n instructions: (ParsedInstruction | PartiallyDecodedInstruction)[];\n};\n\nexport type TokenBalance = {\n accountIndex: number;\n mint: string;\n uiTokenAmount: TokenAmount;\n};\n\n/**\n * Metadata for a parsed confirmed transaction on the ledger\n */\nexport type ParsedConfirmedTransactionMeta = {\n /** The fee charged for processing the transaction */\n fee: number;\n /** An array of cross program invoked parsed instructions */\n innerInstructions?: ParsedInnerInstruction[] | null;\n /** The balances of the transaction accounts before processing */\n preBalances: Array;\n /** The balances of the transaction accounts after processing */\n postBalances: Array;\n /** An array of program log messages emitted during a transaction */\n logMessages?: Array | null;\n /** The token balances of the transaction accounts before processing */\n preTokenBalances?: Array | null;\n /** The token balances of the transaction accounts after processing */\n postTokenBalances?: Array | null;\n /** The error result of transaction processing */\n err: TransactionError | null;\n};\n\nexport type CompiledInnerInstruction = {\n index: number;\n instructions: CompiledInstruction[];\n};\n\n/**\n * Metadata for a confirmed transaction on the ledger\n */\nexport type ConfirmedTransactionMeta = {\n /** The fee charged for processing the transaction */\n fee: number;\n /** An array of cross program invoked instructions */\n innerInstructions?: CompiledInnerInstruction[] | null;\n /** The balances of the transaction accounts before processing */\n preBalances: Array;\n /** The balances of the transaction accounts after processing */\n postBalances: Array;\n /** An array of program log messages emitted during a transaction */\n logMessages?: Array | null;\n /** The token balances of the transaction accounts before processing */\n preTokenBalances?: Array | null;\n /** The token balances of the transaction accounts after processing */\n postTokenBalances?: Array | null;\n /** The error result of transaction processing */\n err: TransactionError | null;\n};\n\n/**\n * A processed transaction from the RPC API\n */\nexport type TransactionResponse = {\n /** The slot during which the transaction was processed */\n slot: number;\n /** The transaction */\n transaction: {\n /** The transaction message */\n message: Message;\n /** The transaction signatures */\n signatures: string[];\n };\n /** Metadata produced from the transaction */\n meta: ConfirmedTransactionMeta | null;\n /** The unix timestamp of when the transaction was processed */\n blockTime?: number | null;\n};\n\n/**\n * A confirmed transaction on the ledger\n */\nexport type ConfirmedTransaction = {\n /** The slot during which the transaction was processed */\n slot: number;\n /** The details of the transaction */\n transaction: Transaction;\n /** Metadata produced from the transaction */\n meta: ConfirmedTransactionMeta | null;\n /** The unix timestamp of when the transaction was processed */\n blockTime?: number | null;\n};\n\n/**\n * A partially decoded transaction instruction\n */\nexport type PartiallyDecodedInstruction = {\n /** Program id called by this instruction */\n programId: PublicKey;\n /** Public keys of accounts passed to this instruction */\n accounts: Array;\n /** Raw base-58 instruction data */\n data: string;\n};\n\n/**\n * A parsed transaction message account\n */\nexport type ParsedMessageAccount = {\n /** Public key of the account */\n pubkey: PublicKey;\n /** Indicates if the account signed the transaction */\n signer: boolean;\n /** Indicates if the account is writable for this transaction */\n writable: boolean;\n};\n\n/**\n * A parsed transaction instruction\n */\nexport type ParsedInstruction = {\n /** Name of the program for this instruction */\n program: string;\n /** ID of the program for this instruction */\n programId: PublicKey;\n /** Parsed instruction info */\n parsed: any;\n};\n\n/**\n * A parsed transaction message\n */\nexport type ParsedMessage = {\n /** Accounts used in the instructions */\n accountKeys: ParsedMessageAccount[];\n /** The atomically executed instructions for the transaction */\n instructions: (ParsedInstruction | PartiallyDecodedInstruction)[];\n /** Recent blockhash */\n recentBlockhash: string;\n};\n\n/**\n * A parsed transaction\n */\nexport type ParsedTransaction = {\n /** Signatures for the transaction */\n signatures: Array;\n /** Message of the transaction */\n message: ParsedMessage;\n};\n\n/**\n * A parsed and confirmed transaction on the ledger\n */\nexport type ParsedConfirmedTransaction = {\n /** The slot during which the transaction was processed */\n slot: number;\n /** The details of the transaction */\n transaction: ParsedTransaction;\n /** Metadata produced from the transaction */\n meta: ParsedConfirmedTransactionMeta | null;\n /** The unix timestamp of when the transaction was processed */\n blockTime?: number | null;\n};\n\n/**\n * A processed block fetched from the RPC API\n */\nexport type BlockResponse = {\n /** Blockhash of this block */\n blockhash: Blockhash;\n /** Blockhash of this block's parent */\n previousBlockhash: Blockhash;\n /** Slot index of this block's parent */\n parentSlot: number;\n /** Vector of transactions with status meta and original message */\n transactions: Array<{\n /** The transaction */\n transaction: {\n /** The transaction message */\n message: Message;\n /** The transaction signatures */\n signatures: string[];\n };\n /** Metadata produced from the transaction */\n meta: ConfirmedTransactionMeta | null;\n }>;\n /** Vector of block rewards */\n rewards?: Array<{\n /** Public key of reward recipient */\n pubkey: string;\n /** Reward value in lamports */\n lamports: number;\n /** Account balance after reward is applied */\n postBalance: number | null;\n /** Type of reward received */\n rewardType: string | null;\n }>;\n /** The unix timestamp of when the block was processed */\n blockTime: number | null;\n};\n\n/**\n * A ConfirmedBlock on the ledger\n */\nexport type ConfirmedBlock = {\n /** Blockhash of this block */\n blockhash: Blockhash;\n /** Blockhash of this block's parent */\n previousBlockhash: Blockhash;\n /** Slot index of this block's parent */\n parentSlot: number;\n /** Vector of transactions and status metas */\n transactions: Array<{\n transaction: Transaction;\n meta: ConfirmedTransactionMeta | null;\n }>;\n /** Vector of block rewards */\n rewards?: Array<{\n pubkey: string;\n lamports: number;\n postBalance: number | null;\n rewardType: string | null;\n }>;\n /** The unix timestamp of when the block was processed */\n blockTime: number | null;\n};\n\n/**\n * A ConfirmedBlock on the ledger with signatures only\n */\nexport type ConfirmedBlockSignatures = {\n /** Blockhash of this block */\n blockhash: Blockhash;\n /** Blockhash of this block's parent */\n previousBlockhash: Blockhash;\n /** Slot index of this block's parent */\n parentSlot: number;\n /** Vector of signatures */\n signatures: Array;\n /** The unix timestamp of when the block was processed */\n blockTime: number | null;\n};\n\n/**\n * A performance sample\n */\nexport type PerfSample = {\n /** Slot number of sample */\n slot: number;\n /** Number of transactions in a sample window */\n numTransactions: number;\n /** Number of slots in a sample window */\n numSlots: number;\n /** Sample window in seconds */\n samplePeriodSecs: number;\n};\n\nfunction createRpcClient(\n url: string,\n useHttps: boolean,\n httpHeaders?: HttpHeaders,\n fetchMiddleware?: FetchMiddleware,\n disableRetryOnRateLimit?: boolean,\n): RpcClient {\n let agentManager: AgentManager | undefined;\n if (!process.env.BROWSER) {\n agentManager = new AgentManager(useHttps);\n }\n\n let fetchWithMiddleware: (url: string, options: any) => Promise;\n\n if (fetchMiddleware) {\n fetchWithMiddleware = (url: string, options: any) => {\n return new Promise((resolve, reject) => {\n fetchMiddleware(url, options, async (url: string, options: any) => {\n try {\n resolve(await fetch(url, options));\n } catch (error) {\n reject(error);\n }\n });\n });\n };\n }\n\n const clientBrowser = new RpcClient(async (request, callback) => {\n const agent = agentManager ? agentManager.requestStart() : undefined;\n const options = {\n method: 'POST',\n body: request,\n agent,\n headers: Object.assign(\n {\n 'Content-Type': 'application/json',\n },\n httpHeaders || {},\n ),\n };\n\n try {\n let too_many_requests_retries = 5;\n let res: Response;\n let waitTime = 500;\n for (;;) {\n if (fetchWithMiddleware) {\n res = await fetchWithMiddleware(url, options);\n } else {\n res = await fetch(url, options);\n }\n\n if (res.status !== 429 /* Too many requests */) {\n break;\n }\n if (disableRetryOnRateLimit === true) {\n break;\n }\n too_many_requests_retries -= 1;\n if (too_many_requests_retries === 0) {\n break;\n }\n console.log(\n `Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`,\n );\n await sleep(waitTime);\n waitTime *= 2;\n }\n\n const text = await res.text();\n if (res.ok) {\n callback(null, text);\n } else {\n callback(new Error(`${res.status} ${res.statusText}: ${text}`));\n }\n } catch (err) {\n if (err instanceof Error) callback(err);\n } finally {\n agentManager && agentManager.requestEnd();\n }\n }, {});\n\n return clientBrowser;\n}\n\nfunction createRpcRequest(client: RpcClient): RpcRequest {\n return (method, args) => {\n return new Promise((resolve, reject) => {\n client.request(method, args, (err: any, response: any) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\nfunction createRpcBatchRequest(client: RpcClient): RpcBatchRequest {\n return (requests: RpcParams[]) => {\n return new Promise((resolve, reject) => {\n // Do nothing if requests is empty\n if (requests.length === 0) resolve([]);\n\n const batch = requests.map((params: RpcParams) => {\n return client.request(params.methodName, params.args);\n });\n\n client.request(batch, (err: any, response: any) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\n/**\n * Expected JSON RPC response for the \"getInflationGovernor\" message\n */\nconst GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochInfo\" message\n */\nconst GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochSchedule\" message\n */\nconst GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"getLeaderSchedule\" message\n */\nconst GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"minimumLedgerSlot\" and \"getFirstAvailableBlock\" messages\n */\nconst SlotRpcResult = jsonRpcResult(number());\n\n/**\n * Supply\n */\nexport type Supply = {\n /** Total supply in lamports */\n total: number;\n /** Circulating supply in lamports */\n circulating: number;\n /** Non-circulating supply in lamports */\n nonCirculating: number;\n /** List of non-circulating account addresses */\n nonCirculatingAccounts: Array;\n};\n\n/**\n * Expected JSON RPC response for the \"getSupply\" message\n */\nconst GetSupplyRpcResult = jsonRpcResultAndContext(\n pick({\n total: number(),\n circulating: number(),\n nonCirculating: number(),\n nonCirculatingAccounts: array(PublicKeyFromString),\n }),\n);\n\n/**\n * Token amount object which returns a token amount in different formats\n * for various client use cases.\n */\nexport type TokenAmount = {\n /** Raw amount of tokens as string ignoring decimals */\n amount: string;\n /** Number of decimals configured for token's mint */\n decimals: number;\n /** Token amount as float, accounts for decimals */\n uiAmount: number | null;\n /** Token amount as string, accounts for decimals */\n uiAmountString?: string;\n};\n\n/**\n * Expected JSON RPC structure for token amounts\n */\nconst TokenAmountResult = pick({\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string()),\n});\n\n/**\n * Token address and balance.\n */\nexport type TokenAccountBalancePair = {\n /** Address of the token account */\n address: PublicKey;\n /** Raw amount of tokens as string ignoring decimals */\n amount: string;\n /** Number of decimals configured for token's mint */\n decimals: number;\n /** Token amount as float, accounts for decimals */\n uiAmount: number | null;\n /** Token amount as string, accounts for decimals */\n uiAmountString?: string;\n};\n\n/**\n * Expected JSON RPC response for the \"getTokenLargestAccounts\" message\n */\nconst GetTokenLargestAccountsResult = jsonRpcResultAndContext(\n array(\n pick({\n address: PublicKeyFromString,\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string()),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message\n */\nconst GetTokenAccountsByOwner = jsonRpcResultAndContext(\n array(\n pick({\n pubkey: PublicKeyFromString,\n account: pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number(),\n }),\n }),\n ),\n);\n\nconst ParsedAccountDataResult = pick({\n program: string(),\n parsed: unknown(),\n space: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message with parsed data\n */\nconst GetParsedTokenAccountsByOwner = jsonRpcResultAndContext(\n array(\n pick({\n pubkey: PublicKeyFromString,\n account: pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedAccountDataResult,\n rentEpoch: number(),\n }),\n }),\n ),\n);\n\n/**\n * Pair of an account address and its balance\n */\nexport type AccountBalancePair = {\n address: PublicKey;\n lamports: number;\n};\n\n/**\n * Expected JSON RPC response for the \"getLargestAccounts\" message\n */\nconst GetLargestAccountsRpcResult = jsonRpcResultAndContext(\n array(\n pick({\n lamports: number(),\n address: PublicKeyFromString,\n }),\n ),\n);\n\n/**\n * @internal\n */\nconst AccountInfoResult = pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number(),\n});\n\n/**\n * @internal\n */\nconst KeyedAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult,\n});\n\nconst ParsedOrRawAccountData = coerce(\n union([instance(Buffer), ParsedAccountDataResult]),\n union([RawAccountDataResult, ParsedAccountDataResult]),\n value => {\n if (Array.isArray(value)) {\n return create(value, BufferFromRawAccountData);\n } else {\n return value;\n }\n },\n);\n\n/**\n * @internal\n */\nconst ParsedAccountInfoResult = pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedOrRawAccountData,\n rentEpoch: number(),\n});\n\nconst KeyedParsedAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: ParsedAccountInfoResult,\n});\n\n/**\n * @internal\n */\nconst StakeActivationResult = pick({\n state: union([\n literal('active'),\n literal('inactive'),\n literal('activating'),\n literal('deactivating'),\n ]),\n active: number(),\n inactive: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedSignaturesForAddress2\" message\n */\n\nconst GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(\n array(\n pick({\n signature: string(),\n slot: number(),\n err: TransactionErrorResult,\n memo: nullable(string()),\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getSignaturesForAddress\" message\n */\nconst GetSignaturesForAddressRpcResult = jsonRpcResult(\n array(\n pick({\n signature: string(),\n slot: number(),\n err: TransactionErrorResult,\n memo: nullable(string()),\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/***\n * Expected JSON RPC response for the \"accountNotification\" message\n */\nconst AccountNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(AccountInfoResult),\n});\n\n/**\n * @internal\n */\nconst ProgramAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult,\n});\n\n/***\n * Expected JSON RPC response for the \"programNotification\" message\n */\nconst ProgramAccountNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(ProgramAccountInfoResult),\n});\n\n/**\n * @internal\n */\nconst SlotInfoResult = pick({\n parent: number(),\n slot: number(),\n root: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"slotNotification\" message\n */\nconst SlotNotificationResult = pick({\n subscription: number(),\n result: SlotInfoResult,\n});\n\n/**\n * Slot updates which can be used for tracking the live progress of a cluster.\n * - `\"firstShredReceived\"`: connected node received the first shred of a block.\n * Indicates that a new block that is being produced.\n * - `\"completed\"`: connected node has received all shreds of a block. Indicates\n * a block was recently produced.\n * - `\"optimisticConfirmation\"`: block was optimistically confirmed by the\n * cluster. It is not guaranteed that an optimistic confirmation notification\n * will be sent for every finalized blocks.\n * - `\"root\"`: the connected node rooted this block.\n * - `\"createdBank\"`: the connected node has started validating this block.\n * - `\"frozen\"`: the connected node has validated this block.\n * - `\"dead\"`: the connected node failed to validate this block.\n */\nexport type SlotUpdate =\n | {\n type: 'firstShredReceived';\n slot: number;\n timestamp: number;\n }\n | {\n type: 'completed';\n slot: number;\n timestamp: number;\n }\n | {\n type: 'createdBank';\n slot: number;\n timestamp: number;\n parent: number;\n }\n | {\n type: 'frozen';\n slot: number;\n timestamp: number;\n stats: {\n numTransactionEntries: number;\n numSuccessfulTransactions: number;\n numFailedTransactions: number;\n maxTransactionsPerEntry: number;\n };\n }\n | {\n type: 'dead';\n slot: number;\n timestamp: number;\n err: string;\n }\n | {\n type: 'optimisticConfirmation';\n slot: number;\n timestamp: number;\n }\n | {\n type: 'root';\n slot: number;\n timestamp: number;\n };\n\n/**\n * @internal\n */\nconst SlotUpdateResult = union([\n pick({\n type: union([\n literal('firstShredReceived'),\n literal('completed'),\n literal('optimisticConfirmation'),\n literal('root'),\n ]),\n slot: number(),\n timestamp: number(),\n }),\n pick({\n type: literal('createdBank'),\n parent: number(),\n slot: number(),\n timestamp: number(),\n }),\n pick({\n type: literal('frozen'),\n slot: number(),\n timestamp: number(),\n stats: pick({\n numTransactionEntries: number(),\n numSuccessfulTransactions: number(),\n numFailedTransactions: number(),\n maxTransactionsPerEntry: number(),\n }),\n }),\n pick({\n type: literal('dead'),\n slot: number(),\n timestamp: number(),\n err: string(),\n }),\n]);\n\n/**\n * Expected JSON RPC response for the \"slotsUpdatesNotification\" message\n */\nconst SlotUpdateNotificationResult = pick({\n subscription: number(),\n result: SlotUpdateResult,\n});\n\n/**\n * Expected JSON RPC response for the \"signatureNotification\" message\n */\nconst SignatureNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(\n union([SignatureStatusResult, SignatureReceivedResult]),\n ),\n});\n\n/**\n * Expected JSON RPC response for the \"rootNotification\" message\n */\nconst RootNotificationResult = pick({\n subscription: number(),\n result: number(),\n});\n\nconst ContactInfoResult = pick({\n pubkey: string(),\n gossip: nullable(string()),\n tpu: nullable(string()),\n rpc: nullable(string()),\n version: nullable(string()),\n});\n\nconst VoteAccountInfoResult = pick({\n votePubkey: string(),\n nodePubkey: string(),\n activatedStake: number(),\n epochVoteAccount: boolean(),\n epochCredits: array(tuple([number(), number(), number()])),\n commission: number(),\n lastVote: number(),\n rootSlot: nullable(number()),\n});\n\n/**\n * Expected JSON RPC response for the \"getVoteAccounts\" message\n */\nconst GetVoteAccounts = jsonRpcResult(\n pick({\n current: array(VoteAccountInfoResult),\n delinquent: array(VoteAccountInfoResult),\n }),\n);\n\nconst ConfirmationStatus = union([\n literal('processed'),\n literal('confirmed'),\n literal('finalized'),\n]);\n\nconst SignatureStatusResponse = pick({\n slot: number(),\n confirmations: nullable(number()),\n err: TransactionErrorResult,\n confirmationStatus: optional(ConfirmationStatus),\n});\n\n/**\n * Expected JSON RPC response for the \"getSignatureStatuses\" message\n */\nconst GetSignatureStatusesRpcResult = jsonRpcResultAndContext(\n array(nullable(SignatureStatusResponse)),\n);\n\n/**\n * Expected JSON RPC response for the \"getMinimumBalanceForRentExemption\" message\n */\nconst GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult(number());\n\nconst ConfirmedTransactionResult = pick({\n signatures: array(string()),\n message: pick({\n accountKeys: array(string()),\n header: pick({\n numRequiredSignatures: number(),\n numReadonlySignedAccounts: number(),\n numReadonlyUnsignedAccounts: number(),\n }),\n instructions: array(\n pick({\n accounts: array(number()),\n data: string(),\n programIdIndex: number(),\n }),\n ),\n recentBlockhash: string(),\n }),\n});\n\nconst ParsedInstructionResult = pick({\n parsed: unknown(),\n program: string(),\n programId: PublicKeyFromString,\n});\n\nconst RawInstructionResult = pick({\n accounts: array(PublicKeyFromString),\n data: string(),\n programId: PublicKeyFromString,\n});\n\nconst InstructionResult = union([\n RawInstructionResult,\n ParsedInstructionResult,\n]);\n\nconst UnknownInstructionResult = union([\n pick({\n parsed: unknown(),\n program: string(),\n programId: string(),\n }),\n pick({\n accounts: array(string()),\n data: string(),\n programId: string(),\n }),\n]);\n\nconst ParsedOrRawInstruction = coerce(\n InstructionResult,\n UnknownInstructionResult,\n value => {\n if ('accounts' in value) {\n return create(value, RawInstructionResult);\n } else {\n return create(value, ParsedInstructionResult);\n }\n },\n);\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionResult = pick({\n signatures: array(string()),\n message: pick({\n accountKeys: array(\n pick({\n pubkey: PublicKeyFromString,\n signer: boolean(),\n writable: boolean(),\n }),\n ),\n instructions: array(ParsedOrRawInstruction),\n recentBlockhash: string(),\n }),\n});\n\nconst TokenBalanceResult = pick({\n accountIndex: number(),\n mint: string(),\n uiTokenAmount: TokenAmountResult,\n});\n\n/**\n * @internal\n */\nconst ConfirmedTransactionMetaResult = pick({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(\n nullable(\n array(\n pick({\n index: number(),\n instructions: array(\n pick({\n accounts: array(number()),\n data: string(),\n programIdIndex: number(),\n }),\n ),\n }),\n ),\n ),\n ),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n});\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionMetaResult = pick({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(\n nullable(\n array(\n pick({\n index: number(),\n instructions: array(ParsedOrRawInstruction),\n }),\n ),\n ),\n ),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedBlock\" message\n */\nconst GetConfirmedBlockRpcResult = jsonRpcResult(\n nullable(\n pick({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(\n pick({\n transaction: ConfirmedTransactionResult,\n meta: nullable(ConfirmedTransactionMetaResult),\n }),\n ),\n rewards: optional(\n array(\n pick({\n pubkey: string(),\n lamports: number(),\n postBalance: nullable(number()),\n rewardType: nullable(string()),\n }),\n ),\n ),\n blockTime: nullable(number()),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedBlockSignatures\" message\n */\nconst GetConfirmedBlockSignaturesRpcResult = jsonRpcResult(\n nullable(\n pick({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n signatures: array(string()),\n blockTime: nullable(number()),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedTransaction\" message\n */\nconst GetConfirmedTransactionRpcResult = jsonRpcResult(\n nullable(\n pick({\n slot: number(),\n meta: ConfirmedTransactionMetaResult,\n blockTime: optional(nullable(number())),\n transaction: ConfirmedTransactionResult,\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedTransaction\" message\n */\nconst GetParsedConfirmedTransactionRpcResult = jsonRpcResult(\n nullable(\n pick({\n slot: number(),\n transaction: ParsedConfirmedTransactionResult,\n meta: nullable(ParsedConfirmedTransactionMetaResult),\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getRecentBlockhash\" message\n */\nconst GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(\n pick({\n blockhash: string(),\n feeCalculator: pick({\n lamportsPerSignature: number(),\n }),\n }),\n);\n\nconst PerfSampleResult = pick({\n slot: number(),\n numTransactions: number(),\n numSlots: number(),\n samplePeriodSecs: number(),\n});\n\n/*\n * Expected JSON RPC response for \"getRecentPerformanceSamples\" message\n */\nconst GetRecentPerformanceSamplesRpcResult = jsonRpcResult(\n array(PerfSampleResult),\n);\n\n/**\n * Expected JSON RPC response for the \"getFeeCalculatorForBlockhash\" message\n */\nconst GetFeeCalculatorRpcResult = jsonRpcResultAndContext(\n nullable(\n pick({\n feeCalculator: pick({\n lamportsPerSignature: number(),\n }),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"requestAirdrop\" message\n */\nconst RequestAirdropRpcResult = jsonRpcResult(string());\n\n/**\n * Expected JSON RPC response for the \"sendTransaction\" message\n */\nconst SendTransactionRpcResult = jsonRpcResult(string());\n\n/**\n * Information about the latest slot being processed by a node\n */\nexport type SlotInfo = {\n /** Currently processing slot */\n slot: number;\n /** Parent of the current slot */\n parent: number;\n /** The root block of the current slot's fork */\n root: number;\n};\n\n/**\n * Parsed account data\n */\nexport type ParsedAccountData = {\n /** Name of the program that owns this account */\n program: string;\n /** Parsed account data */\n parsed: any;\n /** Space used by account data */\n space: number;\n};\n\n/**\n * Stake Activation data\n */\nexport type StakeActivationData = {\n /** the stake account's activation state */\n state: 'active' | 'inactive' | 'activating' | 'deactivating';\n /** stake active during the epoch */\n active: number;\n /** stake inactive during the epoch */\n inactive: number;\n};\n\n/**\n * Data slice argument for getProgramAccounts\n */\nexport type DataSlice = {\n /** offset of data slice */\n offset: number;\n /** length of data slice */\n length: number;\n};\n\n/**\n * Memory comparison filter for getProgramAccounts\n */\nexport type MemcmpFilter = {\n memcmp: {\n /** offset into program account data to start comparison */\n offset: number;\n /** data to match, as base-58 encoded string and limited to less than 129 bytes */\n bytes: string;\n };\n};\n\n/**\n * Data size comparison filter for getProgramAccounts\n */\nexport type DataSizeFilter = {\n /** Size of data for program account data length comparison */\n dataSize: number;\n};\n\n/**\n * A filter object for getProgramAccounts\n */\nexport type GetProgramAccountsFilter = MemcmpFilter | DataSizeFilter;\n\n/**\n * Configuration object for getProgramAccounts requests\n */\nexport type GetProgramAccountsConfig = {\n /** Optional commitment level */\n commitment?: Commitment;\n /** Optional encoding for account data (default base64)\n * To use \"jsonParsed\" encoding, please refer to `getParsedProgramAccounts` in connection.ts\n * */\n encoding?: 'base64';\n /** Optional data slice to limit the returned account data */\n dataSlice?: DataSlice;\n /** Optional array of filters to apply to accounts */\n filters?: GetProgramAccountsFilter[];\n};\n\n/**\n * Configuration object for getParsedProgramAccounts\n */\nexport type GetParsedProgramAccountsConfig = {\n /** Optional commitment level */\n commitment?: Commitment;\n /** Optional array of filters to apply to accounts */\n filters?: GetProgramAccountsFilter[];\n};\n\n/**\n * Information describing an account\n */\nexport type AccountInfo = {\n /** `true` if this account's data contains a loaded program */\n executable: boolean;\n /** Identifier of the program that owns the account */\n owner: PublicKey;\n /** Number of lamports assigned to the account */\n lamports: number;\n /** Optional data assigned to the account */\n data: T;\n /** Optional rent epoch infor for account */\n rentEpoch?: number;\n};\n\n/**\n * Account information identified by pubkey\n */\nexport type KeyedAccountInfo = {\n accountId: PublicKey;\n accountInfo: AccountInfo;\n};\n\n/**\n * Callback function for account change notifications\n */\nexport type AccountChangeCallback = (\n accountInfo: AccountInfo,\n context: Context,\n) => void;\n\n/**\n * @internal\n */\ntype SubscriptionId = 'subscribing' | number;\n\n/**\n * @internal\n */\ntype AccountSubscriptionInfo = {\n publicKey: string; // PublicKey of the account as a base 58 string\n callback: AccountChangeCallback;\n commitment?: Commitment;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for program account change notifications\n */\nexport type ProgramAccountChangeCallback = (\n keyedAccountInfo: KeyedAccountInfo,\n context: Context,\n) => void;\n\n/**\n * @internal\n */\ntype ProgramAccountSubscriptionInfo = {\n programId: string; // PublicKey of the program as a base 58 string\n callback: ProgramAccountChangeCallback;\n commitment?: Commitment;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n filters?: GetProgramAccountsFilter[];\n};\n\n/**\n * Callback function for slot change notifications\n */\nexport type SlotChangeCallback = (slotInfo: SlotInfo) => void;\n\n/**\n * @internal\n */\ntype SlotSubscriptionInfo = {\n callback: SlotChangeCallback;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for slot update notifications\n */\nexport type SlotUpdateCallback = (slotUpdate: SlotUpdate) => void;\n\n/**\n * @private\n */\ntype SlotUpdateSubscriptionInfo = {\n callback: SlotUpdateCallback;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for signature status notifications\n */\nexport type SignatureResultCallback = (\n signatureResult: SignatureResult,\n context: Context,\n) => void;\n\n/**\n * Signature status notification with transaction result\n */\nexport type SignatureStatusNotification = {\n type: 'status';\n result: SignatureResult;\n};\n\n/**\n * Signature received notification\n */\nexport type SignatureReceivedNotification = {\n type: 'received';\n};\n\n/**\n * Callback function for signature notifications\n */\nexport type SignatureSubscriptionCallback = (\n notification: SignatureStatusNotification | SignatureReceivedNotification,\n context: Context,\n) => void;\n\n/**\n * Signature subscription options\n */\nexport type SignatureSubscriptionOptions = {\n commitment?: Commitment;\n enableReceivedNotification?: boolean;\n};\n\n/**\n * @internal\n */\ntype SignatureSubscriptionInfo = {\n signature: TransactionSignature; // TransactionSignature as a base 58 string\n callback: SignatureSubscriptionCallback;\n options?: SignatureSubscriptionOptions;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for root change notifications\n */\nexport type RootChangeCallback = (root: number) => void;\n\n/**\n * @internal\n */\ntype RootSubscriptionInfo = {\n callback: RootChangeCallback;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * @internal\n */\nconst LogsResult = pick({\n err: TransactionErrorResult,\n logs: array(string()),\n signature: string(),\n});\n\n/**\n * Logs result.\n */\nexport type Logs = {\n err: TransactionError | null;\n logs: string[];\n signature: string;\n};\n\n/**\n * Expected JSON RPC response for the \"logsNotification\" message.\n */\nconst LogsNotificationResult = pick({\n result: notificationResultAndContext(LogsResult),\n subscription: number(),\n});\n\n/**\n * Filter for log subscriptions.\n */\nexport type LogsFilter = PublicKey | 'all' | 'allWithVotes';\n\n/**\n * Callback function for log notifications.\n */\nexport type LogsCallback = (logs: Logs, ctx: Context) => void;\n\n/**\n * @private\n */\ntype LogsSubscriptionInfo = {\n callback: LogsCallback;\n filter: LogsFilter;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n commitment?: Commitment;\n};\n\n/**\n * Signature result\n */\nexport type SignatureResult = {\n err: TransactionError | null;\n};\n\n/**\n * Transaction error\n */\nexport type TransactionError = {} | string;\n\n/**\n * Transaction confirmation status\n *
\n *   'processed': Transaction landed in a block which has reached 1 confirmation by the connected node\n *   'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster\n *   'finalized': Transaction landed in a block which has been finalized by the cluster\n * 
\n */\nexport type TransactionConfirmationStatus =\n | 'processed'\n | 'confirmed'\n | 'finalized';\n\n/**\n * Signature status\n */\nexport type SignatureStatus = {\n /** when the transaction was processed */\n slot: number;\n /** the number of blocks that have been confirmed and voted on in the fork containing `slot` */\n confirmations: number | null;\n /** transaction error, if any */\n err: TransactionError | null;\n /** cluster confirmation status, if data available. Possible responses: `processed`, `confirmed`, `finalized` */\n confirmationStatus?: TransactionConfirmationStatus;\n};\n\n/**\n * A confirmed signature with its status\n */\nexport type ConfirmedSignatureInfo = {\n /** the transaction signature */\n signature: string;\n /** when the transaction was processed */\n slot: number;\n /** error, if any */\n err: TransactionError | null;\n /** memo associated with the transaction, if any */\n memo: string | null;\n /** The unix timestamp of when the transaction was processed */\n blockTime?: number | null;\n};\n\n/**\n * An object defining headers to be passed to the RPC server\n */\nexport type HttpHeaders = {[header: string]: string};\n\n/**\n * A callback used to augment the outgoing HTTP request\n */\nexport type FetchMiddleware = (\n url: string,\n options: any,\n fetch: Function,\n) => void;\n\n/**\n * Configuration for instantiating a Connection\n */\nexport type ConnectionConfig = {\n /** Optional commitment level */\n commitment?: Commitment;\n /** Optional endpoint URL to the fullnode JSON RPC PubSub WebSocket Endpoint */\n wsEndpoint?: string;\n /** Optional HTTP headers object */\n httpHeaders?: HttpHeaders;\n /** Optional fetch middleware callback */\n fetchMiddleware?: FetchMiddleware;\n /** Optional Disable retring calls when server responds with HTTP 429 (Too Many Requests) */\n disableRetryOnRateLimit?: boolean;\n /** time to allow for the server to initially process a transaction (in milliseconds) */\n confirmTransactionInitialTimeout?: number;\n};\n\n/**\n * A connection to a fullnode JSON RPC endpoint\n */\nexport class Connection {\n /** @internal */ _commitment?: Commitment;\n /** @internal */ _confirmTransactionInitialTimeout?: number;\n /** @internal */ _rpcEndpoint: string;\n /** @internal */ _rpcWsEndpoint: string;\n /** @internal */ _rpcClient: RpcClient;\n /** @internal */ _rpcRequest: RpcRequest;\n /** @internal */ _rpcBatchRequest: RpcBatchRequest;\n /** @internal */ _rpcWebSocket: RpcWebSocketClient;\n /** @internal */ _rpcWebSocketConnected: boolean = false;\n /** @internal */ _rpcWebSocketHeartbeat: ReturnType<\n typeof setInterval\n > | null = null;\n /** @internal */ _rpcWebSocketIdleTimeout: ReturnType<\n typeof setTimeout\n > | null = null;\n\n /** @internal */ _disableBlockhashCaching: boolean = false;\n /** @internal */ _pollingBlockhash: boolean = false;\n /** @internal */ _blockhashInfo: {\n recentBlockhash: Blockhash | null;\n lastFetch: number;\n simulatedSignatures: Array;\n transactionSignatures: Array;\n } = {\n recentBlockhash: null,\n lastFetch: 0,\n transactionSignatures: [],\n simulatedSignatures: [],\n };\n\n /** @internal */ _accountChangeSubscriptionCounter: number = 0;\n /** @internal */ _accountChangeSubscriptions: {\n [id: number]: AccountSubscriptionInfo;\n } = {};\n\n /** @internal */ _programAccountChangeSubscriptionCounter: number = 0;\n /** @internal */ _programAccountChangeSubscriptions: {\n [id: number]: ProgramAccountSubscriptionInfo;\n } = {};\n\n /** @internal */ _rootSubscriptionCounter: number = 0;\n /** @internal */ _rootSubscriptions: {\n [id: number]: RootSubscriptionInfo;\n } = {};\n\n /** @internal */ _signatureSubscriptionCounter: number = 0;\n /** @internal */ _signatureSubscriptions: {\n [id: number]: SignatureSubscriptionInfo;\n } = {};\n\n /** @internal */ _slotSubscriptionCounter: number = 0;\n /** @internal */ _slotSubscriptions: {\n [id: number]: SlotSubscriptionInfo;\n } = {};\n\n /** @internal */ _logsSubscriptionCounter: number = 0;\n /** @internal */ _logsSubscriptions: {\n [id: number]: LogsSubscriptionInfo;\n } = {};\n\n /** @internal */ _slotUpdateSubscriptionCounter: number = 0;\n /** @internal */ _slotUpdateSubscriptions: {\n [id: number]: SlotUpdateSubscriptionInfo;\n } = {};\n\n /**\n * Establish a JSON RPC connection\n *\n * @param endpoint URL to the fullnode JSON RPC endpoint\n * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object\n */\n constructor(\n endpoint: string,\n commitmentOrConfig?: Commitment | ConnectionConfig,\n ) {\n let url = new URL(endpoint);\n const useHttps = url.protocol === 'https:';\n\n let wsEndpoint;\n let httpHeaders;\n let fetchMiddleware;\n let disableRetryOnRateLimit;\n if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {\n this._commitment = commitmentOrConfig;\n } else if (commitmentOrConfig) {\n this._commitment = commitmentOrConfig.commitment;\n this._confirmTransactionInitialTimeout =\n commitmentOrConfig.confirmTransactionInitialTimeout;\n wsEndpoint = commitmentOrConfig.wsEndpoint;\n httpHeaders = commitmentOrConfig.httpHeaders;\n fetchMiddleware = commitmentOrConfig.fetchMiddleware;\n disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;\n }\n\n this._rpcEndpoint = endpoint;\n this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);\n\n this._rpcClient = createRpcClient(\n url.toString(),\n useHttps,\n httpHeaders,\n fetchMiddleware,\n disableRetryOnRateLimit,\n );\n this._rpcRequest = createRpcRequest(this._rpcClient);\n this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);\n\n this._rpcWebSocket = new RpcWebSocketClient(this._rpcWsEndpoint, {\n autoconnect: false,\n max_reconnects: Infinity,\n });\n this._rpcWebSocket.on('open', this._wsOnOpen.bind(this));\n this._rpcWebSocket.on('error', this._wsOnError.bind(this));\n this._rpcWebSocket.on('close', this._wsOnClose.bind(this));\n this._rpcWebSocket.on(\n 'accountNotification',\n this._wsOnAccountNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'programNotification',\n this._wsOnProgramAccountNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'slotNotification',\n this._wsOnSlotNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'slotsUpdatesNotification',\n this._wsOnSlotUpdatesNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'signatureNotification',\n this._wsOnSignatureNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'rootNotification',\n this._wsOnRootNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'logsNotification',\n this._wsOnLogsNotification.bind(this),\n );\n }\n\n /**\n * The default commitment used for requests\n */\n get commitment(): Commitment | undefined {\n return this._commitment;\n }\n\n /**\n * Fetch the balance for the specified public key, return with context\n */\n async getBalanceAndContext(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise> {\n const args = this._buildArgs([publicKey.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(number()));\n if ('error' in res) {\n throw new Error(\n 'failed to get balance for ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the balance for the specified public key\n */\n async getBalance(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise {\n return await this.getBalanceAndContext(publicKey, commitment)\n .then(x => x.value)\n .catch(e => {\n throw new Error(\n 'failed to get balance of account ' + publicKey.toBase58() + ': ' + e,\n );\n });\n }\n\n /**\n * Fetch the estimated production time of a block\n */\n async getBlockTime(slot: number): Promise {\n const unsafeRes = await this._rpcRequest('getBlockTime', [slot]);\n const res = create(unsafeRes, jsonRpcResult(nullable(number())));\n if ('error' in res) {\n throw new Error(\n 'failed to get block time for slot ' + slot + ': ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the lowest slot that the node has information about in its ledger.\n * This value may increase over time if the node is configured to purge older ledger data\n */\n async getMinimumLedgerSlot(): Promise {\n const unsafeRes = await this._rpcRequest('minimumLedgerSlot', []);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error(\n 'failed to get minimum ledger slot: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the slot of the lowest confirmed block that has not been purged from the ledger\n */\n async getFirstAvailableBlock(): Promise {\n const unsafeRes = await this._rpcRequest('getFirstAvailableBlock', []);\n const res = create(unsafeRes, SlotRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get first available block: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch information about the current supply\n */\n async getSupply(\n config?: GetSupplyConfig | Commitment,\n ): Promise> {\n let configArg: GetSupplyConfig = {};\n if (typeof config === 'string') {\n configArg = {commitment: config};\n } else if (config) {\n configArg = {\n ...config,\n commitment: (config && config.commitment) || this.commitment,\n };\n } else {\n configArg = {\n commitment: this.commitment,\n };\n }\n\n const unsafeRes = await this._rpcRequest('getSupply', [configArg]);\n const res = create(unsafeRes, GetSupplyRpcResult);\n if ('error' in res) {\n throw new Error('failed to get supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current supply of a token mint\n */\n async getTokenSupply(\n tokenMintAddress: PublicKey,\n commitment?: Commitment,\n ): Promise> {\n const args = this._buildArgs([tokenMintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenSupply', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new Error('failed to get token supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current balance of a token account\n */\n async getTokenAccountBalance(\n tokenAddress: PublicKey,\n commitment?: Commitment,\n ): Promise> {\n const args = this._buildArgs([tokenAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenAccountBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new Error(\n 'failed to get token account balance: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the token accounts owned by the specified account\n *\n * @return {Promise}>>>}\n */\n async getTokenAccountsByOwner(\n ownerAddress: PublicKey,\n filter: TokenAccountsFilter,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<\n Array<{pubkey: PublicKey; account: AccountInfo}>\n >\n > {\n let _args: any[] = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({mint: filter.mint.toBase58()});\n } else {\n _args.push({programId: filter.programId.toBase58()});\n }\n\n const args = this._buildArgs(_args, commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetTokenAccountsByOwner);\n if ('error' in res) {\n throw new Error(\n 'failed to get token accounts owned by account ' +\n ownerAddress.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed token accounts owned by the specified account\n *\n * @return {Promise}>>>}\n */\n async getParsedTokenAccountsByOwner(\n ownerAddress: PublicKey,\n filter: TokenAccountsFilter,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<\n Array<{pubkey: PublicKey; account: AccountInfo}>\n >\n > {\n let _args: any[] = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({mint: filter.mint.toBase58()});\n } else {\n _args.push({programId: filter.programId.toBase58()});\n }\n\n const args = this._buildArgs(_args, commitment, 'jsonParsed');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetParsedTokenAccountsByOwner);\n if ('error' in res) {\n throw new Error(\n 'failed to get token accounts owned by account ' +\n ownerAddress.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest accounts with their current balances\n */\n async getLargestAccounts(\n config?: GetLargestAccountsConfig,\n ): Promise>> {\n const arg = {\n ...config,\n commitment: (config && config.commitment) || this.commitment,\n };\n const args = arg.filter || arg.commitment ? [arg] : [];\n const unsafeRes = await this._rpcRequest('getLargestAccounts', args);\n const res = create(unsafeRes, GetLargestAccountsRpcResult);\n if ('error' in res) {\n throw new Error('failed to get largest accounts: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest token accounts with their current balances\n * for a given mint.\n */\n async getTokenLargestAccounts(\n mintAddress: PublicKey,\n commitment?: Commitment,\n ): Promise>> {\n const args = this._buildArgs([mintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenLargestAccounts', args);\n const res = create(unsafeRes, GetTokenLargestAccountsResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get token largest accounts: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key, return with context\n */\n async getAccountInfoAndContext(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise | null>> {\n const args = this._buildArgs([publicKey.toBase58()], commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(\n unsafeRes,\n jsonRpcResultAndContext(nullable(AccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get info about account ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed account info for the specified public key\n */\n async getParsedAccountInfo(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext | null>\n > {\n const args = this._buildArgs(\n [publicKey.toBase58()],\n commitment,\n 'jsonParsed',\n );\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(\n unsafeRes,\n jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get info about account ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key\n */\n async getAccountInfo(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise | null> {\n try {\n const res = await this.getAccountInfoAndContext(publicKey, commitment);\n return res.value;\n } catch (e) {\n throw new Error(\n 'failed to get info about account ' + publicKey.toBase58() + ': ' + e,\n );\n }\n }\n\n /**\n * Fetch all the account info for multiple accounts specified by an array of public keys\n */\n async getMultipleAccountsInfo(\n publicKeys: PublicKey[],\n commitment?: Commitment,\n ): Promise<(AccountInfo | null)[]> {\n const keys = publicKeys.map(key => key.toBase58());\n const args = this._buildArgs([keys], commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);\n const res = create(\n unsafeRes,\n jsonRpcResultAndContext(array(nullable(AccountInfoResult))),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get info for accounts ' + keys + ': ' + res.error.message,\n );\n }\n return res.result.value;\n }\n\n /**\n * Returns epoch activation information for a stake account that has been delegated\n */\n async getStakeActivation(\n publicKey: PublicKey,\n commitment?: Commitment,\n epoch?: number,\n ): Promise {\n const args = this._buildArgs(\n [publicKey.toBase58()],\n commitment,\n undefined,\n epoch !== undefined ? {epoch} : undefined,\n );\n\n const unsafeRes = await this._rpcRequest('getStakeActivation', args);\n const res = create(unsafeRes, jsonRpcResult(StakeActivationResult));\n if ('error' in res) {\n throw new Error(\n `failed to get Stake Activation ${publicKey.toBase58()}: ${\n res.error.message\n }`,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the accounts owned by the specified program id\n *\n * @return {Promise}>>}\n */\n async getProgramAccounts(\n programId: PublicKey,\n configOrCommitment?: GetProgramAccountsConfig | Commitment,\n ): Promise}>> {\n const extra: Pick = {};\n\n let commitment;\n let encoding;\n if (configOrCommitment) {\n if (typeof configOrCommitment === 'string') {\n commitment = configOrCommitment;\n } else {\n commitment = configOrCommitment.commitment;\n encoding = configOrCommitment.encoding;\n\n if (configOrCommitment.dataSlice) {\n extra.dataSlice = configOrCommitment.dataSlice;\n }\n if (configOrCommitment.filters) {\n extra.filters = configOrCommitment.filters;\n }\n }\n }\n\n const args = this._buildArgs(\n [programId.toBase58()],\n commitment,\n encoding || 'base64',\n extra,\n );\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));\n if ('error' in res) {\n throw new Error(\n 'failed to get accounts owned by program ' +\n programId.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch and parse all the accounts owned by the specified program id\n *\n * @return {Promise}>>}\n */\n async getParsedProgramAccounts(\n programId: PublicKey,\n configOrCommitment?: GetParsedProgramAccountsConfig | Commitment,\n ): Promise<\n Array<{\n pubkey: PublicKey;\n account: AccountInfo;\n }>\n > {\n const extra: Pick = {};\n\n let commitment;\n if (configOrCommitment) {\n if (typeof configOrCommitment === 'string') {\n commitment = configOrCommitment;\n } else {\n commitment = configOrCommitment.commitment;\n\n if (configOrCommitment.filters) {\n extra.filters = configOrCommitment.filters;\n }\n }\n }\n\n const args = this._buildArgs(\n [programId.toBase58()],\n commitment,\n 'jsonParsed',\n extra,\n );\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = create(\n unsafeRes,\n jsonRpcResult(array(KeyedParsedAccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get accounts owned by program ' +\n programId.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Confirm the transaction identified by the specified signature.\n */\n async confirmTransaction(\n signature: TransactionSignature,\n commitment?: Commitment,\n ): Promise> {\n let decodedSignature;\n try {\n decodedSignature = bs58.decode(signature);\n } catch (err) {\n throw new Error('signature must be base58 encoded: ' + signature);\n }\n\n assert(decodedSignature.length === 64, 'signature has invalid length');\n\n const start = Date.now();\n const subscriptionCommitment = commitment || this.commitment;\n\n let subscriptionId;\n let response: RpcResponseAndContext | null = null;\n const confirmPromise = new Promise((resolve, reject) => {\n try {\n subscriptionId = this.onSignature(\n signature,\n (result: SignatureResult, context: Context) => {\n subscriptionId = undefined;\n response = {\n context,\n value: result,\n };\n resolve(null);\n },\n subscriptionCommitment,\n );\n } catch (err) {\n reject(err);\n }\n });\n\n let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;\n switch (subscriptionCommitment) {\n case 'processed':\n case 'recent':\n case 'single':\n case 'confirmed':\n case 'singleGossip': {\n timeoutMs = this._confirmTransactionInitialTimeout || 30 * 1000;\n break;\n }\n // exhaust enums to ensure full coverage\n case 'finalized':\n case 'max':\n case 'root':\n }\n\n try {\n await promiseTimeout(confirmPromise, timeoutMs);\n } finally {\n if (subscriptionId) {\n this.removeSignatureListener(subscriptionId);\n }\n }\n\n if (response === null) {\n const duration = (Date.now() - start) / 1000;\n throw new Error(\n `Transaction was not confirmed in ${duration.toFixed(\n 2,\n )} seconds. It is unknown if it succeeded or failed. Check signature ${signature} using the Solana Explorer or CLI tools.`,\n );\n }\n\n return response;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getClusterNodes(): Promise> {\n const unsafeRes = await this._rpcRequest('getClusterNodes', []);\n const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult)));\n if ('error' in res) {\n throw new Error('failed to get cluster nodes: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getVoteAccounts(commitment?: Commitment): Promise {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getVoteAccounts', args);\n const res = create(unsafeRes, GetVoteAccounts);\n if ('error' in res) {\n throw new Error('failed to get vote accounts: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot that the node is processing\n */\n async getSlot(commitment?: Commitment): Promise {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSlot', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get slot: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot leader of the cluster\n */\n async getSlotLeader(commitment?: Commitment): Promise {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSlotLeader', args);\n const res = create(unsafeRes, jsonRpcResult(string()));\n if ('error' in res) {\n throw new Error('failed to get slot leader: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch `limit` number of slot leaders starting from `startSlot`\n *\n * @param startSlot fetch slot leaders starting from this slot\n * @param limit number of slot leaders to return\n */\n async getSlotLeaders(\n startSlot: number,\n limit: number,\n ): Promise> {\n const args = [startSlot, limit];\n const unsafeRes = await this._rpcRequest('getSlotLeaders', args);\n const res = create(unsafeRes, jsonRpcResult(array(PublicKeyFromString)));\n if ('error' in res) {\n throw new Error('failed to get slot leaders: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current status of a signature\n */\n async getSignatureStatus(\n signature: TransactionSignature,\n config?: SignatureStatusConfig,\n ): Promise> {\n const {context, value: values} = await this.getSignatureStatuses(\n [signature],\n config,\n );\n assert(values.length === 1);\n const value = values[0];\n return {context, value};\n }\n\n /**\n * Fetch the current statuses of a batch of signatures\n */\n async getSignatureStatuses(\n signatures: Array,\n config?: SignatureStatusConfig,\n ): Promise>> {\n const params: any[] = [signatures];\n if (config) {\n params.push(config);\n }\n const unsafeRes = await this._rpcRequest('getSignatureStatuses', params);\n const res = create(unsafeRes, GetSignatureStatusesRpcResult);\n if ('error' in res) {\n throw new Error('failed to get signature status: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current transaction count of the cluster\n */\n async getTransactionCount(commitment?: Commitment): Promise {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getTransactionCount', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get transaction count: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current total currency supply of the cluster in lamports\n *\n * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.\n */\n async getTotalSupply(commitment?: Commitment): Promise {\n const result = await this.getSupply({\n commitment,\n excludeNonCirculatingAccountsList: true,\n });\n return result.value.total;\n }\n\n /**\n * Fetch the cluster InflationGovernor parameters\n */\n async getInflationGovernor(\n commitment?: Commitment,\n ): Promise {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getInflationGovernor', args);\n const res = create(unsafeRes, GetInflationGovernorRpcResult);\n if ('error' in res) {\n throw new Error('failed to get inflation: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the inflation reward for a list of addresses for an epoch\n */\n async getInflationReward(\n addresses: PublicKey[],\n epoch?: number,\n commitment?: Commitment,\n ): Promise<(InflationReward | null)[]> {\n const args = this._buildArgs(\n [addresses.map(pubkey => pubkey.toBase58())],\n commitment,\n undefined,\n {\n epoch,\n },\n );\n const unsafeRes = await this._rpcRequest('getInflationReward', args);\n const res = create(unsafeRes, GetInflationRewardResult);\n if ('error' in res) {\n throw new Error('failed to get inflation reward: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Info parameters\n */\n async getEpochInfo(commitment?: Commitment): Promise {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getEpochInfo', args);\n const res = create(unsafeRes, GetEpochInfoRpcResult);\n if ('error' in res) {\n throw new Error('failed to get epoch info: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Schedule parameters\n */\n async getEpochSchedule(): Promise {\n const unsafeRes = await this._rpcRequest('getEpochSchedule', []);\n const res = create(unsafeRes, GetEpochScheduleRpcResult);\n if ('error' in res) {\n throw new Error('failed to get epoch schedule: ' + res.error.message);\n }\n const epochSchedule = res.result;\n return new EpochSchedule(\n epochSchedule.slotsPerEpoch,\n epochSchedule.leaderScheduleSlotOffset,\n epochSchedule.warmup,\n epochSchedule.firstNormalEpoch,\n epochSchedule.firstNormalSlot,\n );\n }\n\n /**\n * Fetch the leader schedule for the current epoch\n * @return {Promise>}\n */\n async getLeaderSchedule(): Promise {\n const unsafeRes = await this._rpcRequest('getLeaderSchedule', []);\n const res = create(unsafeRes, GetLeaderScheduleRpcResult);\n if ('error' in res) {\n throw new Error('failed to get leader schedule: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the minimum balance needed to exempt an account of `dataLength`\n * size from rent\n */\n async getMinimumBalanceForRentExemption(\n dataLength: number,\n commitment?: Commitment,\n ): Promise {\n const args = this._buildArgs([dataLength], commitment);\n const unsafeRes = await this._rpcRequest(\n 'getMinimumBalanceForRentExemption',\n args,\n );\n const res = create(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult);\n if ('error' in res) {\n console.warn('Unable to fetch minimum balance for rent exemption');\n return 0;\n }\n return res.result;\n }\n\n /**\n * Fetch a recent blockhash from the cluster, return with context\n * @return {Promise>}\n */\n async getRecentBlockhashAndContext(\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<{blockhash: Blockhash; feeCalculator: FeeCalculator}>\n > {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);\n const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);\n if ('error' in res) {\n throw new Error('failed to get recent blockhash: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch recent performance samples\n * @return {Promise>}\n */\n async getRecentPerformanceSamples(\n limit?: number,\n ): Promise> {\n const args = this._buildArgs(limit ? [limit] : []);\n const unsafeRes = await this._rpcRequest(\n 'getRecentPerformanceSamples',\n args,\n );\n const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get recent performance samples: ' + res.error.message,\n );\n }\n\n return res.result;\n }\n\n /**\n * Fetch the fee calculator for a recent blockhash from the cluster, return with context\n */\n async getFeeCalculatorForBlockhash(\n blockhash: Blockhash,\n commitment?: Commitment,\n ): Promise> {\n const args = this._buildArgs([blockhash], commitment);\n const unsafeRes = await this._rpcRequest(\n 'getFeeCalculatorForBlockhash',\n args,\n );\n\n const res = create(unsafeRes, GetFeeCalculatorRpcResult);\n if ('error' in res) {\n throw new Error('failed to get fee calculator: ' + res.error.message);\n }\n const {context, value} = res.result;\n return {\n context,\n value: value !== null ? value.feeCalculator : null,\n };\n }\n\n /**\n * Fetch a recent blockhash from the cluster\n * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}\n */\n async getRecentBlockhash(\n commitment?: Commitment,\n ): Promise<{blockhash: Blockhash; feeCalculator: FeeCalculator}> {\n try {\n const res = await this.getRecentBlockhashAndContext(commitment);\n return res.value;\n } catch (e) {\n throw new Error('failed to get recent blockhash: ' + e);\n }\n }\n\n /**\n * Fetch the node version\n */\n async getVersion(): Promise {\n const unsafeRes = await this._rpcRequest('getVersion', []);\n const res = create(unsafeRes, jsonRpcResult(VersionResult));\n if ('error' in res) {\n throw new Error('failed to get version: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the genesis hash\n */\n async getGenesisHash(): Promise {\n const unsafeRes = await this._rpcRequest('getGenesisHash', []);\n const res = create(unsafeRes, jsonRpcResult(string()));\n if ('error' in res) {\n throw new Error('failed to get genesis hash: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch a processed block from the cluster.\n */\n async getBlock(\n slot: number,\n opts?: {commitment?: Finality},\n ): Promise {\n const args = this._buildArgsAtLeastConfirmed(\n [slot],\n opts && opts.commitment,\n );\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);\n const res = create(unsafeRes, GetConfirmedBlockRpcResult);\n\n if ('error' in res) {\n throw new Error('failed to get confirmed block: ' + res.error.message);\n }\n\n const result = res.result;\n if (!result) return result;\n\n return {\n ...result,\n transactions: result.transactions.map(({transaction, meta}) => {\n const message = new Message(transaction.message);\n return {\n meta,\n transaction: {\n ...transaction,\n message,\n },\n };\n }),\n };\n }\n\n /**\n * Fetch a processed transaction from the cluster.\n */\n async getTransaction(\n signature: string,\n opts?: {commitment?: Finality},\n ): Promise {\n const args = this._buildArgsAtLeastConfirmed(\n [signature],\n opts && opts.commitment,\n );\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);\n const res = create(unsafeRes, GetConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transaction: ' + res.error.message,\n );\n }\n\n const result = res.result;\n if (!result) return result;\n\n return {\n ...result,\n transaction: {\n ...result.transaction,\n message: new Message(result.transaction.message),\n },\n };\n }\n\n /**\n * Fetch a list of Transactions and transaction statuses from the cluster\n * for a confirmed block.\n *\n * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.\n */\n async getConfirmedBlock(\n slot: number,\n commitment?: Finality,\n ): Promise {\n const result = await this.getBlock(slot, {commitment});\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n\n return {\n ...result,\n transactions: result.transactions.map(({transaction, meta}) => {\n return {\n meta,\n transaction: Transaction.populate(\n transaction.message,\n transaction.signatures,\n ),\n };\n }),\n };\n }\n\n /**\n * Fetch confirmed blocks between two slots\n */\n async getBlocks(\n startSlot: number,\n endSlot?: number,\n commitment?: Finality,\n ): Promise> {\n const args = this._buildArgsAtLeastConfirmed(\n endSlot !== undefined ? [startSlot, endSlot] : [startSlot],\n commitment,\n );\n const unsafeRes = await this._rpcRequest('getConfirmedBlocks', args);\n const res = create(unsafeRes, jsonRpcResult(array(number())));\n if ('error' in res) {\n throw new Error('failed to get blocks: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards\n */\n async getConfirmedBlockSignatures(\n slot: number,\n commitment?: Finality,\n ): Promise {\n const args = this._buildArgsAtLeastConfirmed(\n [slot],\n commitment,\n undefined,\n {\n transactionDetails: 'signatures',\n rewards: false,\n },\n );\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);\n const res = create(unsafeRes, GetConfirmedBlockSignaturesRpcResult);\n if ('error' in res) {\n throw new Error('failed to get confirmed block: ' + res.error.message);\n }\n const result = res.result;\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n return result;\n }\n\n /**\n * Fetch a transaction details for a confirmed transaction\n */\n async getConfirmedTransaction(\n signature: TransactionSignature,\n commitment?: Finality,\n ): Promise {\n const result = await this.getTransaction(signature, {commitment});\n if (!result) return result;\n const {message, signatures} = result.transaction;\n return {\n ...result,\n transaction: Transaction.populate(message, signatures),\n };\n }\n\n /**\n * Fetch parsed transaction details for a confirmed transaction\n */\n async getParsedConfirmedTransaction(\n signature: TransactionSignature,\n commitment?: Finality,\n ): Promise {\n const args = this._buildArgsAtLeastConfirmed(\n [signature],\n commitment,\n 'jsonParsed',\n );\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);\n const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transaction: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a batch of confirmed transactions\n */\n async getParsedConfirmedTransactions(\n signatures: TransactionSignature[],\n commitment?: Finality,\n ): Promise<(ParsedConfirmedTransaction | null)[]> {\n const batch = signatures.map(signature => {\n const args = this._buildArgsAtLeastConfirmed(\n [signature],\n commitment,\n 'jsonParsed',\n );\n return {\n methodName: 'getConfirmedTransaction',\n args,\n };\n });\n\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map((unsafeRes: any) => {\n const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transactions: ' + res.error.message,\n );\n }\n return res.result;\n });\n\n return res;\n }\n\n /**\n * Fetch a list of all the confirmed signatures for transactions involving an address\n * within a specified slot range. Max range allowed is 10,000 slots.\n *\n * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.\n *\n * @param address queried address\n * @param startSlot start slot, inclusive\n * @param endSlot end slot, inclusive\n */\n async getConfirmedSignaturesForAddress(\n address: PublicKey,\n startSlot: number,\n endSlot: number,\n ): Promise> {\n let options: any = {};\n\n let firstAvailableBlock = await this.getFirstAvailableBlock();\n while (!('until' in options)) {\n startSlot--;\n if (startSlot <= 0 || startSlot < firstAvailableBlock) {\n break;\n }\n\n try {\n const block = await this.getConfirmedBlockSignatures(\n startSlot,\n 'finalized',\n );\n if (block.signatures.length > 0) {\n options.until =\n block.signatures[block.signatures.length - 1].toString();\n }\n } catch (err) {\n if (err instanceof Error && err.message.includes('skipped')) {\n continue;\n } else {\n throw err;\n }\n }\n }\n\n let highestConfirmedRoot = await this.getSlot('finalized');\n while (!('before' in options)) {\n endSlot++;\n if (endSlot > highestConfirmedRoot) {\n break;\n }\n\n try {\n const block = await this.getConfirmedBlockSignatures(endSlot);\n if (block.signatures.length > 0) {\n options.before =\n block.signatures[block.signatures.length - 1].toString();\n }\n } catch (err) {\n if (err instanceof Error && err.message.includes('skipped')) {\n continue;\n } else {\n throw err;\n }\n }\n }\n\n const confirmedSignatureInfo = await this.getConfirmedSignaturesForAddress2(\n address,\n options,\n );\n return confirmedSignatureInfo.map(info => info.signature);\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getConfirmedSignaturesForAddress2(\n address: PublicKey,\n options?: ConfirmedSignaturesForAddress2Options,\n commitment?: Finality,\n ): Promise> {\n const args = this._buildArgsAtLeastConfirmed(\n [address.toBase58()],\n commitment,\n undefined,\n options,\n );\n const unsafeRes = await this._rpcRequest(\n 'getConfirmedSignaturesForAddress2',\n args,\n );\n const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed signatures for address: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getSignaturesForAddress(\n address: PublicKey,\n options?: SignaturesForAddressOptions,\n commitment?: Finality,\n ): Promise> {\n const args = this._buildArgsAtLeastConfirmed(\n [address.toBase58()],\n commitment,\n undefined,\n options,\n );\n const unsafeRes = await this._rpcRequest('getSignaturesForAddress', args);\n const res = create(unsafeRes, GetSignaturesForAddressRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get signatures for address: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster, return with context\n */\n async getNonceAndContext(\n nonceAccount: PublicKey,\n commitment?: Commitment,\n ): Promise> {\n const {context, value: accountInfo} = await this.getAccountInfoAndContext(\n nonceAccount,\n commitment,\n );\n\n let value = null;\n if (accountInfo !== null) {\n value = NonceAccount.fromAccountData(accountInfo.data);\n }\n\n return {\n context,\n value,\n };\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster\n */\n async getNonce(\n nonceAccount: PublicKey,\n commitment?: Commitment,\n ): Promise {\n return await this.getNonceAndContext(nonceAccount, commitment)\n .then(x => x.value)\n .catch(e => {\n throw new Error(\n 'failed to get nonce for account ' +\n nonceAccount.toBase58() +\n ': ' +\n e,\n );\n });\n }\n\n /**\n * Request an allocation of lamports to the specified address\n *\n * ```typescript\n * import { Connection, PublicKey, LAMPORTS_PER_SOL } from \"@solana/web3.js\";\n *\n * (async () => {\n * const connection = new Connection(\"https://api.testnet.solana.com\", \"confirmed\");\n * const myAddress = new PublicKey(\"2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM\");\n * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL);\n * await connection.confirmTransaction(signature);\n * })();\n * ```\n */\n async requestAirdrop(\n to: PublicKey,\n lamports: number,\n ): Promise {\n const unsafeRes = await this._rpcRequest('requestAirdrop', [\n to.toBase58(),\n lamports,\n ]);\n const res = create(unsafeRes, RequestAirdropRpcResult);\n if ('error' in res) {\n throw new Error(\n 'airdrop to ' + to.toBase58() + ' failed: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n async _recentBlockhash(disableCache: boolean): Promise {\n if (!disableCache) {\n // Wait for polling to finish\n while (this._pollingBlockhash) {\n await sleep(100);\n }\n const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch;\n const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS;\n if (this._blockhashInfo.recentBlockhash !== null && !expired) {\n return this._blockhashInfo.recentBlockhash;\n }\n }\n\n return await this._pollNewBlockhash();\n }\n\n /**\n * @internal\n */\n async _pollNewBlockhash(): Promise {\n this._pollingBlockhash = true;\n try {\n const startTime = Date.now();\n for (let i = 0; i < 50; i++) {\n const {blockhash} = await this.getRecentBlockhash('finalized');\n\n if (this._blockhashInfo.recentBlockhash != blockhash) {\n this._blockhashInfo = {\n recentBlockhash: blockhash,\n lastFetch: Date.now(),\n transactionSignatures: [],\n simulatedSignatures: [],\n };\n return blockhash;\n }\n\n // Sleep for approximately half a slot\n await sleep(MS_PER_SLOT / 2);\n }\n\n throw new Error(\n `Unable to obtain a new blockhash after ${Date.now() - startTime}ms`,\n );\n } finally {\n this._pollingBlockhash = false;\n }\n }\n\n /**\n * Simulate a transaction\n */\n async simulateTransaction(\n transactionOrMessage: Transaction | Message,\n signers?: Array,\n includeAccounts?: boolean | Array,\n ): Promise> {\n let transaction;\n if (transactionOrMessage instanceof Transaction) {\n transaction = transactionOrMessage;\n } else {\n transaction = Transaction.populate(transactionOrMessage);\n }\n\n if (transaction.nonceInfo && signers) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n transaction.recentBlockhash = await this._recentBlockhash(disableCache);\n\n if (!signers) break;\n\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n\n const signature = transaction.signature.toString('base64');\n if (\n !this._blockhashInfo.simulatedSignatures.includes(signature) &&\n !this._blockhashInfo.transactionSignatures.includes(signature)\n ) {\n // The signature of this transaction has not been seen before with the\n // current recentBlockhash, all done. Let's break\n this._blockhashInfo.simulatedSignatures.push(signature);\n break;\n } else {\n // This transaction would be treated as duplicate (its derived signature\n // matched to one of already recorded signatures).\n // So, we must fetch a new blockhash for a different signature by disabling\n // our cache not to wait for the cache expiration (BLOCKHASH_CACHE_TIMEOUT_MS).\n disableCache = true;\n }\n }\n }\n\n const message = transaction._compile();\n const signData = message.serialize();\n const wireTransaction = transaction._serialize(signData);\n const encodedTransaction = wireTransaction.toString('base64');\n const config: any = {\n encoding: 'base64',\n commitment: this.commitment,\n };\n\n if (includeAccounts) {\n const addresses = (\n Array.isArray(includeAccounts)\n ? includeAccounts\n : message.nonProgramIds()\n ).map(key => key.toBase58());\n\n config['accounts'] = {\n encoding: 'base64',\n addresses,\n };\n }\n\n if (signers) {\n config.sigVerify = true;\n }\n\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('simulateTransaction', args);\n const res = create(unsafeRes, SimulatedTransactionResponseStruct);\n if ('error' in res) {\n let logs;\n if ('data' in res.error) {\n logs = res.error.data.logs;\n if (logs && Array.isArray(logs)) {\n const traceIndent = '\\n ';\n const logTrace = traceIndent + logs.join(traceIndent);\n console.error(res.error.message, logTrace);\n }\n }\n throw new SendTransactionError(\n 'failed to simulate transaction: ' + res.error.message,\n logs,\n );\n }\n return res.result;\n }\n\n /**\n * Sign and send a transaction\n */\n async sendTransaction(\n transaction: Transaction,\n signers: Array,\n options?: SendOptions,\n ): Promise {\n if (transaction.nonceInfo) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n transaction.recentBlockhash = await this._recentBlockhash(disableCache);\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n\n const signature = transaction.signature.toString('base64');\n if (!this._blockhashInfo.transactionSignatures.includes(signature)) {\n // The signature of this transaction has not been seen before with the\n // current recentBlockhash, all done. Let's break\n this._blockhashInfo.transactionSignatures.push(signature);\n break;\n } else {\n // This transaction would be treated as duplicate (its derived signature\n // matched to one of already recorded signatures).\n // So, we must fetch a new blockhash for a different signature by disabling\n // our cache not to wait for the cache expiration (BLOCKHASH_CACHE_TIMEOUT_MS).\n disableCache = true;\n }\n }\n }\n\n const wireTransaction = transaction.serialize();\n return await this.sendRawTransaction(wireTransaction, options);\n }\n\n /**\n * Send a transaction that has already been signed and serialized into the\n * wire format\n */\n async sendRawTransaction(\n rawTransaction: Buffer | Uint8Array | Array,\n options?: SendOptions,\n ): Promise {\n const encodedTransaction = toBuffer(rawTransaction).toString('base64');\n const result = await this.sendEncodedTransaction(\n encodedTransaction,\n options,\n );\n return result;\n }\n\n /**\n * Send a transaction that has already been signed, serialized into the\n * wire format, and encoded as a base64 string\n */\n async sendEncodedTransaction(\n encodedTransaction: string,\n options?: SendOptions,\n ): Promise {\n const config: any = {encoding: 'base64'};\n const skipPreflight = options && options.skipPreflight;\n const preflightCommitment =\n (options && options.preflightCommitment) || this.commitment;\n\n if (skipPreflight) {\n config.skipPreflight = skipPreflight;\n }\n if (preflightCommitment) {\n config.preflightCommitment = preflightCommitment;\n }\n\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('sendTransaction', args);\n const res = create(unsafeRes, SendTransactionRpcResult);\n if ('error' in res) {\n let logs;\n if ('data' in res.error) {\n logs = res.error.data.logs;\n if (logs && Array.isArray(logs)) {\n const traceIndent = '\\n ';\n const logTrace = traceIndent + logs.join(traceIndent);\n console.error(res.error.message, logTrace);\n }\n }\n throw new SendTransactionError(\n 'failed to send transaction: ' + res.error.message,\n logs,\n );\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n _wsOnOpen() {\n this._rpcWebSocketConnected = true;\n this._rpcWebSocketHeartbeat = setInterval(() => {\n // Ping server every 5s to prevent idle timeouts\n this._rpcWebSocket.notify('ping').catch(() => {});\n }, 5000);\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnError(err: Error) {\n console.error('ws error:', err.message);\n }\n\n /**\n * @internal\n */\n _wsOnClose(code: number) {\n if (this._rpcWebSocketHeartbeat) {\n clearInterval(this._rpcWebSocketHeartbeat);\n this._rpcWebSocketHeartbeat = null;\n }\n\n if (code === 1000) {\n // explicit close, check if any subscriptions have been made since close\n this._updateSubscriptions();\n return;\n }\n\n // implicit close, prepare subscriptions for auto-reconnect\n this._resetSubscriptions();\n }\n\n /**\n * @internal\n */\n async _subscribe(\n sub: {subscriptionId: SubscriptionId | null},\n rpcMethod: string,\n rpcArgs: IWSRequestParams,\n ) {\n if (sub.subscriptionId == null) {\n sub.subscriptionId = 'subscribing';\n try {\n const id = await this._rpcWebSocket.call(rpcMethod, rpcArgs);\n if (typeof id === 'number' && sub.subscriptionId === 'subscribing') {\n // eslint-disable-next-line require-atomic-updates\n sub.subscriptionId = id;\n }\n } catch (err) {\n if (sub.subscriptionId === 'subscribing') {\n // eslint-disable-next-line require-atomic-updates\n sub.subscriptionId = null;\n }\n if (err instanceof Error) {\n console.error(\n `${rpcMethod} error for argument`,\n rpcArgs,\n err.message,\n );\n }\n }\n }\n }\n\n /**\n * @internal\n */\n async _unsubscribe(\n sub: {subscriptionId: SubscriptionId | null},\n rpcMethod: string,\n ) {\n const subscriptionId = sub.subscriptionId;\n if (subscriptionId != null && typeof subscriptionId != 'string') {\n const unsubscribeId: number = subscriptionId;\n try {\n await this._rpcWebSocket.call(rpcMethod, [unsubscribeId]);\n } catch (err) {\n if (err instanceof Error) {\n console.error(`${rpcMethod} error:`, err.message);\n }\n }\n }\n }\n\n /**\n * @internal\n */\n _resetSubscriptions() {\n Object.values(this._accountChangeSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._programAccountChangeSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._rootSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._signatureSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._slotSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._slotUpdateSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n }\n\n /**\n * @internal\n */\n _updateSubscriptions() {\n const accountKeys = Object.keys(this._accountChangeSubscriptions).map(\n Number,\n );\n const programKeys = Object.keys(\n this._programAccountChangeSubscriptions,\n ).map(Number);\n const slotKeys = Object.keys(this._slotSubscriptions).map(Number);\n const slotUpdateKeys = Object.keys(this._slotUpdateSubscriptions).map(\n Number,\n );\n const signatureKeys = Object.keys(this._signatureSubscriptions).map(Number);\n const rootKeys = Object.keys(this._rootSubscriptions).map(Number);\n const logsKeys = Object.keys(this._logsSubscriptions).map(Number);\n if (\n accountKeys.length === 0 &&\n programKeys.length === 0 &&\n slotKeys.length === 0 &&\n slotUpdateKeys.length === 0 &&\n signatureKeys.length === 0 &&\n rootKeys.length === 0 &&\n logsKeys.length === 0\n ) {\n if (this._rpcWebSocketConnected) {\n this._rpcWebSocketConnected = false;\n this._rpcWebSocketIdleTimeout = setTimeout(() => {\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocket.close();\n }, 500);\n }\n return;\n }\n\n if (this._rpcWebSocketIdleTimeout !== null) {\n clearTimeout(this._rpcWebSocketIdleTimeout);\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocketConnected = true;\n }\n\n if (!this._rpcWebSocketConnected) {\n this._rpcWebSocket.connect();\n return;\n }\n\n for (let id of accountKeys) {\n const sub = this._accountChangeSubscriptions[id];\n this._subscribe(\n sub,\n 'accountSubscribe',\n this._buildArgs([sub.publicKey], sub.commitment, 'base64'),\n );\n }\n\n for (let id of programKeys) {\n const sub = this._programAccountChangeSubscriptions[id];\n this._subscribe(\n sub,\n 'programSubscribe',\n this._buildArgs([sub.programId], sub.commitment, 'base64', {\n filters: sub.filters,\n }),\n );\n }\n\n for (let id of slotKeys) {\n const sub = this._slotSubscriptions[id];\n this._subscribe(sub, 'slotSubscribe', []);\n }\n\n for (let id of slotUpdateKeys) {\n const sub = this._slotUpdateSubscriptions[id];\n this._subscribe(sub, 'slotsUpdatesSubscribe', []);\n }\n\n for (let id of signatureKeys) {\n const sub = this._signatureSubscriptions[id];\n const args: any[] = [sub.signature];\n if (sub.options) args.push(sub.options);\n this._subscribe(sub, 'signatureSubscribe', args);\n }\n\n for (let id of rootKeys) {\n const sub = this._rootSubscriptions[id];\n this._subscribe(sub, 'rootSubscribe', []);\n }\n\n for (let id of logsKeys) {\n const sub = this._logsSubscriptions[id];\n let filter;\n if (typeof sub.filter === 'object') {\n filter = {mentions: [sub.filter.toString()]};\n } else {\n filter = sub.filter;\n }\n this._subscribe(\n sub,\n 'logsSubscribe',\n this._buildArgs([filter], sub.commitment),\n );\n }\n }\n\n /**\n * @internal\n */\n _wsOnAccountNotification(notification: object) {\n const res = create(notification, AccountNotificationResult);\n for (const sub of Object.values(this._accountChangeSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result.value, res.result.context);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked whenever the specified account changes\n *\n * @param publicKey Public key of the account to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @return subscription id\n */\n onAccountChange(\n publicKey: PublicKey,\n callback: AccountChangeCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._accountChangeSubscriptionCounter;\n this._accountChangeSubscriptions[id] = {\n publicKey: publicKey.toBase58(),\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id subscription id to deregister\n */\n async removeAccountChangeListener(id: number): Promise {\n if (this._accountChangeSubscriptions[id]) {\n const subInfo = this._accountChangeSubscriptions[id];\n delete this._accountChangeSubscriptions[id];\n await this._unsubscribe(subInfo, 'accountUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown account change id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _wsOnProgramAccountNotification(notification: Object) {\n const res = create(notification, ProgramAccountNotificationResult);\n for (const sub of Object.values(this._programAccountChangeSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n const {value, context} = res.result;\n sub.callback(\n {\n accountId: value.pubkey,\n accountInfo: value.account,\n },\n context,\n );\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked whenever accounts owned by the\n * specified program change\n *\n * @param programId Public key of the program to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @param filters The program account filters to pass into the RPC method\n * @return subscription id\n */\n onProgramAccountChange(\n programId: PublicKey,\n callback: ProgramAccountChangeCallback,\n commitment?: Commitment,\n filters?: GetProgramAccountsFilter[],\n ): number {\n const id = ++this._programAccountChangeSubscriptionCounter;\n this._programAccountChangeSubscriptions[id] = {\n programId: programId.toBase58(),\n callback,\n commitment,\n subscriptionId: null,\n filters,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id subscription id to deregister\n */\n async removeProgramAccountChangeListener(id: number): Promise {\n if (this._programAccountChangeSubscriptions[id]) {\n const subInfo = this._programAccountChangeSubscriptions[id];\n delete this._programAccountChangeSubscriptions[id];\n await this._unsubscribe(subInfo, 'programUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown program account change id: ${id}`);\n }\n }\n\n /**\n * Registers a callback to be invoked whenever logs are emitted.\n */\n onLogs(\n filter: LogsFilter,\n callback: LogsCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._logsSubscriptionCounter;\n this._logsSubscriptions[id] = {\n filter,\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a logs callback.\n *\n * @param id subscription id to deregister.\n */\n async removeOnLogsListener(id: number): Promise {\n if (!this._logsSubscriptions[id]) {\n throw new Error(`Unknown logs id: ${id}`);\n }\n const subInfo = this._logsSubscriptions[id];\n delete this._logsSubscriptions[id];\n await this._unsubscribe(subInfo, 'logsUnsubscribe');\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnLogsNotification(notification: Object) {\n const res = create(notification, LogsNotificationResult);\n const keys = Object.keys(this._logsSubscriptions).map(Number);\n for (let id of keys) {\n const sub = this._logsSubscriptions[id];\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result.value, res.result.context);\n return;\n }\n }\n }\n\n /**\n * @internal\n */\n _wsOnSlotNotification(notification: Object) {\n const res = create(notification, SlotNotificationResult);\n for (const sub of Object.values(this._slotSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon slot changes\n *\n * @param callback Function to invoke whenever the slot changes\n * @return subscription id\n */\n onSlotChange(callback: SlotChangeCallback): number {\n const id = ++this._slotSubscriptionCounter;\n this._slotSubscriptions[id] = {\n callback,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a slot notification callback\n *\n * @param id subscription id to deregister\n */\n async removeSlotChangeListener(id: number): Promise {\n if (this._slotSubscriptions[id]) {\n const subInfo = this._slotSubscriptions[id];\n delete this._slotSubscriptions[id];\n await this._unsubscribe(subInfo, 'slotUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown slot change id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _wsOnSlotUpdatesNotification(notification: Object) {\n const res = create(notification, SlotUpdateNotificationResult);\n for (const sub of Object.values(this._slotUpdateSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s\n * may be useful to track live progress of a cluster.\n *\n * @param callback Function to invoke whenever the slot updates\n * @return subscription id\n */\n onSlotUpdate(callback: SlotUpdateCallback): number {\n const id = ++this._slotUpdateSubscriptionCounter;\n this._slotUpdateSubscriptions[id] = {\n callback,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a slot update notification callback\n *\n * @param id subscription id to deregister\n */\n async removeSlotUpdateListener(id: number): Promise {\n if (this._slotUpdateSubscriptions[id]) {\n const subInfo = this._slotUpdateSubscriptions[id];\n delete this._slotUpdateSubscriptions[id];\n await this._unsubscribe(subInfo, 'slotsUpdatesUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown slot update id: ${id}`);\n }\n }\n\n _buildArgs(\n args: Array,\n override?: Commitment,\n encoding?: 'jsonParsed' | 'base64',\n extra?: any,\n ): Array {\n const commitment = override || this._commitment;\n if (commitment || encoding || extra) {\n let options: any = {};\n if (encoding) {\n options.encoding = encoding;\n }\n if (commitment) {\n options.commitment = commitment;\n }\n if (extra) {\n options = Object.assign(options, extra);\n }\n args.push(options);\n }\n return args;\n }\n\n /**\n * @internal\n */\n _buildArgsAtLeastConfirmed(\n args: Array,\n override?: Finality,\n encoding?: 'jsonParsed' | 'base64',\n extra?: any,\n ): Array {\n const commitment = override || this._commitment;\n if (commitment && !['confirmed', 'finalized'].includes(commitment)) {\n throw new Error(\n 'Using Connection with default commitment: `' +\n this._commitment +\n '`, but method requires at least `confirmed`',\n );\n }\n return this._buildArgs(args, override, encoding, extra);\n }\n\n /**\n * @internal\n */\n _wsOnSignatureNotification(notification: Object) {\n const res = create(notification, SignatureNotificationResult);\n for (const [id, sub] of Object.entries(this._signatureSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n if (res.result.value === 'receivedSignature') {\n sub.callback(\n {\n type: 'received',\n },\n res.result.context,\n );\n } else {\n // Signatures subscriptions are auto-removed by the RPC service so\n // no need to explicitly send an unsubscribe message\n delete this._signatureSubscriptions[Number(id)];\n this._updateSubscriptions();\n sub.callback(\n {\n type: 'status',\n result: res.result.value,\n },\n res.result.context,\n );\n }\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon signature updates\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param commitment Specify the commitment level signature must reach before notification\n * @return subscription id\n */\n onSignature(\n signature: TransactionSignature,\n callback: SignatureResultCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._signatureSubscriptionCounter;\n this._signatureSubscriptions[id] = {\n signature,\n callback: (notification, context) => {\n if (notification.type === 'status') {\n callback(notification.result, context);\n }\n },\n options: {commitment},\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Register a callback to be invoked when a transaction is\n * received and/or processed.\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param options Enable received notifications and set the commitment\n * level that signature must reach before notification\n * @return subscription id\n */\n onSignatureWithOptions(\n signature: TransactionSignature,\n callback: SignatureSubscriptionCallback,\n options?: SignatureSubscriptionOptions,\n ): number {\n const id = ++this._signatureSubscriptionCounter;\n this._signatureSubscriptions[id] = {\n signature,\n callback,\n options,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a signature notification callback\n *\n * @param id subscription id to deregister\n */\n async removeSignatureListener(id: number): Promise {\n if (this._signatureSubscriptions[id]) {\n const subInfo = this._signatureSubscriptions[id];\n delete this._signatureSubscriptions[id];\n await this._unsubscribe(subInfo, 'signatureUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown signature result id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _wsOnRootNotification(notification: Object) {\n const res = create(notification, RootNotificationResult);\n for (const sub of Object.values(this._rootSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon root changes\n *\n * @param callback Function to invoke whenever the root changes\n * @return subscription id\n */\n onRootChange(callback: RootChangeCallback): number {\n const id = ++this._rootSubscriptionCounter;\n this._rootSubscriptions[id] = {\n callback,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a root notification callback\n *\n * @param id subscription id to deregister\n */\n async removeRootChangeListener(id: number): Promise {\n if (this._rootSubscriptions[id]) {\n const subInfo = this._rootSubscriptions[id];\n delete this._rootSubscriptions[id];\n await this._unsubscribe(subInfo, 'rootUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown root change id: ${id}`);\n }\n }\n}\n","import nacl from 'tweetnacl';\n\nimport {PublicKey} from './publickey';\n\n/**\n * Keypair signer interface\n */\nexport interface Signer {\n publicKey: PublicKey;\n secretKey: Uint8Array;\n}\n\n/**\n * Ed25519 Keypair\n */\nexport interface Ed25519Keypair {\n publicKey: Uint8Array;\n secretKey: Uint8Array;\n}\n\n/**\n * An account keypair used for signing transactions.\n */\nexport class Keypair {\n private _keypair: Ed25519Keypair;\n\n /**\n * Create a new keypair instance.\n * Generate random keypair if no {@link Ed25519Keypair} is provided.\n *\n * @param keypair ed25519 keypair\n */\n constructor(keypair?: Ed25519Keypair) {\n if (keypair) {\n this._keypair = keypair;\n } else {\n this._keypair = nacl.sign.keyPair();\n }\n }\n\n /**\n * Generate a new random keypair\n */\n static generate(): Keypair {\n return new Keypair(nacl.sign.keyPair());\n }\n\n /**\n * Create a keypair from a raw secret key byte array.\n *\n * This method should only be used to recreate a keypair from a previously\n * generated secret key. Generating keypairs from a random seed should be done\n * with the {@link Keypair.fromSeed} method.\n *\n * @throws error if the provided secret key is invalid and validation is not skipped.\n *\n * @param secretKey secret key byte array\n * @param options: skip secret key validation\n */\n static fromSecretKey(\n secretKey: Uint8Array,\n options?: {skipValidation?: boolean},\n ): Keypair {\n const keypair = nacl.sign.keyPair.fromSecretKey(secretKey);\n if (!options || !options.skipValidation) {\n const encoder = new TextEncoder();\n const signData = encoder.encode('@solana/web3.js-validation-v1');\n const signature = nacl.sign.detached(signData, keypair.secretKey);\n if (!nacl.sign.detached.verify(signData, signature, keypair.publicKey)) {\n throw new Error('provided secretKey is invalid');\n }\n }\n return new Keypair(keypair);\n }\n\n /**\n * Generate a keypair from a 32 byte seed.\n *\n * @param seed seed byte array\n */\n static fromSeed(seed: Uint8Array): Keypair {\n return new Keypair(nacl.sign.keyPair.fromSeed(seed));\n }\n\n /**\n * The public key for this keypair\n */\n get publicKey(): PublicKey {\n return new PublicKey(this._keypair.publicKey);\n }\n\n /**\n * The raw secret key for this keypair\n */\n get secretKey(): Uint8Array {\n return this._keypair.secretKey;\n }\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from '@solana/buffer-layout';\nimport nacl from 'tweetnacl';\n\nimport {Keypair} from './keypair';\nimport {PublicKey} from './publickey';\nimport {TransactionInstruction} from './transaction';\nimport assert from './util/assert';\n\nconst PRIVATE_KEY_BYTES = 64;\nconst PUBLIC_KEY_BYTES = 32;\nconst SIGNATURE_BYTES = 64;\n\n/**\n * Params for creating an ed25519 instruction using a public key\n */\nexport type CreateEd25519InstructionWithPublicKeyParams = {\n publicKey: Uint8Array;\n message: Uint8Array;\n signature: Uint8Array;\n instructionIndex?: number;\n};\n\n/**\n * Params for creating an ed25519 instruction using a private key\n */\nexport type CreateEd25519InstructionWithPrivateKeyParams = {\n privateKey: Uint8Array;\n message: Uint8Array;\n instructionIndex?: number;\n};\n\nconst ED25519_INSTRUCTION_LAYOUT = BufferLayout.struct([\n BufferLayout.u8('numSignatures'),\n BufferLayout.u8('padding'),\n BufferLayout.u16('signatureOffset'),\n BufferLayout.u16('signatureInstructionIndex'),\n BufferLayout.u16('publicKeyOffset'),\n BufferLayout.u16('publicKeyInstructionIndex'),\n BufferLayout.u16('messageDataOffset'),\n BufferLayout.u16('messageDataSize'),\n BufferLayout.u16('messageInstructionIndex'),\n]);\n\nexport class Ed25519Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the ed25519 program\n */\n static programId: PublicKey = new PublicKey(\n 'Ed25519SigVerify111111111111111111111111111',\n );\n\n /**\n * Create an ed25519 instruction with a public key and signature. The\n * public key must be a buffer that is 32 bytes long, and the signature\n * must be a buffer of 64 bytes.\n */\n static createInstructionWithPublicKey(\n params: CreateEd25519InstructionWithPublicKeyParams,\n ): TransactionInstruction {\n const {publicKey, message, signature, instructionIndex} = params;\n\n assert(\n publicKey.length === PUBLIC_KEY_BYTES,\n `Public Key must be ${PUBLIC_KEY_BYTES} bytes but received ${publicKey.length} bytes`,\n );\n\n assert(\n signature.length === SIGNATURE_BYTES,\n `Signature must be ${SIGNATURE_BYTES} bytes but received ${signature.length} bytes`,\n );\n\n const publicKeyOffset = ED25519_INSTRUCTION_LAYOUT.span;\n const signatureOffset = publicKeyOffset + publicKey.length;\n const messageDataOffset = signatureOffset + signature.length;\n const numSignatures = 1;\n\n const instructionData = Buffer.alloc(messageDataOffset + message.length);\n\n ED25519_INSTRUCTION_LAYOUT.encode(\n {\n numSignatures,\n padding: 0,\n signatureOffset,\n signatureInstructionIndex: instructionIndex,\n publicKeyOffset,\n publicKeyInstructionIndex: instructionIndex,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: instructionIndex,\n },\n instructionData,\n );\n\n instructionData.fill(publicKey, publicKeyOffset);\n instructionData.fill(signature, signatureOffset);\n instructionData.fill(message, messageDataOffset);\n\n return new TransactionInstruction({\n keys: [],\n programId: Ed25519Program.programId,\n data: instructionData,\n });\n }\n\n /**\n * Create an ed25519 instruction with a private key. The private key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPrivateKey(\n params: CreateEd25519InstructionWithPrivateKeyParams,\n ): TransactionInstruction {\n const {privateKey, message, instructionIndex} = params;\n\n assert(\n privateKey.length === PRIVATE_KEY_BYTES,\n `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${privateKey.length} bytes`,\n );\n\n try {\n const keypair = Keypair.fromSecretKey(privateKey);\n const publicKey = keypair.publicKey.toBytes();\n const signature = nacl.sign.detached(message, keypair.secretKey);\n\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n instructionIndex,\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\n","import * as BufferLayout from '@solana/buffer-layout';\n\nimport {encodeData, decodeData, InstructionType} from './instruction';\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport {SystemProgram} from './system-program';\nimport {\n SYSVAR_CLOCK_PUBKEY,\n SYSVAR_RENT_PUBKEY,\n SYSVAR_STAKE_HISTORY_PUBKEY,\n} from './sysvar';\nimport {Transaction, TransactionInstruction} from './transaction';\nimport {toBuffer} from './util/to-buffer';\n\n/**\n * Address of the stake config account which configures the rate\n * of stake warmup and cooldown as well as the slashing penalty.\n */\nexport const STAKE_CONFIG_ID = new PublicKey(\n 'StakeConfig11111111111111111111111111111111',\n);\n\n/**\n * Stake account authority info\n */\nexport class Authorized {\n /** stake authority */\n staker: PublicKey;\n /** withdraw authority */\n withdrawer: PublicKey;\n\n /**\n * Create a new Authorized object\n * @param staker the stake authority\n * @param withdrawer the withdraw authority\n */\n constructor(staker: PublicKey, withdrawer: PublicKey) {\n this.staker = staker;\n this.withdrawer = withdrawer;\n }\n}\n\n/**\n * Stake account lockup info\n */\nexport class Lockup {\n /** Unix timestamp of lockup expiration */\n unixTimestamp: number;\n /** Epoch of lockup expiration */\n epoch: number;\n /** Lockup custodian authority */\n custodian: PublicKey;\n\n /**\n * Create a new Lockup object\n */\n constructor(unixTimestamp: number, epoch: number, custodian: PublicKey) {\n this.unixTimestamp = unixTimestamp;\n this.epoch = epoch;\n this.custodian = custodian;\n }\n\n /**\n * Default, inactive Lockup value\n */\n static default: Lockup = new Lockup(0, 0, PublicKey.default);\n}\n\n/**\n * Create stake account transaction params\n */\nexport type CreateStakeAccountParams = {\n /** Address of the account which will fund creation */\n fromPubkey: PublicKey;\n /** Address of the new stake account */\n stakePubkey: PublicKey;\n /** Authorities of the new stake account */\n authorized: Authorized;\n /** Lockup of the new stake account */\n lockup?: Lockup;\n /** Funding amount */\n lamports: number;\n};\n\n/**\n * Create stake account with seed transaction params\n */\nexport type CreateStakeAccountWithSeedParams = {\n fromPubkey: PublicKey;\n stakePubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n authorized: Authorized;\n lockup?: Lockup;\n lamports: number;\n};\n\n/**\n * Initialize stake instruction params\n */\nexport type InitializeStakeParams = {\n stakePubkey: PublicKey;\n authorized: Authorized;\n lockup?: Lockup;\n};\n\n/**\n * Delegate stake instruction params\n */\nexport type DelegateStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n votePubkey: PublicKey;\n};\n\n/**\n * Authorize stake instruction params\n */\nexport type AuthorizeStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n newAuthorizedPubkey: PublicKey;\n stakeAuthorizationType: StakeAuthorizationType;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Authorize stake instruction params using a derived key\n */\nexport type AuthorizeWithSeedStakeParams = {\n stakePubkey: PublicKey;\n authorityBase: PublicKey;\n authoritySeed: string;\n authorityOwner: PublicKey;\n newAuthorizedPubkey: PublicKey;\n stakeAuthorizationType: StakeAuthorizationType;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Split stake instruction params\n */\nexport type SplitStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n splitStakePubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Withdraw stake instruction params\n */\nexport type WithdrawStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Deactivate stake instruction params\n */\nexport type DeactivateStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Merge stake instruction params\n */\nexport type MergeStakeParams = {\n stakePubkey: PublicKey;\n sourceStakePubKey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Stake Instruction class\n */\nexport class StakeInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a stake instruction and retrieve the instruction type.\n */\n static decodeInstructionType(\n instruction: TransactionInstruction,\n ): StakeInstructionType {\n this.checkProgramId(instruction.programId);\n\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n\n let type: StakeInstructionType | undefined;\n for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType as StakeInstructionType;\n break;\n }\n }\n\n if (!type) {\n throw new Error('Instruction type incorrect; not a StakeInstruction');\n }\n\n return type;\n }\n\n /**\n * Decode a initialize stake instruction and retrieve the instruction params.\n */\n static decodeInitialize(\n instruction: TransactionInstruction,\n ): InitializeStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {authorized, lockup} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Initialize,\n instruction.data,\n );\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorized: new Authorized(\n new PublicKey(authorized.staker),\n new PublicKey(authorized.withdrawer),\n ),\n lockup: new Lockup(\n lockup.unixTimestamp,\n lockup.epoch,\n new PublicKey(lockup.custodian),\n ),\n };\n }\n\n /**\n * Decode a delegate stake instruction and retrieve the instruction params.\n */\n static decodeDelegate(\n instruction: TransactionInstruction,\n ): DelegateStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 6);\n decodeData(STAKE_INSTRUCTION_LAYOUTS.Delegate, instruction.data);\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n votePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[5].pubkey,\n };\n }\n\n /**\n * Decode an authorize stake instruction and retrieve the instruction params.\n */\n static decodeAuthorize(\n instruction: TransactionInstruction,\n ): AuthorizeStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {newAuthorized, stakeAuthorizationType} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Authorize,\n instruction.data,\n );\n\n const o: AuthorizeStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType,\n },\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode an authorize-with-seed stake instruction and retrieve the instruction params.\n */\n static decodeAuthorizeWithSeed(\n instruction: TransactionInstruction,\n ): AuthorizeWithSeedStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {\n newAuthorized,\n stakeAuthorizationType,\n authoritySeed,\n authorityOwner,\n } = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed,\n instruction.data,\n );\n\n const o: AuthorizeWithSeedStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n authorityBase: instruction.keys[1].pubkey,\n authoritySeed: authoritySeed,\n authorityOwner: new PublicKey(authorityOwner),\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType,\n },\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a split stake instruction and retrieve the instruction params.\n */\n static decodeSplit(instruction: TransactionInstruction): SplitStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {lamports} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Split,\n instruction.data,\n );\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n splitStakePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n lamports,\n };\n }\n\n /**\n * Decode a merge stake instruction and retrieve the instruction params.\n */\n static decodeMerge(instruction: TransactionInstruction): MergeStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData(STAKE_INSTRUCTION_LAYOUTS.Merge, instruction.data);\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n sourceStakePubKey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n };\n }\n\n /**\n * Decode a withdraw stake instruction and retrieve the instruction params.\n */\n static decodeWithdraw(\n instruction: TransactionInstruction,\n ): WithdrawStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n const {lamports} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Withdraw,\n instruction.data,\n );\n\n const o: WithdrawStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports,\n };\n if (instruction.keys.length > 5) {\n o.custodianPubkey = instruction.keys[5].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a deactivate stake instruction and retrieve the instruction params.\n */\n static decodeDeactivate(\n instruction: TransactionInstruction,\n ): DeactivateStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData(STAKE_INSTRUCTION_LAYOUTS.Deactivate, instruction.data);\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId: PublicKey) {\n if (!programId.equals(StakeProgram.programId)) {\n throw new Error('invalid instruction; programId is not StakeProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys: Array, expectedLength: number) {\n if (keys.length < expectedLength) {\n throw new Error(\n `invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`,\n );\n }\n }\n}\n\n/**\n * An enumeration of valid StakeInstructionType's\n */\nexport type StakeInstructionType =\n | 'AuthorizeWithSeed'\n | 'Authorize'\n | 'Deactivate'\n | 'Delegate'\n | 'Initialize'\n | 'Split'\n | 'Withdraw'\n | 'Merge';\n\n/**\n * An enumeration of valid stake InstructionType's\n * @internal\n */\nexport const STAKE_INSTRUCTION_LAYOUTS: {\n [type in StakeInstructionType]: InstructionType;\n} = Object.freeze({\n Initialize: {\n index: 0,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.authorized(),\n Layout.lockup(),\n ]),\n },\n Authorize: {\n index: 1,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('newAuthorized'),\n BufferLayout.u32('stakeAuthorizationType'),\n ]),\n },\n Delegate: {\n index: 2,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n Split: {\n index: 3,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n Withdraw: {\n index: 4,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n Deactivate: {\n index: 5,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n Merge: {\n index: 7,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n AuthorizeWithSeed: {\n index: 8,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('newAuthorized'),\n BufferLayout.u32('stakeAuthorizationType'),\n Layout.rustString('authoritySeed'),\n Layout.publicKey('authorityOwner'),\n ]),\n },\n});\n\n/**\n * Stake authorization type\n */\nexport type StakeAuthorizationType = {\n /** The Stake Authorization index (from solana-stake-program) */\n index: number;\n};\n\n/**\n * An enumeration of valid StakeAuthorizationLayout's\n */\nexport const StakeAuthorizationLayout = Object.freeze({\n Staker: {\n index: 0,\n },\n Withdrawer: {\n index: 1,\n },\n});\n\n/**\n * Factory class for transactions to interact with the Stake program\n */\nexport class StakeProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Stake program\n */\n static programId: PublicKey = new PublicKey(\n 'Stake11111111111111111111111111111111111111',\n );\n\n /**\n * Max space of a Stake account\n *\n * This is generated from the solana-stake-program StakeState struct as\n * `std::mem::size_of::()`:\n * https://docs.rs/solana-stake-program/1.4.4/solana_stake_program/stake_state/enum.StakeState.html\n */\n static space: number = 200;\n\n /**\n * Generate an Initialize instruction to add to a Stake Create transaction\n */\n static initialize(params: InitializeStakeParams): TransactionInstruction {\n const {stakePubkey, authorized, lockup: maybeLockup} = params;\n const lockup: Lockup = maybeLockup || Lockup.default;\n const type = STAKE_INSTRUCTION_LAYOUTS.Initialize;\n const data = encodeData(type, {\n authorized: {\n staker: toBuffer(authorized.staker.toBuffer()),\n withdrawer: toBuffer(authorized.withdrawer.toBuffer()),\n },\n lockup: {\n unixTimestamp: lockup.unixTimestamp,\n epoch: lockup.epoch,\n custodian: toBuffer(lockup.custodian.toBuffer()),\n },\n });\n const instructionData = {\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ],\n programId: this.programId,\n data,\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a Transaction that creates a new Stake account at\n * an address generated with `from`, a seed, and the Stake programId\n */\n static createAccountWithSeed(\n params: CreateStakeAccountWithSeedParams,\n ): Transaction {\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId,\n }),\n );\n\n const {stakePubkey, authorized, lockup} = params;\n return transaction.add(this.initialize({stakePubkey, authorized, lockup}));\n }\n\n /**\n * Generate a Transaction that creates a new Stake account\n */\n static createAccount(params: CreateStakeAccountParams): Transaction {\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId,\n }),\n );\n\n const {stakePubkey, authorized, lockup} = params;\n return transaction.add(this.initialize({stakePubkey, authorized, lockup}));\n }\n\n /**\n * Generate a Transaction that delegates Stake tokens to a validator\n * Vote PublicKey. This transaction can also be used to redelegate Stake\n * to a new validator Vote PublicKey.\n */\n static delegate(params: DelegateStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey, votePubkey} = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.Delegate;\n const data = encodeData(type);\n\n return new Transaction().add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: votePubkey, isSigner: false, isWritable: false},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: STAKE_CONFIG_ID, isSigner: false, isWritable: false},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorize(params: AuthorizeStakeParams): Transaction {\n const {\n stakePubkey,\n authorizedPubkey,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey,\n } = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.Authorize;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n stakeAuthorizationType: stakeAuthorizationType.index,\n });\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: true},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorizeWithSeed(params: AuthorizeWithSeedStakeParams): Transaction {\n const {\n stakePubkey,\n authorityBase,\n authoritySeed,\n authorityOwner,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey,\n } = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n stakeAuthorizationType: stakeAuthorizationType.index,\n authoritySeed: authoritySeed,\n authorityOwner: toBuffer(authorityOwner.toBuffer()),\n });\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: authorityBase, isSigner: true, isWritable: false},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that splits Stake tokens into another stake account\n */\n static split(params: SplitStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey, splitStakePubkey, lamports} = params;\n\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: authorizedPubkey,\n newAccountPubkey: splitStakePubkey,\n lamports: 0,\n space: this.space,\n programId: this.programId,\n }),\n );\n const type = STAKE_INSTRUCTION_LAYOUTS.Split;\n const data = encodeData(type, {lamports});\n\n return transaction.add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: splitStakePubkey, isSigner: false, isWritable: true},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that merges Stake accounts.\n */\n static merge(params: MergeStakeParams): Transaction {\n const {stakePubkey, sourceStakePubKey, authorizedPubkey} = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Merge;\n const data = encodeData(type);\n\n return new Transaction().add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: sourceStakePubKey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that withdraws deactivated Stake tokens.\n */\n static withdraw(params: WithdrawStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey, toPubkey, lamports, custodianPubkey} =\n params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw;\n const data = encodeData(type, {lamports});\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: toPubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that deactivates Stake tokens.\n */\n static deactivate(params: DeactivateStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey} = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Deactivate;\n const data = encodeData(type);\n\n return new Transaction().add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from '@solana/buffer-layout';\nimport secp256k1 from 'secp256k1';\nimport sha3 from 'js-sha3';\n\nimport {PublicKey} from './publickey';\nimport {TransactionInstruction} from './transaction';\nimport assert from './util/assert';\nimport {toBuffer} from './util/to-buffer';\n\nconst {publicKeyCreate, ecdsaSign} = secp256k1;\n\nconst PRIVATE_KEY_BYTES = 32;\nconst ETHEREUM_ADDRESS_BYTES = 20;\nconst PUBLIC_KEY_BYTES = 64;\nconst SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;\n\n/**\n * Params for creating an secp256k1 instruction using a public key\n */\nexport type CreateSecp256k1InstructionWithPublicKeyParams = {\n publicKey: Buffer | Uint8Array | Array;\n message: Buffer | Uint8Array | Array;\n signature: Buffer | Uint8Array | Array;\n recoveryId: number;\n instructionIndex?: number;\n};\n\n/**\n * Params for creating an secp256k1 instruction using an Ethereum address\n */\nexport type CreateSecp256k1InstructionWithEthAddressParams = {\n ethAddress: Buffer | Uint8Array | Array | string;\n message: Buffer | Uint8Array | Array;\n signature: Buffer | Uint8Array | Array;\n recoveryId: number;\n instructionIndex?: number;\n};\n\n/**\n * Params for creating an secp256k1 instruction using a private key\n */\nexport type CreateSecp256k1InstructionWithPrivateKeyParams = {\n privateKey: Buffer | Uint8Array | Array;\n message: Buffer | Uint8Array | Array;\n instructionIndex?: number;\n};\n\nconst SECP256K1_INSTRUCTION_LAYOUT = BufferLayout.struct([\n BufferLayout.u8('numSignatures'),\n BufferLayout.u16('signatureOffset'),\n BufferLayout.u8('signatureInstructionIndex'),\n BufferLayout.u16('ethAddressOffset'),\n BufferLayout.u8('ethAddressInstructionIndex'),\n BufferLayout.u16('messageDataOffset'),\n BufferLayout.u16('messageDataSize'),\n BufferLayout.u8('messageInstructionIndex'),\n BufferLayout.blob(20, 'ethAddress'),\n BufferLayout.blob(64, 'signature'),\n BufferLayout.u8('recoveryId'),\n]);\n\nexport class Secp256k1Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the secp256k1 program\n */\n static programId: PublicKey = new PublicKey(\n 'KeccakSecp256k11111111111111111111111111111',\n );\n\n /**\n * Construct an Ethereum address from a secp256k1 public key buffer.\n * @param {Buffer} publicKey a 64 byte secp256k1 public key buffer\n */\n static publicKeyToEthAddress(\n publicKey: Buffer | Uint8Array | Array,\n ): Buffer {\n assert(\n publicKey.length === PUBLIC_KEY_BYTES,\n `Public key must be ${PUBLIC_KEY_BYTES} bytes but received ${publicKey.length} bytes`,\n );\n\n try {\n return Buffer.from(\n sha3.keccak_256.update(toBuffer(publicKey)).digest(),\n ).slice(-ETHEREUM_ADDRESS_BYTES);\n } catch (error) {\n throw new Error(`Error constructing Ethereum address: ${error}`);\n }\n }\n\n /**\n * Create an secp256k1 instruction with a public key. The public key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPublicKey(\n params: CreateSecp256k1InstructionWithPublicKeyParams,\n ): TransactionInstruction {\n const {publicKey, message, signature, recoveryId, instructionIndex} =\n params;\n return Secp256k1Program.createInstructionWithEthAddress({\n ethAddress: Secp256k1Program.publicKeyToEthAddress(publicKey),\n message,\n signature,\n recoveryId,\n instructionIndex,\n });\n }\n\n /**\n * Create an secp256k1 instruction with an Ethereum address. The address\n * must be a hex string or a buffer that is 20 bytes long.\n */\n static createInstructionWithEthAddress(\n params: CreateSecp256k1InstructionWithEthAddressParams,\n ): TransactionInstruction {\n const {\n ethAddress: rawAddress,\n message,\n signature,\n recoveryId,\n instructionIndex = 0,\n } = params;\n\n let ethAddress;\n if (typeof rawAddress === 'string') {\n if (rawAddress.startsWith('0x')) {\n ethAddress = Buffer.from(rawAddress.substr(2), 'hex');\n } else {\n ethAddress = Buffer.from(rawAddress, 'hex');\n }\n } else {\n ethAddress = rawAddress;\n }\n\n assert(\n ethAddress.length === ETHEREUM_ADDRESS_BYTES,\n `Address must be ${ETHEREUM_ADDRESS_BYTES} bytes but received ${ethAddress.length} bytes`,\n );\n\n const dataStart = 1 + SIGNATURE_OFFSETS_SERIALIZED_SIZE;\n const ethAddressOffset = dataStart;\n const signatureOffset = dataStart + ethAddress.length;\n const messageDataOffset = signatureOffset + signature.length + 1;\n const numSignatures = 1;\n\n const instructionData = Buffer.alloc(\n SECP256K1_INSTRUCTION_LAYOUT.span + message.length,\n );\n\n SECP256K1_INSTRUCTION_LAYOUT.encode(\n {\n numSignatures,\n signatureOffset,\n signatureInstructionIndex: instructionIndex,\n ethAddressOffset,\n ethAddressInstructionIndex: instructionIndex,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: instructionIndex,\n signature: toBuffer(signature),\n ethAddress: toBuffer(ethAddress),\n recoveryId,\n },\n instructionData,\n );\n\n instructionData.fill(toBuffer(message), SECP256K1_INSTRUCTION_LAYOUT.span);\n\n return new TransactionInstruction({\n keys: [],\n programId: Secp256k1Program.programId,\n data: instructionData,\n });\n }\n\n /**\n * Create an secp256k1 instruction with a private key. The private key\n * must be a buffer that is 32 bytes long.\n */\n static createInstructionWithPrivateKey(\n params: CreateSecp256k1InstructionWithPrivateKeyParams,\n ): TransactionInstruction {\n const {privateKey: pkey, message, instructionIndex} = params;\n\n assert(\n pkey.length === PRIVATE_KEY_BYTES,\n `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`,\n );\n\n try {\n const privateKey = toBuffer(pkey);\n const publicKey = publicKeyCreate(privateKey, false).slice(1); // throw away leading byte\n const messageHash = Buffer.from(\n sha3.keccak_256.update(toBuffer(message)).digest(),\n );\n const {signature, recid: recoveryId} = ecdsaSign(messageHash, privateKey);\n\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n recoveryId,\n instructionIndex,\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\n","import {Buffer} from 'buffer';\nimport {\n assert as assertType,\n optional,\n string,\n type as pick,\n} from 'superstruct';\n\nimport * as Layout from './layout';\nimport * as shortvec from './util/shortvec-encoding';\nimport {PublicKey} from './publickey';\n\nexport const VALIDATOR_INFO_KEY = new PublicKey(\n 'Va1idator1nfo111111111111111111111111111111',\n);\n\n/**\n * @internal\n */\ntype ConfigKey = {\n publicKey: PublicKey;\n isSigner: boolean;\n};\n\n/**\n * Info used to identity validators.\n */\nexport type Info = {\n /** validator name */\n name: string;\n /** optional, validator website */\n website?: string;\n /** optional, extra information the validator chose to share */\n details?: string;\n /** optional, used to identify validators on keybase.io */\n keybaseUsername?: string;\n};\n\nconst InfoString = pick({\n name: string(),\n website: optional(string()),\n details: optional(string()),\n keybaseUsername: optional(string()),\n});\n\n/**\n * ValidatorInfo class\n */\nexport class ValidatorInfo {\n /**\n * validator public key\n */\n key: PublicKey;\n /**\n * validator information\n */\n info: Info;\n\n /**\n * Construct a valid ValidatorInfo\n *\n * @param key validator public key\n * @param info validator information\n */\n constructor(key: PublicKey, info: Info) {\n this.key = key;\n this.info = info;\n }\n\n /**\n * Deserialize ValidatorInfo from the config account data. Exactly two config\n * keys are required in the data.\n *\n * @param buffer config account data\n * @return null if info was not found\n */\n static fromConfigData(\n buffer: Buffer | Uint8Array | Array,\n ): ValidatorInfo | null {\n const PUBKEY_LENGTH = 32;\n\n let byteArray = [...buffer];\n const configKeyCount = shortvec.decodeLength(byteArray);\n if (configKeyCount !== 2) return null;\n\n const configKeys: Array = [];\n for (let i = 0; i < 2; i++) {\n const publicKey = new PublicKey(byteArray.slice(0, PUBKEY_LENGTH));\n byteArray = byteArray.slice(PUBKEY_LENGTH);\n const isSigner = byteArray.slice(0, 1)[0] === 1;\n byteArray = byteArray.slice(1);\n configKeys.push({publicKey, isSigner});\n }\n\n if (configKeys[0].publicKey.equals(VALIDATOR_INFO_KEY)) {\n if (configKeys[1].isSigner) {\n const rawInfo: any = Layout.rustString().decode(Buffer.from(byteArray));\n const info = JSON.parse(rawInfo as string);\n assertType(info, InfoString);\n return new ValidatorInfo(configKeys[1].publicKey, info);\n }\n }\n\n return null;\n }\n}\n","import * as BufferLayout from '@solana/buffer-layout';\nimport type {Buffer} from 'buffer';\n\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport {toBuffer} from './util/to-buffer';\n\nexport const VOTE_PROGRAM_ID = new PublicKey(\n 'Vote111111111111111111111111111111111111111',\n);\n\nexport type Lockout = {\n slot: number;\n confirmationCount: number;\n};\n\n/**\n * History of how many credits earned by the end of each epoch\n */\nexport type EpochCredits = {\n epoch: number;\n credits: number;\n prevCredits: number;\n};\n\n/**\n * See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88\n *\n * @internal\n */\nconst VoteAccountLayout = BufferLayout.struct([\n Layout.publicKey('nodePubkey'),\n Layout.publicKey('authorizedVoterPubkey'),\n Layout.publicKey('authorizedWithdrawerPubkey'),\n BufferLayout.u8('commission'),\n BufferLayout.nu64(), // votes.length\n BufferLayout.seq(\n BufferLayout.struct([\n BufferLayout.nu64('slot'),\n BufferLayout.u32('confirmationCount'),\n ]),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'votes',\n ),\n BufferLayout.u8('rootSlotValid'),\n BufferLayout.nu64('rootSlot'),\n BufferLayout.nu64('epoch'),\n BufferLayout.nu64('credits'),\n BufferLayout.nu64('lastEpochCredits'),\n BufferLayout.nu64(), // epochCredits.length\n BufferLayout.seq(\n BufferLayout.struct([\n BufferLayout.nu64('epoch'),\n BufferLayout.nu64('credits'),\n BufferLayout.nu64('prevCredits'),\n ]),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'epochCredits',\n ),\n]);\n\ntype VoteAccountArgs = {\n nodePubkey: PublicKey;\n authorizedVoterPubkey: PublicKey;\n authorizedWithdrawerPubkey: PublicKey;\n commission: number;\n votes: Array;\n rootSlot: number | null;\n epoch: number;\n credits: number;\n lastEpochCredits: number;\n epochCredits: Array;\n};\n\n/**\n * VoteAccount class\n */\nexport class VoteAccount {\n nodePubkey: PublicKey;\n authorizedVoterPubkey: PublicKey;\n authorizedWithdrawerPubkey: PublicKey;\n commission: number;\n votes: Array;\n rootSlot: number | null;\n epoch: number;\n credits: number;\n lastEpochCredits: number;\n epochCredits: Array;\n\n /**\n * @internal\n */\n constructor(args: VoteAccountArgs) {\n this.nodePubkey = args.nodePubkey;\n this.authorizedVoterPubkey = args.authorizedVoterPubkey;\n this.authorizedWithdrawerPubkey = args.authorizedWithdrawerPubkey;\n this.commission = args.commission;\n this.votes = args.votes;\n this.rootSlot = args.rootSlot;\n this.epoch = args.epoch;\n this.credits = args.credits;\n this.lastEpochCredits = args.lastEpochCredits;\n this.epochCredits = args.epochCredits;\n }\n\n /**\n * Deserialize VoteAccount from the account data.\n *\n * @param buffer account data\n * @return VoteAccount\n */\n static fromAccountData(\n buffer: Buffer | Uint8Array | Array,\n ): VoteAccount {\n const va = VoteAccountLayout.decode(toBuffer(buffer), 0);\n\n let rootSlot: number | null = va.rootSlot;\n if (!va.rootSlotValid) {\n rootSlot = null;\n }\n\n return new VoteAccount({\n nodePubkey: new PublicKey(va.nodePubkey),\n authorizedVoterPubkey: new PublicKey(va.authorizedVoterPubkey),\n authorizedWithdrawerPubkey: new PublicKey(va.authorizedWithdrawerPubkey),\n commission: va.commission,\n votes: va.votes,\n rootSlot,\n epoch: va.epoch,\n credits: va.credits,\n lastEpochCredits: va.lastEpochCredits,\n epochCredits: va.epochCredits,\n });\n }\n}\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","/* The MIT License (MIT)\n *\n * Copyright 2015-2018 Peter A. Bigot\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * Support for translating between Uint8Array instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n */\n'use strict';\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nexports.s16 = exports.s8 = exports.nu64be = exports.u48be = exports.u40be = exports.u32be = exports.u24be = exports.u16be = exports.nu64 = exports.u48 = exports.u40 = exports.u32 = exports.u24 = exports.u16 = exports.u8 = exports.offset = exports.greedy = exports.Constant = exports.UTF8 = exports.CString = exports.Blob = exports.Boolean = exports.BitField = exports.BitStructure = exports.VariantLayout = exports.Union = exports.UnionLayoutDiscriminator = exports.UnionDiscriminator = exports.Structure = exports.Sequence = exports.DoubleBE = exports.Double = exports.FloatBE = exports.Float = exports.NearInt64BE = exports.NearInt64 = exports.NearUInt64BE = exports.NearUInt64 = exports.IntBE = exports.Int = exports.UIntBE = exports.UInt = exports.OffsetLayout = exports.GreedyCount = exports.ExternalLayout = exports.bindConstructorLayout = exports.nameWithProperty = exports.Layout = exports.uint8ArrayToBuffer = exports.checkUint8Array = void 0;\nexports.constant = exports.utf8 = exports.cstr = exports.blob = exports.unionLayoutDiscriminator = exports.union = exports.seq = exports.bits = exports.struct = exports.f64be = exports.f64 = exports.f32be = exports.f32 = exports.ns64be = exports.s48be = exports.s40be = exports.s32be = exports.s24be = exports.s16be = exports.ns64 = exports.s48 = exports.s40 = exports.s32 = exports.s24 = void 0;\nvar buffer_1 = require(\"buffer\");\n/* Check if a value is a Uint8Array.\n *\n * @ignore */\nfunction checkUint8Array(b) {\n if (!(b instanceof Uint8Array)) {\n throw new TypeError('b must be a Uint8Array');\n }\n}\nexports.checkUint8Array = checkUint8Array;\n/* Create a Buffer instance from a Uint8Array.\n *\n * @ignore */\nfunction uint8ArrayToBuffer(b) {\n checkUint8Array(b);\n return buffer_1.Buffer.from(b.buffer, b.byteOffset, b.length);\n}\nexports.uint8ArrayToBuffer = uint8ArrayToBuffer;\n/**\n * Base class for layout objects.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * Layout#encode|encode} or {@link Layout#decode|decode} functions.\n *\n * @param {Number} span - Initializer for {@link Layout#span|span}. The\n * parameter must be an integer; a negative value signifies that the\n * span is {@link Layout#getSpan|value-specific}.\n *\n * @param {string} [property] - Initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n */\nvar Layout = /** @class */ (function () {\n function Layout(span, property) {\n if (!Number.isInteger(span)) {\n throw new TypeError('span must be an integer');\n }\n /** The span of the layout in bytes.\n *\n * Positive values are generally expected.\n *\n * Zero will only appear in {@link Constant}s and in {@link\n * Sequence}s where the {@link Sequence#count|count} is zero.\n *\n * A negative value indicates that the span is value-specific, and\n * must be obtained using {@link Layout#getSpan|getSpan}. */\n this.span = span;\n /** The property name used when this layout is represented in an\n * Object.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances. If left undefined the span of the unnamed layout will\n * be treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n /** Function to create an Object into which decoded properties will\n * be written.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances, which means:\n * * {@link Structure}\n * * {@link Union}\n * * {@link VariantLayout}\n * * {@link BitStructure}\n *\n * If left undefined the JavaScript representation of these layouts\n * will be Object instances.\n *\n * See {@link bindConstructorLayout}.\n */\n Layout.prototype.makeDestinationObject = function () {\n return {};\n };\n /**\n * Decode from a Uint8Array into a JavaScript value.\n *\n * @param {Uint8Array} b - the buffer from which encoded data is read.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {(Number|Array|Object)} - the value of the decoded data.\n *\n * @abstract\n */\n Layout.prototype.decode = function (b, offset) {\n throw new Error('Layout is abstract');\n };\n /**\n * Encode a JavaScript value into a Uint8Array.\n *\n * @param {(Number|Array|Object)} src - the value to be encoded into\n * the buffer. The type accepted depends on the (sub-)type of {@link\n * Layout}.\n *\n * @param {Uint8Array} b - the buffer into which encoded data will be\n * written.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {Number} - the number of bytes encoded, including the\n * space skipped for internal padding, but excluding data such as\n * {@link Sequence#count|lengths} when stored {@link\n * ExternalLayout|externally}. This is the adjustment to `offset`\n * producing the offset where data for the next layout would be\n * written.\n *\n * @abstract\n */\n Layout.prototype.encode = function (src, b, offset) {\n throw new Error('Layout is abstract');\n };\n /**\n * Calculate the span of a specific instance of a layout.\n *\n * @param {Uint8Array} b - the buffer that contains an encoded instance.\n *\n * @param {Number} [offset] - the offset at which the encoded instance\n * starts. If absent a zero offset is inferred.\n *\n * @return {Number} - the number of bytes covered by the layout\n * instance. If this method is not overridden in a subclass the\n * definition-time constant {@link Layout#span|span} will be\n * returned.\n *\n * @throws {RangeError} - if the length of the value cannot be\n * determined.\n */\n Layout.prototype.getSpan = function (b, offset) {\n if (0 > this.span) {\n throw new RangeError('indeterminate span');\n }\n return this.span;\n };\n /**\n * Replicate the layout using a new property.\n *\n * This function must be used to get a structurally-equivalent layout\n * with a different name since all {@link Layout} instances are\n * immutable.\n *\n * **NOTE** This is a shallow copy. All fields except {@link\n * Layout#property|property} are strictly equal to the origin layout.\n *\n * @param {String} property - the value for {@link\n * Layout#property|property} in the replica.\n *\n * @returns {Layout} - the copy with {@link Layout#property|property}\n * set to `property`.\n */\n Layout.prototype.replicate = function (property) {\n var rv = Object.create(this.constructor.prototype);\n Object.assign(rv, this);\n rv.property = property;\n return rv;\n };\n /**\n * Create an object from layout properties and an array of values.\n *\n * **NOTE** This function returns `undefined` if invoked on a layout\n * that does not return its value as an Object. Objects are\n * returned for things that are a {@link Structure}, which includes\n * {@link VariantLayout|variant layouts} if they are structures, and\n * excludes {@link Union}s. If you want this feature for a union\n * you must use {@link Union.getVariant|getVariant} to select the\n * desired layout.\n *\n * @param {Array} values - an array of values that correspond to the\n * default order for properties. As with {@link Layout#decode|decode}\n * layout elements that have no property name are skipped when\n * iterating over the array values. Only the top-level properties are\n * assigned; arguments are not assigned to properties of contained\n * layouts. Any unused values are ignored.\n *\n * @return {(Object|undefined)}\n */\n Layout.prototype.fromArray = function (values) {\n return undefined;\n };\n return Layout;\n}());\nexports.Layout = Layout;\n/* Provide text that carries a name (such as for a function that will\n * be throwing an error) annotated with the property of a given layout\n * (such as one for which the value was unacceptable).\n *\n * @ignore */\nfunction nameWithProperty(name, lo) {\n if (lo.property) {\n return name + '[' + lo.property + ']';\n }\n return name;\n}\nexports.nameWithProperty = nameWithProperty;\n/**\n * Augment a class so that instances can be encoded/decoded using a\n * given layout.\n *\n * Calling this function couples `Class` with `layout` in several ways:\n *\n * * `Class.layout_` becomes a static member property equal to `layout`;\n * * `layout.boundConstructor_` becomes a static member property equal\n * to `Class`;\n * * The {@link Layout#makeDestinationObject|makeDestinationObject()}\n * property of `layout` is set to a function that returns a `new\n * Class()`;\n * * `Class.decode(b, offset)` becomes a static member function that\n * delegates to {@link Layout#decode|layout.decode}. The\n * synthesized function may be captured and extended.\n * * `Class.prototype.encode(b, offset)` provides an instance member\n * function that delegates to {@link Layout#encode|layout.encode}\n * with `src` set to `this`. The synthesized function may be\n * captured and extended, but when the extension is invoked `this`\n * must be explicitly bound to the instance.\n *\n * @param {class} Class - a JavaScript class with a nullary\n * constructor.\n *\n * @param {Layout} layout - the {@link Layout} instance used to encode\n * instances of `Class`.\n */\nfunction bindConstructorLayout(Class, layout) {\n if ('function' !== typeof Class) {\n throw new TypeError('Class must be constructor');\n }\n if (Object.prototype.hasOwnProperty.call(Class, 'layout_')) {\n throw new Error('Class is already bound to a layout');\n }\n if (!(layout && (layout instanceof Layout))) {\n throw new TypeError('layout must be a Layout');\n }\n if (Object.prototype.hasOwnProperty.call(layout, 'boundConstructor_')) {\n throw new Error('layout is already bound to a constructor');\n }\n Class.layout_ = layout;\n layout.boundConstructor_ = Class;\n layout.makeDestinationObject = (function () { return new Class(); });\n Object.defineProperty(Class.prototype, 'encode', {\n value: function (b, offset) {\n return layout.encode(this, b, offset);\n },\n writable: true\n });\n Object.defineProperty(Class, 'decode', {\n value: function (b, offset) {\n return layout.decode(b, offset);\n },\n writable: true\n });\n}\nexports.bindConstructorLayout = bindConstructorLayout;\n/**\n * An object that behaves like a layout but does not consume space\n * within its containing layout.\n *\n * This is primarily used to obtain metadata about a member, such as a\n * {@link OffsetLayout} that can provide data about a {@link\n * Layout#getSpan|value-specific span}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support {@link\n * ExternalLayout#isCount|isCount} or other {@link Layout} functions.\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n * @augments {Layout}\n */\nvar ExternalLayout = /** @class */ (function (_super) {\n __extends(ExternalLayout, _super);\n function ExternalLayout() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Return `true` iff the external layout decodes to an unsigned\n * integer layout.\n *\n * In that case it can be used as the source of {@link\n * Sequence#count|Sequence counts}, {@link Blob#length|Blob lengths},\n * or as {@link UnionLayoutDiscriminator#layout|external union\n * discriminators}.\n *\n * @abstract\n */\n ExternalLayout.prototype.isCount = function () {\n throw new Error('ExternalLayout is abstract');\n };\n return ExternalLayout;\n}(Layout));\nexports.ExternalLayout = ExternalLayout;\n/**\n * An {@link ExternalLayout} that determines its {@link\n * Layout#decode|value} based on offset into and length of the buffer\n * on which it is invoked.\n *\n * *Factory*: {@link module:Layout.greedy|greedy}\n *\n * @param {Number} [elementSpan] - initializer for {@link\n * GreedyCount#elementSpan|elementSpan}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {ExternalLayout}\n */\nvar GreedyCount = /** @class */ (function (_super) {\n __extends(GreedyCount, _super);\n function GreedyCount(elementSpan, property) {\n var _this = this;\n if (undefined === elementSpan) {\n elementSpan = 1;\n }\n if ((!Number.isInteger(elementSpan)) || (0 >= elementSpan)) {\n throw new TypeError('elementSpan must be a (positive) integer');\n }\n _this = _super.call(this, -1, property) || this;\n /** The layout for individual elements of the sequence. The value\n * must be a positive integer. If not provided, the value will be\n * 1. */\n _this.elementSpan = elementSpan;\n return _this;\n }\n /** @override */\n GreedyCount.prototype.isCount = function () {\n return true;\n };\n /** @override */\n GreedyCount.prototype.decode = function (b, offset) {\n checkUint8Array(b);\n if (undefined === offset) {\n offset = 0;\n }\n var rem = b.length - offset;\n return Math.floor(rem / this.elementSpan);\n };\n /** @override */\n GreedyCount.prototype.encode = function (src, b, offset) {\n return 0;\n };\n return GreedyCount;\n}(ExternalLayout));\nexports.GreedyCount = GreedyCount;\n/**\n * An {@link ExternalLayout} that supports accessing a {@link Layout}\n * at a fixed offset from the start of another Layout. The offset may\n * be before, within, or after the base layout.\n *\n * *Factory*: {@link module:Layout.offset|offset}\n *\n * @param {Layout} layout - initializer for {@link\n * OffsetLayout#layout|layout}, modulo `property`.\n *\n * @param {Number} [offset] - Initializes {@link\n * OffsetLayout#offset|offset}. Defaults to zero.\n *\n * @param {string} [property] - Optional new property name for a\n * {@link Layout#replicate| replica} of `layout` to be used as {@link\n * OffsetLayout#layout|layout}. If not provided the `layout` is used\n * unchanged.\n *\n * @augments {Layout}\n */\nvar OffsetLayout = /** @class */ (function (_super) {\n __extends(OffsetLayout, _super);\n function OffsetLayout(layout, offset, property) {\n var _this = this;\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n if (undefined === offset) {\n offset = 0;\n }\n else if (!Number.isInteger(offset)) {\n throw new TypeError('offset must be integer or undefined');\n }\n _this = _super.call(this, layout.span, property || layout.property) || this;\n /** The subordinated layout. */\n _this.layout = layout;\n /** The location of {@link OffsetLayout#layout} relative to the\n * start of another layout.\n *\n * The value may be positive or negative, but an error will thrown\n * if at the point of use it goes outside the span of the Uint8Array\n * being accessed. */\n _this.offset = offset;\n return _this;\n }\n /** @override */\n OffsetLayout.prototype.isCount = function () {\n return ((this.layout instanceof UInt)\n || (this.layout instanceof UIntBE));\n };\n /** @override */\n OffsetLayout.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.decode(b, offset + this.offset);\n };\n /** @override */\n OffsetLayout.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.encode(src, b, offset + this.offset);\n };\n return OffsetLayout;\n}(ExternalLayout));\nexports.OffsetLayout = OffsetLayout;\n/**\n * Represent an unsigned integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.u8|u8}, {@link\n * module:Layout.u16|u16}, {@link module:Layout.u24|u24}, {@link\n * module:Layout.u32|u32}, {@link module:Layout.u40|u40}, {@link\n * module:Layout.u48|u48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar UInt = /** @class */ (function (_super) {\n __extends(UInt, _super);\n function UInt(span, property) {\n var _this = _super.call(this, span, property) || this;\n if (6 < _this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n return _this;\n }\n /** @override */\n UInt.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readUIntLE(offset, this.span);\n };\n /** @override */\n UInt.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeUIntLE(src, offset, this.span);\n return this.span;\n };\n return UInt;\n}(Layout));\nexports.UInt = UInt;\n/**\n * Represent an unsigned integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.u8be|u8be}, {@link\n * module:Layout.u16be|u16be}, {@link module:Layout.u24be|u24be},\n * {@link module:Layout.u32be|u32be}, {@link\n * module:Layout.u40be|u40be}, {@link module:Layout.u48be|u48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar UIntBE = /** @class */ (function (_super) {\n __extends(UIntBE, _super);\n function UIntBE(span, property) {\n var _this = _super.call(this, span, property) || this;\n if (6 < _this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n return _this;\n }\n /** @override */\n UIntBE.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readUIntBE(offset, this.span);\n };\n /** @override */\n UIntBE.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeUIntBE(src, offset, this.span);\n return this.span;\n };\n return UIntBE;\n}(Layout));\nexports.UIntBE = UIntBE;\n/**\n * Represent a signed integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.s8|s8}, {@link\n * module:Layout.s16|s16}, {@link module:Layout.s24|s24}, {@link\n * module:Layout.s32|s32}, {@link module:Layout.s40|s40}, {@link\n * module:Layout.s48|s48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar Int = /** @class */ (function (_super) {\n __extends(Int, _super);\n function Int(span, property) {\n var _this = _super.call(this, span, property) || this;\n if (6 < _this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n return _this;\n }\n /** @override */\n Int.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readIntLE(offset, this.span);\n };\n /** @override */\n Int.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeIntLE(src, offset, this.span);\n return this.span;\n };\n return Int;\n}(Layout));\nexports.Int = Int;\n/**\n * Represent a signed integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.s8be|s8be}, {@link\n * module:Layout.s16be|s16be}, {@link module:Layout.s24be|s24be},\n * {@link module:Layout.s32be|s32be}, {@link\n * module:Layout.s40be|s40be}, {@link module:Layout.s48be|s48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar IntBE = /** @class */ (function (_super) {\n __extends(IntBE, _super);\n function IntBE(span, property) {\n var _this = _super.call(this, span, property) || this;\n if (6 < _this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n return _this;\n }\n /** @override */\n IntBE.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readIntBE(offset, this.span);\n };\n /** @override */\n IntBE.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeIntBE(src, offset, this.span);\n return this.span;\n };\n return IntBE;\n}(Layout));\nexports.IntBE = IntBE;\nvar V2E32 = Math.pow(2, 32);\n/* True modulus high and low 32-bit words, where low word is always\n * non-negative. */\nfunction divmodInt64(src) {\n var hi32 = Math.floor(src / V2E32);\n var lo32 = src - (hi32 * V2E32);\n return { hi32: hi32, lo32: lo32 };\n}\n/* Reconstruct Number from quotient and non-negative remainder */\nfunction roundedInt64(hi32, lo32) {\n return hi32 * V2E32 + lo32;\n}\n/**\n * Represent an unsigned 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64|nu64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nvar NearUInt64 = /** @class */ (function (_super) {\n __extends(NearUInt64, _super);\n function NearUInt64(property) {\n return _super.call(this, 8, property) || this;\n }\n /** @override */\n NearUInt64.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var buffer = uint8ArrayToBuffer(b);\n var lo32 = buffer.readUInt32LE(offset);\n var hi32 = buffer.readUInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n };\n /** @override */\n NearUInt64.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var split = divmodInt64(src);\n var buffer = uint8ArrayToBuffer(b);\n buffer.writeUInt32LE(split.lo32, offset);\n buffer.writeUInt32LE(split.hi32, offset + 4);\n return 8;\n };\n return NearUInt64;\n}(Layout));\nexports.NearUInt64 = NearUInt64;\n/**\n * Represent an unsigned 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64be|nu64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nvar NearUInt64BE = /** @class */ (function (_super) {\n __extends(NearUInt64BE, _super);\n function NearUInt64BE(property) {\n return _super.call(this, 8, property) || this;\n }\n /** @override */\n NearUInt64BE.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var buffer = uint8ArrayToBuffer(b);\n var hi32 = buffer.readUInt32BE(offset);\n var lo32 = buffer.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n };\n /** @override */\n NearUInt64BE.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var split = divmodInt64(src);\n var buffer = uint8ArrayToBuffer(b);\n buffer.writeUInt32BE(split.hi32, offset);\n buffer.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n };\n return NearUInt64BE;\n}(Layout));\nexports.NearUInt64BE = NearUInt64BE;\n/**\n * Represent a signed 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64|ns64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nvar NearInt64 = /** @class */ (function (_super) {\n __extends(NearInt64, _super);\n function NearInt64(property) {\n return _super.call(this, 8, property) || this;\n }\n /** @override */\n NearInt64.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var buffer = uint8ArrayToBuffer(b);\n var lo32 = buffer.readUInt32LE(offset);\n var hi32 = buffer.readInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n };\n /** @override */\n NearInt64.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var split = divmodInt64(src);\n var buffer = uint8ArrayToBuffer(b);\n buffer.writeUInt32LE(split.lo32, offset);\n buffer.writeInt32LE(split.hi32, offset + 4);\n return 8;\n };\n return NearInt64;\n}(Layout));\nexports.NearInt64 = NearInt64;\n/**\n * Represent a signed 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64be|ns64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nvar NearInt64BE = /** @class */ (function (_super) {\n __extends(NearInt64BE, _super);\n function NearInt64BE(property) {\n return _super.call(this, 8, property) || this;\n }\n /** @override */\n NearInt64BE.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var buffer = uint8ArrayToBuffer(b);\n var hi32 = buffer.readInt32BE(offset);\n var lo32 = buffer.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n };\n /** @override */\n NearInt64BE.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var split = divmodInt64(src);\n var buffer = uint8ArrayToBuffer(b);\n buffer.writeInt32BE(split.hi32, offset);\n buffer.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n };\n return NearInt64BE;\n}(Layout));\nexports.NearInt64BE = NearInt64BE;\n/**\n * Represent a 32-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f32|f32}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar Float = /** @class */ (function (_super) {\n __extends(Float, _super);\n function Float(property) {\n return _super.call(this, 4, property) || this;\n }\n /** @override */\n Float.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readFloatLE(offset);\n };\n /** @override */\n Float.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeFloatLE(src, offset);\n return 4;\n };\n return Float;\n}(Layout));\nexports.Float = Float;\n/**\n * Represent a 32-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f32be|f32be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar FloatBE = /** @class */ (function (_super) {\n __extends(FloatBE, _super);\n function FloatBE(property) {\n return _super.call(this, 4, property) || this;\n }\n /** @override */\n FloatBE.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readFloatBE(offset);\n };\n /** @override */\n FloatBE.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeFloatBE(src, offset);\n return 4;\n };\n return FloatBE;\n}(Layout));\nexports.FloatBE = FloatBE;\n/**\n * Represent a 64-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f64|f64}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar Double = /** @class */ (function (_super) {\n __extends(Double, _super);\n function Double(property) {\n return _super.call(this, 8, property) || this;\n }\n /** @override */\n Double.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readDoubleLE(offset);\n };\n /** @override */\n Double.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeDoubleLE(src, offset);\n return 8;\n };\n return Double;\n}(Layout));\nexports.Double = Double;\n/**\n * Represent a 64-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f64be|f64be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar DoubleBE = /** @class */ (function (_super) {\n __extends(DoubleBE, _super);\n function DoubleBE(property) {\n return _super.call(this, 8, property) || this;\n }\n /** @override */\n DoubleBE.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return uint8ArrayToBuffer(b).readDoubleBE(offset);\n };\n /** @override */\n DoubleBE.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n uint8ArrayToBuffer(b).writeDoubleBE(src, offset);\n return 8;\n };\n return DoubleBE;\n}(Layout));\nexports.DoubleBE = DoubleBE;\n/**\n * Represent a contiguous sequence of a specific layout as an Array.\n *\n * *Factory*: {@link module:Layout.seq|seq}\n *\n * @param {Layout} elementLayout - initializer for {@link\n * Sequence#elementLayout|elementLayout}.\n *\n * @param {(Number|ExternalLayout)} count - initializer for {@link\n * Sequence#count|count}. The parameter must be either a positive\n * integer or an instance of {@link ExternalLayout}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar Sequence = /** @class */ (function (_super) {\n __extends(Sequence, _super);\n function Sequence(elementLayout, count, property) {\n var _this = this;\n if (!(elementLayout instanceof Layout)) {\n throw new TypeError('elementLayout must be a Layout');\n }\n if (!(((count instanceof ExternalLayout) && count.isCount())\n || (Number.isInteger(count) && (0 <= count)))) {\n throw new TypeError('count must be non-negative integer '\n + 'or an unsigned integer ExternalLayout');\n }\n var span = -1;\n if ((!(count instanceof ExternalLayout))\n && (0 < elementLayout.span)) {\n span = count * elementLayout.span;\n }\n _this = _super.call(this, span, property) || this;\n /** The layout for individual elements of the sequence. */\n _this.elementLayout = elementLayout;\n /** The number of elements in the sequence.\n *\n * This will be either a non-negative integer or an instance of\n * {@link ExternalLayout} for which {@link\n * ExternalLayout#isCount|isCount()} is `true`. */\n _this.count = count;\n return _this;\n }\n /** @override */\n Sequence.prototype.getSpan = function (b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n var span = 0;\n var count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n if (0 < this.elementLayout.span) {\n span = count * this.elementLayout.span;\n }\n else {\n var idx = 0;\n while (idx < count) {\n span += this.elementLayout.getSpan(b, offset + span);\n ++idx;\n }\n }\n return span;\n };\n /** @override */\n Sequence.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var rv = [];\n var i = 0;\n var count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n while (i < count) {\n rv.push(this.elementLayout.decode(b, offset));\n offset += this.elementLayout.getSpan(b, offset);\n i += 1;\n }\n return rv;\n };\n /** Implement {@link Layout#encode|encode} for {@link Sequence}.\n *\n * **NOTE** If `src` is shorter than {@link Sequence#count|count} then\n * the unused space in the buffer is left unchanged. If `src` is\n * longer than {@link Sequence#count|count} the unneeded elements are\n * ignored.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n Sequence.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var elo = this.elementLayout;\n var span = src.reduce(function (span, v) {\n return span + elo.encode(v, b, offset + span);\n }, 0);\n if (this.count instanceof ExternalLayout) {\n this.count.encode(src.length, b, offset);\n }\n return span;\n };\n return Sequence;\n}(Layout));\nexports.Sequence = Sequence;\n/**\n * Represent a contiguous sequence of arbitrary layout elements as an\n * Object.\n *\n * *Factory*: {@link module:Layout.struct|struct}\n *\n * **NOTE** The {@link Layout#span|span} of the structure is variable\n * if any layout in {@link Structure#fields|fields} has a variable\n * span. When {@link Layout#encode|encoding} we must have a value for\n * all variable-length fields, or we wouldn't be able to figure out\n * how much space to use for storage. We can only identify the value\n * for a field when it has a {@link Layout#property|property}. As\n * such, although a structure may contain both unnamed fields and\n * variable-length fields, it cannot contain an unnamed\n * variable-length field.\n *\n * @param {Layout[]} fields - initializer for {@link\n * Structure#fields|fields}. An error is raised if this contains a\n * variable-length field for which a {@link Layout#property|property}\n * is not defined.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @param {Boolean} [decodePrefixes] - initializer for {@link\n * Structure#decodePrefixes|property}.\n *\n * @throws {Error} - if `fields` contains an unnamed variable-length\n * layout.\n *\n * @augments {Layout}\n */\nvar Structure = /** @class */ (function (_super) {\n __extends(Structure, _super);\n function Structure(fields, property, decodePrefixes) {\n var _this = this;\n if (!(Array.isArray(fields)\n && fields.reduce(function (acc, v) { return acc && (v instanceof Layout); }, true))) {\n throw new TypeError('fields must be array of Layout instances');\n }\n if (('boolean' === typeof property)\n && (undefined === decodePrefixes)) {\n decodePrefixes = property;\n property = undefined;\n }\n /* Verify absence of unnamed variable-length fields. */\n for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) {\n var fd = fields_1[_i];\n if ((0 > fd.span)\n && (undefined === fd.property)) {\n throw new Error('fields cannot contain unnamed variable-length layout');\n }\n }\n var span = -1;\n try {\n span = fields.reduce(function (span, fd) { return span + fd.getSpan(); }, 0);\n }\n catch (e) {\n // ignore error\n }\n _this = _super.call(this, span, property) || this;\n /** The sequence of {@link Layout} values that comprise the\n * structure.\n *\n * The individual elements need not be the same type, and may be\n * either scalar or aggregate layouts. If a member layout leaves\n * its {@link Layout#property|property} undefined the\n * corresponding region of the buffer associated with the element\n * will not be mutated.\n *\n * @type {Layout[]} */\n _this.fields = fields;\n /** Control behavior of {@link Layout#decode|decode()} given short\n * buffers.\n *\n * In some situations a structure many be extended with additional\n * fields over time, with older installations providing only a\n * prefix of the full structure. If this property is `true`\n * decoding will accept those buffers and leave subsequent fields\n * undefined, as long as the buffer ends at a field boundary.\n * Defaults to `false`. */\n _this.decodePrefixes = !!decodePrefixes;\n return _this;\n }\n /** @override */\n Structure.prototype.getSpan = function (b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n var span = 0;\n try {\n span = this.fields.reduce(function (span, fd) {\n var fsp = fd.getSpan(b, offset);\n offset += fsp;\n return span + fsp;\n }, 0);\n }\n catch (e) {\n throw new RangeError('indeterminate span');\n }\n return span;\n };\n /** @override */\n Structure.prototype.decode = function (b, offset) {\n checkUint8Array(b);\n if (undefined === offset) {\n offset = 0;\n }\n var dest = this.makeDestinationObject();\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(b, offset);\n }\n offset += fd.getSpan(b, offset);\n if (this.decodePrefixes\n && (b.length === offset)) {\n break;\n }\n }\n return dest;\n };\n /** Implement {@link Layout#encode|encode} for {@link Structure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the buffer is\n * left unmodified. */\n Structure.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var firstOffset = offset;\n var lastOffset = 0;\n var lastWrote = 0;\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n var span = fd.span;\n lastWrote = (0 < span) ? span : 0;\n if (undefined !== fd.property) {\n var fv = src[fd.property];\n if (undefined !== fv) {\n lastWrote = fd.encode(fv, b, offset);\n if (0 > span) {\n /* Read the as-encoded span, which is not necessarily the\n * same as what we wrote. */\n span = fd.getSpan(b, offset);\n }\n }\n }\n lastOffset = offset;\n offset += span;\n }\n /* Use (lastOffset + lastWrote) instead of offset because the last\n * item may have had a dynamic length and we don't want to include\n * the padding between it and the end of the space reserved for\n * it. */\n return (lastOffset + lastWrote) - firstOffset;\n };\n /** @override */\n Structure.prototype.fromArray = function (values) {\n var dest = this.makeDestinationObject();\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n if ((undefined !== fd.property)\n && (0 < values.length)) {\n dest[fd.property] = values.shift();\n }\n }\n return dest;\n };\n /**\n * Get access to the layout of a given property.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Layout} - the layout associated with `property`, or\n * undefined if there is no such property.\n */\n Structure.prototype.layoutFor = function (property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n if (fd.property === property) {\n return fd;\n }\n }\n return undefined;\n };\n /**\n * Get the offset of a structure member.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Number} - the offset in bytes to the start of `property`\n * within the structure, or undefined if `property` is not a field\n * within the structure. If the property is a member but follows a\n * variable-length structure member a negative number will be\n * returned.\n */\n Structure.prototype.offsetOf = function (property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n var offset = 0;\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n if (fd.property === property) {\n return offset;\n }\n if (0 > fd.span) {\n offset = -1;\n }\n else if (0 <= offset) {\n offset += fd.span;\n }\n }\n return undefined;\n };\n return Structure;\n}(Layout));\nexports.Structure = Structure;\n/**\n * An object that can provide a {@link\n * Union#discriminator|discriminator} API for {@link Union}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * UnionDiscriminator#encode|encode} or {@link\n * UnionDiscriminator#decode|decode} functions.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}.\n *\n * @abstract\n */\nvar UnionDiscriminator = /** @class */ (function () {\n function UnionDiscriminator(property) {\n /** The {@link Layout#property|property} to be used when the\n * discriminator is referenced in isolation (generally when {@link\n * Union#decode|Union decode} cannot delegate to a specific\n * variant). */\n this.property = property;\n }\n /** Analog to {@link Layout#decode|Layout decode} for union discriminators.\n *\n * The implementation of this method need not reference the buffer if\n * variant information is available through other means. */\n UnionDiscriminator.prototype.decode = function (b, offset) {\n throw new Error('UnionDiscriminator is abstract');\n };\n /** Analog to {@link Layout#decode|Layout encode} for union discriminators.\n *\n * The implementation of this method need not store the value if\n * variant information is maintained through other means. */\n UnionDiscriminator.prototype.encode = function (src, b, offset) {\n throw new Error('UnionDiscriminator is abstract');\n };\n return UnionDiscriminator;\n}());\nexports.UnionDiscriminator = UnionDiscriminator;\n/**\n * An object that can provide a {@link\n * UnionDiscriminator|discriminator API} for {@link Union} using an\n * unsigned integral {@link Layout} instance located either inside or\n * outside the union.\n *\n * @param {ExternalLayout} layout - initializes {@link\n * UnionLayoutDiscriminator#layout|layout}. Must satisfy {@link\n * ExternalLayout#isCount|isCount()}.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}, superseding the property\n * from `layout`, but defaulting to `variant` if neither `property`\n * nor layout provide a property name.\n *\n * @augments {UnionDiscriminator}\n */\nvar UnionLayoutDiscriminator = /** @class */ (function (_super) {\n __extends(UnionLayoutDiscriminator, _super);\n function UnionLayoutDiscriminator(layout, property) {\n var _this = this;\n if (!((layout instanceof ExternalLayout)\n && layout.isCount())) {\n throw new TypeError('layout must be an unsigned integer ExternalLayout');\n }\n _this = _super.call(this, property || layout.property || 'variant') || this;\n /** The {@link ExternalLayout} used to access the discriminator\n * value. */\n _this.layout = layout;\n return _this;\n }\n /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n UnionLayoutDiscriminator.prototype.decode = function (b, offset) {\n return this.layout.decode(b, offset);\n };\n /** Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n UnionLayoutDiscriminator.prototype.encode = function (src, b, offset) {\n return this.layout.encode(src, b, offset);\n };\n return UnionLayoutDiscriminator;\n}(UnionDiscriminator));\nexports.UnionLayoutDiscriminator = UnionLayoutDiscriminator;\n/**\n * Represent any number of span-compatible layouts.\n *\n * *Factory*: {@link module:Layout.union|union}\n *\n * If the union has a {@link Union#defaultLayout|default layout} that\n * layout must have a non-negative {@link Layout#span|span}. The span\n * of a fixed-span union includes its {@link\n * Union#discriminator|discriminator} if the variant is a {@link\n * Union#usesPrefixDiscriminator|prefix of the union}, plus the span\n * of its {@link Union#defaultLayout|default layout}.\n *\n * If the union does not have a default layout then the encoded span\n * of the union depends on the encoded span of its variant (which may\n * be fixed or variable).\n *\n * {@link VariantLayout#layout|Variant layout}s are added through\n * {@link Union#addVariant|addVariant}. If the union has a default\n * layout, the span of the {@link VariantLayout#layout|layout\n * contained by the variant} must not exceed the span of the {@link\n * Union#defaultLayout|default layout} (minus the span of a {@link\n * Union#usesPrefixDiscriminator|prefix disriminator}, if used). The\n * span of the variant will equal the span of the union itself.\n *\n * The variant for a buffer can only be identified from the {@link\n * Union#discriminator|discriminator} {@link\n * UnionDiscriminator#property|property} (in the case of the {@link\n * Union#defaultLayout|default layout}), or by using {@link\n * Union#getVariant|getVariant} and examining the resulting {@link\n * VariantLayout} instance.\n *\n * A variant compatible with a JavaScript object can be identified\n * using {@link Union#getSourceVariant|getSourceVariant}.\n *\n * @param {(UnionDiscriminator|ExternalLayout|Layout)} discr - How to\n * identify the layout used to interpret the union contents. The\n * parameter must be an instance of {@link UnionDiscriminator}, an\n * {@link ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}, or {@link UInt} (or {@link\n * UIntBE}). When a non-external layout element is passed the layout\n * appears at the start of the union. In all cases the (synthesized)\n * {@link UnionDiscriminator} instance is recorded as {@link\n * Union#discriminator|discriminator}.\n *\n * @param {(Layout|null)} defaultLayout - initializer for {@link\n * Union#defaultLayout|defaultLayout}. If absent defaults to `null`.\n * If `null` there is no default layout: the union has data-dependent\n * length and attempts to decode or encode unrecognized variants will\n * throw an exception. A {@link Layout} instance must have a\n * non-negative {@link Layout#span|span}, and if it lacks a {@link\n * Layout#property|property} the {@link\n * Union#defaultLayout|defaultLayout} will be a {@link\n * Layout#replicate|replica} with property `content`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar Union = /** @class */ (function (_super) {\n __extends(Union, _super);\n function Union(discr, defaultLayout, property) {\n var _this = this;\n var upv = ((discr instanceof UInt)\n || (discr instanceof UIntBE));\n var discriminator;\n if (upv) {\n discriminator = new UnionLayoutDiscriminator(new OffsetLayout(discr));\n }\n else if ((discr instanceof ExternalLayout)\n && discr.isCount()) {\n discriminator = new UnionLayoutDiscriminator(discr);\n }\n else if (!(discr instanceof UnionDiscriminator)) {\n throw new TypeError('discr must be a UnionDiscriminator '\n + 'or an unsigned integer layout');\n }\n else {\n discriminator = discr;\n }\n if (undefined === defaultLayout) {\n defaultLayout = null;\n }\n if (!((null === defaultLayout)\n || (defaultLayout instanceof Layout))) {\n throw new TypeError('defaultLayout must be null or a Layout');\n }\n if (null !== defaultLayout) {\n if (0 > defaultLayout.span) {\n throw new Error('defaultLayout must have constant span');\n }\n if (undefined === defaultLayout.property) {\n defaultLayout = defaultLayout.replicate('content');\n }\n }\n /* The union span can be estimated only if there's a default\n * layout. The union spans its default layout, plus any prefix\n * variant layout. By construction both layouts, if present, have\n * non-negative span. */\n var span = -1;\n if (defaultLayout) {\n span = defaultLayout.span;\n if ((0 <= span) && upv) {\n span += discriminator.layout.span;\n }\n }\n _this = _super.call(this, span, property) || this;\n /** The interface for the discriminator value in isolation.\n *\n * This a {@link UnionDiscriminator} either passed to the\n * constructor or synthesized from the `discr` constructor\n * argument. {@link\n * Union#usesPrefixDiscriminator|usesPrefixDiscriminator} will be\n * `true` iff the `discr` parameter was a non-offset {@link\n * Layout} instance. */\n _this.discriminator = discriminator;\n /** `true` if the {@link Union#discriminator|discriminator} is the\n * first field in the union.\n *\n * If `false` the discriminator is obtained from somewhere\n * else. */\n _this.usesPrefixDiscriminator = upv;\n /** The layout for non-discriminator content when the value of the\n * discriminator is not recognized.\n *\n * This is the value passed to the constructor. It is\n * structurally equivalent to the second component of {@link\n * Union#layout|layout} but may have a different property\n * name. */\n _this.defaultLayout = defaultLayout;\n /** A registry of allowed variants.\n *\n * The keys are unsigned integers which should be compatible with\n * {@link Union.discriminator|discriminator}. The property value\n * is the corresponding {@link VariantLayout} instances assigned\n * to this union by {@link Union#addVariant|addVariant}.\n *\n * **NOTE** The registry remains mutable so that variants can be\n * {@link Union#addVariant|added} at any time. Users should not\n * manipulate the content of this property. */\n _this.registry = {};\n /* Private variable used when invoking getSourceVariant */\n var boundGetSourceVariant = _this.defaultGetSourceVariant.bind(_this);\n /** Function to infer the variant selected by a source object.\n *\n * Defaults to {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant} but may\n * be overridden using {@link\n * Union#configGetSourceVariant|configGetSourceVariant}.\n *\n * @param {Object} src - as with {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * @returns {(undefined|VariantLayout)} The default variant\n * (`undefined`) or first registered variant that uses a property\n * available in `src`. */\n _this.getSourceVariant = function (src) {\n return boundGetSourceVariant(src);\n };\n /** Function to override the implementation of {@link\n * Union#getSourceVariant|getSourceVariant}.\n *\n * Use this if the desired variant cannot be identified using the\n * algorithm of {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * **NOTE** The provided function will be invoked bound to this\n * Union instance, providing local access to {@link\n * Union#registry|registry}.\n *\n * @param {Function} gsv - a function that follows the API of\n * {@link Union#defaultGetSourceVariant|defaultGetSourceVariant}. */\n _this.configGetSourceVariant = function (gsv) {\n boundGetSourceVariant = gsv.bind(this);\n };\n return _this;\n }\n /** @override */\n Union.prototype.getSpan = function (b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n /* Default layouts always have non-negative span, so we don't have\n * one and we have to recognize the variant which will in turn\n * determine the span. */\n var vlo = this.getVariant(b, offset);\n if (!vlo) {\n throw new Error('unable to determine span for unrecognized variant');\n }\n return vlo.getSpan(b, offset);\n };\n /**\n * Method to infer a registered Union variant compatible with `src`.\n *\n * The first satisfied rule in the following sequence defines the\n * return value:\n * * If `src` has properties matching the Union discriminator and\n * the default layout, `undefined` is returned regardless of the\n * value of the discriminator property (this ensures the default\n * layout will be used);\n * * If `src` has a property matching the Union discriminator, the\n * value of the discriminator identifies a registered variant, and\n * either (a) the variant has no layout, or (b) `src` has the\n * variant's property, then the variant is returned (because the\n * source satisfies the constraints of the variant it identifies);\n * * If `src` does not have a property matching the Union\n * discriminator, but does have a property matching a registered\n * variant, then the variant is returned (because the source\n * matches a variant without an explicit conflict);\n * * An error is thrown (because we either can't identify a variant,\n * or we were explicitly told the variant but can't satisfy it).\n *\n * @param {Object} src - an object presumed to be compatible with\n * the content of the Union.\n *\n * @return {(undefined|VariantLayout)} - as described above.\n *\n * @throws {Error} - if `src` cannot be associated with a default or\n * registered variant.\n */\n Union.prototype.defaultGetSourceVariant = function (src) {\n if (Object.prototype.hasOwnProperty.call(src, this.discriminator.property)) {\n if (this.defaultLayout && this.defaultLayout.property\n && Object.prototype.hasOwnProperty.call(src, this.defaultLayout.property)) {\n return undefined;\n }\n var vlo = this.registry[src[this.discriminator.property]];\n if (vlo\n && ((!vlo.layout)\n || (vlo.property && Object.prototype.hasOwnProperty.call(src, vlo.property)))) {\n return vlo;\n }\n }\n else {\n for (var tag in this.registry) {\n var vlo = this.registry[tag];\n if (vlo.property && Object.prototype.hasOwnProperty.call(src, vlo.property)) {\n return vlo;\n }\n }\n }\n throw new Error('unable to infer src variant');\n };\n /** Implement {@link Layout#decode|decode} for {@link Union}.\n *\n * If the variant is {@link Union#addVariant|registered} the return\n * value is an instance of that variant, with no explicit\n * discriminator. Otherwise the {@link Union#defaultLayout|default\n * layout} is used to decode the content. */\n Union.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var dest;\n var dlo = this.discriminator;\n var discr = dlo.decode(b, offset);\n var clo = this.registry[discr];\n if (undefined === clo) {\n var defaultLayout = this.defaultLayout;\n var contentOffset = 0;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dest = this.makeDestinationObject();\n dest[dlo.property] = discr;\n dest[defaultLayout.property] = defaultLayout.decode(b, offset + contentOffset);\n }\n else {\n dest = clo.decode(b, offset);\n }\n return dest;\n };\n /** Implement {@link Layout#encode|encode} for {@link Union}.\n *\n * This API assumes the `src` object is consistent with the union's\n * {@link Union#defaultLayout|default layout}. To encode variants\n * use the appropriate variant-specific {@link VariantLayout#encode}\n * method. */\n Union.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var vlo = this.getSourceVariant(src);\n if (undefined === vlo) {\n var dlo = this.discriminator;\n // this.defaultLayout is not undefined when vlo is undefined\n var clo = this.defaultLayout;\n var contentOffset = 0;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dlo.encode(src[dlo.property], b, offset);\n // clo.property is not undefined when vlo is undefined\n return contentOffset + clo.encode(src[clo.property], b, offset + contentOffset);\n }\n return vlo.encode(src, b, offset);\n };\n /** Register a new variant structure within a union. The newly\n * created variant is returned.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} layout - initializer for {@link\n * VariantLayout#layout|layout}.\n *\n * @param {String} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {VariantLayout} */\n Union.prototype.addVariant = function (variant, layout, property) {\n var rv = new VariantLayout(this, variant, layout, property);\n this.registry[variant] = rv;\n return rv;\n };\n /**\n * Get the layout associated with a registered variant.\n *\n * If `vb` does not produce a registered variant the function returns\n * `undefined`.\n *\n * @param {(Number|Uint8Array)} vb - either the variant number, or a\n * buffer from which the discriminator is to be read.\n *\n * @param {Number} offset - offset into `vb` for the start of the\n * union. Used only when `vb` is an instance of {Uint8Array}.\n *\n * @return {({VariantLayout}|undefined)}\n */\n Union.prototype.getVariant = function (vb, offset) {\n var variant;\n if (vb instanceof Uint8Array) {\n if (undefined === offset) {\n offset = 0;\n }\n variant = this.discriminator.decode(vb, offset);\n }\n else {\n variant = vb;\n }\n return this.registry[variant];\n };\n return Union;\n}(Layout));\nexports.Union = Union;\n/**\n * Represent a specific variant within a containing union.\n *\n * **NOTE** The {@link Layout#span|span} of the variant may include\n * the span of the {@link Union#discriminator|discriminator} used to\n * identify it, but values read and written using the variant strictly\n * conform to the content of {@link VariantLayout#layout|layout}.\n *\n * **NOTE** User code should not invoke this constructor directly. Use\n * the union {@link Union#addVariant|addVariant} helper method.\n *\n * @param {Union} union - initializer for {@link\n * VariantLayout#union|union}.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} [layout] - initializer for {@link\n * VariantLayout#layout|layout}. If absent the variant carries no\n * data.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}. Unlike many other layouts, variant\n * layouts normally include a property name so they can be identified\n * within their containing {@link Union}. The property identifier may\n * be absent only if `layout` is is absent.\n *\n * @augments {Layout}\n */\nvar VariantLayout = /** @class */ (function (_super) {\n __extends(VariantLayout, _super);\n function VariantLayout(union, variant, layout, property) {\n var _this = this;\n if (!(union instanceof Union)) {\n throw new TypeError('union must be a Union');\n }\n if ((!Number.isInteger(variant)) || (0 > variant)) {\n throw new TypeError('variant must be a (non-negative) integer');\n }\n if (('string' === typeof layout)\n && (undefined === property)) {\n property = layout;\n layout = null;\n }\n if (layout) {\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n if ((null !== union.defaultLayout)\n && (0 <= layout.span)\n && (layout.span > union.defaultLayout.span)) {\n throw new Error('variant span exceeds span of containing union');\n }\n if ('string' !== typeof property) {\n throw new TypeError('variant must have a String property');\n }\n }\n var span = union.span;\n if (0 > union.span) {\n span = layout ? layout.span : 0;\n if ((0 <= span) && union.usesPrefixDiscriminator) {\n span += union.discriminator.layout.span;\n }\n }\n _this = _super.call(this, span, property) || this;\n /** The {@link Union} to which this variant belongs. */\n _this.union = union;\n /** The unsigned integral value identifying this variant within\n * the {@link Union#discriminator|discriminator} of the containing\n * union. */\n _this.variant = variant;\n /** The {@link Layout} to be used when reading/writing the\n * non-discriminator part of the {@link\n * VariantLayout#union|union}. If `null` the variant carries no\n * data. */\n _this.layout = layout || null;\n return _this;\n }\n /** @override */\n VariantLayout.prototype.getSpan = function (b, offset) {\n if (0 <= this.span) {\n /* Will be equal to the containing union span if that is not\n * variable. */\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n var contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n /* Span is defined solely by the variant (and prefix discriminator) */\n var span = 0;\n if (this.layout) {\n span = this.layout.getSpan(b, offset + contentOffset);\n }\n return contentOffset + span;\n };\n /** @override */\n VariantLayout.prototype.decode = function (b, offset) {\n var dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n if (this !== this.union.getVariant(b, offset)) {\n throw new Error('variant mismatch');\n }\n var contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n // VariantLayout property is never undefined\n var property = this.property;\n if (this.layout) {\n dest[property] = this.layout.decode(b, offset + contentOffset);\n }\n else if (property) {\n dest[property] = true;\n }\n else if (this.union.usesPrefixDiscriminator) {\n dest[this.union.discriminator.property] = this.variant;\n }\n return dest;\n };\n /** @override */\n VariantLayout.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n // VariantLayout property is never undefined\n var property = this.property;\n if (this.layout\n && (!Object.prototype.hasOwnProperty.call(src, property))) {\n throw new TypeError('variant lacks property ' + property);\n }\n this.union.discriminator.encode(this.variant, b, offset);\n var span = contentOffset;\n if (this.layout) {\n this.layout.encode(src[property], b, offset + contentOffset);\n span += this.layout.getSpan(b, offset + contentOffset);\n if ((0 <= this.union.span)\n && (span > this.union.span)) {\n throw new Error('encoded variant overruns containing union');\n }\n }\n return span;\n };\n /** Delegate {@link Layout#fromArray|fromArray} to {@link\n * VariantLayout#layout|layout}. */\n VariantLayout.prototype.fromArray = function (values) {\n if (this.layout) {\n return this.layout.fromArray(values);\n }\n return undefined;\n };\n return VariantLayout;\n}(Layout));\nexports.VariantLayout = VariantLayout;\n/** JavaScript chose to define bitwise operations as operating on\n * signed 32-bit values in 2's complement form, meaning any integer\n * with bit 31 set is going to look negative. For right shifts that's\n * not a problem, because `>>>` is a logical shift, but for every\n * other bitwise operator we have to compensate for possible negative\n * results. */\nfunction fixBitwiseResult(v) {\n if (0 > v) {\n v += 0x100000000;\n }\n return v;\n}\n/**\n * Contain a sequence of bit fields as an unsigned integer.\n *\n * *Factory*: {@link module:Layout.bits|bits}\n *\n * This is a container element; within it there are {@link BitField}\n * instances that provide the extracted properties. The container\n * simply defines the aggregate representation and its bit ordering.\n * The representation is an object containing properties with numeric\n * or {@link Boolean} values.\n *\n * {@link BitField}s are added with the {@link\n * BitStructure#addField|addField} and {@link\n * BitStructure#addBoolean|addBoolean} methods.\n\n * @param {Layout} word - initializer for {@link\n * BitStructure#word|word}. The parameter must be an instance of\n * {@link UInt} (or {@link UIntBE}) that is no more than 4 bytes wide.\n *\n * @param {bool} [msb] - `true` if the bit numbering starts at the\n * most significant bit of the containing word; `false` (default) if\n * it starts at the least significant bit of the containing word. If\n * the parameter at this position is a string and `property` is\n * `undefined` the value of this argument will instead be used as the\n * value of `property`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar BitStructure = /** @class */ (function (_super) {\n __extends(BitStructure, _super);\n function BitStructure(word, msb, property) {\n var _this = this;\n if (!((word instanceof UInt)\n || (word instanceof UIntBE))) {\n throw new TypeError('word must be a UInt or UIntBE layout');\n }\n if (('string' === typeof msb)\n && (undefined === property)) {\n property = msb;\n msb = false;\n }\n if (4 < word.span) {\n throw new RangeError('word cannot exceed 32 bits');\n }\n _this = _super.call(this, word.span, property) || this;\n /** The layout used for the packed value. {@link BitField}\n * instances are packed sequentially depending on {@link\n * BitStructure#msb|msb}. */\n _this.word = word;\n /** Whether the bit sequences are packed starting at the most\n * significant bit growing down (`true`), or the least significant\n * bit growing up (`false`).\n *\n * **NOTE** Regardless of this value, the least significant bit of\n * any {@link BitField} value is the least significant bit of the\n * corresponding section of the packed value. */\n _this.msb = !!msb;\n /** The sequence of {@link BitField} layouts that comprise the\n * packed structure.\n *\n * **NOTE** The array remains mutable to allow fields to be {@link\n * BitStructure#addField|added} after construction. Users should\n * not manipulate the content of this property.*/\n _this.fields = [];\n /* Storage for the value. Capture a variable instead of using an\n * instance property because we don't want anything to change the\n * value without going through the mutator. */\n var value = 0;\n _this._packedSetValue = function (v) {\n value = fixBitwiseResult(v);\n return this;\n };\n _this._packedGetValue = function () {\n return value;\n };\n return _this;\n }\n /** @override */\n BitStructure.prototype.decode = function (b, offset) {\n var dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n var value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(value);\n }\n }\n return dest;\n };\n /** Implement {@link Layout#encode|encode} for {@link BitStructure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the packed\n * value is left unmodified. Unused bits are also left unmodified. */\n BitStructure.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n if (undefined !== fd.property) {\n var fv = src[fd.property];\n if (undefined !== fv) {\n fd.encode(fv);\n }\n }\n }\n return this.word.encode(this._packedGetValue(), b, offset);\n };\n /** Register a new bitfield with a containing bit structure. The\n * resulting bitfield is returned.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {BitField} */\n BitStructure.prototype.addField = function (bits, property) {\n var bf = new BitField(this, bits, property);\n this.fields.push(bf);\n return bf;\n };\n /** As with {@link BitStructure#addField|addField} for single-bit\n * fields with `boolean` value representation.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {Boolean} */\n BitStructure.prototype.addBoolean = function (property) {\n // This is my Boolean, not the Javascript one.\n // eslint-disable-next-line no-new-wrappers\n var bf = new Boolean(this, property);\n this.fields.push(bf);\n return bf;\n };\n /**\n * Get access to the bit field for a given property.\n *\n * @param {String} property - the bit field of interest.\n *\n * @return {BitField} - the field associated with `property`, or\n * undefined if there is no such property.\n */\n BitStructure.prototype.fieldFor = function (property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (var _i = 0, _a = this.fields; _i < _a.length; _i++) {\n var fd = _a[_i];\n if (fd.property === property) {\n return fd;\n }\n }\n return undefined;\n };\n return BitStructure;\n}(Layout));\nexports.BitStructure = BitStructure;\n/**\n * Represent a sequence of bits within a {@link BitStructure}.\n *\n * All bit field values are represented as unsigned integers.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addField|addField} helper\n * method.\n *\n * **NOTE** BitField instances are not instances of {@link Layout}\n * since {@link Layout#span|span} measures 8-bit units.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n */\nvar BitField = /** @class */ (function () {\n function BitField(container, bits, property) {\n if (!(container instanceof BitStructure)) {\n throw new TypeError('container must be a BitStructure');\n }\n if ((!Number.isInteger(bits)) || (0 >= bits)) {\n throw new TypeError('bits must be positive integer');\n }\n var totalBits = 8 * container.span;\n var usedBits = container.fields.reduce(function (sum, fd) { return sum + fd.bits; }, 0);\n if ((bits + usedBits) > totalBits) {\n throw new Error('bits too long for span remainder ('\n + (totalBits - usedBits) + ' of '\n + totalBits + ' remain)');\n }\n /** The {@link BitStructure} instance to which this bit field\n * belongs. */\n this.container = container;\n /** The span of this value in bits. */\n this.bits = bits;\n /** A mask of {@link BitField#bits|bits} bits isolating value bits\n * that fit within the field.\n *\n * That is, it masks a value that has not yet been shifted into\n * position within its containing packed integer. */\n this.valueMask = (1 << bits) - 1;\n if (32 === bits) { // shifted value out of range\n this.valueMask = 0xFFFFFFFF;\n }\n /** The offset of the value within the containing packed unsigned\n * integer. The least significant bit of the packed value is at\n * offset zero, regardless of bit ordering used. */\n this.start = usedBits;\n if (this.container.msb) {\n this.start = totalBits - usedBits - bits;\n }\n /** A mask of {@link BitField#bits|bits} isolating the field value\n * within the containing packed unsigned integer. */\n this.wordMask = fixBitwiseResult(this.valueMask << this.start);\n /** The property name used when this bitfield is represented in an\n * Object.\n *\n * Intended to be functionally equivalent to {@link\n * Layout#property}.\n *\n * If left undefined the corresponding span of bits will be\n * treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n /** Store a value into the corresponding subsequence of the containing\n * bit field. */\n BitField.prototype.decode = function (b, offset) {\n var word = this.container._packedGetValue();\n var wordValue = fixBitwiseResult(word & this.wordMask);\n var value = wordValue >>> this.start;\n return value;\n };\n /** Store a value into the corresponding subsequence of the containing\n * bit field.\n *\n * **NOTE** This is not a specialization of {@link\n * Layout#encode|Layout.encode} and there is no return value. */\n BitField.prototype.encode = function (value) {\n if ((!Number.isInteger(value))\n || (value !== fixBitwiseResult(value & this.valueMask))) {\n throw new TypeError(nameWithProperty('BitField.encode', this)\n + ' value must be integer not exceeding ' + this.valueMask);\n }\n var word = this.container._packedGetValue();\n var wordValue = fixBitwiseResult(value << this.start);\n this.container._packedSetValue(fixBitwiseResult(word & ~this.wordMask)\n | wordValue);\n };\n return BitField;\n}());\nexports.BitField = BitField;\n/**\n * Represent a single bit within a {@link BitStructure} as a\n * JavaScript boolean.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addBoolean|addBoolean} helper\n * method.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {BitField}\n */\n/* eslint-disable no-extend-native */\nvar Boolean = /** @class */ (function (_super) {\n __extends(Boolean, _super);\n function Boolean(container, property) {\n return _super.call(this, container, 1, property) || this;\n }\n /** Override {@link BitField#decode|decode} for {@link Boolean|Boolean}.\n *\n * @returns {boolean} */\n Boolean.prototype.decode = function (b, offset) {\n return !!BitField.prototype.decode.call(this, b, offset);\n };\n /** @override */\n Boolean.prototype.encode = function (value) {\n if ('boolean' === typeof value) {\n // BitField requires integer values\n value = +value;\n }\n return BitField.prototype.encode.call(this, value);\n };\n return Boolean;\n}(BitField));\nexports.Boolean = Boolean;\n/* eslint-enable no-extend-native */\n/**\n * Contain a fixed-length block of arbitrary data, represented as a\n * Uint8Array.\n *\n * *Factory*: {@link module:Layout.blob|blob}\n *\n * @param {(Number|ExternalLayout)} length - initializes {@link\n * Blob#length|length}.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar Blob = /** @class */ (function (_super) {\n __extends(Blob, _super);\n function Blob(length, property) {\n var _this = this;\n if (!(((length instanceof ExternalLayout) && length.isCount())\n || (Number.isInteger(length) && (0 <= length)))) {\n throw new TypeError('length must be positive integer '\n + 'or an unsigned integer ExternalLayout');\n }\n var span = -1;\n if (!(length instanceof ExternalLayout)) {\n span = length;\n }\n _this = _super.call(this, span, property) || this;\n /** The number of bytes in the blob.\n *\n * This may be a non-negative integer, or an instance of {@link\n * ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}. */\n _this.length = length;\n return _this;\n }\n /** @override */\n Blob.prototype.getSpan = function (b, offset) {\n var span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return span;\n };\n /** @override */\n Blob.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return uint8ArrayToBuffer(b).slice(offset, offset + span);\n };\n /** Implement {@link Layout#encode|encode} for {@link Blob}.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n Blob.prototype.encode = function (src, b, offset) {\n var span = this.length;\n if (this.length instanceof ExternalLayout) {\n span = src.length;\n }\n if (!(src instanceof Uint8Array && span === src.length)) {\n throw new TypeError(nameWithProperty('Blob.encode', this)\n + ' requires (length ' + span + ') Uint8Array as src');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Uint8Array');\n }\n var srcBuffer = uint8ArrayToBuffer(src);\n uint8ArrayToBuffer(b).write(srcBuffer.toString('hex'), offset, span, 'hex');\n if (this.length instanceof ExternalLayout) {\n this.length.encode(span, b, offset);\n }\n return span;\n };\n return Blob;\n}(Layout));\nexports.Blob = Blob;\n/**\n * Contain a `NUL`-terminated UTF8 string.\n *\n * *Factory*: {@link module:Layout.cstr|cstr}\n *\n * **NOTE** Any UTF8 string that incorporates a zero-valued byte will\n * not be correctly decoded by this layout.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar CString = /** @class */ (function (_super) {\n __extends(CString, _super);\n function CString(property) {\n return _super.call(this, -1, property) || this;\n }\n /** @override */\n CString.prototype.getSpan = function (b, offset) {\n checkUint8Array(b);\n if (undefined === offset) {\n offset = 0;\n }\n var idx = offset;\n while ((idx < b.length) && (0 !== b[idx])) {\n idx += 1;\n }\n return 1 + idx - offset;\n };\n /** @override */\n CString.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var span = this.getSpan(b, offset);\n return uint8ArrayToBuffer(b).slice(offset, offset + span - 1).toString('utf-8');\n };\n /** @override */\n CString.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n var srcb = buffer_1.Buffer.from(src, 'utf8');\n var span = srcb.length;\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n var buffer = uint8ArrayToBuffer(b);\n srcb.copy(buffer, offset);\n buffer[offset + span] = 0;\n return span + 1;\n };\n return CString;\n}(Layout));\nexports.CString = CString;\n/**\n * Contain a UTF8 string with implicit length.\n *\n * *Factory*: {@link module:Layout.utf8|utf8}\n *\n * **NOTE** Because the length is implicit in the size of the buffer\n * this layout should be used only in isolation, or in a situation\n * where the length can be expressed by operating on a slice of the\n * containing buffer.\n *\n * @param {Number} [maxSpan] - the maximum length allowed for encoded\n * string content. If not provided there is no bound on the allowed\n * content.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar UTF8 = /** @class */ (function (_super) {\n __extends(UTF8, _super);\n function UTF8(maxSpan, property) {\n var _this = this;\n if (('string' === typeof maxSpan) && (undefined === property)) {\n property = maxSpan;\n maxSpan = undefined;\n }\n if (undefined === maxSpan) {\n maxSpan = -1;\n }\n else if (!Number.isInteger(maxSpan)) {\n throw new TypeError('maxSpan must be an integer');\n }\n _this = _super.call(this, -1, property) || this;\n /** The maximum span of the layout in bytes.\n *\n * Positive values are generally expected. Zero is abnormal.\n * Attempts to encode or decode a value that exceeds this length\n * will throw a `RangeError`.\n *\n * A negative value indicates that there is no bound on the length\n * of the content. */\n _this.maxSpan = maxSpan;\n return _this;\n }\n /** @override */\n UTF8.prototype.getSpan = function (b, offset) {\n checkUint8Array(b);\n if (undefined === offset) {\n offset = 0;\n }\n return b.length - offset;\n };\n /** @override */\n UTF8.prototype.decode = function (b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n var span = this.getSpan(b, offset);\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n return uint8ArrayToBuffer(b).slice(offset, offset + span).toString('utf-8');\n };\n /** @override */\n UTF8.prototype.encode = function (src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n var srcb = buffer_1.Buffer.from(src, 'utf8');\n var span = srcb.length;\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n srcb.copy(uint8ArrayToBuffer(b), offset);\n return span;\n };\n return UTF8;\n}(Layout));\nexports.UTF8 = UTF8;\n/**\n * Contain a constant value.\n *\n * This layout may be used in cases where a JavaScript value can be\n * inferred without an expression in the binary encoding. An example\n * would be a {@link VariantLayout|variant layout} where the content\n * is implied by the union {@link Union#discriminator|discriminator}.\n *\n * @param {Object|Number|String} value - initializer for {@link\n * Constant#value|value}. If the value is an object (or array) and\n * the application intends the object to remain unchanged regardless\n * of what is done to values decoded by this layout, the value should\n * be frozen prior passing it to this constructor.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nvar Constant = /** @class */ (function (_super) {\n __extends(Constant, _super);\n function Constant(value, property) {\n var _this = _super.call(this, 0, property) || this;\n /** The value produced by this constant when the layout is {@link\n * Constant#decode|decoded}.\n *\n * Any JavaScript value including `null` and `undefined` is\n * permitted.\n *\n * **WARNING** If `value` passed in the constructor was not\n * frozen, it is possible for users of decoded values to change\n * the content of the value. */\n _this.value = value;\n return _this;\n }\n /** @override */\n Constant.prototype.decode = function (b, offset) {\n return this.value;\n };\n /** @override */\n Constant.prototype.encode = function (src, b, offset) {\n /* Constants take no space */\n return 0;\n };\n return Constant;\n}(Layout));\nexports.Constant = Constant;\n/** Factory for {@link GreedyCount}. */\nexports.greedy = (function (elementSpan, property) { return new GreedyCount(elementSpan, property); });\n/** Factory for {@link OffsetLayout}. */\nexports.offset = (function (layout, offset, property) { return new OffsetLayout(layout, offset, property); });\n/** Factory for {@link UInt|unsigned int layouts} spanning one\n * byte. */\nexports.u8 = (function (property) { return new UInt(1, property); });\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16 = (function (property) { return new UInt(2, property); });\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24 = (function (property) { return new UInt(3, property); });\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32 = (function (property) { return new UInt(4, property); });\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40 = (function (property) { return new UInt(5, property); });\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48 = (function (property) { return new UInt(6, property); });\n/** Factory for {@link NearUInt64|little-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64 = (function (property) { return new NearUInt64(property); });\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16be = (function (property) { return new UIntBE(2, property); });\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24be = (function (property) { return new UIntBE(3, property); });\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32be = (function (property) { return new UIntBE(4, property); });\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40be = (function (property) { return new UIntBE(5, property); });\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48be = (function (property) { return new UIntBE(6, property); });\n/** Factory for {@link NearUInt64BE|big-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64be = (function (property) { return new NearUInt64BE(property); });\n/** Factory for {@link Int|signed int layouts} spanning one\n * byte. */\nexports.s8 = (function (property) { return new Int(1, property); });\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning two bytes. */\nexports.s16 = (function (property) { return new Int(2, property); });\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning three bytes. */\nexports.s24 = (function (property) { return new Int(3, property); });\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning four bytes. */\nexports.s32 = (function (property) { return new Int(4, property); });\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning five bytes. */\nexports.s40 = (function (property) { return new Int(5, property); });\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning six bytes. */\nexports.s48 = (function (property) { return new Int(6, property); });\n/** Factory for {@link NearInt64|little-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64 = (function (property) { return new NearInt64(property); });\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning two bytes. */\nexports.s16be = (function (property) { return new IntBE(2, property); });\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning three bytes. */\nexports.s24be = (function (property) { return new IntBE(3, property); });\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning four bytes. */\nexports.s32be = (function (property) { return new IntBE(4, property); });\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning five bytes. */\nexports.s40be = (function (property) { return new IntBE(5, property); });\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning six bytes. */\nexports.s48be = (function (property) { return new IntBE(6, property); });\n/** Factory for {@link NearInt64BE|big-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64be = (function (property) { return new NearInt64BE(property); });\n/** Factory for {@link Float|little-endian 32-bit floating point} values. */\nexports.f32 = (function (property) { return new Float(property); });\n/** Factory for {@link FloatBE|big-endian 32-bit floating point} values. */\nexports.f32be = (function (property) { return new FloatBE(property); });\n/** Factory for {@link Double|little-endian 64-bit floating point} values. */\nexports.f64 = (function (property) { return new Double(property); });\n/** Factory for {@link DoubleBE|big-endian 64-bit floating point} values. */\nexports.f64be = (function (property) { return new DoubleBE(property); });\n/** Factory for {@link Structure} values. */\nexports.struct = (function (fields, property, decodePrefixes) {\n return new Structure(fields, property, decodePrefixes);\n});\n/** Factory for {@link BitStructure} values. */\nexports.bits = (function (word, msb, property) { return new BitStructure(word, msb, property); });\n/** Factory for {@link Sequence} values. */\nexports.seq = (function (elementLayout, count, property) {\n return new Sequence(elementLayout, count, property);\n});\n/** Factory for {@link Union} values. */\nexports.union = (function (discr, defaultLayout, property) {\n return new Union(discr, defaultLayout, property);\n});\n/** Factory for {@link UnionLayoutDiscriminator} values. */\nexports.unionLayoutDiscriminator = (function (layout, property) { return new UnionLayoutDiscriminator(layout, property); });\n/** Factory for {@link Blob} values. */\nexports.blob = (function (length, property) { return new Blob(length, property); });\n/** Factory for {@link CString} values. */\nexports.cstr = (function (property) { return new CString(property); });\n/** Factory for {@link UTF8} values. */\nexports.utf8 = (function (maxSpan, property) { return new UTF8(maxSpan, property); });\n/** Factory for {@link Constant} values. */\nexports.constant = (function (value, property) { return new Constant(value, property); });\n//# sourceMappingURL=Layout.js.map","import JSBI from 'jsbi'\n\nexport const FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'\n\nexport const INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'\n\nexport const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)\n\n// exports for internal consumption\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\nexport const FIVE = JSBI.BigInt(5)\nexport const _997 = JSBI.BigInt(997)\nexport const _1000 = JSBI.BigInt(1000)\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport _Decimal from 'decimal.js-light'\nimport _Big, { RoundingMode } from 'big.js'\nimport toFormat from 'toformat'\n\nimport { BigintIsh, Rounding } from '../../constants'\n\nconst Decimal = toFormat(_Decimal)\nconst Big = toFormat(_Big)\n\nconst toSignificantRounding = {\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\n}\n\nconst toFixedRounding = {\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\n}\n\nexport class Fraction {\n public readonly numerator: JSBI\n public readonly denominator: JSBI\n\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\n this.numerator = JSBI.BigInt(numerator)\n this.denominator = JSBI.BigInt(denominator)\n }\n\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\n return new Fraction(fractionish)\n\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\n throw new Error('Could not parse fraction')\n }\n\n // performs floor division\n public get quotient(): JSBI {\n return JSBI.divide(this.numerator, this.denominator)\n }\n\n // remainder after floor division\n public get remainder(): Fraction {\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\n }\n\n public invert(): Fraction {\n return new Fraction(this.denominator, this.numerator)\n }\n\n public add(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.add(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public subtract(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.subtract(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public lessThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.lessThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public equalTo(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.equal(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public greaterThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.greaterThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public multiply(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.numerator),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public divide(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(this.denominator, otherParsed.numerator)\n )\n }\n\n public toSignificant(\n significantDigits: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\n\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\n const quotient = new Decimal(this.numerator.toString())\n .div(this.denominator.toString())\n .toSignificantDigits(significantDigits)\n return quotient.toFormat(quotient.decimalPlaces(), format)\n }\n\n public toFixed(\n decimalPlaces: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\n\n Big.DP = decimalPlaces\n Big.RM = toFixedRounding[rounding]\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\n }\n\n /**\n * Helper method for converting any super class back to a fraction\n */\n public get asFraction(): Fraction {\n return new Fraction(this.numerator, this.denominator)\n }\n}\n","import invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { Currency } from '../currency'\nimport { Token } from '../token'\nimport { Fraction } from './fraction'\nimport _Big from 'big.js'\n\nimport toFormat from 'toformat'\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\n\nconst Big = toFormat(_Big)\n\nexport class CurrencyAmount extends Fraction {\n public readonly currency: T\n public readonly decimalScale: JSBI\n\n /**\n * Returns a new currency amount instance from the unitless amount of token, i.e. the raw amount\n * @param currency the currency in the amount\n * @param rawAmount the raw token or ether amount\n */\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\n return new CurrencyAmount(currency, rawAmount)\n }\n\n /**\n * Construct a currency amount with a denominator that is not equal to 1\n * @param currency the currency\n * @param numerator the numerator of the fractional token amount\n * @param denominator the denominator of the fractional token amount\n */\n public static fromFractionalAmount(\n currency: T,\n numerator: BigintIsh,\n denominator: BigintIsh\n ): CurrencyAmount {\n return new CurrencyAmount(currency, numerator, denominator)\n }\n\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\n super(numerator, denominator)\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\n this.currency = currency\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\n }\n\n public add(other: CurrencyAmount): CurrencyAmount {\n invariant(this.currency.equals(other.currency), 'CURRENCY')\n const added = super.add(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\n }\n\n public subtract(other: CurrencyAmount): CurrencyAmount {\n invariant(this.currency.equals(other.currency), 'CURRENCY')\n const subtracted = super.subtract(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\n }\n\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\n const multiplied = super.multiply(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\n }\n\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\n const divided = super.divide(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\n }\n\n public toSignificant(\n significantDigits: number = 6,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(\n decimalPlaces: number = this.currency.decimals,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\n }\n\n public toExact(format: object = { groupSeparator: '' }): string {\n Big.DP = this.currency.decimals\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\n }\n\n public get wrapped(): CurrencyAmount {\n if (this.currency.isToken) return this as CurrencyAmount\n return CurrencyAmount.fromFractionalAmount(this.currency.wrapped, this.numerator, this.denominator)\n }\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Fraction } from './fraction'\n\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\n\n/**\n * Converts a fraction to a percent\n * @param fraction the fraction to convert\n */\nfunction toPercent(fraction: Fraction): Percent {\n return new Percent(fraction.numerator, fraction.denominator)\n}\n\nexport class Percent extends Fraction {\n /**\n * This boolean prevents a fraction from being interpreted as a Percent\n */\n public readonly isPercent: true = true\n\n add(other: Fraction | BigintIsh): Percent {\n return toPercent(super.add(other))\n }\n\n subtract(other: Fraction | BigintIsh): Percent {\n return toPercent(super.subtract(other))\n }\n\n multiply(other: Fraction | BigintIsh): Percent {\n return toPercent(super.multiply(other))\n }\n\n divide(other: Fraction | BigintIsh): Percent {\n return toPercent(super.divide(other))\n }\n\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Currency } from '../currency'\nimport { Fraction } from './fraction'\nimport { CurrencyAmount } from './currencyAmount'\n\nexport class Price extends Fraction {\n public readonly baseCurrency: TBase // input i.e. denominator\n public readonly quoteCurrency: TQuote // output i.e. numerator\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\n\n /**\n * Construct a price, either with the base and quote currency amount, or the\n * @param args\n */\n public constructor(\n ...args:\n | [TBase, TQuote, BigintIsh, BigintIsh]\n | [{ baseAmount: CurrencyAmount; quoteAmount: CurrencyAmount }]\n ) {\n let baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh\n\n if (args.length === 4) {\n ;[baseCurrency, quoteCurrency, denominator, numerator] = args\n } else {\n const result = args[0].quoteAmount.divide(args[0].baseAmount)\n ;[baseCurrency, quoteCurrency, denominator, numerator] = [\n args[0].baseAmount.currency,\n args[0].quoteAmount.currency,\n result.denominator,\n result.numerator\n ]\n }\n super(numerator, denominator)\n\n this.baseCurrency = baseCurrency\n this.quoteCurrency = quoteCurrency\n this.scalar = new Fraction(\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\n )\n }\n\n /**\n * Flip the price, switching the base and quote currency\n */\n public invert(): Price {\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\n }\n\n /**\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\n * @param other the other price\n */\n public multiply(other: Price): Price {\n invariant(this.quoteCurrency.equals(other.baseCurrency), 'TOKEN')\n const fraction = super.multiply(other)\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\n }\n\n /**\n * Return the amount of quote currency corresponding to a given amount of the base currency\n * @param currencyAmount the amount of base currency to quote against the price\n */\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\n invariant(currencyAmount.currency.equals(this.baseCurrency), 'TOKEN')\n const result = super.multiply(currencyAmount)\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\n }\n\n /**\n * Get the value scaled by decimals for formatting\n * @private\n */\n private get adjustedForDecimals(): Fraction {\n return super.multiply(this.scalar)\n }\n\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { Currency } from './currency'\nimport { Token } from './token'\n\n/**\n * A currency is any fungible financial instrument, including Ether, all ERC20 tokens, and other chain-native currencies\n */\nexport abstract class BaseCurrency {\n /**\n * Returns whether the currency is native to the chain and must be wrapped (e.g. Ether)\n */\n public abstract readonly isNative: boolean\n /**\n * Returns whether the currency is a token that is usable in Uniswap without wrapping\n */\n public abstract readonly isToken: boolean\n\n /**\n * The chain ID on which this currency resides\n */\n public readonly chainId: number\n /**\n * The decimals used in representing currency amounts\n */\n public readonly decimals: number\n /**\n * The symbol of the currency, i.e. a short textual non-unique identifier\n */\n public readonly symbol?: string\n /**\n * The name of the currency, i.e. a descriptive textual non-unique identifier\n */\n public readonly name?: string\n\n /**\n * Constructs an instance of the base class `BaseCurrency`.\n * @param chainId the chain ID on which this currency resides\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n protected constructor(chainId: number, decimals: number, symbol?: string, name?: string) {\n invariant(Number.isSafeInteger(chainId), 'CHAIN_ID')\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.chainId = chainId\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n }\n\n /**\n * Returns whether this currency is functionally equivalent to the other currency\n * @param other the other currency\n */\n public abstract equals(other: Currency): boolean\n\n /**\n * Return the wrapped version of this currency that can be used with the Uniswap contracts. Currencies must\n * implement this to be used in Uniswap\n */\n public abstract get wrapped(): Token\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the native currency of the chain on which it resides, e.g.\n */\nexport abstract class NativeCurrency extends BaseCurrency {\n public readonly isNative: true = true\n public readonly isToken: false = false\n}\n","import { getAddress } from '@ethersproject/address'\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\nimport { BaseCurrency } from './baseCurrency'\nimport { Currency } from './currency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isNative: false = false\n public readonly isToken: true = true\n\n /**\n * The contract address on the chain on which this token lives\n */\n public readonly address: string\n\n public constructor(chainId: number, address: string, decimals: number, symbol?: string, name?: string) {\n super(chainId, decimals, symbol, name)\n this.address = validateAndParseAddress(address)\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Currency): boolean {\n return other.isToken && this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n\n /**\n * Return this token, which does not need to be wrapped\n */\n public get wrapped(): Token {\n return this\n }\n}\n","import { Token } from './token'\n\n/**\n * Known WETH9 implementation addresses, used in our implementation of Ether#wrapped\n */\nexport const WETH9: { [chainId: number]: Token } = {\n [1]: new Token(1, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH', 'Wrapped Ether'),\n [3]: new Token(3, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH', 'Wrapped Ether'),\n [4]: new Token(4, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH', 'Wrapped Ether'),\n [5]: new Token(5, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH', 'Wrapped Ether'),\n [42]: new Token(42, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH', 'Wrapped Ether'),\n\n [10]: new Token(10, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'),\n [69]: new Token(69, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'),\n\n [42161]: new Token(42161, '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', 18, 'WETH', 'Wrapped Ether'),\n [421611]: new Token(421611, '0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681', 18, 'WETH', 'Wrapped Ether')\n}\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\n\n/**\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\n * @param midPrice mid price before the trade\n * @param inputAmount the input amount of the trade\n * @param outputAmount the output amount of the trade\n */\nexport function computePriceImpact(\n midPrice: Price,\n inputAmount: CurrencyAmount,\n outputAmount: CurrencyAmount\n): Percent {\n const quotedOutputAmount = midPrice.quote(inputAmount)\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\n return new Percent(priceImpact.numerator, priceImpact.denominator)\n}\n","import invariant from 'tiny-invariant'\n\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\n// `maxSize` by removing the last item\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\n\n // short circuit first item add\n if (items.length === 0) {\n items.push(add)\n return null\n } else {\n const isFull = items.length === maxSize\n // short circuit if full and the additional item does not come before the last item\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\n return add\n }\n\n let lo = 0,\n hi = items.length\n\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (comparator(items[mid], add) <= 0) {\n lo = mid + 1\n } else {\n hi = mid\n }\n }\n items.splice(lo, 0, add)\n return isFull ? items.pop()! : null\n }\n}\n","import invariant from 'tiny-invariant'\nimport { Currency } from './currency'\nimport { NativeCurrency } from './nativeCurrency'\nimport { Token } from './token'\nimport { WETH9 } from './weth9'\n\n/**\n * Ether is the main usage of a 'native' currency, i.e. for Ethereum mainnet and all testnets\n */\nexport class Ether extends NativeCurrency {\n protected constructor(chainId: number) {\n super(chainId, 18, 'ETH', 'Ether')\n }\n\n public get wrapped(): Token {\n const weth9 = WETH9[this.chainId]\n invariant(!!weth9, 'WRAPPED')\n return weth9\n }\n\n private static _etherCache: { [chainId: number]: Ether } = {}\n\n public static onChain(chainId: number): Ether {\n return this._etherCache[chainId] ?? (this._etherCache[chainId] = new Ether(chainId))\n }\n\n public equals(other: Currency): boolean {\n return other.isNative && other.chainId === this.chainId\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\n\nconst ZERO = JSBI.BigInt(0)\nconst ONE = JSBI.BigInt(1)\nconst TWO = JSBI.BigInt(2)\n\n/**\n * Computes floor(sqrt(value))\n * @param value the value for which to compute the square root, rounded down\n */\nexport function sqrt(value: JSBI): JSBI {\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\n\n // rely on built in sqrt if possible\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\n }\n\n let z: JSBI\n let x: JSBI\n z = value\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\n while (JSBI.lessThan(x, z)) {\n z = x\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\n }\n return z\n}\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nexport default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return possibleConstructorReturn(this, result);\n };\n}","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? prefix + \": \" + provided : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","function toVal(mix) {\n\tvar k, y, str='';\n\n\tif (typeof mix === 'string' || typeof mix === 'number') {\n\t\tstr += mix;\n\t} else if (typeof mix === 'object') {\n\t\tif (Array.isArray(mix)) {\n\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tif (y = toVal(mix[k])) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (k in mix) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\tstr += k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn str;\n}\n\nexport default function () {\n\tvar i=0, tmp, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (tmp = arguments[i++]) {\n\t\t\tif (x = toVal(tmp)) {\n\t\t\t\tstr && (str += ' ');\n\t\t\t\tstr += x\n\t\t\t}\n\t\t}\n\t}\n\treturn str;\n}\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.removeNull = exports.JSONSerializable = exports.prepareSignBytes = void 0;\nfunction prepareSignBytes(obj) {\n if (Array.isArray(obj)) {\n return obj.map(prepareSignBytes);\n }\n // string, number, or null\n if (typeof obj !== \"object\" || obj === null) {\n return obj;\n }\n var sorted = {};\n Object.keys(obj)\n .sort()\n .forEach(function (key) {\n if (obj[key] === undefined || obj[key] === null)\n return;\n sorted[key] = prepareSignBytes(obj[key]);\n });\n return sorted;\n}\nexports.prepareSignBytes = prepareSignBytes;\nvar JSONSerializable = /** @class */ (function () {\n function JSONSerializable() {\n }\n JSONSerializable.prototype.toJSON = function () {\n return JSON.stringify(prepareSignBytes(this.toData()));\n };\n JSONSerializable.prototype.toAminoJSON = function () {\n return JSON.stringify(prepareSignBytes(this.toAmino()));\n };\n return JSONSerializable;\n}());\nexports.JSONSerializable = JSONSerializable;\nfunction removeNull(obj) {\n if (obj !== null && typeof obj === 'object') {\n return Object.entries(obj)\n .filter(function (_a) {\n var v = _a[1];\n return v != null;\n })\n .reduce(function (acc, _a) {\n var _b;\n var k = _a[0], v = _a[1];\n return (__assign(__assign({}, acc), (_b = {}, _b[k] = v === Object(v) && !Array.isArray(v) ? removeNull(v) : v, _b)));\n }, {});\n }\n return obj;\n}\nexports.removeNull = removeNull;\n//# sourceMappingURL=json.js.map","module.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Any = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"google.protobuf\";\nconst baseAny = { typeUrl: \"\" };\nexports.Any = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.typeUrl !== \"\") {\n writer.uint32(10).string(message.typeUrl);\n }\n if (message.value.length !== 0) {\n writer.uint32(18).bytes(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseAny);\n message.value = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.typeUrl = reader.string();\n break;\n case 2:\n message.value = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseAny);\n message.value = new Uint8Array();\n if (object.typeUrl !== undefined && object.typeUrl !== null) {\n message.typeUrl = String(object.typeUrl);\n }\n else {\n message.typeUrl = \"\";\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = bytesFromBase64(object.value);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);\n message.value !== undefined &&\n (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseAny);\n if (object.typeUrl !== undefined && object.typeUrl !== null) {\n message.typeUrl = object.typeUrl;\n }\n else {\n message.typeUrl = \"\";\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = object.value;\n }\n else {\n message.value = new Uint8Array();\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=any.js.map","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { chainPropTypes, getDisplayName } from '@material-ui/utils';\nimport makeStyles from '../makeStyles';\nimport getThemeProps from '../getThemeProps';\nimport useTheme from '../useTheme'; // Link a style sheet with a component.\n// It does not modify the component passed to it;\n// instead, it returns a new component, with a `classes` property.\n\nvar withStyles = function withStyles(stylesOrCreator) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return function (Component) {\n var defaultTheme = options.defaultTheme,\n _options$withTheme = options.withTheme,\n withTheme = _options$withTheme === void 0 ? false : _options$withTheme,\n name = options.name,\n stylesOptions = _objectWithoutProperties(options, [\"defaultTheme\", \"withTheme\", \"name\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (Component === undefined) {\n throw new Error(['You are calling withStyles(styles)(Component) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = getDisplayName(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var useStyles = makeStyles(stylesOrCreator, _extends({\n defaultTheme: defaultTheme,\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var WithStyles = /*#__PURE__*/React.forwardRef(function WithStyles(props, ref) {\n var classesProp = props.classes,\n innerRef = props.innerRef,\n other = _objectWithoutProperties(props, [\"classes\", \"innerRef\"]); // The wrapper receives only user supplied props, which could be a subset of\n // the actual props Component might receive due to merging with defaultProps.\n // So copying it here would give us the same result in the wrapper as well.\n\n\n var classes = useStyles(_extends({}, Component.defaultProps, props));\n var theme;\n var more = other;\n\n if (typeof name === 'string' || withTheme) {\n // name and withTheme are invariant in the outer scope\n // eslint-disable-next-line react-hooks/rules-of-hooks\n theme = useTheme() || defaultTheme;\n\n if (name) {\n more = getThemeProps({\n theme: theme,\n name: name,\n props: other\n });\n } // Provide the theme to the wrapped component.\n // So we don't have to use the `withTheme()` Higher-order Component.\n\n\n if (withTheme && !more.theme) {\n more.theme = theme;\n }\n }\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n ref: innerRef || ref,\n classes: classes\n }, more));\n });\n process.env.NODE_ENV !== \"production\" ? WithStyles.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * Use that prop to pass a ref to the decorated component.\n * @deprecated\n */\n innerRef: chainPropTypes(PropTypes.oneOfType([PropTypes.func, PropTypes.object]), function (props) {\n if (props.innerRef == null) {\n return null;\n }\n\n return null; // return new Error(\n // 'Material-UI: The `innerRef` prop is deprecated and will be removed in v5. ' +\n // 'Refs are now automatically forwarded to the inner component.',\n // );\n })\n } : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n WithStyles.displayName = \"WithStyles(\".concat(getDisplayName(Component), \")\");\n }\n\n hoistNonReactStatics(WithStyles, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // Exposed for test purposes.\n WithStyles.Naked = Component;\n WithStyles.options = options;\n WithStyles.useStyles = useStyles;\n }\n\n return WithStyles;\n };\n};\n\nexport default withStyles;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { withStyles as withStylesWithoutDefault } from '@material-ui/styles';\nimport defaultTheme from './defaultTheme';\n\nfunction withStyles(stylesOrCreator, options) {\n return withStylesWithoutDefault(stylesOrCreator, _extends({\n defaultTheme: defaultTheme\n }, options));\n}\n\nexport default withStyles;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar coreWasms = {\n bundler: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./core/bridge\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n node: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./core-node/bridge\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n};\nvar migrationWasms = {\n bundler: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./migration/wormhole_migration\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n node: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./migration-node/wormhole_migration\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n};\nvar nftWasms = {\n bundler: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./nft/nft_bridge\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n node: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./nft-node/nft_bridge\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n};\nvar tokenWasms = {\n bundler: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./token/token_bridge\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n node: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\"./token-node/token_bridge\")];\n case 1: return [2 /*return*/, _a.sent()];\n }\n }); }); },\n};\nvar importDefaultCoreWasm = coreWasms.bundler;\nvar importDefaultMigrationWasm = migrationWasms.bundler;\nvar importDefaultNftWasm = nftWasms.bundler;\nvar importDefaultTokenWasm = tokenWasms.bundler;\nexport function setDefaultWasm(type) {\n importDefaultCoreWasm = coreWasms[type];\n importDefaultMigrationWasm = migrationWasms[type];\n importDefaultNftWasm = nftWasms[type];\n importDefaultTokenWasm = tokenWasms[type];\n}\nexport function importCoreWasm() {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importDefaultCoreWasm()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexport function importMigrationWasm() {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importDefaultMigrationWasm()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexport function importNftWasm() {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importDefaultNftWasm()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexport function importTokenWasm() {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importDefaultTokenWasm()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\n","import { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@material-ui/utils\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word a the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? \"Material-UI: capitalize(string) expects a string argument.\" : _formatMuiErrorMessage(7));\n }\n\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","var unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function F() {};\n\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\n\nmodule.exports = _createForOfIteratorHelper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(refA, refB) {\n /**\n * This will create a new function if the ref props change and are defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior\n */\n return React.useMemo(function () {\n if (refA == null && refB == null) {\n return null;\n }\n\n return function (refValue) {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","import unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nexport default function _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function F() {};\n\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // 'A' - 'F'\n if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n // '0' - '9'\n } else {\n return (c - 48) & 0xf;\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this.strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is BN v4 instance\n r.strip();\n } else {\n // r is BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DEFAULT_ADMIN_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar AccessControl__factory = /** @class */ (function () {\n function AccessControl__factory() {\n }\n AccessControl__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n AccessControl__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n AccessControl__factory.abi = _abi;\n return AccessControl__factory;\n}());\nexport { AccessControl__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DEFAULT_ADMIN_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"getRoleMember\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleMemberCount\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar AccessControlEnumerable__factory = /** @class */ (function () {\n function AccessControlEnumerable__factory() {\n }\n AccessControlEnumerable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n AccessControlEnumerable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n AccessControlEnumerable__factory.abi = _abi;\n return AccessControlEnumerable__factory;\n}());\nexport { AccessControlEnumerable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405260405161098838038061098883398101604081905261002291610483565b61004d60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5161058e565b6000805160206109418339815191521461007757634e487b7160e01b600052600160045260246000fd5b6100838282600061008a565b50506105f3565b61009383610164565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100d45750805b1561015f5761015d836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561011557600080fd5b505afa158015610129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014d9190610469565b8361030460201b6100291760201c565b505b505050565b6101778161033060201b6100551760201c565b6101d65760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b610259816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561021257600080fd5b505afa158015610226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024a9190610469565b61033060201b6100551760201c565b6102be5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101cd565b806102e360008051602061094183398151915260001b61033a60201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061032983836040518060600160405280602781526020016109616027913961033d565b9392505050565b803b15155b919050565b90565b606061034884610330565b6103a35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101cd565b600080856001600160a01b0316856040516103be919061053f565b600060405180830381855af49150503d80600081146103f9576040519150601f19603f3d011682016040523d82523d6000602084013e6103fe565b606091505b50909250905061040f828286610419565b9695505050505050565b60608315610428575081610329565b8251156104385782518084602001fd5b8160405162461bcd60e51b81526004016101cd919061055b565b80516001600160a01b038116811461033557600080fd5b60006020828403121561047a578081fd5b61032982610452565b60008060408385031215610495578081fd5b61049e83610452565b60208401519092506001600160401b03808211156104ba578283fd5b818501915085601f8301126104cd578283fd5b8151818111156104df576104df6105dd565b604051601f8201601f19908116603f01168101908382118183101715610507576105076105dd565b8160405282815288602084870101111561051f578586fd5b6105308360208301602088016105b1565b80955050505050509250929050565b600082516105518184602087016105b1565b9190910192915050565b600060208252825180602084015261057a8160408501602087016105b1565b601f01601f19169190910160400192915050565b6000828210156105ac57634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105cc5781810151838201526020016105b4565b8381111561015d5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f806106026000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b600060208252825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cb996891e0e185f82d2c11ffc73eff0fcb823b001721fc4f725e35a9ed5dc4264736f6c63430008030033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar BeaconProxy__factory = /** @class */ (function (_super) {\n __extends(BeaconProxy__factory, _super);\n function BeaconProxy__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n BeaconProxy__factory.prototype.deploy = function (beacon, data, overrides) {\n return _super.prototype.deploy.call(this, beacon, data, overrides || {});\n };\n BeaconProxy__factory.prototype.getDeployTransaction = function (beacon, data, overrides) {\n return _super.prototype.getDeployTransaction.call(this, beacon, data, overrides || {});\n };\n BeaconProxy__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n BeaconProxy__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n BeaconProxy__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n BeaconProxy__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n BeaconProxy__factory.bytecode = _bytecode;\n BeaconProxy__factory.abi = _abi;\n return BeaconProxy__factory;\n}(ContractFactory));\nexport { BeaconProxy__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"WETH\",\n outputs: [\n {\n internalType: \"contract IWETH\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"outstandingBridged\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"tokenAddress\",\n type: \"address\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"attestToken\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"arbiterFee\",\n type: \"uint256\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"wrapAndTransferETH\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"arbiterFee\",\n type: \"uint256\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"transferTokens\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"updateWrapped\",\n outputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"createWrapped\",\n outputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransfer\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransferAndUnwrapETH\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.AssetMeta\",\n name: \"meta\",\n type: \"tuple\",\n },\n ],\n name: \"encodeAssetMeta\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"fee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct BridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n name: \"encodeTransfer\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseAssetMeta\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.AssetMeta\",\n name: \"meta\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransfer\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"fee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct BridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50614c57806100206000396000f3fe608060405260043610620001df5760003560e01c8063aa4efa5b11620000ff578063c68785191162000095578063f768441f116200006c578063f768441f146200070c578063fbe3c2cd1462000731578063fbeeacd91462000752578063ff200cde14620007b257600080fd5b8063c68785191462000685578063d60b347f14620006aa578063e805981014620006e757600080fd5b8063b046223b11620000d6578063b046223b14620005f8578063b172b222146200061d578063b96c7e4d1462000634578063c48fa115146200066e57600080fd5b8063aa4efa5b1462000560578063ad5c46481462000594578063ad66a5f114620005b457600080fd5b80632c3c02a4116200017557806384acd1bb116200014c57806384acd1bb14620004da5780639981509f14620004fa5780639a8a05921462000511578063a5799f93146200053b57600080fd5b80632c3c02a414620004525780632f3a3d5d14620004865780635f85426614620004a657600080fd5b80631a2be4da11620001b65780631a2be4da14620003165780631ff1e28614620003645780632539464514620003a25780632b51137514620003c957600080fd5b806301f5325514620001ec57806307dfd8fb146200026a5780630f5287b014620002e657600080fd5b36620001e757005b600080fd5b348015620001f957600080fd5b50620002116200020b36600462003950565b620007d7565b604051620002619190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b3480156200027757600080fd5b506200028f6200028936600462003950565b620009e1565b604051620002619190600060c08201905060ff83511682526020830151602083015261ffff604084015116604083015260ff60608401511660608301526080830151608083015260a083015160a083015292915050565b620002fd620002f73660046200385b565b62000b70565b6040516001600160401b03909116815260200162000261565b3480156200032357600080fd5b5062000353620003353660046200383e565b6001600160a01b031660009081526009602052604090205460ff1690565b604051901515815260200162000261565b3480156200037157600080fd5b50620003896200038336600462003cec565b62000ffd565b6040516001600160a01b03909116815260200162000261565b348015620003af57600080fd5b50620003c7620003c136600462003950565b6200102c565b005b348015620003d657600080fd5b50620003ee620003e836600462003950565b62001110565b604051620002619190600060e08201905060ff83511682526020830151602083015260408301516040830152606083015161ffff8082166060850152608085015160808501528060a08601511660a0850152505060c083015160c083015292915050565b3480156200045f57600080fd5b5062000353620004713660046200391e565b60009081526005602052604090205460ff1690565b3480156200049357600080fd5b506001546001600160a01b031662000389565b348015620004b357600080fd5b50620004cb620004c536600462003a9a565b620012c5565b60405162000261919062003e49565b348015620004e757600080fd5b506000546001600160a01b031662000389565b620002fd6200050b36600462003d1a565b6200135a565b3480156200051e57600080fd5b5060025461ffff165b60405161ffff909116815260200162000261565b3480156200054857600080fd5b50620003c76200055a36600462003950565b620015e8565b3480156200056d57600080fd5b50620003536200057f3660046200391e565b60009081526006602052604090205460ff1690565b348015620005a157600080fd5b506004546001600160a01b031662000389565b348015620005c157600080fd5b50620005e9620005d336600462003cae565b61ffff166000908152600b602052604090205490565b60405190815260200162000261565b3480156200060557600080fd5b50620004cb6200061736600462003a00565b62001755565b3480156200062a57600080fd5b50600354620005e9565b3480156200064157600080fd5b50620005e9620006533660046200383e565b6001600160a01b03166000908152600a602052604090205490565b620002fd6200067f366004620038c6565b620017ce565b3480156200069257600080fd5b50620003c7620006a436600462003950565b62001ace565b348015620006b757600080fd5b5062000353620006c93660046200383e565b6001600160a01b031660009081526007602052604090205460ff1690565b348015620006f457600080fd5b50620003896200070636600462003950565b62001ade565b3480156200071957600080fd5b50620003896200072b36600462003950565b62001bfd565b3480156200073e57600080fd5b5060025462010000900461ffff1662000527565b3480156200075f57600080fd5b50620007776200077136600462003950565b62001d12565b6040516200026191908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b348015620007bf57600080fd5b50620003c7620007d136600462003950565b62001eed565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906200080e838262001efa565b82526200081d60208262004019565b82519091506a546f6b656e427269646765146200088d5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b62000899838262001f5c565b60ff166020830152620008ae60018262004019565b9050816020015160ff16600114620009155760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840162000884565b62000921838262001fbc565b61ffff1660408301526200093760028262004019565b905062000945838262001fbc565b61ffff1660608301526200095b60028262004019565b905062000969838262001efa565b60808301526200097b60208262004019565b905080835114620009db5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840162000884565b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529062000a1f838262001f5c565b60ff16825262000a3160018262004019565b9050816000015160ff1660021462000a805760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000884565b62000a8c838262001efa565b60208084019190915262000aa1908262004019565b905062000aaf838262001fbc565b61ffff16604083015262000ac560028262004019565b905062000ad3838262001f5c565b60ff16606083015262000ae860018262004019565b905062000af6838262001efa565b608083015262000b0860208262004019565b905062000b16838262001efa565b60a083015262000b2860208262004019565b905080835114620009db5760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000884565b600080600062000b98896001600160a01b031660009081526009602052604090205460ff1690565b1562000c9257886001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000bd857600080fd5b505afa15801562000bed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c13919062003ccd565b9150886001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c4f57600080fd5b505afa15801562000c64573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c8a919062003937565b905062000ca6565b505060025461ffff166001600160a01b0388165b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b038c169162000cea919062003dd2565b600060405180830381855afa9150503d806000811462000d27576040519150601f19603f3d011682016040523d82523d6000602084013e62000d2c565b606091505b5091505060008180602001905181019062000d48919062003d85565b905062000d6162000d5a8b836200201d565b826200205c565b995062000d7160025461ffff1690565b61ffff168461ffff16141562000f1f57604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17905290516000916001600160a01b038e169162000dd6919062003dd2565b600060405180830381855afa9150503d806000811462000e13576040519150601f19603f3d011682016040523d82523d6000602084013e62000e18565b606091505b5091505060008180602001905181019062000e34919062003937565b905062000e448d33308f62002091565b6040513060248201526000906001600160a01b038f16906370a0823160e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000ea7919062003dd2565b600060405180830381855afa9150503d806000811462000ee4576040519150601f19603f3d011682016040523d82523d6000602084013e62000ee9565b606091505b5091505060008180602001905181019062000f05919062003937565b905062000f1383826200417f565b9d505050505062000f90565b62000f2d8b33308d62002091565b604051632770a7eb60e21b8152306004820152602481018b90526001600160a01b038c1690639dc29fac90604401600060405180830381600087803b15801562000f7657600080fd5b505af115801562000f8b573d6000803e3d6000fd5b505050505b600062000f9e8b836200201d565b9050600062000fae89846200201d565b905062000fbe60025461ffff1690565b61ffff168661ffff16141562000fda5762000fda8d8362002104565b62000fec8686848e8e86348f620021d1565b9d9c50505050505050505050505050565b61ffff821660009081526008602090815260408083208484529091529020546001600160a01b03165b92915050565b60008060006200103c846200230f565b925092509250818190620010655760405162461bcd60e51b815260040162000884919062003e49565b506200108b8361014001516000908152600560205260409020805460ff19166001179055565b60006200109c8460e0015162001d12565b9050620010ac60025461ffff1690565b61ffff16816040015161ffff1614620010f95760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640162000884565b606081015162001109906200253e565b5050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081018290529062001155838262001f5c565b60ff1682526200116760018262004019565b9050816000015160ff16600114620011b55760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000884565b620011c1838262002675565b602080840191909152620011d6908262004019565b9050620011e4838262001efa565b6040830152620011f660208262004019565b905062001204838262001fbc565b61ffff1660608301526200121a60028262004019565b905062001228838262001efa565b60808301526200123a60208262004019565b905062001248838262001fbc565b61ffff1660a08301526200125e60028262004019565b90506200126c838262002675565b60c08301526200127e60208262004019565b905080835114620009db5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000884565b8051602080830151604080850151606080870151608088015160a089015160c08a0151955160f89990991b6001600160f81b031916978901979097526021880195909552604187019290925260f091821b6001600160f01b03199081166061880152606387019490945293901b909116608384015260858301529060a5015b6040516020818303038152906040529050919050565b600080620013706000546001600160a01b031690565b6001600160a01b0316631a90a2196040518163ffffffff1660e01b815260040160206040518083038186803b158015620013a957600080fd5b505afa158015620013be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013e4919062003937565b9050348110620014425760405162461bcd60e51b815260206004820152602260248201527f76616c756520697320736d616c6c6572207468616e20776f726d686f6c652066604482015261656560f01b606482015260840162000884565b60006200145082346200417f565b905080851115620014b95760405162461bcd60e51b815260206004820152602c60248201527f66656520697320626967676572207468616e20616d6f756e74206d696e75732060448201526b776f726d686f6c652066656560a01b606482015260840162000884565b6000620014c88260126200201d565b90506000620014d98760126200201d565b90506000620014ea8360126200205c565b620014f690856200417f565b905080156200152f57604051339082156108fc029083906000818181858888f193505050501580156200152d573d6000803e3d6000fd5b505b6004546001600160a01b031663d0e30db06200154c83876200417f565b6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156200157857600080fd5b505af11580156200158d573d6000803e3d6000fd5b5050505050620015b0620015a96004546001600160a01b031690565b8462002104565b620015da620015c260025461ffff1690565b6004546001600160a01b0316858d8d878b8e620021d1565b9a9950505050505050505050565b6000806000620015f8846200230f565b925092509250818190620016215760405162461bcd60e51b815260040162000884919062003e49565b50620016478361014001516000908152600560205260409020805460ff19166001179055565b6000620016588460e00151620007d7565b90506200166860025461ffff1690565b61ffff16816040015161ffff161480620016885750604081015161ffff16155b620016c95760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640162000884565b606081015161ffff166000908152600b602052604081205414620017305760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c726561647920726567697374657265640000000000000000604482015260640162000884565b620011098160600151826080015161ffff9091166000908152600b6020526040902055565b8051602080830151604080850151606080870151608088015160a0890151945160f898891b6001600160f81b031990811698820198909852602181019690965260f09390931b6001600160f01b031916604186015290951b90931660438301526044820192909252606481019190915260840162001344565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b179052905160009182916001600160a01b03861691620018139162003dd2565b600060405180830381855afa9150503d806000811462001850576040519150601f19603f3d011682016040523d82523d6000602084013e62001855565b606091505b5060408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b1790529051919350600092506001600160a01b038716916200189e919062003dd2565b600060405180830381855afa9150503d8060008114620018db576040519150601f19603f3d011682016040523d82523d6000602084013e620018e0565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b0388169162001929919062003dd2565b600060405180830381855afa9150503d806000811462001966576040519150601f19603f3d011682016040523d82523d6000602084013e6200196b565b606091505b5091505060008380602001905181019062001987919062003d85565b9050600083806020019051810190620019a19190620039ca565b9050600083806020019051810190620019bb9190620039ca565b9050600080602084015191506020830151905060006040518060c00160405280600260ff1681526020018d6001600160a01b031660001b815260200162001a0560025461ffff1690565b61ffff1681526020018760ff168152602001848152602001838152509050600062001a308262001755565b905062001a456000546001600160a01b031690565b6001600160a01b031663b19a437e348e84600f6040518563ffffffff1660e01b815260040162001a789392919062003f37565b6020604051808303818588803b15801562001a9257600080fd5b505af115801562001aa7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062000fec919062003d68565b62001adb816000620026ce565b50565b60008060008062001af76000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001b24919062003e49565b60006040518083038186803b15801562001b3d57600080fd5b505afa15801562001b52573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001b7c919081019062003b3f565b92509250925081819062001ba55760405162461bcd60e51b815260040162000884919062003e49565b5062001bb18362002da9565b62001bd05760405162461bcd60e51b8152600401620008849062003f0e565b600062001be18460e00151620009e1565b905062001bf3818560a0015162002de6565b9695505050505050565b60008060008062001c166000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001c43919062003e49565b60006040518083038186803b15801562001c5c57600080fd5b505afa15801562001c71573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001c9b919081019062003b3f565b92509250925081819062001cc45760405162461bcd60e51b815260040162000884919062003e49565b5062001cd08362002da9565b62001cef5760405162461bcd60e51b8152600401620008849062003f0e565b600062001d008460e00151620009e1565b905062001bf3818560a0015162003097565b60408051608081018252600080825260208201819052918101829052606081018290529062001d42838262001efa565b825262001d5160208262004019565b82519091506a546f6b656e4272696467651462001dbf5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840162000884565b62001dcb838262001f5c565b60ff16602083015262001de060018262004019565b9050816020015160ff1660021462001e495760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840162000884565b62001e55838262001fbc565b61ffff16604083015262001e6b60028262004019565b905062001e79838262001efa565b606083015262001e8b60208262004019565b905080835114620009db5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840162000884565b62001adb816001620026ce565b600062001f0982602062004019565b8351101562001f535760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640162000884565b50016020015190565b600062001f6b82600162004019565b8351101562001fb35760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640162000884565b50016001015190565b600062001fcb82600262004019565b83511015620020145760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640162000884565b50016002015190565b600060088260ff16111562002055576200203960088362004199565b6200204690600a6200409e565b62002052908462004034565b92505b5090919050565b600060088260ff16111562002055576200207860088362004199565b6200208590600a6200409e565b6200205290846200415d565b6040516001600160a01b0380851660248301528316604482015260648101829052620020fe9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262003192565b50505050565b6001600160a01b0382166000908152600a60205260409020546001600160401b0362002131838362004019565b11156200219f5760405162461bcd60e51b815260206004820152603560248201527f7472616e736665722065786365656473206d6178206f75747374616e64696e6760448201527408189c9a5919d959081d1bdad95b88185b5bdd5b9d605a1b606482015260840162000884565b620021cc83620021b0848462004019565b6001600160a01b039091166000908152600a6020526040902055565b505050565b6000868411156200221a5760405162461bcd60e51b815260206004820152601260248201527119995948195e18d959591cc8185b5bdd5b9d60721b604482015260640162000884565b6040805160e081018252600181526020810189905290810189905261ffff808b16606083015260808201879052871660a082015260c0810185905260006200226282620012c5565b9050620022776000546001600160a01b031690565b6001600160a01b031663b19a437e868684600f6040518563ffffffff1660e01b8152600401620022aa9392919062003f37565b6020604051808303818588803b158015620022c457600080fd5b505af1158015620022d9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002300919062003d68565b9b9a5050505050505050505050565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620023836000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620023b0919062003e49565b60006040518083038186803b158015620023c957600080fd5b505afa158015620023de573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002408919081019062003b3f565b9250925092508162002421579194509250905062002537565b60025462010000900461ffff1661ffff16836060015161ffff16146200247f5750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062002537565b600354836080015114620024d257505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062002537565b61014083015160009081526005602052604090205460ff16156200251c5782600060405180606001604052806022815260200162004c006022913995509550955050505062002537565b50506040805160208101909152600081529093506001925090505b9193909250565b6000620025727f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506200257f826200326b565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620025c49162003dd2565b600060405180830381855af49150503d806000811462002601576040519150601f19603f3d011682016040523d82523d6000602084013e62002606565b606091505b50915091508181906200262e5760405162461bcd60e51b815260040162000884919062003e49565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b60006200268482602062004019565b8351101562001f535760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b604482015260640162000884565b6000806000620026e66000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162002713919062003e49565b60006040518083038186803b1580156200272c57600080fd5b505afa15801562002741573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200276b919081019062003b3f565b925092509250818190620027945760405162461bcd60e51b815260040162000884919062003e49565b50620027a08362002da9565b620027bf5760405162461bcd60e51b8152600401620008849062003f0e565b6000620027d08460e0015162001110565b9050620027f184610140015160009081526006602052604090205460ff1690565b15620028405760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c65746564000000000000604482015260640162000884565b620028658461014001516000908152600660205260409020805460ff19166001179055565b60025461ffff1661ffff168160a0015161ffff1614620028bf5760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b604482015260640162000884565b6000620028cf60025461ffff1690565b61ffff16826060015161ffff16141562002901575060408101516020820151620028fb908290620032ad565b62002982565b6000620029178360600151846040015162000ffd565b90506001600160a01b0381166200297f5760405162461bcd60e51b815260206004820152602560248201527f6e6f207772617070657220666f72207468697320746f6b656e2063726561746560448201526419081e595d60da1b606482015260840162000884565b90505b8515806200299d57506004546001600160a01b038281169116145b620029f75760405162461bcd60e51b815260206004820152602360248201527f696e76616c696420746f6b656e2c2063616e206f6e6c7920756e77726170205760448201526208aa8960eb1b606482015260840162000884565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b0384169162002a3b919062003dd2565b600060405180830381855afa9150503d806000811462002a78576040519150601f19603f3d011682016040523d82523d6000602084013e62002a7d565b606091505b5091505060008180602001905181019062002a99919062003d85565b9050600062002aad8560200151836200205c565b9050600062002ac18660c00151846200205c565b9050801562002c50578181111562002b275760405162461bcd60e51b815260206004820152602260248201527f66656520686967686572207468616e207472616e7366657272656420616d6f756044820152611b9d60f21b606482015260840162000884565b891562002bc15760048054604051632e1a7d4d60e01b81529182018390526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002b7357600080fd5b505af115801562002b88573d6000803e3d6000fd5b505060405133925083156108fc02915083906000818181858888f1935050505015801562002bba573d6000803e3d6000fd5b5062002c50565b60025461ffff1661ffff16866060015161ffff161462002c43576040516340c10f1960e01b8152336004820152602481018290526001600160a01b038616906340c10f1990604401600060405180830381600087803b15801562002c2457600080fd5b505af115801562002c39573d6000803e3d6000fd5b5050505062002c50565b62002c50853383620032e3565b600062002c5e82846200417f565b60808801519091508b1562002d095760048054604051632e1a7d4d60e01b81529182018490526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002cb257600080fd5b505af115801562002cc7573d6000803e3d6000fd5b50506040516001600160a01b038416925084156108fc02915084906000818181858888f1935050505015801562002d02573d6000803e3d6000fd5b5062002d9a565b60025461ffff1661ffff16886060015161ffff161462002d8d576040516340c10f1960e01b81526001600160a01b038281166004830152602482018490528816906340c10f1990604401600060405180830381600087803b15801562002d6e57600080fd5b505af115801562002d83573d6000803e3d6000fd5b5050505062002d9a565b62002d9a878284620032e3565b50505050505050505050505050565b6000816080015162002dcf836060015161ffff166000908152600b602052604090205490565b141562002dde57506001919050565b506000919050565b600062002df660025461ffff1690565b61ffff16836040015161ffff16141562002e645760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b606482015260840162000884565b60006001600160a01b031662002e838460400151856020015162000ffd565b6001600160a01b03161462002edb5760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c72656164792065786973747300000000604482015260640162000884565b600063c71f461560e01b62002ef48560a0015162003315565b62002f03866080015162003315565b8660600151863089604001518a6020015160405160240162002f2c979695949392919062003ea1565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b0319909516949094179093525190925060009162002f7691309185910162003e23565b604051602081830303815290604052905060006040518060200162002f9b9062003682565b601f1982820381018352601f90910116604081905262002fc19190849060200162003df0565b60405160208183030381529060405290506000866040015187602001516040516020016200300892919060f09290921b6001600160f01b0319168252600282015260220190565b604051602081830303815290604052805190602001209050808251602084016000f59450843b6200303857600080fd5b6040808801516020808a015161ffff90921660009081526008825283812092815291815282822080546001600160a01b0319166001600160a01b038a1690811790915582526009905220805460ff191660011790555050505092915050565b600080620030ae8460400151856020015162000ffd565b90506001600160a01b038116620031085760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420617373657420646f6573206e6f7420657869737473000000604482015260640162000884565b806001600160a01b031663a18cd7c6620031268660a0015162003315565b62003135876080015162003315565b866040518463ffffffff1660e01b8152600401620031569392919062003e5e565b600060405180830381600087803b1580156200317157600080fd5b505af115801562003186573d6000803e3d6000fd5b50929695505050505050565b6000620031e9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620034509092919063ffffffff16565b805190915015620021cc57808060200190518101906200320a919062003901565b620021cc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000884565b62003276816200346b565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b620032df8282620032d3856001600160a01b03166000908152600a602052604090205490565b620021b091906200417f565b5050565b6040516001600160a01b038316602482015260448101829052620021cc90849063a9059cbb60e01b90606401620020c6565b606060005b6020811080156200335857508281602081106200334757634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b156200337357806200336a81620041ee565b9150506200331a565b6000816001600160401b038111156200339c57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015620033c7576020820181803683370190505b50905060005b828110156200344857848160208110620033f757634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200341c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350806200343f81620041ee565b915050620033cd565b509392505050565b606062003461848460008562003512565b90505b9392505050565b803b620034d15760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000884565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606082471015620035755760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000884565b843b620035c55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000884565b600080866001600160a01b03168587604051620035e3919062003dd2565b60006040518083038185875af1925050503d806000811462003622576040519150601f19603f3d011682016040523d82523d6000602084013e62003627565b606091505b50915091506200363982828662003644565b979650505050505050565b606083156200365557508162003464565b825115620036665782518084602001fd5b8160405162461bcd60e51b815260040162000884919062003e49565b610993806200426d83390190565b80356001600160a01b0381168114620036a857600080fd5b919050565b600082601f830112620036be578081fd5b815160206001600160401b03821115620036dc57620036dc62004222565b620036ec818360051b0162003fbc565b80838252828201915082860187848660071b89010111156200370c578586fd5b855b858110156200377c57608080838b03121562003728578788fd5b6200373262003f6b565b8351815286840151878201526040808501516200374f816200425c565b9082015260608481015162003764816200425c565b9082015285529385019391909101906001016200370e565b5090979650505050505050565b80518015158114620036a857600080fd5b600082601f830112620037ab578081fd5b8151620037c2620037bc8262003fef565b62003fbc565b818152846020838601011115620037d7578283fd5b620037ea826020830160208701620041bf565b949350505050565b8035620036a88162004238565b8051620036a88162004238565b8051620036a88162004249565b80516001600160401b0381168114620036a857600080fd5b8051620036a8816200425c565b60006020828403121562003850578081fd5b620034648262003690565b60008060008060008060c0878903121562003874578182fd5b6200387f8762003690565b9550602087013594506040870135620038988162004238565b9350606087013592506080870135915060a0870135620038b88162004249565b809150509295509295509295565b60008060408385031215620038d9578182fd5b620038e48362003690565b91506020830135620038f68162004249565b809150509250929050565b60006020828403121562003913578081fd5b620034648262003789565b60006020828403121562003930578081fd5b5035919050565b60006020828403121562003949578081fd5b5051919050565b60006020828403121562003962578081fd5b81356001600160401b0381111562003978578182fd5b8201601f8101841362003989578182fd5b80356200399a620037bc8262003fef565b818152856020838501011115620039af578384fd5b81602084016020830137908101602001929092525092915050565b600060208284031215620039dc578081fd5b81516001600160401b03811115620039f2578182fd5b620037ea848285016200379a565b600060c0828403121562003a12578081fd5b60405160c081018181106001600160401b038211171562003a375762003a3762004222565b604052823562003a47816200425c565b815260208381013590820152604083013562003a638162004238565b6040820152606083013562003a78816200425c565b60608201526080838101359082015260a0928301359281019290925250919050565b600060e0828403121562003aac578081fd5b60405160e081018181106001600160401b038211171562003ad15762003ad162004222565b604052823562003ae1816200425c565b808252506020830135602082015260408301356040820152606083013562003b098162004238565b60608201526080838101359082015262003b2660a08401620037f2565b60a082015260c083013560c08201528091505092915050565b60008060006060848603121562003b54578081fd5b83516001600160401b038082111562003b6b578283fd5b90850190610160828803121562003b80578283fd5b62003b8a62003f96565b62003b958362003831565b815262003ba5602084016200380c565b602082015262003bb8604084016200380c565b604082015262003bcb60608401620037ff565b60608201526080830151608082015262003be860a0840162003819565b60a082015262003bfb60c0840162003831565b60c082015260e08301518281111562003c12578485fd5b62003c20898286016200379a565b60e08301525061010062003c368185016200380c565b90820152610120838101518381111562003c4e578586fd5b62003c5c8a828701620036ad565b91830191909152506101408381015190820152945062003c7f6020870162003789565b9350604086015191508082111562003c95578283fd5b5062003ca4868287016200379a565b9150509250925092565b60006020828403121562003cc0578081fd5b8135620034648162004238565b60006020828403121562003cdf578081fd5b8151620034648162004238565b6000806040838503121562003cff578182fd5b823562003d0c8162004238565b946020939093013593505050565b6000806000806080858703121562003d30578182fd5b843562003d3d8162004238565b93506020850135925060408501359150606085013562003d5d8162004249565b939692955090935050565b60006020828403121562003d7a578081fd5b620034648262003819565b60006020828403121562003d97578081fd5b815162003464816200425c565b6000815180845262003dbe816020860160208601620041bf565b601f01601f19169290920160200192915050565b6000825162003de6818460208701620041bf565b9190910192915050565b6000835162003e04818460208801620041bf565b83519083019062003e1a818360208801620041bf565b01949350505050565b6001600160a01b0383168152604060208201819052600090620034619083018462003da4565b60208152600062003464602083018462003da4565b60608152600062003e73606083018662003da4565b828103602084015262003e87818662003da4565b9150506001600160401b0383166040830152949350505050565b60e08152600062003eb660e083018a62003da4565b828103602084015262003eca818a62003da4565b60ff98909816604084015250506001600160401b039490941660608501526001600160a01b0392909216608084015261ffff1660a083015260c09091015292915050565b6020808252600f908201526e34b73b30b634b21032b6b4ba3a32b960891b604082015260600190565b63ffffffff8416815260606020820152600062003f58606083018562003da4565b905060ff83166040830152949350505050565b604051608081016001600160401b038111828210171562003f905762003f9062004222565b60405290565b60405161016081016001600160401b038111828210171562003f905762003f9062004222565b604051601f8201601f191681016001600160401b038111828210171562003fe75762003fe762004222565b604052919050565b60006001600160401b038211156200400b576200400b62004222565b50601f01601f191660200190565b600082198211156200402f576200402f6200420c565b500190565b6000826200405057634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115620040965781600019048211156200407a576200407a6200420c565b808516156200408857918102915b93841c93908002906200405a565b509250929050565b60006200346460ff841683600082620040ba5750600162001026565b81620040c95750600062001026565b8160018114620040e25760028114620040ed576200410d565b600191505062001026565b60ff8411156200410157620041016200420c565b50506001821b62001026565b5060208310610133831016604e8410600b841016171562004132575081810a62001026565b6200413e838362004055565b80600019048211156200415557620041556200420c565b029392505050565b60008160001904831182151516156200417a576200417a6200420c565b500290565b6000828210156200419457620041946200420c565b500390565b600060ff821660ff841680821015620041b657620041b66200420c565b90039392505050565b60005b83811015620041dc578181015183820152602001620041c2565b83811115620020fe5750506000910152565b60006000198214156200420557620042056200420c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462001adb57600080fd5b63ffffffff8116811462001adb57600080fd5b60ff8116811462001adb57600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a264697066735822122059e176f1dd762c3e0e31070f4ed2d4b5cddbd1debc7238a2f5568bf5c60b490064736f6c63430008040033\";\nvar Bridge__factory = /** @class */ (function (_super) {\n __extends(Bridge__factory, _super);\n function Bridge__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Bridge__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Bridge__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Bridge__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Bridge__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Bridge__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Bridge__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Bridge__factory.bytecode = _bytecode;\n Bridge__factory.abi = _abi;\n return Bridge__factory;\n}(ContractFactory));\nexport { Bridge__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"WETH\",\n outputs: [\n {\n internalType: \"contract IWETH\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"outstandingBridged\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610372806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063aa4efa5b1161008c578063b172b22211610066578063b172b2221461022d578063b96c7e4d14610235578063d60b347f1461025e578063fbe3c2cd1461028a57600080fd5b8063aa4efa5b146101c7578063ad5c4648146101ea578063ad66a5f1146101fb57600080fd5b80631a2be4da146100d45780631ff1e286146101155780632c3c02a4146101675780632f3a3d5d1461018a57806384acd1bb1461019b5780639a8a0592146101ac575b600080fd5b6101006100e23660046102b3565b6001600160a01b031660009081526009602052604090205460ff1690565b60405190151581526020015b60405180910390f35b61014f610123366004610313565b61ffff91909116600090815260086020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b03909116815260200161010c565b6101006101753660046102e1565b60009081526005602052604090205460ff1690565b6001546001600160a01b031661014f565b6000546001600160a01b031661014f565b60025461ffff165b60405161ffff909116815260200161010c565b6101006101d53660046102e1565b60009081526006602052604090205460ff1690565b6004546001600160a01b031661014f565b61021f6102093660046102f9565b61ffff166000908152600b602052604090205490565b60405190815260200161010c565b60035461021f565b61021f6102433660046102b3565b6001600160a01b03166000908152600a602052604090205490565b61010061026c3660046102b3565b6001600160a01b031660009081526007602052604090205460ff1690565b60025462010000900461ffff166101b4565b803561ffff811681146102ae57600080fd5b919050565b6000602082840312156102c4578081fd5b81356001600160a01b03811681146102da578182fd5b9392505050565b6000602082840312156102f2578081fd5b5035919050565b60006020828403121561030a578081fd5b6102da8261029c565b60008060408385031215610325578081fd5b61032e8361029c565b94602093909301359350505056fea26469706673582212200e8167a8bd25af5437d7bb9e32d5d47e4017c7654316991ea75c8591ce88787c64736f6c63430008040033\";\nvar BridgeGetters__factory = /** @class */ (function (_super) {\n __extends(BridgeGetters__factory, _super);\n function BridgeGetters__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n BridgeGetters__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n BridgeGetters__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n BridgeGetters__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n BridgeGetters__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n BridgeGetters__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n BridgeGetters__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n BridgeGetters__factory.bytecode = _bytecode;\n BridgeGetters__factory.abi = _abi;\n return BridgeGetters__factory;\n}(ContractFactory));\nexport { BridgeGetters__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"WETH\",\n outputs: [\n {\n internalType: \"contract IWETH\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"outstandingBridged\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50611485806100206000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063a5799f93116100a2578063b172b22211610071578063b172b222146102f7578063b96c7e4d146102ff578063d60b347f14610328578063fbe3c2cd14610354578063fbeeacd91461036657600080fd5b8063a5799f931461027e578063aa4efa5b14610291578063ad5c4648146102b4578063ad66a5f1146102c557600080fd5b80632c3c02a4116100de5780632c3c02a41461021e5780632f3a3d5d1461024157806384acd1bb146102525780639a8a05921461026357600080fd5b806301f53255146101105780631a2be4da1461017b5780631ff1e286146101b75780632539464514610209575b600080fd5b61012361011e3660046110a2565b6103b3565b6040516101729190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b6101a761018936600461105c565b6001600160a01b031660009081526009602052604090205460ff1690565b6040519015158152602001610172565b6101f16101c5366004611284565b61ffff91909116600090815260086020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b039091168152602001610172565b61021c6102173660046110a2565b6105a4565b005b6101a761022c36600461108a565b60009081526005602052604090205460ff1690565b6001546001600160a01b03166101f1565b6000546001600160a01b03166101f1565b60025461ffff165b60405161ffff9091168152602001610172565b61021c61028c3660046110a2565b61067b565b6101a761029f36600461108a565b60009081526006602052604090205460ff1690565b6004546001600160a01b03166101f1565b6102e96102d3366004611268565b61ffff166000908152600b602052604090205490565b604051908152602001610172565b6003546102e9565b6102e961030d36600461105c565b6001600160a01b03166000908152600a602052604090205490565b6101a761033636600461105c565b6001600160a01b031660009081526007602052604090205460ff1690565b60025462010000900461ffff1661026b565b6103796103743660046110a2565b6107d9565b60405161017291908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906103e8838261099e565b82526103f56020826113b0565b82519091506a546f6b656e427269646765146104645760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b61046e83826109fc565b60ff1660208301526104816001826113b0565b9050816020015160ff166001146104e65760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840161045b565b6104f08382610a58565b61ffff1660408301526105046002826113b0565b90506105108382610a58565b61ffff1660608301526105246002826113b0565b9050610530838261099e565b60808301526105406020826113b0565b90508083511461059e5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840161045b565b50919050565b60008060006105b284610ab5565b9250925092508181906105d85760405162461bcd60e51b815260040161045b91906112f7565b506105fd8361014001516000908152600560205260409020805460ff19166001179055565b600061060c8460e001516107d9565b905061061b60025461ffff1690565b61ffff16816040015161ffff16146106665760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640161045b565b606081015161067490610cd4565b5050505050565b600080600061068984610ab5565b9250925092508181906106af5760405162461bcd60e51b815260040161045b91906112f7565b506106d48361014001516000908152600560205260409020805460ff19166001179055565b60006106e38460e001516103b3565b90506106f260025461ffff1690565b61ffff16816040015161ffff1614806107115750604081015161ffff16155b6107505760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640161045b565b606081015161ffff166000908152600b6020526040812054146107b55760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c726561647920726567697374657265640000000000000000604482015260640161045b565b6106748160600151826080015161ffff9091166000908152600b6020526040902055565b604080516080810182526000808252602082018190529181018290526060810182905290610807838261099e565b82526108146020826113b0565b82519091506a546f6b656e427269646765146108805760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840161045b565b61088a83826109fc565b60ff16602083015261089d6001826113b0565b9050816020015160ff166002146109045760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840161045b565b61090e8382610a58565b61ffff1660408301526109226002826113b0565b905061092e838261099e565b606083015261093e6020826113b0565b90508083511461059e5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840161045b565b60006109ab8260206113b0565b835110156109f35760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640161045b565b50016020015190565b6000610a098260016113b0565b83511015610a4f5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640161045b565b50016001015190565b6000610a658260026113b0565b83511015610aac5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640161045b565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610b286000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610b5391906112f7565b60006040518083038186803b158015610b6b57600080fd5b505afa158015610b7f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ba79190810190611116565b92509250925081610bbe5791945092509050610ccd565b60025462010000900461ffff1661ffff16836060015161ffff1614610c1a5750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610ccd565b600354836080015114610c6b57505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610ccd565b61014083015160009081526005602052604090205460ff1615610cb25782600060405180606001604052806022815260200161142e60229139955095509550505050610ccd565b50506040805160208101909152600081529093506001925090505b9193909250565b6000610d077f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050610d1282610e01565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691610d55916112db565b600060405180830381855af49150503d8060008114610d90576040519150601f19603f3d011682016040523d82523d6000602084013e610d95565b606091505b5091509150818190610dba5760405162461bcd60e51b815260040161045b91906112f7565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b610e0a81610e41565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610ea55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161045b565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b600082601f830112610ef6578081fd5b8151602067ffffffffffffffff821115610f1257610f12611404565b610f20818360051b01611357565b80838252828201915082860187848660071b8901011115610f3f578586fd5b855b85811015610fa257608080838b031215610f59578788fd5b610f6161130a565b8351815286840151878201526040610f7a81860161104b565b908201526060610f8b85820161104b565b908201528552938501939190910190600101610f41565b5090979650505050505050565b80518015158114610fbf57600080fd5b919050565b600082601f830112610fd4578081fd5b8151610fe7610fe282611388565b611357565b818152846020838601011115610ffb578283fd5b61100c8260208301602087016113d4565b949350505050565b8051610fbf8161141a565b805163ffffffff81168114610fbf57600080fd5b805167ffffffffffffffff81168114610fbf57600080fd5b805160ff81168114610fbf57600080fd5b60006020828403121561106d578081fd5b81356001600160a01b0381168114611083578182fd5b9392505050565b60006020828403121561109b578081fd5b5035919050565b6000602082840312156110b3578081fd5b813567ffffffffffffffff8111156110c9578182fd5b8201601f810184136110d9578182fd5b80356110e7610fe282611388565b8181528560208385010111156110fb578384fd5b81602084016020830137908101602001929092525092915050565b60008060006060848603121561112a578182fd5b835167ffffffffffffffff80821115611141578384fd5b908501906101608288031215611155578384fd5b61115d611333565b6111668361104b565b81526111746020840161101f565b60208201526111856040840161101f565b604082015261119660608401611014565b6060820152608083015160808201526111b160a08401611033565b60a08201526111c260c0840161104b565b60c082015260e0830151828111156111d8578586fd5b6111e489828601610fc4565b60e0830152506101006111f881850161101f565b90820152610120838101518381111561120f578687fd5b61121b8a828701610ee6565b91830191909152506101408381015190820152945061123c60208701610faf565b93506040860151915080821115611251578283fd5b5061125e86828701610fc4565b9150509250925092565b600060208284031215611279578081fd5b81356110838161141a565b60008060408385031215611296578182fd5b82356112a18161141a565b946020939093013593505050565b600081518084526112c78160208601602086016113d4565b601f01601f19169290920160200192915050565b600082516112ed8184602087016113d4565b9190910192915050565b60208152600061108360208301846112af565b6040516080810167ffffffffffffffff8111828210171561132d5761132d611404565b60405290565b604051610160810167ffffffffffffffff8111828210171561132d5761132d611404565b604051601f8201601f1916810167ffffffffffffffff8111828210171561138057611380611404565b604052919050565b600067ffffffffffffffff8211156113a2576113a2611404565b50601f01601f191660200190565b600082198211156113cf57634e487b7160e01b81526011600452602481fd5b500190565b60005b838110156113ef5781810151838201526020016113d7565b838111156113fe576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff8116811461142a57600080fd5b5056fe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a26469706673582212205559f87e66119ef459f524781e1ad0229720aeb77eafeec52bc379386c821a2964736f6c63430008040033\";\nvar BridgeGovernance__factory = /** @class */ (function (_super) {\n __extends(BridgeGovernance__factory, _super);\n function BridgeGovernance__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n BridgeGovernance__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n BridgeGovernance__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n BridgeGovernance__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n BridgeGovernance__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n BridgeGovernance__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n BridgeGovernance__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n BridgeGovernance__factory.bytecode = _bytecode;\n BridgeGovernance__factory.abi = _abi;\n return BridgeGovernance__factory;\n}(ContractFactory));\nexport { BridgeGovernance__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"WETH\",\n outputs: [\n {\n internalType: \"contract IWETH\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"tokenAddress\",\n type: \"address\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"attestToken\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransfer\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransferAndUnwrapETH\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"createWrapped\",\n outputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.AssetMeta\",\n name: \"meta\",\n type: \"tuple\",\n },\n ],\n name: \"encodeAssetMeta\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"fee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct BridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n name: \"encodeTransfer\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"outstandingBridged\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseAssetMeta\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.AssetMeta\",\n name: \"meta\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransfer\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"fee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct BridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"arbiterFee\",\n type: \"uint256\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"transferTokens\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"updateWrapped\",\n outputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"arbiterFee\",\n type: \"uint256\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"wrapAndTransferETH\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50614d80806100206000396000f3fe608060405260043610620001f75760003560e01c8063a5799f93116200010b578063c48fa11511620000a1578063f768441f116200006c578063f768441f1462000754578063fbe3c2cd1462000779578063fbeeacd9146200079a578063ff200cde14620007fa57600080fd5b8063c48fa11514620006b6578063c687851914620006cd578063d60b347f14620006f2578063e8059810146200072f57600080fd5b8063ad66a5f111620000e2578063ad66a5f114620005fc578063b046223b1462000640578063b172b2221462000665578063b96c7e4d146200067c57600080fd5b8063a5799f931462000583578063aa4efa5b14620005a8578063ad5c464814620005dc57600080fd5b80632c3c02a4116200018d5780638129fc1c11620001585780638129fc1c146200050a57806384acd1bb14620005225780639981509f14620005425780639a8a0592146200055957600080fd5b80632c3c02a4146200046a5780632f3a3d5d146200049e5780635c60da1b14620004be5780635f85426614620004d657600080fd5b80631a2be4da11620001ce5780631a2be4da146200032e5780631ff1e286146200037c5780632539464514620003ba5780632b51137514620003e157600080fd5b806301f53255146200020457806307dfd8fb14620002825780630f5287b014620002fe57600080fd5b36620001ff57005b600080fd5b3480156200021157600080fd5b50620002296200022336600462003a79565b6200081f565b604051620002799190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b3480156200028f57600080fd5b50620002a7620002a136600462003a79565b62000a29565b604051620002799190600060c08201905060ff83511682526020830151602083015261ffff604084015116604083015260ff60608401511660608301526080830151608083015260a083015160a083015292915050565b620003156200030f36600462003984565b62000bb8565b6040516001600160401b03909116815260200162000279565b3480156200033b57600080fd5b506200036b6200034d36600462003967565b6001600160a01b031660009081526009602052604090205460ff1690565b604051901515815260200162000279565b3480156200038957600080fd5b50620003a16200039b36600462003e15565b62001045565b6040516001600160a01b03909116815260200162000279565b348015620003c757600080fd5b50620003df620003d936600462003a79565b62001074565b005b348015620003ee57600080fd5b50620004066200040036600462003a79565b62001158565b604051620002799190600060e08201905060ff83511682526020830151602083015260408301516040830152606083015161ffff8082166060850152608085015160808501528060a08601511660a0850152505060c083015160c083015292915050565b3480156200047757600080fd5b506200036b6200048936600462003a47565b60009081526005602052604090205460ff1690565b348015620004ab57600080fd5b506001546001600160a01b0316620003a1565b348015620004cb57600080fd5b50620003a16200130d565b348015620004e357600080fd5b50620004fb620004f536600462003bc3565b62001327565b60405162000279919062003f72565b3480156200051757600080fd5b50620003df620013bc565b3480156200052f57600080fd5b506000546001600160a01b0316620003a1565b620003156200055336600462003e43565b62001486565b3480156200056657600080fd5b5060025461ffff165b60405161ffff909116815260200162000279565b3480156200059057600080fd5b50620003df620005a236600462003a79565b62001714565b348015620005b557600080fd5b506200036b620005c736600462003a47565b60009081526006602052604090205460ff1690565b348015620005e957600080fd5b506004546001600160a01b0316620003a1565b3480156200060957600080fd5b50620006316200061b36600462003dd7565b61ffff166000908152600b602052604090205490565b60405190815260200162000279565b3480156200064d57600080fd5b50620004fb6200065f36600462003b29565b62001881565b3480156200067257600080fd5b5060035462000631565b3480156200068957600080fd5b50620006316200069b36600462003967565b6001600160a01b03166000908152600a602052604090205490565b62000315620006c7366004620039ef565b620018fa565b348015620006da57600080fd5b50620003df620006ec36600462003a79565b62001bfa565b348015620006ff57600080fd5b506200036b6200071136600462003967565b6001600160a01b031660009081526007602052604090205460ff1690565b3480156200073c57600080fd5b50620003a16200074e36600462003a79565b62001c07565b3480156200076157600080fd5b50620003a16200077336600462003a79565b62001d26565b3480156200078657600080fd5b5060025462010000900461ffff166200056f565b348015620007a757600080fd5b50620007bf620007b936600462003a79565b62001e3b565b6040516200027991908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b3480156200080757600080fd5b50620003df6200081936600462003a79565b62002016565b6040805160a08101825260008082526020820181905291810182905260608101829052608081018290529062000856838262002023565b82526200086560208262004142565b82519091506a546f6b656e42726964676514620008d55760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b620008e1838262002085565b60ff166020830152620008f660018262004142565b9050816020015160ff166001146200095d5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b6064820152608401620008cc565b620009698382620020e5565b61ffff1660408301526200097f60028262004142565b90506200098d8382620020e5565b61ffff166060830152620009a360028262004142565b9050620009b1838262002023565b6080830152620009c360208262004142565b90508083511462000a235760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b6064820152608401620008cc565b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529062000a67838262002085565b60ff16825262000a7960018262004142565b9050816000015160ff1660021462000ac85760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b6044820152606401620008cc565b62000ad4838262002023565b60208084019190915262000ae9908262004142565b905062000af78382620020e5565b61ffff16604083015262000b0d60028262004142565b905062000b1b838262002085565b60ff16606083015262000b3060018262004142565b905062000b3e838262002023565b608083015262000b5060208262004142565b905062000b5e838262002023565b60a083015262000b7060208262004142565b90508083511462000a235760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b6044820152606401620008cc565b600080600062000be0896001600160a01b031660009081526009602052604090205460ff1690565b1562000cda57886001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c2057600080fd5b505afa15801562000c35573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c5b919062003df6565b9150886001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c9757600080fd5b505afa15801562000cac573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cd2919062003a60565b905062000cee565b505060025461ffff166001600160a01b0388165b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b038c169162000d32919062003efb565b600060405180830381855afa9150503d806000811462000d6f576040519150601f19603f3d011682016040523d82523d6000602084013e62000d74565b606091505b5091505060008180602001905181019062000d90919062003eae565b905062000da962000da28b8362002146565b8262002185565b995062000db960025461ffff1690565b61ffff168461ffff16141562000f6757604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17905290516000916001600160a01b038e169162000e1e919062003efb565b600060405180830381855afa9150503d806000811462000e5b576040519150601f19603f3d011682016040523d82523d6000602084013e62000e60565b606091505b5091505060008180602001905181019062000e7c919062003a60565b905062000e8c8d33308f620021ba565b6040513060248201526000906001600160a01b038f16906370a0823160e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000eef919062003efb565b600060405180830381855afa9150503d806000811462000f2c576040519150601f19603f3d011682016040523d82523d6000602084013e62000f31565b606091505b5091505060008180602001905181019062000f4d919062003a60565b905062000f5b8382620042a8565b9d505050505062000fd8565b62000f758b33308d620021ba565b604051632770a7eb60e21b8152306004820152602481018b90526001600160a01b038c1690639dc29fac90604401600060405180830381600087803b15801562000fbe57600080fd5b505af115801562000fd3573d6000803e3d6000fd5b505050505b600062000fe68b8362002146565b9050600062000ff6898462002146565b90506200100660025461ffff1690565b61ffff168661ffff1614156200102257620010228d836200222d565b620010348686848e8e86348f620022fa565b9d9c50505050505050505050505050565b61ffff821660009081526008602090815260408083208484529091529020546001600160a01b03165b92915050565b6000806000620010848462002438565b925092509250818190620010ad5760405162461bcd60e51b8152600401620008cc919062003f72565b50620010d38361014001516000908152600560205260409020805460ff19166001179055565b6000620010e48460e0015162001e3b565b9050620010f460025461ffff1690565b61ffff16816040015161ffff1614620011415760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401620008cc565b6060810151620011519062002667565b5050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101829052906200119d838262002085565b60ff168252620011af60018262004142565b9050816000015160ff16600114620011fd5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620008cc565b6200120983826200279e565b6020808401919091526200121e908262004142565b90506200122c838262002023565b60408301526200123e60208262004142565b90506200124c8382620020e5565b61ffff1660608301526200126260028262004142565b905062001270838262002023565b60808301526200128260208262004142565b9050620012908382620020e5565b61ffff1660a0830152620012a660028262004142565b9050620012b483826200279e565b60c0830152620012c660208262004142565b90508083511462000a235760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620008cc565b6000620013226001546001600160a01b031690565b905090565b8051602080830151604080850151606080870151608088015160a089015160c08a0151955160f89990991b6001600160f81b031916978901979097526021880195909552604187019290925260f091821b6001600160f01b03199081166061880152606387019490945293901b909116608384015260858301529060a5015b6040516020818303038152906040529050919050565b6000620013f07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001415816001600160a01b031660009081526007602052604090205460ff1690565b156200145a5760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401620008cc565b62001483816001600160a01b03166000908152600760205260409020805460ff19166001179055565b50565b6000806200149c6000546001600160a01b031690565b6001600160a01b0316631a90a2196040518163ffffffff1660e01b815260040160206040518083038186803b158015620014d557600080fd5b505afa158015620014ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001510919062003a60565b90503481106200156e5760405162461bcd60e51b815260206004820152602260248201527f76616c756520697320736d616c6c6572207468616e20776f726d686f6c652066604482015261656560f01b6064820152608401620008cc565b60006200157c8234620042a8565b905080851115620015e55760405162461bcd60e51b815260206004820152602c60248201527f66656520697320626967676572207468616e20616d6f756e74206d696e75732060448201526b776f726d686f6c652066656560a01b6064820152608401620008cc565b6000620015f482601262002146565b905060006200160587601262002146565b905060006200161683601262002185565b620016229085620042a8565b905080156200165b57604051339082156108fc029083906000818181858888f1935050505015801562001659573d6000803e3d6000fd5b505b6004546001600160a01b031663d0e30db0620016788387620042a8565b6040518263ffffffff1660e01b81526004016000604051808303818588803b158015620016a457600080fd5b505af1158015620016b9573d6000803e3d6000fd5b5050505050620016dc620016d56004546001600160a01b031690565b846200222d565b62001706620016ee60025461ffff1690565b6004546001600160a01b0316858d8d878b8e620022fa565b9a9950505050505050505050565b6000806000620017248462002438565b9250925092508181906200174d5760405162461bcd60e51b8152600401620008cc919062003f72565b50620017738361014001516000908152600560205260409020805460ff19166001179055565b6000620017848460e001516200081f565b90506200179460025461ffff1690565b61ffff16816040015161ffff161480620017b45750604081015161ffff16155b620017f55760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b6044820152606401620008cc565b606081015161ffff166000908152600b6020526040812054146200185c5760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c7265616479207265676973746572656400000000000000006044820152606401620008cc565b620011518160600151826080015161ffff9091166000908152600b6020526040902055565b8051602080830151604080850151606080870151608088015160a0890151945160f898891b6001600160f81b031990811698820198909852602181019690965260f09390931b6001600160f01b031916604186015290951b909316604383015260448201929092526064810191909152608401620013a6565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b179052905160009182916001600160a01b038616916200193f9162003efb565b600060405180830381855afa9150503d80600081146200197c576040519150601f19603f3d011682016040523d82523d6000602084013e62001981565b606091505b5060408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b1790529051919350600092506001600160a01b03871691620019ca919062003efb565b600060405180830381855afa9150503d806000811462001a07576040519150601f19603f3d011682016040523d82523d6000602084013e62001a0c565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b0388169162001a55919062003efb565b600060405180830381855afa9150503d806000811462001a92576040519150601f19603f3d011682016040523d82523d6000602084013e62001a97565b606091505b5091505060008380602001905181019062001ab3919062003eae565b905060008380602001905181019062001acd919062003af3565b905060008380602001905181019062001ae7919062003af3565b9050600080602084015191506020830151905060006040518060c00160405280600260ff1681526020018d6001600160a01b031660001b815260200162001b3160025461ffff1690565b61ffff1681526020018760ff168152602001848152602001838152509050600062001b5c8262001881565b905062001b716000546001600160a01b031690565b6001600160a01b031663b19a437e348e84600f6040518563ffffffff1660e01b815260040162001ba49392919062004060565b6020604051808303818588803b15801562001bbe57600080fd5b505af115801562001bd3573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062001034919062003e91565b62001483816000620027f7565b60008060008062001c206000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001c4d919062003f72565b60006040518083038186803b15801562001c6657600080fd5b505afa15801562001c7b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001ca5919081019062003c68565b92509250925081819062001cce5760405162461bcd60e51b8152600401620008cc919062003f72565b5062001cda8362002ed2565b62001cf95760405162461bcd60e51b8152600401620008cc9062004037565b600062001d0a8460e0015162000a29565b905062001d1c818560a0015162002f0f565b9695505050505050565b60008060008062001d3f6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001d6c919062003f72565b60006040518083038186803b15801562001d8557600080fd5b505afa15801562001d9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001dc4919081019062003c68565b92509250925081819062001ded5760405162461bcd60e51b8152600401620008cc919062003f72565b5062001df98362002ed2565b62001e185760405162461bcd60e51b8152600401620008cc9062004037565b600062001e298460e0015162000a29565b905062001d1c818560a00151620031c0565b60408051608081018252600080825260208201819052918101829052606081018290529062001e6b838262002023565b825262001e7a60208262004142565b82519091506a546f6b656e4272696467651462001ee85760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b6064820152608401620008cc565b62001ef4838262002085565b60ff16602083015262001f0960018262004142565b9050816020015160ff1660021462001f725760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b6064820152608401620008cc565b62001f7e8382620020e5565b61ffff16604083015262001f9460028262004142565b905062001fa2838262002023565b606083015262001fb460208262004142565b90508083511462000a235760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b6064820152608401620008cc565b62001483816001620027f7565b60006200203282602062004142565b835110156200207c5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401620008cc565b50016020015190565b60006200209482600162004142565b83511015620020dc5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401620008cc565b50016001015190565b6000620020f482600262004142565b835110156200213d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401620008cc565b50016002015190565b600060088260ff1611156200217e5762002162600883620042c2565b6200216f90600a620041c7565b6200217b90846200415d565b92505b5090919050565b600060088260ff1611156200217e57620021a1600883620042c2565b620021ae90600a620041c7565b6200217b908462004286565b6040516001600160a01b0380851660248301528316604482015260648101829052620022279085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152620032bb565b50505050565b6001600160a01b0382166000908152600a60205260409020546001600160401b036200225a838362004142565b1115620022c85760405162461bcd60e51b815260206004820152603560248201527f7472616e736665722065786365656473206d6178206f75747374616e64696e6760448201527408189c9a5919d959081d1bdad95b88185b5bdd5b9d605a1b6064820152608401620008cc565b620022f583620022d9848462004142565b6001600160a01b039091166000908152600a6020526040902055565b505050565b600086841115620023435760405162461bcd60e51b815260206004820152601260248201527119995948195e18d959591cc8185b5bdd5b9d60721b6044820152606401620008cc565b6040805160e081018252600181526020810189905290810189905261ffff808b16606083015260808201879052871660a082015260c0810185905260006200238b8262001327565b9050620023a06000546001600160a01b031690565b6001600160a01b031663b19a437e868684600f6040518563ffffffff1660e01b8152600401620023d39392919062004060565b6020604051808303818588803b158015620023ed57600080fd5b505af115801562002402573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002429919062003e91565b9b9a5050505050505050505050565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620024ac6000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620024d9919062003f72565b60006040518083038186803b158015620024f257600080fd5b505afa15801562002507573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002531919081019062003c68565b925092509250816200254a579194509250905062002660565b60025462010000900461ffff1661ffff16836060015161ffff1614620025a85750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062002660565b600354836080015114620025fb57505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062002660565b61014083015160009081526005602052604090205460ff1615620026455782600060405180606001604052806022815260200162004d296022913995509550955050505062002660565b50506040805160208101909152600081529093506001925090505b9193909250565b60006200269b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050620026a88262003394565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620026ed9162003efb565b600060405180830381855af49150503d80600081146200272a576040519150601f19603f3d011682016040523d82523d6000602084013e6200272f565b606091505b5091509150818190620027575760405162461bcd60e51b8152600401620008cc919062003f72565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b6000620027ad82602062004142565b835110156200207c5760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401620008cc565b60008060006200280f6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016200283c919062003f72565b60006040518083038186803b1580156200285557600080fd5b505afa1580156200286a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002894919081019062003c68565b925092509250818190620028bd5760405162461bcd60e51b8152600401620008cc919062003f72565b50620028c98362002ed2565b620028e85760405162461bcd60e51b8152600401620008cc9062004037565b6000620028f98460e0015162001158565b90506200291a84610140015160009081526006602052604090205460ff1690565b15620029695760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c657465640000000000006044820152606401620008cc565b6200298e8461014001516000908152600660205260409020805460ff19166001179055565b60025461ffff1661ffff168160a0015161ffff1614620029e85760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b6044820152606401620008cc565b6000620029f860025461ffff1690565b61ffff16826060015161ffff16141562002a2a57506040810151602082015162002a24908290620033d6565b62002aab565b600062002a408360600151846040015162001045565b90506001600160a01b03811662002aa85760405162461bcd60e51b815260206004820152602560248201527f6e6f207772617070657220666f72207468697320746f6b656e2063726561746560448201526419081e595d60da1b6064820152608401620008cc565b90505b85158062002ac657506004546001600160a01b038281169116145b62002b205760405162461bcd60e51b815260206004820152602360248201527f696e76616c696420746f6b656e2c2063616e206f6e6c7920756e77726170205760448201526208aa8960eb1b6064820152608401620008cc565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b0384169162002b64919062003efb565b600060405180830381855afa9150503d806000811462002ba1576040519150601f19603f3d011682016040523d82523d6000602084013e62002ba6565b606091505b5091505060008180602001905181019062002bc2919062003eae565b9050600062002bd685602001518362002185565b9050600062002bea8660c001518462002185565b9050801562002d79578181111562002c505760405162461bcd60e51b815260206004820152602260248201527f66656520686967686572207468616e207472616e7366657272656420616d6f756044820152611b9d60f21b6064820152608401620008cc565b891562002cea5760048054604051632e1a7d4d60e01b81529182018390526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002c9c57600080fd5b505af115801562002cb1573d6000803e3d6000fd5b505060405133925083156108fc02915083906000818181858888f1935050505015801562002ce3573d6000803e3d6000fd5b5062002d79565b60025461ffff1661ffff16866060015161ffff161462002d6c576040516340c10f1960e01b8152336004820152602481018290526001600160a01b038616906340c10f1990604401600060405180830381600087803b15801562002d4d57600080fd5b505af115801562002d62573d6000803e3d6000fd5b5050505062002d79565b62002d798533836200340c565b600062002d878284620042a8565b60808801519091508b1562002e325760048054604051632e1a7d4d60e01b81529182018490526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002ddb57600080fd5b505af115801562002df0573d6000803e3d6000fd5b50506040516001600160a01b038416925084156108fc02915084906000818181858888f1935050505015801562002e2b573d6000803e3d6000fd5b5062002ec3565b60025461ffff1661ffff16886060015161ffff161462002eb6576040516340c10f1960e01b81526001600160a01b038281166004830152602482018490528816906340c10f1990604401600060405180830381600087803b15801562002e9757600080fd5b505af115801562002eac573d6000803e3d6000fd5b5050505062002ec3565b62002ec38782846200340c565b50505050505050505050505050565b6000816080015162002ef8836060015161ffff166000908152600b602052604090205490565b141562002f0757506001919050565b506000919050565b600062002f1f60025461ffff1690565b61ffff16836040015161ffff16141562002f8d5760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b6064820152608401620008cc565b60006001600160a01b031662002fac8460400151856020015162001045565b6001600160a01b031614620030045760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c726561647920657869737473000000006044820152606401620008cc565b600063c71f461560e01b6200301d8560a001516200343e565b6200302c86608001516200343e565b8660600151863089604001518a6020015160405160240162003055979695949392919062003fca565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b031990951694909417909352519092506000916200309f91309185910162003f4c565b6040516020818303038152906040529050600060405180602001620030c490620037ab565b601f1982820381018352601f909101166040819052620030ea9190849060200162003f19565b60405160208183030381529060405290506000866040015187602001516040516020016200313192919060f09290921b6001600160f01b0319168252600282015260220190565b604051602081830303815290604052805190602001209050808251602084016000f59450843b6200316157600080fd5b6040808801516020808a015161ffff90921660009081526008825283812092815291815282822080546001600160a01b0319166001600160a01b038a1690811790915582526009905220805460ff191660011790555050505092915050565b600080620031d78460400151856020015162001045565b90506001600160a01b038116620032315760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420617373657420646f6573206e6f74206578697374730000006044820152606401620008cc565b806001600160a01b031663a18cd7c66200324f8660a001516200343e565b6200325e87608001516200343e565b866040518463ffffffff1660e01b81526004016200327f9392919062003f87565b600060405180830381600087803b1580156200329a57600080fd5b505af1158015620032af573d6000803e3d6000fd5b50929695505050505050565b600062003312826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620035799092919063ffffffff16565b805190915015620022f5578080602001905181019062003333919062003a2a565b620022f55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620008cc565b6200339f8162003594565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b620034088282620033fc856001600160a01b03166000908152600a602052604090205490565b620022d99190620042a8565b5050565b6040516001600160a01b038316602482015260448101829052620022f590849063a9059cbb60e01b90606401620021ef565b606060005b6020811080156200348157508281602081106200347057634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b156200349c5780620034938162004317565b91505062003443565b6000816001600160401b03811115620034c557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015620034f0576020820181803683370190505b50905060005b8281101562003571578481602081106200352057634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200354557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620035688162004317565b915050620034f6565b509392505050565b60606200358a84846000856200363b565b90505b9392505050565b803b620035fa5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620008cc565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060824710156200369e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620008cc565b843b620036ee5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620008cc565b600080866001600160a01b031685876040516200370c919062003efb565b60006040518083038185875af1925050503d80600081146200374b576040519150601f19603f3d011682016040523d82523d6000602084013e62003750565b606091505b5091509150620037628282866200376d565b979650505050505050565b606083156200377e5750816200358d565b8251156200378f5782518084602001fd5b8160405162461bcd60e51b8152600401620008cc919062003f72565b610993806200439683390190565b80356001600160a01b0381168114620037d157600080fd5b919050565b600082601f830112620037e7578081fd5b815160206001600160401b038211156200380557620038056200434b565b62003815818360051b01620040e5565b80838252828201915082860187848660071b890101111562003835578586fd5b855b85811015620038a557608080838b03121562003851578788fd5b6200385b62004094565b835181528684015187820152604080850151620038788162004385565b908201526060848101516200388d8162004385565b90820152855293850193919091019060010162003837565b5090979650505050505050565b80518015158114620037d157600080fd5b600082601f830112620038d4578081fd5b8151620038eb620038e58262004118565b620040e5565b81815284602083860101111562003900578283fd5b62003913826020830160208701620042e8565b949350505050565b8035620037d18162004361565b8051620037d18162004361565b8051620037d18162004372565b80516001600160401b0381168114620037d157600080fd5b8051620037d18162004385565b60006020828403121562003979578081fd5b6200358d82620037b9565b60008060008060008060c087890312156200399d578182fd5b620039a887620037b9565b9550602087013594506040870135620039c18162004361565b9350606087013592506080870135915060a0870135620039e18162004372565b809150509295509295509295565b6000806040838503121562003a02578182fd5b62003a0d83620037b9565b9150602083013562003a1f8162004372565b809150509250929050565b60006020828403121562003a3c578081fd5b6200358d82620038b2565b60006020828403121562003a59578081fd5b5035919050565b60006020828403121562003a72578081fd5b5051919050565b60006020828403121562003a8b578081fd5b81356001600160401b0381111562003aa1578182fd5b8201601f8101841362003ab2578182fd5b803562003ac3620038e58262004118565b81815285602083850101111562003ad8578384fd5b81602084016020830137908101602001929092525092915050565b60006020828403121562003b05578081fd5b81516001600160401b0381111562003b1b578182fd5b6200391384828501620038c3565b600060c0828403121562003b3b578081fd5b60405160c081018181106001600160401b038211171562003b605762003b606200434b565b604052823562003b708162004385565b815260208381013590820152604083013562003b8c8162004361565b6040820152606083013562003ba18162004385565b60608201526080838101359082015260a0928301359281019290925250919050565b600060e0828403121562003bd5578081fd5b60405160e081018181106001600160401b038211171562003bfa5762003bfa6200434b565b604052823562003c0a8162004385565b808252506020830135602082015260408301356040820152606083013562003c328162004361565b60608201526080838101359082015262003c4f60a084016200391b565b60a082015260c083013560c08201528091505092915050565b60008060006060848603121562003c7d578081fd5b83516001600160401b038082111562003c94578283fd5b90850190610160828803121562003ca9578283fd5b62003cb3620040bf565b62003cbe836200395a565b815262003cce6020840162003935565b602082015262003ce16040840162003935565b604082015262003cf46060840162003928565b60608201526080830151608082015262003d1160a0840162003942565b60a082015262003d2460c084016200395a565b60c082015260e08301518281111562003d3b578485fd5b62003d4989828601620038c3565b60e08301525061010062003d5f81850162003935565b90820152610120838101518381111562003d77578586fd5b62003d858a828701620037d6565b91830191909152506101408381015190820152945062003da860208701620038b2565b9350604086015191508082111562003dbe578283fd5b5062003dcd86828701620038c3565b9150509250925092565b60006020828403121562003de9578081fd5b81356200358d8162004361565b60006020828403121562003e08578081fd5b81516200358d8162004361565b6000806040838503121562003e28578182fd5b823562003e358162004361565b946020939093013593505050565b6000806000806080858703121562003e59578182fd5b843562003e668162004361565b93506020850135925060408501359150606085013562003e868162004372565b939692955090935050565b60006020828403121562003ea3578081fd5b6200358d8262003942565b60006020828403121562003ec0578081fd5b81516200358d8162004385565b6000815180845262003ee7816020860160208601620042e8565b601f01601f19169290920160200192915050565b6000825162003f0f818460208701620042e8565b9190910192915050565b6000835162003f2d818460208801620042e8565b83519083019062003f43818360208801620042e8565b01949350505050565b6001600160a01b03831681526040602082018190526000906200358a9083018462003ecd565b6020815260006200358d602083018462003ecd565b60608152600062003f9c606083018662003ecd565b828103602084015262003fb0818662003ecd565b9150506001600160401b0383166040830152949350505050565b60e08152600062003fdf60e083018a62003ecd565b828103602084015262003ff3818a62003ecd565b60ff98909816604084015250506001600160401b039490941660608501526001600160a01b0392909216608084015261ffff1660a083015260c09091015292915050565b6020808252600f908201526e34b73b30b634b21032b6b4ba3a32b960891b604082015260600190565b63ffffffff8416815260606020820152600062004081606083018562003ecd565b905060ff83166040830152949350505050565b604051608081016001600160401b0381118282101715620040b957620040b96200434b565b60405290565b60405161016081016001600160401b0381118282101715620040b957620040b96200434b565b604051601f8201601f191681016001600160401b03811182821017156200411057620041106200434b565b604052919050565b60006001600160401b038211156200413457620041346200434b565b50601f01601f191660200190565b6000821982111562004158576200415862004335565b500190565b6000826200417957634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115620041bf578160001904821115620041a357620041a362004335565b80851615620041b157918102915b93841c939080029062004183565b509250929050565b60006200358d60ff841683600082620041e3575060016200106e565b81620041f2575060006200106e565b81600181146200420b5760028114620042165762004236565b60019150506200106e565b60ff8411156200422a576200422a62004335565b50506001821b6200106e565b5060208310610133831016604e8410600b84101617156200425b575081810a6200106e565b6200426783836200417e565b80600019048211156200427e576200427e62004335565b029392505050565b6000816000190483118215151615620042a357620042a362004335565b500290565b600082821015620042bd57620042bd62004335565b500390565b600060ff821660ff841680821015620042df57620042df62004335565b90039392505050565b60005b8381101562004305578181015183820152602001620042eb565b83811115620022275750506000910152565b60006000198214156200432e576200432e62004335565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff811681146200148357600080fd5b63ffffffff811681146200148357600080fd5b60ff811681146200148357600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220be83f8bec2944555ac2f26c49d486b8ad5034a5c48edaef755a50336198b2af464736f6c63430008040033\";\nvar BridgeImplementation__factory = /** @class */ (function (_super) {\n __extends(BridgeImplementation__factory, _super);\n function BridgeImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n BridgeImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n BridgeImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n BridgeImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n BridgeImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n BridgeImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n BridgeImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n BridgeImplementation__factory.bytecode = _bytecode;\n BridgeImplementation__factory.abi = _abi;\n return BridgeImplementation__factory;\n}(ContractFactory));\nexport { BridgeImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar BridgeNFT__factory = /** @class */ (function (_super) {\n __extends(BridgeNFT__factory, _super);\n function BridgeNFT__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n BridgeNFT__factory.prototype.deploy = function (beacon, data, overrides) {\n return _super.prototype.deploy.call(this, beacon, data, overrides || {});\n };\n BridgeNFT__factory.prototype.getDeployTransaction = function (beacon, data, overrides) {\n return _super.prototype.getDeployTransaction.call(this, beacon, data, overrides || {});\n };\n BridgeNFT__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n BridgeNFT__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n BridgeNFT__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n BridgeNFT__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n BridgeNFT__factory.bytecode = _bytecode;\n BridgeNFT__factory.abi = _abi;\n return BridgeNFT__factory;\n}(ContractFactory));\nexport { BridgeNFT__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"wormhole\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"governanceChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"governanceContract\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"tokenImplementation\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"WETH\",\n type: \"address\",\n },\n ],\n name: \"setup\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610299806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633bfa063814610030575b600080fd5b61004361003e3660046101e5565b610045565b005b60028054600080546001600160a01b0389166001600160a01b031990911617905561ffff868116620100000263ffffffff19909216908916171790556003839055600180546001600160a01b0319166001600160a01b038416179055600480546001600160a01b0319166001600160a01b0383161790556100c5876100ce565b50505050505050565b6100d78161010e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6101765760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146101ce57600080fd5b919050565b803561ffff811681146101ce57600080fd5b600080600080600080600060e0888a0312156101ff578283fd5b610208886101b7565b9650610216602089016101d3565b9550610224604089016101b7565b9450610232606089016101d3565b93506080880135925061024760a089016101b7565b915061025560c089016101b7565b90509295989194975092955056fea26469706673582212209a7c4b81dc8885f571074127d92f516568ccd8ac5597e6f490bab77c9fc3b11664736f6c63430008040033\";\nvar BridgeSetup__factory = /** @class */ (function (_super) {\n __extends(BridgeSetup__factory, _super);\n function BridgeSetup__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n BridgeSetup__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n BridgeSetup__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n BridgeSetup__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n BridgeSetup__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n BridgeSetup__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n BridgeSetup__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n BridgeSetup__factory.bytecode = _bytecode;\n BridgeSetup__factory.abi = _abi;\n return BridgeSetup__factory;\n}(ContractFactory));\nexport { BridgeSetup__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar BridgeToken__factory = /** @class */ (function (_super) {\n __extends(BridgeToken__factory, _super);\n function BridgeToken__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n BridgeToken__factory.prototype.deploy = function (beacon, data, overrides) {\n return _super.prototype.deploy.call(this, beacon, data, overrides || {});\n };\n BridgeToken__factory.prototype.getDeployTransaction = function (beacon, data, overrides) {\n return _super.prototype.getDeployTransaction.call(this, beacon, data, overrides || {});\n };\n BridgeToken__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n BridgeToken__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n BridgeToken__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n BridgeToken__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n BridgeToken__factory.bytecode = _bytecode;\n BridgeToken__factory.abi = _abi;\n return BridgeToken__factory;\n}(ContractFactory));\nexport { BridgeToken__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weiAmount\",\n type: \"uint256\",\n },\n ],\n name: \"Deposited\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weiAmount\",\n type: \"uint256\",\n },\n ],\n name: \"Withdrawn\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"deposit\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"depositsOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"withdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"withdrawalAllowed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ConditionalEscrow__factory = /** @class */ (function () {\n function ConditionalEscrow__factory() {\n }\n ConditionalEscrow__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ConditionalEscrow__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ConditionalEscrow__factory.abi = _abi;\n return ConditionalEscrow__factory;\n}());\nexport { ConditionalEscrow__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"uri_\",\n type: \"string\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n name: \"uri\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b50604051620016b9380380620016b9833981016040819052620000349162000105565b6200003f8162000046565b506200022e565b80516200005b9060029060208401906200005f565b5050565b8280546200006d90620001db565b90600052602060002090601f016020900481019282620000915760008555620000dc565b82601f10620000ac57805160ff1916838001178555620000dc565b82800160010185558215620000dc579182015b82811115620000dc578251825591602001919060010190620000bf565b50620000ea929150620000ee565b5090565b5b80821115620000ea5760008155600101620000ef565b6000602080838503121562000118578182fd5b82516001600160401b03808211156200012f578384fd5b818501915085601f83011262000143578384fd5b81518181111562000158576200015862000218565b604051601f8201601f19908116603f0116810190838211818310171562000183576200018362000218565b8160405282815288868487010111156200019b578687fd5b8693505b82841015620001be57848401860151818501870152928501926200019f565b82841115620001cf57868684830101525b98975050505050505050565b600181811c90821680620001f057607f821691505b602082108114156200021257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61147b806200023e6000396000f3fe608060405234801561001057600080fd5b50600436106100875760003560e01c80634e1273f41161005b5780634e1273f41461010a578063a22cb4651461012a578063e985e9c51461013d578063f242432a1461017957610087565b8062fdd58e1461008c57806301ffc9a7146100b25780630e89341c146100d55780632eb2c2d6146100f5575b600080fd5b61009f61009a366004610efa565b61018c565b6040519081526020015b60405180910390f35b6100c56100c0366004610fee565b610223565b60405190151581526020016100a9565b6100e86100e336600461102d565b610277565b6040516100a991906111ae565b610108610103366004610db7565b61030b565b005b61011d610118366004610f23565b6103b4565b6040516100a9919061116d565b610108610138366004610ec0565b610516565b6100c561014b366004610d85565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610108610187366004610e5d565b61062a565b60006001600160a01b0383166101fd5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061025457506001600160e01b031982166303a24d0760e21b145b8061026f57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b606060028054610286906112d4565b80601f01602080910402602001604051908101604052809291908181526020018280546102b2906112d4565b80156102ff5780601f106102d4576101008083540402835291602001916102ff565b820191906000526020600020905b8154815290600101906020018083116102e257829003601f168201915b50505050509050919050565b6103136106c3565b6001600160a01b0316856001600160a01b0316148061033957506103398561014b6106c3565b6103a05760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016101f4565b6103ad85858585856106c8565b5050505050565b606081518351146104195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016101f4565b6000835167ffffffffffffffff81111561044357634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b50905060005b845181101561050e576104d385828151811061049e57634e487b7160e01b600052603260045260246000fd5b60200260200101518583815181106104c657634e487b7160e01b600052603260045260246000fd5b602002602001015161018c565b8282815181106104f357634e487b7160e01b600052603260045260246000fd5b60209081029190910101526105078161133c565b9050610472565b509392505050565b816001600160a01b03166105286106c3565b6001600160a01b031614156105915760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016101f4565b806001600061059e6106c3565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556105e26106c3565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161061e911515815260200190565b60405180910390a35050565b6106326106c3565b6001600160a01b0316856001600160a01b0316148061065857506106588561014b6106c3565b6106b65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016101f4565b6103ad85858585856108cc565b335b90565b815183511461072a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016101f4565b6001600160a01b0384166107505760405162461bcd60e51b81526004016101f490611209565b600061075a6106c3565b905060005b845181101561085e57600085828151811061078a57634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106107b657634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156108065760405162461bcd60e51b81526004016101f49061124e565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906108439084906112bc565b92505081905550505050806108579061133c565b905061075f565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516108ae929190611180565b60405180910390a46108c48187878787876109fd565b505050505050565b6001600160a01b0384166108f25760405162461bcd60e51b81526004016101f490611209565b60006108fc6106c3565b905061091681878761090d88610b68565b6103ad88610b68565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156109575760405162461bcd60e51b81526004016101f49061124e565b6000858152602081815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906109949084906112bc565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46109f4828888888888610bc1565b50505050505050565b6001600160a01b0384163b156108c45760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190610a4190899089908890889088906004016110ca565b602060405180830381600087803b158015610a5b57600080fd5b505af1925050508015610a8b575060408051601f3d908101601f19168201909252610a8891810190611011565b60015b610b3857610a97611383565b806308c379a01415610ad15750610aac61139a565b80610ab75750610ad3565b8060405162461bcd60e51b81526004016101f491906111ae565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016101f4565b6001600160e01b0319811663bc197c8160e01b146109f45760405162461bcd60e51b81526004016101f4906111c1565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110610bb057634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b156108c45760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190610c059089908990889088908890600401611128565b602060405180830381600087803b158015610c1f57600080fd5b505af1925050508015610c4f575060408051601f3d908101601f19168201909252610c4c91810190611011565b60015b610c5b57610a97611383565b6001600160e01b0319811663f23a6e6160e01b146109f45760405162461bcd60e51b81526004016101f4906111c1565b80356001600160a01b038116811461027257600080fd5b600082601f830112610cb2578081fd5b81356020610cbf82611298565b604051610ccc828261130f565b8381528281019150858301600585901b87018401881015610ceb578586fd5b855b85811015610d0957813584529284019290840190600101610ced565b5090979650505050505050565b600082601f830112610d26578081fd5b813567ffffffffffffffff811115610d4057610d4061136d565b604051610d57601f8301601f19166020018261130f565b818152846020838601011115610d6b578283fd5b816020850160208301379081016020019190915292915050565b60008060408385031215610d97578182fd5b610da083610c8b565b9150610dae60208401610c8b565b90509250929050565b600080600080600060a08688031215610dce578081fd5b610dd786610c8b565b9450610de560208701610c8b565b9350604086013567ffffffffffffffff80821115610e01578283fd5b610e0d89838a01610ca2565b94506060880135915080821115610e22578283fd5b610e2e89838a01610ca2565b93506080880135915080821115610e43578283fd5b50610e5088828901610d16565b9150509295509295909350565b600080600080600060a08688031215610e74578081fd5b610e7d86610c8b565b9450610e8b60208701610c8b565b93506040860135925060608601359150608086013567ffffffffffffffff811115610eb4578182fd5b610e5088828901610d16565b60008060408385031215610ed2578182fd5b610edb83610c8b565b915060208301358015158114610eef578182fd5b809150509250929050565b60008060408385031215610f0c578182fd5b610f1583610c8b565b946020939093013593505050565b60008060408385031215610f35578182fd5b823567ffffffffffffffff80821115610f4c578384fd5b818501915085601f830112610f5f578384fd5b81356020610f6c82611298565b604051610f79828261130f565b8381528281019150858301600585901b870184018b1015610f98578889fd5b8896505b84871015610fc157610fad81610c8b565b835260019690960195918301918301610f9c565b5096505086013592505080821115610fd7578283fd5b50610fe485828601610ca2565b9150509250929050565b600060208284031215610fff578081fd5b813561100a8161142c565b9392505050565b600060208284031215611022578081fd5b815161100a8161142c565b60006020828403121561103e578081fd5b5035919050565b6000815180845260208085019450808401835b8381101561107457815187529582019590820190600101611058565b509495945050505050565b60008151808452815b818110156110a457602081850181015186830182015201611088565b818111156110b55782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0386811682528516602082015260a0604082018190526000906110f690830186611045565b82810360608401526111088186611045565b9050828103608084015261111c818561107f565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906111629083018461107f565b979650505050505050565b60006020825261100a6020830184611045565b6000604082526111936040830185611045565b82810360208401526111a58185611045565b95945050505050565b60006020825261100a602083018461107f565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b600067ffffffffffffffff8211156112b2576112b261136d565b5060051b60200190565b600082198211156112cf576112cf611357565b500190565b600181811c908216806112e857607f821691505b6020821081141561130957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff811182821017156113355761133561136d565b6040525050565b600060001982141561135057611350611357565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156106c557600481823e5160e01c90565b600060443d10156113aa576106c5565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156113dc5750505050506106c5565b82850191508151818111156113f6575050505050506106c5565b843d8701016020828501011115611412575050505050506106c5565b6114216020828601018761130f565b509094505050505090565b6001600160e01b03198116811461144257600080fd5b5056fea26469706673582212205adf82880a09a85f7a1b95c8af419ce5cf77d06610ac0ffd5b99d7df48fdd51f64736f6c63430008030033\";\nvar ERC1155__factory = /** @class */ (function (_super) {\n __extends(ERC1155__factory, _super);\n function ERC1155__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC1155__factory.prototype.deploy = function (uri_, overrides) {\n return _super.prototype.deploy.call(this, uri_, overrides || {});\n };\n ERC1155__factory.prototype.getDeployTransaction = function (uri_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, uri_, overrides || {});\n };\n ERC1155__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC1155__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC1155__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1155__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1155__factory.bytecode = _bytecode;\n ERC1155__factory.abi = _abi;\n return ERC1155__factory;\n}(ContractFactory));\nexport { ERC1155__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"burnBatch\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n name: \"uri\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ERC1155Burnable__factory = /** @class */ (function () {\n function ERC1155Burnable__factory() {\n }\n ERC1155Burnable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1155Burnable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1155Burnable__factory.abi = _abi;\n return ERC1155Burnable__factory;\n}());\nexport { ERC1155Burnable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n name: \"onERC1155BatchReceived\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n name: \"onERC1155Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b506103b8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806301ffc9a714610046578063bc197c811461006e578063f23a6e61146100a6575b600080fd5b61005961005436600461030c565b6100c5565b60405190151581526020015b60405180910390f35b61008d61007c366004610203565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610065565b61008d6100b43660046102a9565b63f23a6e6160e01b95945050505050565b60006001600160e01b03198216630271189760e51b14806100f657506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b80356001600160a01b03811681146100f957600080fd5b600082601f830112610125578081fd5b8135602067ffffffffffffffff8211156101415761014161036c565b8160051b61015082820161033b565b83815282810190868401838801850189101561016a578687fd5b8693505b8584101561018c57803583526001939093019291840191840161016e565b50979650505050505050565b600082601f8301126101a8578081fd5b813567ffffffffffffffff8111156101c2576101c261036c565b6101d5601f8201601f191660200161033b565b8181528460208386010111156101e9578283fd5b816020850160208301379081016020019190915292915050565b600080600080600060a0868803121561021a578081fd5b610223866100fe565b9450610231602087016100fe565b9350604086013567ffffffffffffffff8082111561024d578283fd5b61025989838a01610115565b9450606088013591508082111561026e578283fd5b61027a89838a01610115565b9350608088013591508082111561028f578283fd5b5061029c88828901610198565b9150509295509295909350565b600080600080600060a086880312156102c0578081fd5b6102c9866100fe565b94506102d7602087016100fe565b93506040860135925060608601359150608086013567ffffffffffffffff811115610300578182fd5b61029c88828901610198565b60006020828403121561031d578081fd5b81356001600160e01b031981168114610334578182fd5b9392505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156103645761036461036c565b604052919050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220c7089a563675685ec683fd12db514d46eb711c3b0cdf61b0863c181eff8fdfde64736f6c63430008030033\";\nvar ERC1155Holder__factory = /** @class */ (function (_super) {\n __extends(ERC1155Holder__factory, _super);\n function ERC1155Holder__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC1155Holder__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n ERC1155Holder__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n ERC1155Holder__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC1155Holder__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC1155Holder__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1155Holder__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1155Holder__factory.bytecode = _bytecode;\n ERC1155Holder__factory.abi = _abi;\n return ERC1155Holder__factory;\n}(ContractFactory));\nexport { ERC1155Holder__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Paused\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Unpaused\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"paused\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n name: \"uri\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ERC1155Pausable__factory = /** @class */ (function () {\n function ERC1155Pausable__factory() {\n }\n ERC1155Pausable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1155Pausable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1155Pausable__factory.abi = _abi;\n return ERC1155Pausable__factory;\n}());\nexport { ERC1155Pausable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Paused\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Unpaused\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DEFAULT_ADMIN_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"MINTER_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"PAUSER_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"burnBatch\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"getRoleMember\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleMemberCount\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"mintBatch\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pause\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"paused\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"unpause\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n name: \"uri\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b5060405162002e4b38038062002e4b8339810160408190526200003491620002d8565b806200004081620000b8565b506005805460ff19169055620000596000335b620000d1565b620000857f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63362000053565b620000b17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3362000053565b5062000401565b8051620000cd90600490602084019062000232565b5050565b620000e882826200011460201b62000b791760201c565b60008281526001602090815260409091206200010f91839062000b8762000120821b17901c565b505050565b620000cd828262000140565b600062000137836001600160a01b038416620001e0565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000cd576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200019c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205462000229575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200013a565b5060006200013a565b8280546200024090620003ae565b90600052602060002090601f016020900481019282620002645760008555620002af565b82601f106200027f57805160ff1916838001178555620002af565b82800160010185558215620002af579182015b82811115620002af57825182559160200191906001019062000292565b50620002bd929150620002c1565b5090565b5b80821115620002bd5760008155600101620002c2565b60006020808385031215620002eb578182fd5b82516001600160401b038082111562000302578384fd5b818501915085601f83011262000316578384fd5b8151818111156200032b576200032b620003eb565b604051601f8201601f19908116603f01168101908382118183101715620003565762000356620003eb565b8160405282815288868487010111156200036e578687fd5b8693505b8284101562000391578484018601518185018701529285019262000372565b82841115620003a257868684830101525b98975050505050505050565b600181811c90821680620003c357607f821691505b60208210811415620003e557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b612a3a80620004116000396000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c8063731133e9116100de578063ca15c87311610097578063e63ab1e911610071578063e63ab1e914610355578063e985e9c51461037c578063f242432a146103b8578063f5298aca146103cb57610172565b8063ca15c87314610308578063d53913931461031b578063d547741f1461034257610172565b8063731133e9146102945780638456cb59146102a75780639010d07c146102af57806391d14854146102da578063a217fddf146102ed578063a22cb465146102f557610172565b80632f2ff15d116101305780632f2ff15d1461022b57806336568abe1461023e5780633f4ba83a146102515780634e1273f4146102595780635c975abb146102795780636b20c4541461028157610172565b8062fdd58e1461017757806301ffc9a71461019d5780630e89341c146101c05780631f7fdffa146101e0578063248a9ca3146101f55780632eb2c2d614610218575b600080fd5b61018a610185366004612173565b6103de565b6040519081526020015b60405180910390f35b6101b06101ab366004612347565b61047a565b6040519015158152602001610194565b6101d36101ce3660046122ec565b61048d565b604051610194919061253e565b6101f36101ee3660046120a4565b610521565b005b61018a6102033660046122ec565b60009081526020819052604090206001015490565b6101f3610226366004611f2a565b610579565b6101f3610239366004612304565b610610565b6101f361024c366004612304565b610637565b6101f3610659565b61026c610267366004612221565b6106ff565b60405161019491906124fd565b6101b0610861565b6101f361028f366004612033565b61086b565b6101f36102a23660046121ce565b6108ae565b6101f3610900565b6102c26102bd366004612326565b6109a4565b6040516001600160a01b039091168152602001610194565b6101b06102e8366004612304565b6109c3565b61018a600081565b6101f3610303366004612139565b6109ec565b61018a6103163660046122ec565b610ad0565b61018a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6101f3610350366004612304565b610ae7565b61018a7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101b061038a366004611ef8565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b6101f36103c6366004611fd0565b610af1565b6101f36103d936600461219c565b610b36565b60006001600160a01b03831661044f5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060008181526002602090815260408083206001600160a01b03861684529091529020545b92915050565b600061048582610b9c565b90505b919050565b60606004805461049c90612893565b80601f01602080910402602001604051908101604052809291908181526020018280546104c890612893565b80156105155780601f106104ea57610100808354040283529160200191610515565b820191906000526020600020905b8154815290600101906020018083116104f857829003601f168201915b50505050509050919050565b61054b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336102e8565b6105675760405162461bcd60e51b8152600401610446906126ae565b61057384848484610bdc565b50505050565b6001600160a01b0385163314806105955750610595853361038a565b6105fc5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610446565b6106098585858585610d53565b5050505050565b61061a8282610f1c565b60008281526001602052604090206106329082610b87565b505050565b6106418282610f43565b60008281526001602052604090206106329082610fbd565b6106837f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336102e8565b6106f55760405162461bcd60e51b815260206004820152603b60248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f20756e706175736500000000006064820152608401610446565b6106fd610fd2565b565b606081518351146107645760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610446565b6000835167ffffffffffffffff81111561078e57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156107b7578160200160208202803683370190505b50905060005b84518110156108595761081e8582815181106107e957634e487b7160e01b600052603260045260246000fd5b602002602001015185838151811061081157634e487b7160e01b600052603260045260246000fd5b60200260200101516103de565b82828151811061083e57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610852816128fb565b90506107bd565b509392505050565b60055460ff165b90565b6001600160a01b0383163314806108875750610887833361038a565b6108a35760405162461bcd60e51b8152600401610446906125dd565b610632838383611067565b6108d87f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336102e8565b6108f45760405162461bcd60e51b8152600401610446906126ae565b61057384848484611214565b61092a7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336102e8565b61099c5760405162461bcd60e51b815260206004820152603960248201527f455243313135355072657365744d696e7465725061757365723a206d7573742060448201527f686176652070617573657220726f6c6520746f207061757365000000000000006064820152608401610446565b6106fd6112ec565b60008281526001602052604081206109bc9083611369565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b0383161415610a575760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610446565b3360008181526003602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610ac4911515815260200190565b60405180910390a35050565b600081815260016020526040812061048590611375565b610641828261137f565b6001600160a01b038516331480610b0d5750610b0d853361038a565b610b295760405162461bcd60e51b8152600401610446906125dd565b61060985858585856113a5565b6001600160a01b038316331480610b525750610b52833361038a565b610b6e5760405162461bcd60e51b8152600401610446906125dd565b6106328383836114c6565b610b8382826115cb565b5050565b60006109bc836001600160a01b03841661164f565b60006001600160e01b03198216636cdb3d1360e11b1480610bcd57506001600160e01b031982166303a24d0760e21b145b8061048557506104858261169e565b6001600160a01b038416610c025760405162461bcd60e51b81526004016104469061279d565b8151835114610c235760405162461bcd60e51b815260040161044690612755565b33610c33816000878787876116c3565b60005b8451811015610ceb57838181518110610c5f57634e487b7160e01b600052603260045260246000fd5b602002602001015160026000878481518110610c8b57634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610cd39190612802565b90915550819050610ce3816128fb565b915050610c36565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610d3c929190612510565b60405180910390a4610609816000878787876116d1565b8151835114610d745760405162461bcd60e51b815260040161044690612755565b6001600160a01b038416610d9a5760405162461bcd60e51b815260040161044690612626565b33610da98187878787876116c3565b60005b8451811015610eae576000858281518110610dd757634e487b7160e01b600052603260045260246000fd5b602002602001015190506000858381518110610e0357634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610e545760405162461bcd60e51b81526004016104469061270b565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e93908490612802565b9250508190555050505080610ea7906128fb565b9050610dac565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610efe929190612510565b60405180910390a4610f148187878787876116d1565b505050505050565b600082815260208190526040902060010154610f3981335b61183c565b61063283836115cb565b6001600160a01b0381163314610fb35760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610446565b610b8382826118a0565b60006109bc836001600160a01b038416611905565b610fda610861565b61101d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610446565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b03831661108d5760405162461bcd60e51b81526004016104469061266b565b80518251146110ae5760405162461bcd60e51b815260040161044690612755565b60003390506110d1818560008686604051806020016040528060008152506116c3565b60005b83518110156111b55760008482815181106110ff57634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061112b57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038c16835290935291909120549091508181101561117c5760405162461bcd60e51b815260040161044690612599565b60009283526002602090815260408085206001600160a01b038b16865290915290922091039055806111ad816128fb565b9150506110d4565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611206929190612510565b60405180910390a450505050565b6001600160a01b03841661123a5760405162461bcd60e51b81526004016104469061279d565b3361125a8160008761124b88611a22565b61125488611a22565b876116c3565b60008481526002602090815260408083206001600160a01b03891684529091528120805485929061128c908490612802565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461060981600087878787611a7b565b6112f4610861565b156113345760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610446565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861104a3390565b60006109bc8383611b45565b6000610485825490565b60008281526020819052604090206001015461139b8133610f34565b61063283836118a0565b6001600160a01b0384166113cb5760405162461bcd60e51b815260040161044690612626565b336113db81878761124b88611a22565b60008481526002602090815260408083206001600160a01b038a1684529091529020548381101561141e5760405162461bcd60e51b81526004016104469061270b565b60008581526002602090815260408083206001600160a01b038b811685529252808320878503905590881682528120805486929061145d908490612802565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46114bd828888888888611a7b565b50505050505050565b6001600160a01b0383166114ec5760405162461bcd60e51b81526004016104469061266b565b3361151b818560006114fd87611a22565b61150687611a22565b604051806020016040528060008152506116c3565b60008381526002602090815260408083206001600160a01b03881684529091529020548281101561155e5760405162461bcd60e51b815260040161044690612599565b60008481526002602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6115d582826109c3565b610b83576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561160b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205461169657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610474565b506000610474565b60006001600160e01b03198216635a05180f60e01b1480610485575061048582611b7d565b610f14868686868686611bb2565b6001600160a01b0384163b15610f145760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611715908990899088908890889060040161245a565b602060405180830381600087803b15801561172f57600080fd5b505af192505050801561175f575060408051601f3d908101601f1916820190925261175c91810190612363565b60015b61180c5761176b612942565b806308c379a014156117a55750611780612959565b8061178b57506117a7565b8060405162461bcd60e51b8152600401610446919061253e565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610446565b6001600160e01b0319811663bc197c8160e01b146114bd5760405162461bcd60e51b815260040161044690612551565b61184682826109c3565b610b835761185e816001600160a01b03166014611c1c565b611869836020611c1c565b60405160200161187a9291906123e5565b60408051601f198184030181529082905262461bcd60e51b82526104469160040161253e565b6118aa82826109c3565b15610b83576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015611a18576000611929600183612839565b855490915060009061193d90600190612839565b90508181146119be57600086600001828154811061196b57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508087600001848154811061199c57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b85548690806119dd57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610474565b6000915050610474565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611a6a57634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b15610f145760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611abf90899089908890889088906004016124b8565b602060405180830381600087803b158015611ad957600080fd5b505af1925050508015611b09575060408051601f3d908101601f19168201909252611b0691810190612363565b60015b611b155761176b612942565b6001600160e01b0319811663f23a6e6160e01b146114bd5760405162461bcd60e51b815260040161044690612551565b6000826000018281548110611b6a57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60006001600160e01b03198216637965db0b60e01b148061048557506301ffc9a760e01b6001600160e01b0319831614610485565b611bba610861565b15610f145760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201526b1dda1a5b19481c185d5cd95960a21b6064820152608401610446565b60606000611c2b83600261281a565b611c36906002612802565b67ffffffffffffffff811115611c5c57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611c86576020820181803683370190505b509050600360fc1b81600081518110611caf57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cec57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000611d1084600261281a565b611d1b906001612802565b90505b6001811115611daf576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d5d57634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110611d8157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93611da88161287c565b9050611d1e565b5083156109bc5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610446565b80356001600160a01b038116811461048857600080fd5b600082601f830112611e25578081fd5b81356020611e32826127de565b604051611e3f82826128ce565b8381528281019150858301600585901b87018401881015611e5e578586fd5b855b85811015611e7c57813584529284019290840190600101611e60565b5090979650505050505050565b600082601f830112611e99578081fd5b813567ffffffffffffffff811115611eb357611eb361292c565b604051611eca601f8301601f1916602001826128ce565b818152846020838601011115611ede578283fd5b816020850160208301379081016020019190915292915050565b60008060408385031215611f0a578182fd5b611f1383611dfe565b9150611f2160208401611dfe565b90509250929050565b600080600080600060a08688031215611f41578081fd5b611f4a86611dfe565b9450611f5860208701611dfe565b9350604086013567ffffffffffffffff80821115611f74578283fd5b611f8089838a01611e15565b94506060880135915080821115611f95578283fd5b611fa189838a01611e15565b93506080880135915080821115611fb6578283fd5b50611fc388828901611e89565b9150509295509295909350565b600080600080600060a08688031215611fe7578081fd5b611ff086611dfe565b9450611ffe60208701611dfe565b93506040860135925060608601359150608086013567ffffffffffffffff811115612027578182fd5b611fc388828901611e89565b600080600060608486031215612047578283fd5b61205084611dfe565b9250602084013567ffffffffffffffff8082111561206c578384fd5b61207887838801611e15565b9350604086013591508082111561208d578283fd5b5061209a86828701611e15565b9150509250925092565b600080600080608085870312156120b9578384fd5b6120c285611dfe565b9350602085013567ffffffffffffffff808211156120de578485fd5b6120ea88838901611e15565b945060408701359150808211156120ff578384fd5b61210b88838901611e15565b93506060870135915080821115612120578283fd5b5061212d87828801611e89565b91505092959194509250565b6000806040838503121561214b578182fd5b61215483611dfe565b915060208301358015158114612168578182fd5b809150509250929050565b60008060408385031215612185578182fd5b61218e83611dfe565b946020939093013593505050565b6000806000606084860312156121b0578081fd5b6121b984611dfe565b95602085013595506040909401359392505050565b600080600080608085870312156121e3578182fd5b6121ec85611dfe565b93506020850135925060408501359150606085013567ffffffffffffffff811115612215578182fd5b61212d87828801611e89565b60008060408385031215612233578182fd5b823567ffffffffffffffff8082111561224a578384fd5b818501915085601f83011261225d578384fd5b8135602061226a826127de565b60405161227782826128ce565b8381528281019150858301600585901b870184018b1015612296578889fd5b8896505b848710156122bf576122ab81611dfe565b83526001969096019591830191830161229a565b50965050860135925050808211156122d5578283fd5b506122e285828601611e15565b9150509250929050565b6000602082840312156122fd578081fd5b5035919050565b60008060408385031215612316578182fd5b82359150611f2160208401611dfe565b60008060408385031215612338578182fd5b50508035926020909101359150565b600060208284031215612358578081fd5b81356109bc816129eb565b600060208284031215612374578081fd5b81516109bc816129eb565b6000815180845260208085019450808401835b838110156123ae57815187529582019590820190600101612392565b509495945050505050565b600081518084526123d1816020860160208601612850565b601f01601f19169290920160200192915050565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161241d816017850160208801612850565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161244e816028840160208801612850565b01602801949350505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906124869083018661237f565b8281036060840152612498818661237f565b905082810360808401526124ac81856123b9565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906124f2908301846123b9565b979650505050505050565b6000602082526109bc602083018461237f565b600060408252612523604083018561237f565b8281036020840152612535818561237f565b95945050505050565b6000602082526109bc60208301846123b9565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526038908201527f455243313135355072657365744d696e7465725061757365723a206d7573742060408201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b600067ffffffffffffffff8211156127f8576127f861292c565b5060051b60200190565b6000821982111561281557612815612916565b500190565b600081600019048311821515161561283457612834612916565b500290565b60008282101561284b5761284b612916565b500390565b60005b8381101561286b578181015183820152602001612853565b838111156105735750506000910152565b60008161288b5761288b612916565b506000190190565b600181811c908216806128a757607f821691505b602082108114156128c857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff811182821017156128f4576128f461292c565b6040525050565b600060001982141561290f5761290f612916565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d111561086857600481823e5160e01c90565b600060443d101561296957610868565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561299b575050505050610868565b82850191508151818111156129b557505050505050610868565b843d87010160208285010111156129d157505050505050610868565b6129e0602082860101876128ce565b509094505050505090565b6001600160e01b031981168114612a0157600080fd5b5056fea2646970667358221220060dba8a5818696e0f5d911225cc590120dc203aec666c59c2a67d5b30ecb68464736f6c63430008030033\";\nvar ERC1155PresetMinterPauser__factory = /** @class */ (function (_super) {\n __extends(ERC1155PresetMinterPauser__factory, _super);\n function ERC1155PresetMinterPauser__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC1155PresetMinterPauser__factory.prototype.deploy = function (uri, overrides) {\n return _super.prototype.deploy.call(this, uri, overrides || {});\n };\n ERC1155PresetMinterPauser__factory.prototype.getDeployTransaction = function (uri, overrides) {\n return _super.prototype.getDeployTransaction.call(this, uri, overrides || {});\n };\n ERC1155PresetMinterPauser__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC1155PresetMinterPauser__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC1155PresetMinterPauser__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1155PresetMinterPauser__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1155PresetMinterPauser__factory.bytecode = _bytecode;\n ERC1155PresetMinterPauser__factory.abi = _abi;\n return ERC1155PresetMinterPauser__factory;\n}(ContractFactory));\nexport { ERC1155PresetMinterPauser__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onERC1155BatchReceived\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onERC1155Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ERC1155Receiver__factory = /** @class */ (function () {\n function ERC1155Receiver__factory() {\n }\n ERC1155Receiver__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1155Receiver__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1155Receiver__factory.abi = _abi;\n return ERC1155Receiver__factory;\n}());\nexport { ERC1155Receiver__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"exists\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n name: \"uri\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ERC1155Supply__factory = /** @class */ (function () {\n function ERC1155Supply__factory() {\n }\n ERC1155Supply__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1155Supply__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1155Supply__factory.abi = _abi;\n return ERC1155Supply__factory;\n}());\nexport { ERC1155Supply__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ERC165__factory = /** @class */ (function () {\n function ERC165__factory() {\n }\n ERC165__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC165__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC165__factory.abi = _abi;\n return ERC165__factory;\n}());\nexport { ERC165__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ERC165Storage__factory = /** @class */ (function () {\n function ERC165Storage__factory() {\n }\n ERC165Storage__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC165Storage__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC165Storage__factory.abi = _abi;\n return ERC165Storage__factory;\n}());\nexport { ERC165Storage__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"interfaceHash\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"canImplementInterfaceForAddress\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610112806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460a4565b604e565b60405190815260200160405180910390f35b6000828152602081815260408083206001600160a01b038516845290915281205460ff16607b576000609d565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560b5578182fd5b8235915060208301356001600160a01b038116811460d1578182fd5b80915050925092905056fea26469706673582212204632c1ec3802d05d61ae8523ec72aef2d74c909d2807e5511841a201a52fc3b864736f6c63430008030033\";\nvar ERC1820Implementer__factory = /** @class */ (function (_super) {\n __extends(ERC1820Implementer__factory, _super);\n function ERC1820Implementer__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC1820Implementer__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n ERC1820Implementer__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n ERC1820Implementer__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC1820Implementer__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC1820Implementer__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1820Implementer__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1820Implementer__factory.bytecode = _bytecode;\n ERC1820Implementer__factory.abi = _abi;\n return ERC1820Implementer__factory;\n}(ContractFactory));\nexport { ERC1820Implementer__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_logic\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405260405161077e38038061077e83398101604081905261002291610303565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61041b565b6000805160206107378339815191521461007757634e487b7160e01b600052600160045260246000fd5b6100838282600061008a565b5050610480565b610093836100c0565b6000825111806100a05750805b156100bb576100b9838361010060201b6100291760201c565b505b505050565b6100c98161012c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101258383604051806060016040528060278152602001610757602791396101ec565b9392505050565b61013f816102c160201b6100551760201c565b6101a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101cb60008051602061073783398151915260001b6102c760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61024b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161019d565b600080856001600160a01b03168560405161026691906103cc565b600060405180830381855af49150503d80600081146102a1576040519150601f19603f3d011682016040523d82523d6000602084013e6102a6565b606091505b5090925090506102b78282866102ca565b9695505050505050565b3b151590565b90565b606083156102d9575081610125565b8251156102e95782518084602001fd5b8160405162461bcd60e51b815260040161019d91906103e8565b60008060408385031215610315578182fd5b82516001600160a01b038116811461032b578283fd5b60208401519092506001600160401b0380821115610347578283fd5b818501915085601f83011261035a578283fd5b81518181111561036c5761036c61046a565b604051601f8201601f19908116603f011681019083821181831017156103945761039461046a565b816040528281528860208487010111156103ac578586fd5b6103bd83602083016020880161043e565b80955050505050509250929050565b600082516103de81846020870161043e565b9190910192915050565b600060208252825180602084015261040781604085016020870161043e565b601f01601f19169190910160400192915050565b60008282101561043957634e487b7160e01b81526011600452602481fd5b500390565b60005b83811015610459578181015183820152602001610441565b838111156100b95750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a88061048f6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b600060208252825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122045a655e4377b466c772d0002c84619390141d500175e10ed25cf2bf57537dfc564736f6c63430008030033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar ERC1967Proxy__factory = /** @class */ (function (_super) {\n __extends(ERC1967Proxy__factory, _super);\n function ERC1967Proxy__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC1967Proxy__factory.prototype.deploy = function (_logic, _data, overrides) {\n return _super.prototype.deploy.call(this, _logic, _data, overrides || {});\n };\n ERC1967Proxy__factory.prototype.getDeployTransaction = function (_logic, _data, overrides) {\n return _super.prototype.getDeployTransaction.call(this, _logic, _data, overrides || {});\n };\n ERC1967Proxy__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC1967Proxy__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC1967Proxy__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1967Proxy__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1967Proxy__factory.bytecode = _bytecode;\n ERC1967Proxy__factory.abi = _abi;\n return ERC1967Proxy__factory;\n}(ContractFactory));\nexport { ERC1967Proxy__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n];\nvar ERC1967Upgrade__factory = /** @class */ (function () {\n function ERC1967Upgrade__factory() {\n }\n ERC1967Upgrade__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC1967Upgrade__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC1967Upgrade__factory.abi = _abi;\n return ERC1967Upgrade__factory;\n}());\nexport { ERC1967Upgrade__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b5060405162000b4b38038062000b4b8339810160408190526200003491620001c1565b81516200004990600390602085019062000068565b5080516200005f90600490602084019062000068565b5050506200027b565b828054620000769062000228565b90600052602060002090601f0160209004810192826200009a5760008555620000e5565b82601f10620000b557805160ff1916838001178555620000e5565b82800160010185558215620000e5579182015b82811115620000e5578251825591602001919060010190620000c8565b50620000f3929150620000f7565b5090565b5b80821115620000f35760008155600101620000f8565b600082601f8301126200011f578081fd5b81516001600160401b03808211156200013c576200013c62000265565b604051601f8301601f19908116603f0116810190828211818310171562000167576200016762000265565b8160405283815260209250868385880101111562000183578485fd5b8491505b83821015620001a6578582018301518183018401529082019062000187565b83821115620001b757848385830101525b9695505050505050565b60008060408385031215620001d4578182fd5b82516001600160401b0380821115620001eb578384fd5b620001f9868387016200010e565b935060208501519150808211156200020f578283fd5b506200021e858286016200010e565b9150509250929050565b600181811c908216806200023d57607f821691505b602082108114156200025f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6108c0806200028b6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b4114610149578063a457c2d714610151578063a9059cbb14610164578063dd62ed3e14610177576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101b0565b6040516100c391906107d8565b60405180910390f35b6100df6100da3660046107af565b610242565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610774565b610258565b604051601281526020016100c3565b6100df6101313660046107af565b610307565b6100f3610144366004610721565b610343565b6100b6610362565b6100df61015f3660046107af565b610371565b6100df6101723660046107af565b61040a565b6100f3610185366004610742565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101bf9061084f565b80601f01602080910402602001604051908101604052809291908181526020018280546101eb9061084f565b80156102385780601f1061020d57610100808354040283529160200191610238565b820191906000526020600020905b81548152906001019060200180831161021b57829003601f168201915b5050505050905090565b600061024f338484610417565b50600192915050565b600061026584848461053b565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156102ef5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6102fc8533858403610417565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161024f91859061033e90869061082b565b610417565b6001600160a01b0381166000908152602081905260409020545b919050565b6060600480546101bf9061084f565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156103f35760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016102e6565b6104003385858403610417565b5060019392505050565b600061024f33848461053b565b6001600160a01b0383166104795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102e6565b6001600160a01b0382166104da5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102e6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661059f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102e6565b6001600160a01b0382166106015760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102e6565b6001600160a01b038316600090815260208190526040902054818110156106795760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102e6565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906106b090849061082b565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106fc91815260200190565b60405180910390a350505050565b80356001600160a01b038116811461035d57600080fd5b600060208284031215610732578081fd5b61073b8261070a565b9392505050565b60008060408385031215610754578081fd5b61075d8361070a565b915061076b6020840161070a565b90509250929050565b600080600060608486031215610788578081fd5b6107918461070a565b925061079f6020850161070a565b9150604084013590509250925092565b600080604083850312156107c1578182fd5b6107ca8361070a565b946020939093013593505050565b6000602080835283518082850152825b81811015610804578581018301518582016040015282016107e8565b818111156108155783604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561084a57634e487b7160e01b81526011600452602481fd5b500190565b600181811c9082168061086357607f821691505b6020821081141561088457634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220d5fe2a4e17ce9d022007f408350bf2342a192449074b95d77ad2ccae63966f1064736f6c63430008030033\";\nvar ERC20__factory = /** @class */ (function (_super) {\n __extends(ERC20__factory, _super);\n function ERC20__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC20__factory.prototype.deploy = function (name_, symbol_, overrides) {\n return _super.prototype.deploy.call(this, name_, symbol_, overrides || {});\n };\n ERC20__factory.prototype.getDeployTransaction = function (name_, symbol_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, name_, symbol_, overrides || {});\n };\n ERC20__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC20__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC20__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20__factory.bytecode = _bytecode;\n ERC20__factory.abi = _abi;\n return ERC20__factory;\n}(ContractFactory));\nexport { ERC20__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burnFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20Burnable__factory = /** @class */ (function () {\n function ERC20Burnable__factory() {\n }\n ERC20Burnable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20Burnable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20Burnable__factory.abi = _abi;\n return ERC20Burnable__factory;\n}());\nexport { ERC20Burnable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"cap\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20Capped__factory = /** @class */ (function () {\n function ERC20Capped__factory() {\n }\n ERC20Capped__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20Capped__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20Capped__factory.abi = _abi;\n return ERC20Capped__factory;\n}());\nexport { ERC20Capped__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"flashFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract IERC3156FlashBorrower\",\n name: \"receiver\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"flashLoan\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"maxFlashLoan\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20FlashMint__factory = /** @class */ (function () {\n function ERC20FlashMint__factory() {\n }\n ERC20FlashMint__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20FlashMint__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20FlashMint__factory.abi = _abi;\n return ERC20FlashMint__factory;\n}());\nexport { ERC20FlashMint__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Paused\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Unpaused\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"paused\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20Pausable__factory = /** @class */ (function () {\n function ERC20Pausable__factory() {\n }\n ERC20Pausable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20Pausable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20Pausable__factory.abi = _abi;\n return ERC20Pausable__factory;\n}());\nexport { ERC20Pausable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DOMAIN_SEPARATOR\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"nonces\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"deadline\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"permit\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20Permit__factory = /** @class */ (function () {\n function ERC20Permit__factory() {\n }\n ERC20Permit__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20Permit__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20Permit__factory.abi = _abi;\n return ERC20Permit__factory;\n}());\nexport { ERC20Permit__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol\",\n type: \"string\",\n },\n {\n internalType: \"uint256\",\n name: \"initialSupply\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burnFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b5060405162000f0438038062000f048339810160408190526200003491620002c3565b8351849084906200004d9060039060208501906200016a565b508051620000639060049060208401906200016a565b5050506200007881836200008260201b60201c565b50505050620003cc565b6001600160a01b038216620000dd5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000f1919062000354565b90915550506001600160a01b038216600090815260208190526040812080548392906200012090849062000354565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620001789062000379565b90600052602060002090601f0160209004810192826200019c5760008555620001e7565b82601f10620001b757805160ff1916838001178555620001e7565b82800160010185558215620001e7579182015b82811115620001e7578251825591602001919060010190620001ca565b50620001f5929150620001f9565b5090565b5b80821115620001f55760008155600101620001fa565b600082601f83011262000221578081fd5b81516001600160401b03808211156200023e576200023e620003b6565b604051601f8301601f19908116603f01168101908282118183101715620002695762000269620003b6565b8160405283815260209250868385880101111562000285578485fd5b8491505b83821015620002a8578582018301518183018401529082019062000289565b83821115620002b957848385830101525b9695505050505050565b60008060008060808587031215620002d9578384fd5b84516001600160401b0380821115620002f0578586fd5b620002fe8883890162000210565b9550602087015191508082111562000314578485fd5b50620003238782880162000210565b60408701516060880151919550935090506001600160a01b038116811462000349578182fd5b939692955090935050565b600082198211156200037457634e487b7160e01b81526011600452602481fd5b500190565b600181811c908216806200038e57607f821691505b60208210811415620003b057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b610b2880620003dc6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b4114610197578063a457c2d71461019f578063a9059cbb146101b2578063dd62ed3e146101c5576100cf565b806342966c681461015c57806370a082311461017157806379cc679014610184576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461011557806323b872dd14610127578063313ce5671461013a5780633950935114610149575b600080fd5b6100dc6101fe565b6040516100e99190610a1f565b60405180910390f35b6101056101003660046109de565b610290565b60405190151581526020016100e9565b6002545b6040519081526020016100e9565b6101056101353660046109a3565b6102a6565b604051601281526020016100e9565b6101056101573660046109de565b610355565b61016f61016a366004610a07565b610391565b005b61011961017f366004610950565b61039e565b61016f6101923660046109de565b6103bd565b6100dc610443565b6101056101ad3660046109de565b610452565b6101056101c03660046109de565b6104eb565b6101196101d3366004610971565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461020d90610aa1565b80601f016020809104026020016040519081016040528092919081815260200182805461023990610aa1565b80156102865780601f1061025b57610100808354040283529160200191610286565b820191906000526020600020905b81548152906001019060200180831161026957829003601f168201915b5050505050905090565b600061029d3384846104f8565b50600192915050565b60006102b384848461061c565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561033d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61034a85338584036104f8565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161029d91859061038c908690610a72565b6104f8565b61039b33826107eb565b50565b6001600160a01b0381166000908152602081905260409020545b919050565b60006103c983336101d3565b9050818110156104275760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b6064820152608401610334565b61043483338484036104f8565b61043e83836107eb565b505050565b60606004805461020d90610aa1565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156104d45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610334565b6104e133858584036104f8565b5060019392505050565b600061029d33848461061c565b6001600160a01b03831661055a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610334565b6001600160a01b0382166105bb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610334565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166106805760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610334565b6001600160a01b0382166106e25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610334565b6001600160a01b0383166000908152602081905260409020548181101561075a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610334565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610791908490610a72565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107dd91815260200190565b60405180910390a350505050565b6001600160a01b03821661084b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610334565b6001600160a01b038216600090815260208190526040902054818110156108bf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610334565b6001600160a01b03831660009081526020819052604081208383039055600280548492906108ee908490610a8a565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a361043e565b80356001600160a01b03811681146103b857600080fd5b600060208284031215610961578081fd5b61096a82610939565b9392505050565b60008060408385031215610983578081fd5b61098c83610939565b915061099a60208401610939565b90509250929050565b6000806000606084860312156109b7578081fd5b6109c084610939565b92506109ce60208501610939565b9150604084013590509250925092565b600080604083850312156109f0578182fd5b6109f983610939565b946020939093013593505050565b600060208284031215610a18578081fd5b5035919050565b6000602080835283518082850152825b81811015610a4b57858101830151858201604001528201610a2f565b81811115610a5c5783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610a8557610a85610adc565b500190565b600082821015610a9c57610a9c610adc565b500390565b600181811c90821680610ab557607f821691505b60208210811415610ad657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea26469706673582212200c78bc7e539580fb43b4dda3de1c552a8b022d52444f540f93aaf59495067d5e64736f6c63430008030033\";\nvar ERC20PresetFixedSupply__factory = /** @class */ (function (_super) {\n __extends(ERC20PresetFixedSupply__factory, _super);\n function ERC20PresetFixedSupply__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC20PresetFixedSupply__factory.prototype.deploy = function (name, symbol, initialSupply, owner, overrides) {\n return _super.prototype.deploy.call(this, name, symbol, initialSupply, owner, overrides || {});\n };\n ERC20PresetFixedSupply__factory.prototype.getDeployTransaction = function (name, symbol, initialSupply, owner, overrides) {\n return _super.prototype.getDeployTransaction.call(this, name, symbol, initialSupply, owner, overrides || {});\n };\n ERC20PresetFixedSupply__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC20PresetFixedSupply__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC20PresetFixedSupply__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20PresetFixedSupply__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20PresetFixedSupply__factory.bytecode = _bytecode;\n ERC20PresetFixedSupply__factory.abi = _abi;\n return ERC20PresetFixedSupply__factory;\n}(ContractFactory));\nexport { ERC20PresetFixedSupply__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol\",\n type: \"string\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Paused\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Unpaused\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DEFAULT_ADMIN_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"MINTER_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"PAUSER_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burnFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"getRoleMember\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleMemberCount\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pause\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"paused\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"unpause\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b5060405162001e3938038062001e3983398101604081905262000034916200039c565b8151829082906200004d90600590602085019062000243565b5080516200006390600690602084019062000243565b50506007805460ff19169055506200007e6000335b620000de565b620000aa7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63362000078565b620000d67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3362000078565b505062000456565b620000f582826200012160201b620009ec1760201c565b60008281526001602090815260409091206200011c918390620009f662000131821b17901c565b505050565b6200012d828262000151565b5050565b600062000148836001600160a01b038416620001f1565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200012d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001ad3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546200023a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200014b565b5060006200014b565b828054620002519062000403565b90600052602060002090601f016020900481019282620002755760008555620002c0565b82601f106200029057805160ff1916838001178555620002c0565b82800160010185558215620002c0579182015b82811115620002c0578251825591602001919060010190620002a3565b50620002ce929150620002d2565b5090565b5b80821115620002ce5760008155600101620002d3565b600082601f830112620002fa578081fd5b81516001600160401b038082111562000317576200031762000440565b604051601f8301601f19908116603f0116810190828211818310171562000342576200034262000440565b816040528381526020925086838588010111156200035e578485fd5b8491505b8382101562000381578582018301518183018401529082019062000362565b838211156200039257848385830101525b9695505050505050565b60008060408385031215620003af578182fd5b82516001600160401b0380821115620003c6578384fd5b620003d486838701620002e9565b93506020850151915080821115620003ea578283fd5b50620003f985828601620002e9565b9150509250929050565b600181811c908216806200041857607f821691505b602082108114156200043a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6119d380620004666000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d5391393146103af578063d547741f146103d6578063dd62ed3e146103e9578063e63ab1e914610422576101c4565b8063a457c2d714610376578063a9059cbb14610389578063ca15c8731461039c576101c4565b80639010d07c116100d35780639010d07c1461032857806391d148541461035357806395d89b4114610366578063a217fddf1461036e576101c4565b806370a08231146102e457806379cc67901461030d5780638456cb5914610320576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a146102ab57806340c10f19146102b357806342966c68146102c65780635c975abb146102d9576101c4565b8063313ce5671461027657806336568abe146102855780633950935114610298576101c4565b806318160ddd116101a257806318160ddd1461021957806323b872dd1461022b578063248a9ca31461023e5780632f2ff15d14610261576101c4565b806301ffc9a7146101c957806306fdde03146101f1578063095ea7b314610206575b600080fd5b6101dc6101d73660046117eb565b610449565b60405190151581526020015b60405180910390f35b6101f9610476565b6040516101e89190611888565b6101dc610214366004611767565b610508565b6004545b6040519081526020016101e8565b6101dc61023936600461172c565b61051f565b61021d61024c366004611790565b60009081526020819052604090206001015490565b61027461026f3660046117a8565b6105ce565b005b604051601281526020016101e8565b6102746102933660046117a8565b6105f5565b6101dc6102a6366004611767565b610617565b610274610653565b6102746102c1366004611767565b6106f9565b6102746102d4366004611790565b61079c565b60075460ff166101dc565b61021d6102f23660046116e0565b6001600160a01b031660009081526002602052604090205490565b61027461031b366004611767565b6107a9565b61027461082a565b61033b6103363660046117ca565b6108ce565b6040516001600160a01b0390911681526020016101e8565b6101dc6103613660046117a8565b6108ed565b6101f9610916565b61021d600081565b6101dc610384366004611767565b610925565b6101dc610397366004611767565b6109be565b61021d6103aa366004611790565b6109cb565b61021d7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102746103e43660046117a8565b6109e2565b61021d6103f73660046116fa565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b61021d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60006001600160e01b03198216635a05180f60e01b148061046e575061046e82610a0b565b90505b919050565b6060600580546104859061194c565b80601f01602080910402602001604051908101604052809291908181526020018280546104b19061194c565b80156104fe5780601f106104d3576101008083540402835291602001916104fe565b820191906000526020600020905b8154815290600101906020018083116104e157829003601f168201915b5050505050905090565b6000610515338484610a40565b5060015b92915050565b600061052c848484610b64565b6001600160a01b0384166000908152600360209081526040808320338452909152902054828110156105b65760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6105c38533858403610a40565b506001949350505050565b6105d88282610d3f565b60008281526001602052604090206105f090826109f6565b505050565b6105ff8282610d66565b60008281526001602052604090206105f09082610de0565b3360008181526003602090815260408083206001600160a01b0387168452909152812054909161051591859061064e9086906118bb565b610a40565b61067d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610361565b6106ef5760405162461bcd60e51b815260206004820152603960248201527f45524332305072657365744d696e7465725061757365723a206d75737420686160448201527f76652070617573657220726f6c6520746f20756e70617573650000000000000060648201526084016105ad565b6106f7610df5565b565b6107237f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610361565b61078e5760405162461bcd60e51b815260206004820152603660248201527f45524332305072657365744d696e7465725061757365723a206d7573742068616044820152751d99481b5a5b9d195c881c9bdb19481d1bc81b5a5b9d60521b60648201526084016105ad565b6107988282610e88565b5050565b6107a63382610f74565b50565b60006107b583336103f7565b9050818110156108135760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b60648201526084016105ad565b6108208333848403610a40565b6105f08383610f74565b6108547f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610361565b6108c65760405162461bcd60e51b815260206004820152603760248201527f45524332305072657365744d696e7465725061757365723a206d75737420686160448201527f76652070617573657220726f6c6520746f20706175736500000000000000000060648201526084016105ad565b6106f76110ce565b60008281526001602052604081206108e69083611149565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600680546104859061194c565b3360009081526003602090815260408083206001600160a01b0386168452909152812054828110156109a75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105ad565b6109b43385858403610a40565b5060019392505050565b6000610515338484610b64565b600081815260016020526040812061046e90611155565b6105ff828261115f565b6107988282611185565b60006108e6836001600160a01b038416611209565b60006001600160e01b03198216637965db0b60e01b148061046e57506301ffc9a760e01b6001600160e01b031983161461046e565b6001600160a01b038316610aa25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ad565b6001600160a01b038216610b035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ad565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bc85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ad565b6001600160a01b038216610c2a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ad565b610c35838383611258565b6001600160a01b03831660009081526002602052604090205481811015610cad5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105ad565b6001600160a01b03808516600090815260026020526040808220858503905591851681529081208054849290610ce49084906118bb565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d3091815260200190565b60405180910390a35b50505050565b600082815260208190526040902060010154610d5c81335b611263565b6105f08383611185565b6001600160a01b0381163314610dd65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105ad565b61079882826112c7565b60006108e6836001600160a01b03841661132c565b60075460ff16610e3e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105ad565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216610ede5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105ad565b610eea60008383611258565b8060046000828254610efc91906118bb565b90915550506001600160a01b03821660009081526002602052604081208054839290610f299084906118bb565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3610798565b6001600160a01b038216610fd45760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105ad565b610fe082600083611258565b6001600160a01b038216600090815260026020526040902054818110156110545760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105ad565b6001600160a01b03831660009081526002602052604081208383039055600480548492906110839084906118f2565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36105f0565b60075460ff16156111145760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105ad565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e6b3390565b60006108e68383611449565b600061046e825490565b60008281526020819052604090206001015461117b8133610d57565b6105f083836112c7565b61118f82826108ed565b610798576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556111c53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205461125057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610519565b506000610519565b6105f0838383611481565b61126d82826108ed565b61079857611285816001600160a01b031660146114e7565b6112908360206114e7565b6040516020016112a1929190611813565b60408051601f198184030181529082905262461bcd60e51b82526105ad91600401611888565b6112d182826108ed565b15610798576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000818152600183016020526040812054801561143f5760006113506001836118f2565b8554909150600090611364906001906118f2565b90508181146113e557600086600001828154811061139257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050808760000184815481106113c357634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b855486908061140457634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610519565b6000915050610519565b600082600001828154811061146e57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60075460ff16156105f05760405162461bcd60e51b815260206004820152602a60248201527f45524332305061757361626c653a20746f6b656e207472616e736665722077686044820152691a5b19481c185d5cd95960b21b60648201526084016105ad565b606060006114f68360026118d3565b6115019060026118bb565b67ffffffffffffffff81111561152757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611551576020820181803683370190505b509050600360fc1b8160008151811061157a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106115b757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006115db8460026118d3565b6115e69060016118bb565b90505b600181111561167a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061162857634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061164c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361167381611935565b90506115e9565b5083156108e65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105ad565b80356001600160a01b038116811461047157600080fd5b6000602082840312156116f1578081fd5b6108e6826116c9565b6000806040838503121561170c578081fd5b611715836116c9565b9150611723602084016116c9565b90509250929050565b600080600060608486031215611740578081fd5b611749846116c9565b9250611757602085016116c9565b9150604084013590509250925092565b60008060408385031215611779578182fd5b611782836116c9565b946020939093013593505050565b6000602082840312156117a1578081fd5b5035919050565b600080604083850312156117ba578182fd5b82359150611723602084016116c9565b600080604083850312156117dc578182fd5b50508035926020909101359150565b6000602082840312156117fc578081fd5b81356001600160e01b0319811681146108e6578182fd5b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161184b816017850160208801611909565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161187c816028840160208801611909565b01602801949350505050565b60006020825282518060208401526118a7816040850160208701611909565b601f01601f19169190910160400192915050565b600082198211156118ce576118ce611987565b500190565b60008160001904831182151516156118ed576118ed611987565b500290565b60008282101561190457611904611987565b500390565b60005b8381101561192457818101518382015260200161190c565b83811115610d395750506000910152565b60008161194457611944611987565b506000190190565b600181811c9082168061196057607f821691505b6020821081141561198157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220ae386b40d9bc06b6d5a7d9610f6825fc91bf0484da9d4a0f3bb5474557c2aa4864736f6c63430008030033\";\nvar ERC20PresetMinterPauser__factory = /** @class */ (function (_super) {\n __extends(ERC20PresetMinterPauser__factory, _super);\n function ERC20PresetMinterPauser__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC20PresetMinterPauser__factory.prototype.deploy = function (name, symbol, overrides) {\n return _super.prototype.deploy.call(this, name, symbol, overrides || {});\n };\n ERC20PresetMinterPauser__factory.prototype.getDeployTransaction = function (name, symbol, overrides) {\n return _super.prototype.getDeployTransaction.call(this, name, symbol, overrides || {});\n };\n ERC20PresetMinterPauser__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC20PresetMinterPauser__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC20PresetMinterPauser__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20PresetMinterPauser__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20PresetMinterPauser__factory.bytecode = _bytecode;\n ERC20PresetMinterPauser__factory.abi = _abi;\n return ERC20PresetMinterPauser__factory;\n}(ContractFactory));\nexport { ERC20PresetMinterPauser__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"Snapshot\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"snapshotId\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOfAt\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"snapshotId\",\n type: \"uint256\",\n },\n ],\n name: \"totalSupplyAt\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20Snapshot__factory = /** @class */ (function () {\n function ERC20Snapshot__factory() {\n }\n ERC20Snapshot__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20Snapshot__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20Snapshot__factory.abi = _abi;\n return ERC20Snapshot__factory;\n}());\nexport { ERC20Snapshot__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"delegator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"fromDelegate\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"toDelegate\",\n type: \"address\",\n },\n ],\n name: \"DelegateChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"delegate\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"previousBalance\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"newBalance\",\n type: \"uint256\",\n },\n ],\n name: \"DelegateVotesChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DOMAIN_SEPARATOR\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint32\",\n name: \"pos\",\n type: \"uint32\",\n },\n ],\n name: \"checkpoints\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"fromBlock\",\n type: \"uint32\",\n },\n {\n internalType: \"uint224\",\n name: \"votes\",\n type: \"uint224\",\n },\n ],\n internalType: \"struct ERC20Votes.Checkpoint\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"delegatee\",\n type: \"address\",\n },\n ],\n name: \"delegate\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"delegatee\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"expiry\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"delegateBySig\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"delegates\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getPastTotalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getPastVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"nonces\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"numCheckpoints\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"deadline\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"permit\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20Votes__factory = /** @class */ (function () {\n function ERC20Votes__factory() {\n }\n ERC20Votes__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20Votes__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20Votes__factory.abi = _abi;\n return ERC20Votes__factory;\n}());\nexport { ERC20Votes__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"delegator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"fromDelegate\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"toDelegate\",\n type: \"address\",\n },\n ],\n name: \"DelegateChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"delegate\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"previousBalance\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"newBalance\",\n type: \"uint256\",\n },\n ],\n name: \"DelegateVotesChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DOMAIN_SEPARATOR\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint32\",\n name: \"pos\",\n type: \"uint32\",\n },\n ],\n name: \"checkpoints\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"fromBlock\",\n type: \"uint32\",\n },\n {\n internalType: \"uint224\",\n name: \"votes\",\n type: \"uint224\",\n },\n ],\n internalType: \"struct ERC20Votes.Checkpoint\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"delegatee\",\n type: \"address\",\n },\n ],\n name: \"delegate\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"delegatee\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"expiry\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"delegateBySig\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"delegates\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"getCurrentVotes\",\n outputs: [\n {\n internalType: \"uint96\",\n name: \"\",\n type: \"uint96\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getPastTotalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getPastVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getPriorVotes\",\n outputs: [\n {\n internalType: \"uint96\",\n name: \"\",\n type: \"uint96\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"nonces\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"numCheckpoints\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"deadline\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"permit\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20VotesComp__factory = /** @class */ (function () {\n function ERC20VotesComp__factory() {\n }\n ERC20VotesComp__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20VotesComp__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20VotesComp__factory.abi = _abi;\n return ERC20VotesComp__factory;\n}());\nexport { ERC20VotesComp__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"depositFor\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"underlying\",\n outputs: [\n {\n internalType: \"contract IERC20\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"withdrawTo\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC20Wrapper__factory = /** @class */ (function () {\n function ERC20Wrapper__factory() {\n }\n ERC20Wrapper__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC20Wrapper__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC20Wrapper__factory.abi = _abi;\n return ERC20Wrapper__factory;\n}());\nexport { ERC20Wrapper__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"forwarder\",\n type: \"address\",\n },\n ],\n name: \"isTrustedForwarder\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ERC2771Context__factory = /** @class */ (function () {\n function ERC2771Context__factory() {\n }\n ERC2771Context__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC2771Context__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC2771Context__factory.abi = _abi;\n return ERC2771Context__factory;\n}());\nexport { ERC2771Context__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b50604051620014d2380380620014d28339810160408190526200003491620001c1565b81516200004990600090602085019062000068565b5080516200005f90600190602084019062000068565b5050506200027b565b828054620000769062000228565b90600052602060002090601f0160209004810192826200009a5760008555620000e5565b82601f10620000b557805160ff1916838001178555620000e5565b82800160010185558215620000e5579182015b82811115620000e5578251825591602001919060010190620000c8565b50620000f3929150620000f7565b5090565b5b80821115620000f35760008155600101620000f8565b600082601f8301126200011f578081fd5b81516001600160401b03808211156200013c576200013c62000265565b604051601f8301601f19908116603f0116810190828211818310171562000167576200016762000265565b8160405283815260209250868385880101111562000183578485fd5b8491505b83821015620001a6578582018301518183018401529082019062000187565b83821115620001b757848385830101525b9695505050505050565b60008060408385031215620001d4578182fd5b82516001600160401b0380821115620001eb578384fd5b620001f9868387016200010e565b935060208501519150808211156200020f578283fd5b506200021e858286016200010e565b9150509250929050565b600181811c908216806200023d57607f821691505b602082108114156200025f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b611247806200028b6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80636352211e1161008c578063a22cb46511610066578063a22cb465146101b3578063b88d4fde146101c6578063c87b56dd146101d9578063e985e9c5146101ec576100cf565b80636352211e1461017757806370a082311461018a57806395d89b41146101ab576100cf565b806301ffc9a7146100d457806306fdde03146100fc578063081812fc14610111578063095ea7b31461013c57806323b872dd1461015157806342842e0e14610164575b600080fd5b6100e76100e2366004610f3f565b610228565b60405190151581526020015b60405180910390f35b61010461027c565b6040516100f39190611027565b61012461011f366004610f77565b61030e565b6040516001600160a01b0390911681526020016100f3565b61014f61014a366004610f16565b6103a8565b005b61014f61015f366004610dcc565b6104be565b61014f610172366004610dcc565b6104ef565b610124610185366004610f77565b61050a565b61019d610198366004610d80565b610581565b6040519081526020016100f3565b610104610608565b61014f6101c1366004610edc565b610617565b61014f6101d4366004610e07565b6106e9565b6101046101e7366004610f77565b610721565b6100e76101fa366004610d9a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b148061025957506001600160e01b03198216635b5e139f60e01b145b8061027457506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b60606000805461028b9061114c565b80601f01602080910402602001604051908101604052809291908181526020018280546102b79061114c565b80156103045780601f106102d957610100808354040283529160200191610304565b820191906000526020600020905b8154815290600101906020018083116102e757829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661038c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006103b38261050a565b9050806001600160a01b0316836001600160a01b031614156104215760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610383565b336001600160a01b038216148061043d575061043d81336101fa565b6104af5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610383565b6104b98383610809565b505050565b6104c83382610877565b6104e45760405162461bcd60e51b81526004016103839061108c565b6104b983838361096e565b6104b9838383604051806020016040528060008152506106e9565b6000818152600260205260408120546001600160a01b0316806102745760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610383565b60006001600160a01b0382166105ec5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610383565b506001600160a01b031660009081526003602052604090205490565b60606001805461028b9061114c565b6001600160a01b0382163314156106705760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610383565b3360008181526005602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516106dd911515815260200190565b60405180910390a35050565b6106f33383610877565b61070f5760405162461bcd60e51b81526004016103839061108c565b61071b84848484610b0e565b50505050565b6000818152600260205260409020546060906001600160a01b03166107a05760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610383565b60006107b760408051602081019091526000815290565b905060008151116107d75760405180602001604052806000815250610802565b806107e184610b41565b6040516020016107f2929190610fbb565b6040516020818303038152906040525b9392505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061083e8261050a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166108f05760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610383565b60006108fb8361050a565b9050806001600160a01b0316846001600160a01b031614806109365750836001600160a01b031661092b8461030e565b6001600160a01b0316145b8061096657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166109818261050a565b6001600160a01b0316146109e95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610383565b6001600160a01b038216610a4b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610383565b610a56600082610809565b6001600160a01b0383166000908152600360205260408120805460019290610a7f908490611109565b90915550506001600160a01b0382166000908152600360205260408120805460019290610aad9084906110dd565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610b1984848461096e565b610b2584848484610c5c565b61071b5760405162461bcd60e51b81526004016103839061103a565b606081610b6657506040805180820190915260018152600360fc1b6020820152610277565b8160005b8115610b905780610b7a81611187565b9150610b899050600a836110f5565b9150610b6a565b60008167ffffffffffffffff811115610bb957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610be3576020820181803683370190505b5090505b841561096657610bf8600183611109565b9150610c05600a866111a2565b610c109060306110dd565b60f81b818381518110610c3357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350610c55600a866110f5565b9450610be7565b60006001600160a01b0384163b15610d5e57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610ca0903390899088908890600401610fea565b602060405180830381600087803b158015610cba57600080fd5b505af1925050508015610cea575060408051601f3d908101601f19168201909252610ce791810190610f5b565b60015b610d44573d808015610d18576040519150601f19603f3d011682016040523d82523d6000602084013e610d1d565b606091505b508051610d3c5760405162461bcd60e51b81526004016103839061103a565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610966565b506001949350505050565b80356001600160a01b038116811461027757600080fd5b600060208284031215610d91578081fd5b61080282610d69565b60008060408385031215610dac578081fd5b610db583610d69565b9150610dc360208401610d69565b90509250929050565b600080600060608486031215610de0578081fd5b610de984610d69565b9250610df760208501610d69565b9150604084013590509250925092565b60008060008060808587031215610e1c578081fd5b610e2585610d69565b9350610e3360208601610d69565b925060408501359150606085013567ffffffffffffffff80821115610e56578283fd5b818701915087601f830112610e69578283fd5b813581811115610e7b57610e7b6111e2565b604051601f8201601f19908116603f01168101908382118183101715610ea357610ea36111e2565b816040528281528a6020848701011115610ebb578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060408385031215610eee578182fd5b610ef783610d69565b915060208301358015158114610f0b578182fd5b809150509250929050565b60008060408385031215610f28578182fd5b610f3183610d69565b946020939093013593505050565b600060208284031215610f50578081fd5b8135610802816111f8565b600060208284031215610f6c578081fd5b8151610802816111f8565b600060208284031215610f88578081fd5b5035919050565b60008151808452610fa7816020860160208601611120565b601f01601f19169290920160200192915050565b60008351610fcd818460208801611120565b835190830190610fe1818360208801611120565b01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061101d90830184610f8f565b9695505050505050565b6000602082526108026020830184610f8f565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156110f0576110f06111b6565b500190565b600082611104576111046111cc565b500490565b60008282101561111b5761111b6111b6565b500390565b60005b8381101561113b578181015183820152602001611123565b8381111561071b5750506000910152565b600181811c9082168061116057607f821691505b6020821081141561118157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561119b5761119b6111b6565b5060010190565b6000826111b1576111b16111cc565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461120e57600080fd5b5056fea26469706673582212202d938d3b28324cc89e6d2076ba56ed8ae7428805a112a58e80ba9ad3b13c770964736f6c63430008030033\";\nvar ERC721__factory = /** @class */ (function (_super) {\n __extends(ERC721__factory, _super);\n function ERC721__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC721__factory.prototype.deploy = function (name_, symbol_, overrides) {\n return _super.prototype.deploy.call(this, name_, symbol_, overrides || {});\n };\n ERC721__factory.prototype.getDeployTransaction = function (name_, symbol_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, name_, symbol_, overrides || {});\n };\n ERC721__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC721__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC721__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC721__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC721__factory.bytecode = _bytecode;\n ERC721__factory.abi = _abi;\n return ERC721__factory;\n}(ContractFactory));\nexport { ERC721__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC721Burnable__factory = /** @class */ (function () {\n function ERC721Burnable__factory() {\n }\n ERC721Burnable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC721Burnable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC721Burnable__factory.abi = _abi;\n return ERC721Burnable__factory;\n}());\nexport { ERC721Burnable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenByIndex\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenOfOwnerByIndex\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC721Enumerable__factory = /** @class */ (function () {\n function ERC721Enumerable__factory() {\n }\n ERC721Enumerable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC721Enumerable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC721Enumerable__factory.abi = _abi;\n return ERC721Enumerable__factory;\n}());\nexport { ERC721Enumerable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n name: \"onERC721Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b506101a8806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063150b7a0214610030575b600080fd5b61004e61003e366004610087565b630a85bd0160e11b949350505050565b6040516001600160e01b0319909116815260200160405180910390f35b80356001600160a01b038116811461008257600080fd5b919050565b6000806000806080858703121561009c578384fd5b6100a58561006b565b93506100b36020860161006b565b925060408501359150606085013567ffffffffffffffff808211156100d6578283fd5b818701915087601f8301126100e9578283fd5b8135818111156100fb576100fb61015c565b604051601f8201601f19908116603f011681019083821181831017156101235761012361015c565b816040528281528a602084870101111561013b578586fd5b82602086016020830137918201602001949094529598949750929550505050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dc27e8fed018fdfacad30c665dc1bdf024b6ef66c2c22fbce4a02747ba89990064736f6c63430008030033\";\nvar ERC721Holder__factory = /** @class */ (function (_super) {\n __extends(ERC721Holder__factory, _super);\n function ERC721Holder__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC721Holder__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n ERC721Holder__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n ERC721Holder__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC721Holder__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC721Holder__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC721Holder__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC721Holder__factory.bytecode = _bytecode;\n ERC721Holder__factory.abi = _abi;\n return ERC721Holder__factory;\n}(ContractFactory));\nexport { ERC721Holder__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Paused\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Unpaused\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"paused\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC721Pausable__factory = /** @class */ (function () {\n function ERC721Pausable__factory() {\n }\n ERC721Pausable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC721Pausable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC721Pausable__factory.abi = _abi;\n return ERC721Pausable__factory;\n}());\nexport { ERC721Pausable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"baseTokenURI\",\n type: \"string\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Paused\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Unpaused\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DEFAULT_ADMIN_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"MINTER_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"PAUSER_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"getRoleMember\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleMemberCount\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pause\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"paused\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenByIndex\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenOfOwnerByIndex\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"unpause\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b5060405162002b1438038062002b148339810160408190526200003491620003b3565b8251839083906200004d9060029060208501906200025a565b508051620000639060039060208401906200025a565b5050600c805460ff191690555080516200008590600e9060208401906200025a565b50620000946000335b620000f5565b620000c07f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336200008e565b620000ec7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336200008e565b50505062000493565b6200010c82826200013860201b62000e901760201c565b60008281526001602090815260409091206200013391839062000e9e62000148821b17901c565b505050565b62000144828262000168565b5050565b60006200015f836001600160a01b03841662000208565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000144576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001c43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054620002515750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000162565b50600062000162565b828054620002689062000440565b90600052602060002090601f0160209004810192826200028c5760008555620002d7565b82601f10620002a757805160ff1916838001178555620002d7565b82800160010185558215620002d7579182015b82811115620002d7578251825591602001919060010190620002ba565b50620002e5929150620002e9565b5090565b5b80821115620002e55760008155600101620002ea565b600082601f83011262000311578081fd5b81516001600160401b03808211156200032e576200032e6200047d565b604051601f8301601f19908116603f011681019082821181831017156200035957620003596200047d565b8160405283815260209250868385880101111562000375578485fd5b8491505b8382101562000398578582018301518183018401529082019062000379565b83821115620003a957848385830101525b9695505050505050565b600080600060608486031215620003c8578283fd5b83516001600160401b0380821115620003df578485fd5b620003ed8783880162000300565b9450602086015191508082111562000403578384fd5b620004118783880162000300565b9350604086015191508082111562000427578283fd5b50620004368682870162000300565b9150509250925092565b600181811c908216806200045557607f821691505b602082108114156200047757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61267180620004a36000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80636352211e1161010f578063a22cb465116100a2578063d539139311610071578063d5391393146103f7578063d547741f1461041e578063e63ab1e914610431578063e985e9c514610458576101e5565b8063a22cb465146103ab578063b88d4fde146103be578063c87b56dd146103d1578063ca15c873146103e4576101e5565b80639010d07c116100de5780639010d07c1461037557806391d148541461038857806395d89b411461039b578063a217fddf146103a3576101e5565b80636352211e146103345780636a6278421461034757806370a082311461035a5780638456cb591461036d576101e5565b80632f2ff15d1161018757806342842e0e1161015657806342842e0e146102f057806342966c68146103035780634f6ccce7146103165780635c975abb14610329576101e5565b80632f2ff15d146102af5780632f745c59146102c257806336568abe146102d55780633f4ba83a146102e8576101e5565b8063095ea7b3116101c3578063095ea7b31461025257806318160ddd1461026757806323b872dd14610279578063248a9ca31461028c576101e5565b806301ffc9a7146101ea57806306fdde0314610212578063081812fc14610227575b600080fd5b6101fd6101f83660046122d9565b610494565b60405190151581526020015b60405180910390f35b61021a6104a7565b604051610209919061241e565b61023a61023536600461227e565b610539565b6040516001600160a01b039091168152602001610209565b610265610260366004612255565b6105d3565b005b600a545b604051908152602001610209565b61026561028736600461210b565b6106e9565b61026b61029a36600461227e565b60009081526020819052604090206001015490565b6102656102bd366004612296565b61071b565b61026b6102d0366004612255565b61073d565b6102656102e3366004612296565b6107d6565b6102656107f8565b6102656102fe36600461210b565b6108a0565b61026561031136600461227e565b6108bb565b61026b61032436600461227e565b610935565b600c5460ff166101fd565b61023a61034236600461227e565b6109d6565b6102656103553660046120bf565b610a4d565b61026b6103683660046120bf565b610b09565b610265610b90565b61023a6103833660046122b8565b610c34565b6101fd610396366004612296565b610c53565b61021a610c7c565b61026b600081565b6102656103b936600461221b565b610c8b565b6102656103cc366004612146565b610d5d565b61021a6103df36600461227e565b610d95565b61026b6103f236600461227e565b610e6f565b61026b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61026561042c366004612296565b610e86565b61026b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101fd6104663660046120d9565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b600061049f82610eb3565b90505b919050565b6060600280546104b690612579565b80601f01602080910402602001604051908101604052809291908181526020018280546104e290612579565b801561052f5780601f106105045761010080835404028352916020019161052f565b820191906000526020600020905b81548152906001019060200180831161051257829003601f168201915b5050505050905090565b6000818152600460205260408120546001600160a01b03166105b75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006105de826109d6565b9050806001600160a01b0316836001600160a01b0316141561064c5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016105ae565b336001600160a01b038216148061066857506106688133610466565b6106da5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016105ae565b6106e48383610ed8565b505050565b6106f4335b82610f46565b6107105760405162461bcd60e51b81526004016105ae90612483565b6106e483838361103d565b61072582826111e8565b60008281526001602052604090206106e49082610e9e565b600061074883610b09565b82106107aa5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016105ae565b506001600160a01b03821660009081526008602090815260408083208484529091529020545b92915050565b6107e0828261120f565b60008281526001602052604090206106e49082611289565b6108227f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610396565b610896576040805162461bcd60e51b81526020600482015260248101919091527f4552433732315072657365744d696e7465725061757365724175746f49643a2060448201527f6d75737420686176652070617573657220726f6c6520746f20756e706175736560648201526084016105ae565b61089e61129e565b565b6106e483838360405180602001604052806000815250610d5d565b6108c4336106ee565b6109295760405162461bcd60e51b815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201526f1b995c881b9bdc88185c1c1c9bdd995960821b60648201526084016105ae565b61093281611331565b50565b6000610940600a5490565b82106109a35760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016105ae565b600a82815481106109c457634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000818152600460205260408120546001600160a01b03168061049f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016105ae565b610a777f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610396565b610ae95760405162461bcd60e51b815260206004820152603d60248201527f4552433732315072657365744d696e7465725061757365724175746f49643a2060448201527f6d7573742068617665206d696e74657220726f6c6520746f206d696e7400000060648201526084016105ae565b610afb81610af6600d5490565b6113d8565b610932600d80546001019055565b60006001600160a01b038216610b745760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016105ae565b506001600160a01b031660009081526005602052604090205490565b610bba7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610396565b610c2c5760405162461bcd60e51b815260206004820152603e60248201527f4552433732315072657365744d696e7465725061757365724175746f49643a2060448201527f6d75737420686176652070617573657220726f6c6520746f207061757365000060648201526084016105ae565b61089e611526565b6000828152600160205260408120610c4c90836115a1565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600380546104b690612579565b6001600160a01b038216331415610ce45760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105ae565b3360008181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610d51911515815260200190565b60405180910390a35050565b610d673383610f46565b610d835760405162461bcd60e51b81526004016105ae90612483565b610d8f848484846115ad565b50505050565b6000818152600460205260409020546060906001600160a01b0316610e145760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016105ae565b6000610e1e6115e0565b90506000815111610e3e5760405180602001604052806000815250610c4c565b80610e48846115ef565b604051602001610e5992919061233d565b6040516020818303038152906040529392505050565b600081815260016020526040812061049f9061170a565b6107e08282611714565b610e9a828261173a565b5050565b6000610c4c836001600160a01b0384166117be565b60006001600160e01b0319821663780e9d6360e01b148061049f575061049f8261180d565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610f0d826109d6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600460205260408120546001600160a01b0316610fbf5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105ae565b6000610fca836109d6565b9050806001600160a01b0316846001600160a01b031614806110055750836001600160a01b0316610ffa84610539565b6001600160a01b0316145b8061103557506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611050826109d6565b6001600160a01b0316146110b85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016105ae565b6001600160a01b03821661111a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105ae565b61112583838361184d565b611130600082610ed8565b6001600160a01b038316600090815260056020526040812080546001929061115990849061251f565b90915550506001600160a01b03821660009081526005602052604081208054600192906111879084906124d4565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008281526020819052604090206001015461120581335b611858565b6106e4838361173a565b6001600160a01b038116331461127f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105ae565b610e9a82826118bc565b6000610c4c836001600160a01b038416611921565b600c5460ff166112e75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105ae565b600c805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600061133c826109d6565b905061134a8160008461184d565b611355600083610ed8565b6001600160a01b038116600090815260056020526040812080546001929061137e90849061251f565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b03821661142e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105ae565b6000818152600460205260409020546001600160a01b0316156114935760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105ae565b61149f6000838361184d565b6001600160a01b03821660009081526005602052604081208054600192906114c89084906124d4565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600c5460ff161561156c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105ae565b600c805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586113143390565b6000610c4c8383611a3e565b6115b884848461103d565b6115c484848484611a76565b610d8f5760405162461bcd60e51b81526004016105ae90612431565b6060600e80546104b690612579565b60608161161457506040805180820190915260018152600360fc1b60208201526104a2565b8160005b811561163e5780611628816125b4565b91506116379050600a836124ec565b9150611618565b60008167ffffffffffffffff81111561166757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611691576020820181803683370190505b5090505b8415611035576116a660018361251f565b91506116b3600a866125cf565b6116be9060306124d4565b60f81b8183815181106116e157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611703600a866124ec565b9450611695565b600061049f825490565b6000828152602081905260409020600101546117308133611200565b6106e483836118bc565b6117448282610c53565b610e9a576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561177a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054611805575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107d0565b5060006107d0565b60006001600160e01b031982166380ac58cd60e01b148061183e57506001600160e01b03198216635b5e139f60e01b145b8061049f575061049f82611b83565b6106e4838383611ba8565b6118628282610c53565b610e9a5761187a816001600160a01b03166014611c1a565b611885836020611c1a565b60405160200161189692919061236c565b60408051601f198184030181529082905262461bcd60e51b82526105ae9160040161241e565b6118c68282610c53565b15610e9a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015611a3457600061194560018361251f565b85549091506000906119599060019061251f565b90508181146119da57600086600001828154811061198757634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050808760000184815481106119b857634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b85548690806119f957634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107d0565b60009150506107d0565b6000826000018281548110611a6357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60006001600160a01b0384163b15611b7857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611aba9033908990889088906004016123e1565b602060405180830381600087803b158015611ad457600080fd5b505af1925050508015611b04575060408051601f3d908101601f19168201909252611b01918101906122f5565b60015b611b5e573d808015611b32576040519150601f19603f3d011682016040523d82523d6000602084013e611b37565b606091505b508051611b565760405162461bcd60e51b81526004016105ae90612431565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611035565b506001949350505050565b60006001600160e01b03198216635a05180f60e01b148061049f575061049f82611dfc565b611bb3838383611e31565b600c5460ff16156106e45760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b60648201526084016105ae565b60606000611c29836002612500565b611c349060026124d4565b67ffffffffffffffff811115611c5a57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611c84576020820181803683370190505b509050600360fc1b81600081518110611cad57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cea57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000611d0e846002612500565b611d199060016124d4565b90505b6001811115611dad576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d5b57634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110611d7f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93611da681612562565b9050611d1c565b508315610c4c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105ae565b60006001600160e01b03198216637965db0b60e01b148061049f57506301ffc9a760e01b6001600160e01b031983161461049f565b6001600160a01b038316611e8c57611e8781600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b611eaf565b816001600160a01b0316836001600160a01b031614611eaf57611eaf8382611eee565b6001600160a01b038216611ecb57611ec681611f8b565b6106e4565b826001600160a01b0316826001600160a01b0316146106e4576106e48282612064565b60006001611efb84610b09565b611f05919061251f565b600083815260096020526040902054909150808214611f58576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a54600090611f9d9060019061251f565b6000838152600b6020526040812054600a8054939450909284908110611fd357634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600a838154811061200257634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a80548061204857634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061206f83610b09565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b80356001600160a01b03811681146104a257600080fd5b6000602082840312156120d0578081fd5b610c4c826120a8565b600080604083850312156120eb578081fd5b6120f4836120a8565b9150612102602084016120a8565b90509250929050565b60008060006060848603121561211f578081fd5b612128846120a8565b9250612136602085016120a8565b9150604084013590509250925092565b6000806000806080858703121561215b578081fd5b612164856120a8565b9350612172602086016120a8565b925060408501359150606085013567ffffffffffffffff80821115612195578283fd5b818701915087601f8301126121a8578283fd5b8135818111156121ba576121ba61260f565b604051601f8201601f19908116603f011681019083821181831017156121e2576121e261260f565b816040528281528a60208487010111156121fa578586fd5b82602086016020830137918201602001949094529598949750929550505050565b6000806040838503121561222d578182fd5b612236836120a8565b91506020830135801515811461224a578182fd5b809150509250929050565b60008060408385031215612267578182fd5b612270836120a8565b946020939093013593505050565b60006020828403121561228f578081fd5b5035919050565b600080604083850312156122a8578182fd5b82359150612102602084016120a8565b600080604083850312156122ca578182fd5b50508035926020909101359150565b6000602082840312156122ea578081fd5b8135610c4c81612625565b600060208284031215612306578081fd5b8151610c4c81612625565b60008151808452612329816020860160208601612536565b601f01601f19169290920160200192915050565b6000835161234f818460208801612536565b835190830190612363818360208801612536565b01949350505050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516123a4816017850160208801612536565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516123d5816028840160208801612536565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061241490830184612311565b9695505050505050565b600060208252610c4c6020830184612311565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156124e7576124e76125e3565b500190565b6000826124fb576124fb6125f9565b500490565b600081600019048311821515161561251a5761251a6125e3565b500290565b600082821015612531576125316125e3565b500390565b60005b83811015612551578181015183820152602001612539565b83811115610d8f5750506000910152565b600081612571576125716125e3565b506000190190565b600181811c9082168061258d57607f821691505b602082108114156125ae57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156125c8576125c86125e3565b5060010190565b6000826125de576125de6125f9565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461093257600080fdfea26469706673582212207c3140b8543572afa84e5729a8fa58be87a95dc18779058077802a524585368b64736f6c63430008030033\";\nvar ERC721PresetMinterPauserAutoId__factory = /** @class */ (function (_super) {\n __extends(ERC721PresetMinterPauserAutoId__factory, _super);\n function ERC721PresetMinterPauserAutoId__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC721PresetMinterPauserAutoId__factory.prototype.deploy = function (name, symbol, baseTokenURI, overrides) {\n return _super.prototype.deploy.call(this, name, symbol, baseTokenURI, overrides || {});\n };\n ERC721PresetMinterPauserAutoId__factory.prototype.getDeployTransaction = function (name, symbol, baseTokenURI, overrides) {\n return _super.prototype.getDeployTransaction.call(this, name, symbol, baseTokenURI, overrides || {});\n };\n ERC721PresetMinterPauserAutoId__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC721PresetMinterPauserAutoId__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC721PresetMinterPauserAutoId__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC721PresetMinterPauserAutoId__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC721PresetMinterPauserAutoId__factory.bytecode = _bytecode;\n ERC721PresetMinterPauserAutoId__factory.abi = _abi;\n return ERC721PresetMinterPauserAutoId__factory;\n}(ContractFactory));\nexport { ERC721PresetMinterPauserAutoId__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar ERC721URIStorage__factory = /** @class */ (function () {\n function ERC721URIStorage__factory() {\n }\n ERC721URIStorage__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC721URIStorage__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC721URIStorage__factory.abi = _abi;\n return ERC721URIStorage__factory;\n}());\nexport { ERC721URIStorage__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"address[]\",\n name: \"defaultOperators_\",\n type: \"address[]\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"AuthorizedOperator\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Burned\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Minted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"RevokedOperator\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Sent\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"holder\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"authorizeOperator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"defaultOperators\",\n outputs: [\n {\n internalType: \"address[]\",\n name: \"\",\n type: \"address[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"granularity\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"isOperatorFor\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"operatorBurn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"operatorSend\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"revokeOperator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"send\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"holder\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b5060405162001d3b38038062001d3b8339810160408190526200003491620003b0565b82516200004990600290602086019062000221565b5081516200005f90600390602085019062000221565b50805162000075906004906020840190620002b0565b5060005b8151811015620000f157600160056000848481518110620000aa57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000e88162000535565b91505062000079565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200016c57600080fd5b505af115801562000181573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b158015620001ff57600080fd5b505af115801562000214573d6000803e3d6000fd5b5050505050505062000573565b8280546200022f90620004f8565b90600052602060002090601f0160209004810192826200025357600085556200029e565b82601f106200026e57805160ff19168380011785556200029e565b828001600101855582156200029e579182015b828111156200029e57825182559160200191906001019062000281565b50620002ac92915062000308565b5090565b8280548282559060005260206000209081019282156200029e579160200282015b828111156200029e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002d1565b5b80821115620002ac576000815560010162000309565b600082601f83011262000330578081fd5b81516001600160401b038111156200034c576200034c6200055d565b602062000362601f8301601f19168201620004c5565b828152858284870101111562000376578384fd5b835b838110156200039557858101830151828201840152820162000378565b83811115620003a657848385840101525b5095945050505050565b600080600060608486031215620003c5578283fd5b83516001600160401b0380821115620003dc578485fd5b620003ea878388016200031f565b945060209150818601518181111562000401578485fd5b6200040f888289016200031f565b94505060408601518181111562000424578384fd5b8601601f8101881362000435578384fd5b8051828111156200044a576200044a6200055d565b8060051b92506200045d848401620004c5565b8181528481019083860185850187018c101562000478578788fd5b8795505b83861015620004b457805194506001600160a01b03851685146200049e578788fd5b848352600195909501949186019186016200047c565b508096505050505050509250925092565b604051601f8201601f191681016001600160401b0381118282101715620004f057620004f06200055d565b604052919050565b600181811c908216806200050d57607f821691505b602082108114156200052f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156200055657634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b6117b880620005836000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063959b8c3f116100a2578063d95b637111610071578063d95b63711461022b578063dd62ed3e1461023e578063fad8b32a14610277578063fc673c4f1461028a578063fe9d93031461029d57610116565b8063959b8c3f146101ea57806395d89b41146101fd5780639bd9bbc614610205578063a9059cbb1461021857610116565b806323b872dd116100e957806323b872dd14610183578063313ce56714610196578063556f0dc7146101a557806362ad1b83146101ac57806370a08231146101c157610116565b806306e485381461011b57806306fdde0314610139578063095ea7b31461014e57806318160ddd14610171575b600080fd5b6101236102b0565b60405161013091906115af565b60405180910390f35b610141610312565b60405161013091906115fc565b61016161015c3660046113c6565b61039b565b6040519015158152602001610130565b6001545b604051908152602001610130565b6101616101913660046112f6565b6103b3565b60405160128152602001610130565b6001610175565b6101bf6101ba366004611336565b61057c565b005b6101756101cf366004611286565b6001600160a01b031660009081526020819052604090205490565b6101bf6101f8366004611286565b6105b8565b6101416106d6565b6101bf6102133660046113f1565b6106e5565b6101616102263660046113c6565b610708565b6101616102393660046112be565b6107bb565b61017561024c3660046112be565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6101bf610285366004611286565b61085d565b6101bf610298366004611448565b610979565b6101bf6102ab3660046114c5565b6109b1565b6060600480548060200260200160405190810160405280929190818152602001828054801561030857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116102ea575b5050505050905090565b60606002805461032190611703565b80601f016020809104026020016040519081016040528092919081815260200182805461034d90611703565b80156103085780601f1061036f57610100808354040283529160200191610308565b820191906000526020600020905b81548152906001019060200180831161037d57509395945050505050565b6000336103a98185856109d0565b5060019392505050565b60006001600160a01b0383166103e45760405162461bcd60e51b81526004016103db9061160f565b60405180910390fd5b6001600160a01b0384166104495760405162461bcd60e51b815260206004820152602660248201527f4552433737373a207472616e736665722066726f6d20746865207a65726f206160448201526564647265737360d01b60648201526084016103db565b600033905061047a818686866040518060200160405280600081525060405180602001604052806000815250610af7565b6104a6818686866040518060200160405280600081525060405180602001604052806000815250610c2e565b6001600160a01b038086166000908152600860209081526040808320938516835292905220548381101561052e5760405162461bcd60e51b815260206004820152602960248201527f4552433737373a207472616e7366657220616d6f756e74206578636565647320604482015268616c6c6f77616e636560b81b60648201526084016103db565b610542868361053d87856116ec565b6109d0565b6105708287878760405180602001604052806000815250604051806020016040528060008152506000610d94565b50600195945050505050565b61058633866107bb565b6105a25760405162461bcd60e51b81526004016103db90611653565b6105b185858585856001610f68565b5050505050565b336001600160a01b038216141561061d5760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff161561066e573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff1916905561069d565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461032190611703565b61070333848484604051806020016040528060008152506001610f68565b505050565b60006001600160a01b0383166107305760405162461bcd60e51b81526004016103db9061160f565b6000339050610761818286866040518060200160405280600081525060405180602001604052806000815250610af7565b61078d818286866040518060200160405280600081525060405180602001604052806000815250610c2e565b6103a98182868660405180602001604052806000815250604051806020016040528060008152506000610d94565b6000816001600160a01b0316836001600160a01b0316148061082657506001600160a01b03831660009081526005602052604090205460ff16801561082657506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b8061085657506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6001600160a01b0381163314156108c05760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff1615610914573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610940565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b61098333856107bb565b61099f5760405162461bcd60e51b81526004016103db90611653565b6109ab8484848461104b565b50505050565b6109cc3383836040518060200160405280600081525061104b565b5050565b6001600160a01b038316610a345760405162461bcd60e51b815260206004820152602560248201527f4552433737373a20617070726f76652066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103db565b6001600160a01b038216610a965760405162461bcd60e51b815260206004820152602360248201527f4552433737373a20617070726f766520746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103db565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610b7357600080fd5b505afa158015610b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bab91906112a2565b90506001600160a01b03811615610c2557604051633ad5cbc160e11b81526001600160a01b038216906375ab978290610bf2908a908a908a908a908a908a90600401611555565b600060405180830381600087803b158015610c0c57600080fd5b505af1158015610c20573d6000803e3d6000fd5b505050505b50505050505050565b6001600160a01b03851660009081526020819052604090205483811015610ca75760405162461bcd60e51b815260206004820152602760248201527f4552433737373a207472616e7366657220616d6f756e7420657863656564732060448201526662616c616e636560c81b60648201526084016103db565b6001600160a01b03808716600090815260208190526040808220878503905591871681529081208054869290610cde9084906116d4565b92505081905550846001600160a01b0316866001600160a01b0316886001600160a01b03167f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc82614677987878787604051610d369392919061169f565b60405180910390a4846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610d8391815260200190565b60405180910390a350505050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610e1057600080fd5b505afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4891906112a2565b90506001600160a01b03811615610ec4576040516223de2960e01b81526001600160a01b038216906223de2990610e8d908b908b908b908b908b908b90600401611555565b600060405180830381600087803b158015610ea757600080fd5b505af1158015610ebb573d6000803e3d6000fd5b50505050610f5e565b8115610f5e576001600160a01b0386163b15610f5e5760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a4016103db565b5050505050505050565b6001600160a01b038616610fc95760405162461bcd60e51b815260206004820152602260248201527f4552433737373a2073656e642066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b6001600160a01b03851661101f5760405162461bcd60e51b815260206004820181905260248201527f4552433737373a2073656e6420746f20746865207a65726f206164647265737360448201526064016103db565b3361102e818888888888610af7565b61103c818888888888610c2e565b610c2581888888888888610d94565b6001600160a01b0384166110ac5760405162461bcd60e51b815260206004820152602260248201527f4552433737373a206275726e2066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b336110bc81866000878787610af7565b6001600160a01b038516600090815260208190526040902054848110156111315760405162461bcd60e51b815260206004820152602360248201527f4552433737373a206275726e20616d6f756e7420657863656564732062616c616044820152626e636560e81b60648201526084016103db565b6001600160a01b03861660009081526020819052604081208683039055600180548792906111609084906116ec565b92505081905550856001600160a01b0316826001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988787876040516111ae9392919061169f565b60405180910390a36040518581526000906001600160a01b038816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050565b600082601f83011261120f578081fd5b813567ffffffffffffffff8082111561122a5761122a611754565b604051601f8301601f19908116603f0116810190828211818310171561125257611252611754565b8160405283815286602085880101111561126a578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215611297578081fd5b81356108568161176a565b6000602082840312156112b3578081fd5b81516108568161176a565b600080604083850312156112d0578081fd5b82356112db8161176a565b915060208301356112eb8161176a565b809150509250929050565b60008060006060848603121561130a578081fd5b83356113158161176a565b925060208401356113258161176a565b929592945050506040919091013590565b600080600080600060a0868803121561134d578081fd5b85356113588161176a565b945060208601356113688161176a565b935060408601359250606086013567ffffffffffffffff8082111561138b578283fd5b61139789838a016111ff565b935060808801359150808211156113ac578283fd5b506113b9888289016111ff565b9150509295509295909350565b600080604083850312156113d8578182fd5b82356113e38161176a565b946020939093013593505050565b600080600060608486031215611405578283fd5b83356114108161176a565b925060208401359150604084013567ffffffffffffffff811115611432578182fd5b61143e868287016111ff565b9150509250925092565b6000806000806080858703121561145d578384fd5b84356114688161176a565b935060208501359250604085013567ffffffffffffffff8082111561148b578384fd5b611497888389016111ff565b935060608701359150808211156114ac578283fd5b506114b9878288016111ff565b91505092959194509250565b600080604083850312156114d7578182fd5b82359150602083013567ffffffffffffffff8111156114f4578182fd5b611500858286016111ff565b9150509250929050565b60008151808452815b8181101561152f57602081850181015186830182015201611513565b818111156115405782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c0608082018190526000906115909083018561150a565b82810360a08401526115a2818561150a565b9998505050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156115f05783516001600160a01b0316835292840192918401916001016115cb565b50909695505050505050565b600060208252610856602083018461150a565b60208082526024908201527f4552433737373a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f60408201526b39103337b9103437b63232b960a11b606082015260800190565b6000848252606060208301526116b8606083018561150a565b82810360408401526116ca818561150a565b9695505050505050565b600082198211156116e7576116e761173e565b500190565b6000828210156116fe576116fe61173e565b500390565b600181811c9082168061171757607f821691505b6020821081141561173857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461177f57600080fd5b5056fea26469706673582212208c42e235847878fc7d8ada1e55ed07d1efdb2128f8d741cd4debfe867146b70b64736f6c63430008030033\";\nvar ERC777__factory = /** @class */ (function (_super) {\n __extends(ERC777__factory, _super);\n function ERC777__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC777__factory.prototype.deploy = function (name_, symbol_, defaultOperators_, overrides) {\n return _super.prototype.deploy.call(this, name_, symbol_, defaultOperators_, overrides || {});\n };\n ERC777__factory.prototype.getDeployTransaction = function (name_, symbol_, defaultOperators_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, name_, symbol_, defaultOperators_, overrides || {});\n };\n ERC777__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC777__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC777__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC777__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC777__factory.bytecode = _bytecode;\n ERC777__factory.abi = _abi;\n return ERC777__factory;\n}(ContractFactory));\nexport { ERC777__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol\",\n type: \"string\",\n },\n {\n internalType: \"address[]\",\n name: \"defaultOperators\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256\",\n name: \"initialSupply\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"AuthorizedOperator\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Burned\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Minted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"RevokedOperator\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Sent\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"holder\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"authorizeOperator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"defaultOperators\",\n outputs: [\n {\n internalType: \"address[]\",\n name: \"\",\n type: \"address[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"granularity\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"isOperatorFor\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"operatorBurn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"operatorSend\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"revokeOperator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"send\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"holder\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b506040516200222f3803806200222f833981016040819052620000349162000775565b84848482600290805190602001906200004f929190620005c9565b50815162000065906003906020850190620005c9565b5080516200007b90600490602084019062000658565b5060005b8151811015620000f757600160056000848481518110620000b057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000ee8162000a17565b9150506200007f565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200017257600080fd5b505af115801562000187573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b1580156200020557600080fd5b505af11580156200021a573d6000803e3d6000fd5b5050505050505062000253818360405180602001604052806000815250604051806020016040528060008152506200025e60201b60201c565b505050505062000a61565b6200026e84848484600162000274565b50505050565b6001600160a01b038516620002d05760405162461bcd60e51b815260206004820181905260248201527f4552433737373a206d696e7420746f20746865207a65726f206164647265737360448201526064015b60405180910390fd5b60003390508460016000828254620002e9919062000990565b90915550506001600160a01b038616600090815260208190526040812080548792906200031890849062000990565b909155506200033090508160008888888888620003ca565b856001600160a01b0316816001600160a01b03167f2fe5be0146f74c5bce36c0b80911af6c7d86ff27e89d5cfa61fc681327954e5d878787604051620003799392919062000924565b60405180910390a36040518581526001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b1580156200044757600080fd5b505afa1580156200045c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000482919062000751565b90506001600160a01b0381161562000504576040516223de2960e01b81526001600160a01b038216906223de2990620004ca908b908b908b908b908b908b90600401620008c6565b600060405180830381600087803b158015620004e557600080fd5b505af1158015620004fa573d6000803e3d6000fd5b50505050620005b5565b8115620005b5576200052a866001600160a01b0316620005bf60201b620009d01760201c565b15620005b55760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a401620002c7565b5050505050505050565b803b15155b919050565b828054620005d790620009da565b90600052602060002090601f016020900481019282620005fb576000855562000646565b82601f106200061657805160ff191683800117855562000646565b8280016001018555821562000646579182015b828111156200064657825182559160200191906001019062000629565b5062000654929150620006b0565b5090565b82805482825590600052602060002090810192821562000646579160200282015b828111156200064657825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000679565b5b80821115620006545760008155600101620006b1565b80516001600160a01b0381168114620005c457600080fd5b600082601f830112620006f0578081fd5b81516001600160401b038111156200070c576200070c62000a4b565b62000721601f8201601f19166020016200095d565b81815284602083860101111562000736578283fd5b62000749826020830160208701620009ab565b949350505050565b60006020828403121562000763578081fd5b6200076e82620006c7565b9392505050565b600080600080600060a086880312156200078d578081fd5b85516001600160401b0380821115620007a4578283fd5b620007b289838a01620006df565b9650602091508188015181811115620007c9578384fd5b620007d78a828b01620006df565b965050604088015181811115620007ec578384fd5b8801601f81018a13620007fd578384fd5b80518281111562000812576200081262000a4b565b8060051b9250620008258484016200095d565b8181528481019083860185850187018e101562000840578788fd5b8795505b838610156200086d576200085881620006c7565b83526001959095019491860191860162000844565b50809850505050505050606086015191506200088c60808701620006c7565b90509295509295909350565b60008151808452620008b2816020860160208601620009ab565b601f01601f19169290920160200192915050565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c060808201819052600090620009039083018562000898565b82810360a084015262000917818562000898565b9998505050505050505050565b6000848252606060208301526200093f606083018562000898565b828103604084015262000953818562000898565b9695505050505050565b604051601f8201601f191681016001600160401b038111828210171562000988576200098862000a4b565b604052919050565b60008219821115620009a657620009a662000a35565b500190565b60005b83811015620009c8578181015183820152602001620009ae565b838111156200026e5750506000910152565b600181811c90821680620009ef57607f821691505b6020821081141562000a1157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141562000a2e5762000a2e62000a35565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6117be8062000a716000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063959b8c3f116100a2578063d95b637111610071578063d95b63711461022b578063dd62ed3e1461023e578063fad8b32a14610277578063fc673c4f1461028a578063fe9d93031461029d57610116565b8063959b8c3f146101ea57806395d89b41146101fd5780639bd9bbc614610205578063a9059cbb1461021857610116565b806323b872dd116100e957806323b872dd14610183578063313ce56714610196578063556f0dc7146101a557806362ad1b83146101ac57806370a08231146101c157610116565b806306e485381461011b57806306fdde0314610139578063095ea7b31461014e57806318160ddd14610171575b600080fd5b6101236102b0565b60405161013091906115b5565b60405180910390f35b610141610312565b6040516101309190611602565b61016161015c3660046113cc565b61039b565b6040519015158152602001610130565b6001545b604051908152602001610130565b6101616101913660046112fc565b6103b3565b60405160128152602001610130565b6001610175565b6101bf6101ba36600461133c565b61057c565b005b6101756101cf36600461128c565b6001600160a01b031660009081526020819052604090205490565b6101bf6101f836600461128c565b6105b8565b6101416106d6565b6101bf6102133660046113f7565b6106e5565b6101616102263660046113cc565b610708565b6101616102393660046112c4565b6107bb565b61017561024c3660046112c4565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6101bf61028536600461128c565b61085d565b6101bf61029836600461144e565b610979565b6101bf6102ab3660046114cb565b6109b1565b6060600480548060200260200160405190810160405280929190818152602001828054801561030857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116102ea575b5050505050905090565b60606002805461032190611709565b80601f016020809104026020016040519081016040528092919081815260200182805461034d90611709565b80156103085780601f1061036f57610100808354040283529160200191610308565b820191906000526020600020905b81548152906001019060200180831161037d57509395945050505050565b6000336103a98185856109d6565b5060019392505050565b60006001600160a01b0383166103e45760405162461bcd60e51b81526004016103db90611615565b60405180910390fd5b6001600160a01b0384166104495760405162461bcd60e51b815260206004820152602660248201527f4552433737373a207472616e736665722066726f6d20746865207a65726f206160448201526564647265737360d01b60648201526084016103db565b600033905061047a818686866040518060200160405280600081525060405180602001604052806000815250610afd565b6104a6818686866040518060200160405280600081525060405180602001604052806000815250610c34565b6001600160a01b038086166000908152600860209081526040808320938516835292905220548381101561052e5760405162461bcd60e51b815260206004820152602960248201527f4552433737373a207472616e7366657220616d6f756e74206578636565647320604482015268616c6c6f77616e636560b81b60648201526084016103db565b610542868361053d87856116f2565b6109d6565b6105708287878760405180602001604052806000815250604051806020016040528060008152506000610d9a565b50600195945050505050565b61058633866107bb565b6105a25760405162461bcd60e51b81526004016103db90611659565b6105b185858585856001610f6e565b5050505050565b336001600160a01b038216141561061d5760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff161561066e573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff1916905561069d565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461032190611709565b61070333848484604051806020016040528060008152506001610f6e565b505050565b60006001600160a01b0383166107305760405162461bcd60e51b81526004016103db90611615565b6000339050610761818286866040518060200160405280600081525060405180602001604052806000815250610afd565b61078d818286866040518060200160405280600081525060405180602001604052806000815250610c34565b6103a98182868660405180602001604052806000815250604051806020016040528060008152506000610d9a565b6000816001600160a01b0316836001600160a01b0316148061082657506001600160a01b03831660009081526005602052604090205460ff16801561082657506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b8061085657506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6001600160a01b0381163314156108c05760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b60648201526084016103db565b6001600160a01b03811660009081526005602052604090205460ff1615610914573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610940565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b61098333856107bb565b61099f5760405162461bcd60e51b81526004016103db90611659565b6109ab84848484611051565b50505050565b6109cc33838360405180602001604052806000815250611051565b5050565b3b151590565b6001600160a01b038316610a3a5760405162461bcd60e51b815260206004820152602560248201527f4552433737373a20617070726f76652066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103db565b6001600160a01b038216610a9c5760405162461bcd60e51b815260206004820152602360248201527f4552433737373a20617070726f766520746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103db565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610b7957600080fd5b505afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb191906112a8565b90506001600160a01b03811615610c2b57604051633ad5cbc160e11b81526001600160a01b038216906375ab978290610bf8908a908a908a908a908a908a9060040161155b565b600060405180830381600087803b158015610c1257600080fd5b505af1158015610c26573d6000803e3d6000fd5b505050505b50505050505050565b6001600160a01b03851660009081526020819052604090205483811015610cad5760405162461bcd60e51b815260206004820152602760248201527f4552433737373a207472616e7366657220616d6f756e7420657863656564732060448201526662616c616e636560c81b60648201526084016103db565b6001600160a01b03808716600090815260208190526040808220878503905591871681529081208054869290610ce49084906116da565b92505081905550846001600160a01b0316866001600160a01b0316886001600160a01b03167f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc82614677987878787604051610d3c939291906116a5565b60405180910390a4846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610d8991815260200190565b60405180910390a350505050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610e1657600080fd5b505afa158015610e2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4e91906112a8565b90506001600160a01b03811615610eca576040516223de2960e01b81526001600160a01b038216906223de2990610e93908b908b908b908b908b908b9060040161155b565b600060405180830381600087803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b50505050610f64565b8115610f64576001600160a01b0386163b15610f645760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a4016103db565b5050505050505050565b6001600160a01b038616610fcf5760405162461bcd60e51b815260206004820152602260248201527f4552433737373a2073656e642066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b6001600160a01b0385166110255760405162461bcd60e51b815260206004820181905260248201527f4552433737373a2073656e6420746f20746865207a65726f206164647265737360448201526064016103db565b33611034818888888888610afd565b611042818888888888610c34565b610c2b81888888888888610d9a565b6001600160a01b0384166110b25760405162461bcd60e51b815260206004820152602260248201527f4552433737373a206275726e2066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b336110c281866000878787610afd565b6001600160a01b038516600090815260208190526040902054848110156111375760405162461bcd60e51b815260206004820152602360248201527f4552433737373a206275726e20616d6f756e7420657863656564732062616c616044820152626e636560e81b60648201526084016103db565b6001600160a01b03861660009081526020819052604081208683039055600180548792906111669084906116f2565b92505081905550856001600160a01b0316826001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988787876040516111b4939291906116a5565b60405180910390a36040518581526000906001600160a01b038816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050565b600082601f830112611215578081fd5b813567ffffffffffffffff808211156112305761123061175a565b604051601f8301601f19908116603f011681019082821181831017156112585761125861175a565b81604052838152866020858801011115611270578485fd5b8360208701602083013792830160200193909352509392505050565b60006020828403121561129d578081fd5b813561085681611770565b6000602082840312156112b9578081fd5b815161085681611770565b600080604083850312156112d6578081fd5b82356112e181611770565b915060208301356112f181611770565b809150509250929050565b600080600060608486031215611310578081fd5b833561131b81611770565b9250602084013561132b81611770565b929592945050506040919091013590565b600080600080600060a08688031215611353578081fd5b853561135e81611770565b9450602086013561136e81611770565b935060408601359250606086013567ffffffffffffffff80821115611391578283fd5b61139d89838a01611205565b935060808801359150808211156113b2578283fd5b506113bf88828901611205565b9150509295509295909350565b600080604083850312156113de578182fd5b82356113e981611770565b946020939093013593505050565b60008060006060848603121561140b578283fd5b833561141681611770565b925060208401359150604084013567ffffffffffffffff811115611438578182fd5b61144486828701611205565b9150509250925092565b60008060008060808587031215611463578384fd5b843561146e81611770565b935060208501359250604085013567ffffffffffffffff80821115611491578384fd5b61149d88838901611205565b935060608701359150808211156114b2578283fd5b506114bf87828801611205565b91505092959194509250565b600080604083850312156114dd578182fd5b82359150602083013567ffffffffffffffff8111156114fa578182fd5b61150685828601611205565b9150509250929050565b60008151808452815b8181101561153557602081850181015186830182015201611519565b818111156115465782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c06080820181905260009061159690830185611510565b82810360a08401526115a88185611510565b9998505050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156115f65783516001600160a01b0316835292840192918401916001016115d1565b50909695505050505050565b6000602082526108566020830184611510565b60208082526024908201527f4552433737373a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f60408201526b39103337b9103437b63232b960a11b606082015260800190565b6000848252606060208301526116be6060830185611510565b82810360408401526116d08185611510565b9695505050505050565b600082198211156116ed576116ed611744565b500190565b60008282101561170457611704611744565b500390565b600181811c9082168061171d57607f821691505b6020821081141561173e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461178557600080fd5b5056fea2646970667358221220a087bebce295c54528d46a529b236de0c8206d5e357ef6a1a716cef58739474f64736f6c63430008030033\";\nvar ERC777PresetFixedSupply__factory = /** @class */ (function (_super) {\n __extends(ERC777PresetFixedSupply__factory, _super);\n function ERC777PresetFixedSupply__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ERC777PresetFixedSupply__factory.prototype.deploy = function (name, symbol, defaultOperators, initialSupply, owner, overrides) {\n return _super.prototype.deploy.call(this, name, symbol, defaultOperators, initialSupply, owner, overrides || {});\n };\n ERC777PresetFixedSupply__factory.prototype.getDeployTransaction = function (name, symbol, defaultOperators, initialSupply, owner, overrides) {\n return _super.prototype.getDeployTransaction.call(this, name, symbol, defaultOperators, initialSupply, owner, overrides || {});\n };\n ERC777PresetFixedSupply__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ERC777PresetFixedSupply__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ERC777PresetFixedSupply__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ERC777PresetFixedSupply__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ERC777PresetFixedSupply__factory.bytecode = _bytecode;\n ERC777PresetFixedSupply__factory.abi = _abi;\n return ERC777PresetFixedSupply__factory;\n}(ContractFactory));\nexport { ERC777PresetFixedSupply__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weiAmount\",\n type: \"uint256\",\n },\n ],\n name: \"Deposited\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weiAmount\",\n type: \"uint256\",\n },\n ],\n name: \"Withdrawn\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"deposit\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"depositsOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"withdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105718061007e6000396000f3fe6080604052600436106100555760003560e01c806351cff8d91461005a578063715018a61461007c5780638da5cb5b14610091578063e3a9db1a146100be578063f2fde38b14610102578063f340fa0114610122575b600080fd5b34801561006657600080fd5b5061007a6100753660046104aa565b610135565b005b34801561008857600080fd5b5061007a6101d7565b34801561009d57600080fd5b506000546040516001600160a01b0390911681526020015b60405180910390f35b3480156100ca57600080fd5b506100f46100d93660046104aa565b6001600160a01b031660009081526001602052604090205490565b6040519081526020016100b5565b34801561010e57600080fd5b5061007a61011d3660046104aa565b61020d565b61007a6101303660046104aa565b6102a8565b6000546001600160a01b031633146101685760405162461bcd60e51b815260040161015f906104cd565b60405180910390fd5b6001600160a01b0381166000818152600160205260408120805491905590610190908261033c565b816001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516101cb91815260200190565b60405180910390a25050565b6000546001600160a01b031633146102015760405162461bcd60e51b815260040161015f906104cd565b61020b600061045a565b565b6000546001600160a01b031633146102375760405162461bcd60e51b815260040161015f906104cd565b6001600160a01b03811661029c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161015f565b6102a58161045a565b50565b6000546001600160a01b031633146102d25760405162461bcd60e51b815260040161015f906104cd565b6001600160a01b0381166000908152600160205260408120805434928392916102fc908490610502565b90915550506040518181526001600160a01b038316907f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4906020016101cb565b8047101561038c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161015f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146103d9576040519150601f19603f3d011682016040523d82523d6000602084013e6103de565b606091505b50509050806104555760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161015f565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104bb578081fd5b81356104c681610526565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561052157634e487b7160e01b81526011600452602481fd5b500190565b6001600160a01b03811681146102a557600080fdfea2646970667358221220fb80e6f61ed9d07b2715127957616df7a00a176f20e17aebd317ca95eeeb3bd364736f6c63430008030033\";\nvar Escrow__factory = /** @class */ (function (_super) {\n __extends(Escrow__factory, _super);\n function Escrow__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Escrow__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Escrow__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Escrow__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Escrow__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Escrow__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Escrow__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Escrow__factory.bytecode = _bytecode;\n Escrow__factory.abi = _abi;\n return Escrow__factory;\n}(ContractFactory));\nexport { Escrow__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint32\",\n name: \"oldGuardianIndex\",\n type: \"uint32\",\n },\n {\n indexed: false,\n internalType: \"uint32\",\n name: \"newGuardianIndex\",\n type: \"uint32\",\n },\n ],\n name: \"LogGuardianSetChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"emitter_address\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n ],\n name: \"LogMessagePublished\",\n type: \"event\",\n },\n];\nvar _bytecode = \"0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220b763ee65fd55402218232b20022bb7d672e3d87067b237b910132e2b7bdcdbaf64736f6c63430008040033\";\nvar Events__factory = /** @class */ (function (_super) {\n __extends(Events__factory, _super);\n function Events__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Events__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Events__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Events__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Events__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Events__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Events__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Events__factory.bytecode = _bytecode;\n Events__factory.abi = _abi;\n return Events__factory;\n}(ContractFactory));\nexport { Events__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals_\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence_\",\n type: \"uint64\",\n },\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"nativeContract_\",\n type: \"bytes32\",\n },\n ],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"nativeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue_\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue_\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence_\",\n type: \"uint64\",\n },\n ],\n name: \"updateDetails\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5061124a806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063a18cd7c611610071578063a18cd7c614610246578063a457c2d714610259578063a9059cbb1461026c578063c71f46151461027f578063dd62ed3e1461029257600080fd5b80638da5cb5b146101ef57806395d89b411461020a5780639a8a0592146102125780639dc29fac1461023357600080fd5b8063313ce567116100e9578063313ce5671461018157806339509351146101965780633d6c043b146101a957806340c10f19146101b157806370a08231146101c657600080fd5b806306fdde031461011b578063095ea7b31461013957806318160ddd1461015c57806323b872dd1461016e575b600080fd5b6101236102cb565b60405161013091906110b5565b60405180910390f35b61014c610147366004610ea7565b6102f4565b6040519015158152602001610130565b6003545b604051908152602001610130565b61014c61017c366004610e6c565b61030a565b60045460405160ff9091168152602001610130565b61014c6101a4366004610ea7565b6103c0565b600854610160565b6101c46101bf366004610ea7565b6103f7565b005b6101606101d4366004610e19565b6001600160a01b031660009081526005602052604090205490565b6007546040516001600160a01b039091168152602001610130565b61012361042f565b600754600160a81b900461ffff1660405161ffff9091168152602001610130565b6101c4610241366004610ea7565b6104c4565b6101c4610254366004610ed0565b6104f8565b61014c610267366004610ea7565b6105ce565b61014c61027a366004610ea7565b610669565b6101c461028d366004610f41565b610676565b6101606102a0366004610e3a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6040516060906102e090600090602001610fff565b604051602081830303815290604052905090565b6000610301338484610775565b50600192915050565b600061031784848461089a565b6001600160a01b0384166000908152600660209081526040808320338452909152902054828110156103a15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103b585336103b08685611196565b610775565b506001949350505050565b3360008181526006602090815260408083206001600160a01b038716845290915281205490916103019185906103b090869061113f565b6007546001600160a01b031633146104215760405162461bcd60e51b815260040161039890611108565b61042b8282610a94565b5050565b606060006001018054610441906111ad565b80601f016020809104026020016040519081016040528092919081815260200182805461046d906111ad565b80156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b5050505050905090565b6007546001600160a01b031633146104ee5760405162461bcd60e51b815260040161039890611108565b61042b8282610b76565b6007546001600160a01b031633146105225760405162461bcd60e51b815260040161039890611108565b60025467ffffffffffffffff8083169116106105805760405162461bcd60e51b815260206004820152601e60248201527f63757272656e74206d6574616461746120697320757020746f206461746500006044820152606401610398565b8251610593906000906020860190610cc5565b5081516105a7906001906020850190610cc5565b506002805467ffffffffffffffff191667ffffffffffffffff929092169190911790555050565b3360009081526006602090815260408083206001600160a01b0386168452909152812054828110156106505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610398565b61065f33856103b08685611196565b5060019392505050565b600061030133848461089a565b600754600160a01b900460ff16156106c65760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610398565b6007805460ff60a01b1916600160a01b17905586516106ec9060009060208a0190610cc5565b508551610700906001906020890190610cc5565b506004805460ff90961660ff19909616959095179094556002805467ffffffffffffffff90941667ffffffffffffffff19909416939093179092556007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b03909216919091179190911790556008555050565b6001600160a01b0383166107d75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610398565b6001600160a01b0382166108385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610398565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166108fe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610398565b6001600160a01b0382166109605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610398565b6001600160a01b038316600090815260056020526040902054818110156109d85760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610398565b6109e28282611196565b6001600160a01b038516600090815260056020526040902055600a610a08836009611177565b610a129190611157565b6001600160a01b03841660009081526005602052604081208054909190610a3a90849061113f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a8691815260200190565b60405180910390a350505050565b6001600160a01b038216610aea5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610398565b8060006003016000828254610aff919061113f565b90915550506001600160a01b03821660009081526005602052604081208054839290610b2c90849061113f565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610bd65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610398565b6001600160a01b03821660009081526005602052604090205481811015610c4a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610398565b610c548282611196565b6001600160a01b03841660009081526005602052604081209190915560038054849290610c82908490611196565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161088d565b828054610cd1906111ad565b90600052602060002090601f016020900481019282610cf35760008555610d39565b82601f10610d0c57805160ff1916838001178555610d39565b82800160010185558215610d39579182015b82811115610d39578251825591602001919060010190610d1e565b50610d45929150610d49565b5090565b5b80821115610d455760008155600101610d4a565b80356001600160a01b0381168114610d7557600080fd5b919050565b600082601f830112610d8a578081fd5b813567ffffffffffffffff80821115610da557610da56111fe565b604051601f8301601f19908116603f01168101908282118183101715610dcd57610dcd6111fe565b81604052838152866020858801011115610de5578485fd5b8360208701602083013792830160200193909352509392505050565b803567ffffffffffffffff81168114610d7557600080fd5b600060208284031215610e2a578081fd5b610e3382610d5e565b9392505050565b60008060408385031215610e4c578081fd5b610e5583610d5e565b9150610e6360208401610d5e565b90509250929050565b600080600060608486031215610e80578081fd5b610e8984610d5e565b9250610e9760208501610d5e565b9150604084013590509250925092565b60008060408385031215610eb9578182fd5b610ec283610d5e565b946020939093013593505050565b600080600060608486031215610ee4578283fd5b833567ffffffffffffffff80821115610efb578485fd5b610f0787838801610d7a565b94506020860135915080821115610f1c578384fd5b50610f2986828701610d7a565b925050610f3860408501610e01565b90509250925092565b600080600080600080600060e0888a031215610f5b578283fd5b873567ffffffffffffffff80821115610f72578485fd5b610f7e8b838c01610d7a565b985060208a0135915080821115610f93578485fd5b50610fa08a828b01610d7a565b965050604088013560ff81168114610fb6578384fd5b9450610fc460608901610e01565b9350610fd260808901610d5e565b925060a088013561ffff81168114610fe8578283fd5b8092505060c0880135905092959891949750929550565b600080835482600182811c91508083168061101b57607f831692505b602080841082141561103b57634e487b7160e01b87526022600452602487fd5b81801561104f57600181146110605761108c565b60ff1986168952848901965061108c565b60008a815260209020885b868110156110845781548b82015290850190830161106b565b505084890196505b5050505050506110ad816a2028576f726d686f6c652960a81b8152600b0190565b949350505050565b6000602080835283518082850152825b818110156110e1578581018301518582016040015282016110c5565b818111156110f25783604083870101525b50601f01601f1916929092016040019392505050565b60208082526017908201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604082015260600190565b60008219821115611152576111526111e8565b500190565b60008261117257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611191576111916111e8565b500290565b6000828210156111a8576111a86111e8565b500390565b600181811c908216806111c157607f821691505b602082108114156111e257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dd0475fec2dafd6e5c5998462772888228fbdd44f7ab4c369f5ffd5b3a43802664736f6c63430008040033\";\nvar FeeToken__factory = /** @class */ (function (_super) {\n __extends(FeeToken__factory, _super);\n function FeeToken__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n FeeToken__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n FeeToken__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n FeeToken__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n FeeToken__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n FeeToken__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n FeeToken__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n FeeToken__factory.bytecode = _bytecode;\n FeeToken__factory.abi = _abi;\n return FeeToken__factory;\n}(ContractFactory));\nexport { FeeToken__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"getGuardianSet\",\n outputs: [\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getCurrentGuardianSetIndex\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getGuardianSetExpiry\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"messageFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"emitter\",\n type: \"address\",\n },\n ],\n name: \"nextSequence\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610399806100206000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b172b22211610066578063b172b22214610173578063d60b347f1461017b578063eb8d3f12146101a7578063f951975a146101bd578063fbe3c2cd146101dd57600080fd5b80631a90a219146100a35780631cfe7951146100ba5780632c3c02a4146100d95780634cf842b51461010c5780639a8a059214610158575b600080fd5b6007545b6040519081526020015b60405180910390f35b60035463ffffffff165b60405163ffffffff90911681526020016100b1565b6100fc6100e73660046102bc565b60009081526005602052604090205460ff1690565b60405190151581526020016100b1565b61013f61011a36600461028e565b6001600160a01b031660009081526004602052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff90911681526020016100b1565b60005461ffff165b60405161ffff90911681526020016100b1565b6001546100a7565b6100fc61018936600461028e565b6001600160a01b031660009081526006602052604090205460ff1690565b600354640100000000900463ffffffff166100c4565b6101d06101cb3660046102d4565b6101ef565b6040516100b191906102f8565b60005462010000900461ffff16610160565b60408051808201825260608082526000602080840182905263ffffffff8616825260028152908490208451815492830281018401865294850182815293949390928492849184018282801561026d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161024f575b50505091835250506001919091015463ffffffff1660209091015292915050565b60006020828403121561029f578081fd5b81356001600160a01b03811681146102b5578182fd5b9392505050565b6000602082840312156102cd578081fd5b5035919050565b6000602082840312156102e5578081fd5b813563ffffffff811681146102b5578182fd5b6020808252825160408383015280516060840181905260009291820190839060808601905b808310156103465783516001600160a01b0316825292840192600192909201919084019061031d565b5063ffffffff84880151166040870152809450505050509291505056fea2646970667358221220b37d7bc0de99a24c48e14d96b1f7a4843a7b9ebcd48bb4ab7001a65489744aa664736f6c63430008040033\";\nvar Getters__factory = /** @class */ (function (_super) {\n __extends(Getters__factory, _super);\n function Getters__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Getters__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Getters__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Getters__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Getters__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Getters__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Getters__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Getters__factory.bytecode = _bytecode;\n Getters__factory.abi = _abi;\n return Getters__factory;\n}(ContractFactory));\nexport { Getters__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"GuardianSetAdded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getCurrentGuardianSetIndex\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"getGuardianSet\",\n outputs: [\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getGuardianSetExpiry\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"messageFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"emitter\",\n type: \"address\",\n },\n ],\n name: \"nextSequence\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseAndVerifyVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct GovernanceStructs.ContractUpgrade\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseGuardianSetUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"newGuardianSet\",\n type: \"tuple\",\n },\n {\n internalType: \"uint32\",\n name: \"newGuardianSetIndex\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct GovernanceStructs.GuardianSetUpgrade\",\n name: \"gsu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedSetMessageFee\",\n type: \"bytes\",\n },\n ],\n name: \"parseSetMessageFee\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"messageFee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct GovernanceStructs.SetMessageFee\",\n name: \"smf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedTransferFees\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransferFees\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct GovernanceStructs.TransferFees\",\n name: \"tf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"guardianSet\",\n type: \"tuple\",\n },\n ],\n name: \"verifySignatures\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitContractUpgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitSetMessageFee\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitNewGuardianSet\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitTransferFees\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar Governance__factory = /** @class */ (function () {\n function Governance__factory() {\n }\n Governance__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Governance__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Governance__factory.abi = _abi;\n return Governance__factory;\n}());\nexport { Governance__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct GovernanceStructs.ContractUpgrade\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseGuardianSetUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"newGuardianSet\",\n type: \"tuple\",\n },\n {\n internalType: \"uint32\",\n name: \"newGuardianSetIndex\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct GovernanceStructs.GuardianSetUpgrade\",\n name: \"gsu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedSetMessageFee\",\n type: \"bytes\",\n },\n ],\n name: \"parseSetMessageFee\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"messageFee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct GovernanceStructs.SetMessageFee\",\n name: \"smf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedTransferFees\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransferFees\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct GovernanceStructs.TransferFees\",\n name: \"tf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610bed806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630319e59c1461005157806304ca84cf146100b65780634fdc60fa146100d6578063515f32471461012c575b600080fd5b61006461005f3660046109fb565b610179565b6040516100ad9190600060a0820190508251825260ff602084015116602083015261ffff6040840151166040830152606083015160608301526080830151608083015292915050565b60405180910390f35b6100c96100c43660046109fb565b6102d4565b6040516100ad9190610aa5565b6100e96100e43660046109fb565b610508565b6040516100ad91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b61013f61013a3660046109fb565b610644565b6040516100ad91908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906101ae8382610773565b82526101bb602082610b58565b90506101c783826107d1565b60ff1660208301526101da600182610b58565b9050816020015160ff1660041461022f5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064015b60405180910390fd5b610239838261082d565b61ffff16604083015261024d600282610b58565b9050610259838261088a565b6060830152610269602082610b58565b90506102758382610773565b6080830152610285602082610b58565b9050808351146102ce5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b6044820152606401610226565b50919050565b6102dc6109a1565b60006102e88382610773565b82526102f5602082610b58565b905061030183826107d1565b60ff166020830152610314600182610b58565b9050816020015160ff1660021461036d5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e536574557067726164650000000000006044820152606401610226565b610377838261082d565b61ffff16604083015261038b600282610b58565b905061039783826108df565b63ffffffff1660808301526103ad600482610b58565b905060006103bb84836107d1565b90506103c8600183610b58565b915060405180604001604052808260ff1667ffffffffffffffff8111156103ff57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610428578160200160208202803683370190505b5081526000602090910181905260608501919091525b8160ff168110156104b057610453858461093c565b60608501515180518390811061047957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015261049c601484610b58565b9250806104a881610b70565b91505061043e565b50818451146105015760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e536574557067726164650000000000006044820152606401610226565b5050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906105368382610773565b8252610543602082610b58565b905061054f83826107d1565b60ff166020830152610562600182610b58565b9050816020015160ff166001146105b55760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b6044820152606401610226565b6105bf838261082d565b61ffff1660408301526105d3600282610b58565b90506105df8382610773565b6001600160a01b031660608301526105f8602082610b58565b9050808351146102ce5760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b6044820152606401610226565b6040805160808101825260008082526020820181905291810182905260608101829052906106728382610773565b825261067f602082610b58565b905061068b83826107d1565b60ff16602083015261069e600182610b58565b9050816020015160ff166003146106ef5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b6044820152606401610226565b6106f9838261082d565b61ffff16604083015261070d600282610b58565b9050610719838261088a565b6060830152610729602082610b58565b9050808351146102ce5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b6044820152606401610226565b6000610780826020610b58565b835110156107c85760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401610226565b50016020015190565b60006107de826001610b58565b835110156108245760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401610226565b50016001015190565b600061083a826002610b58565b835110156108815760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610226565b50016002015190565b6000610897826020610b58565b835110156107c85760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401610226565b60006108ec826004610b58565b835110156109335760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b6044820152606401610226565b50016004015190565b6000610949826014610b58565b835110156109915760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610226565b500160200151600160601b900490565b6040518060a0016040528060008019168152602001600060ff168152602001600061ffff1681526020016109ee604051806040016040528060608152602001600063ffffffff1681525090565b8152600060209091015290565b600060208284031215610a0c578081fd5b813567ffffffffffffffff80821115610a23578283fd5b818401915084601f830112610a36578283fd5b813581811115610a4857610a48610ba1565b604051601f8201601f19908116603f01168101908382118183101715610a7057610a70610ba1565b81604052828152876020848701011115610a88578586fd5b826020860160208301379182016020019490945295945050505050565b6000602080835283518184015260ff8185015116604084015261ffff6040850151166060840152606084015160a0608085015261010084018151604060c08701528181518084526101208801915085830193508692505b80831015610b255783516001600160a01b03168252928501926001929092019190850190610afc565b509383015163ffffffff1660e0870152608087015193610b4d60a088018663ffffffff169052565b979650505050505050565b60008219821115610b6b57610b6b610b8b565b500190565b6000600019821415610b8457610b84610b8b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea264697066735822122040001b882371cab99e7ec08da6584ea4d110a78c5cdab234ddd9f351bbea2b5e64736f6c63430008040033\";\nvar GovernanceStructs__factory = /** @class */ (function (_super) {\n __extends(GovernanceStructs__factory, _super);\n function GovernanceStructs__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n GovernanceStructs__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n GovernanceStructs__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n GovernanceStructs__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n GovernanceStructs__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n GovernanceStructs__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernanceStructs__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernanceStructs__factory.bytecode = _bytecode;\n GovernanceStructs__factory.abi = _abi;\n return GovernanceStructs__factory;\n}(ContractFactory));\nexport { GovernanceStructs__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar Governor__factory = /** @class */ (function () {\n function Governor__factory() {\n }\n Governor__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Governor__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Governor__factory.abi = _abi;\n return Governor__factory;\n}());\nexport { Governor__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalQueued\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"cancel\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"execute\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"getActions\",\n outputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n ],\n name: \"getReceipt\",\n outputs: [\n {\n components: [\n {\n internalType: \"bool\",\n name: \"hasVoted\",\n type: \"bool\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint96\",\n name: \"votes\",\n type: \"uint96\",\n },\n ],\n internalType: \"struct IGovernorCompatibilityBravo.Receipt\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalEta\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"proposalThreshold\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposals\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"forVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"againstVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"abstainVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"bool\",\n name: \"canceled\",\n type: \"bool\",\n },\n {\n internalType: \"bool\",\n name: \"executed\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"queue\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"queue\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"quorumVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"timelock\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorCompatibilityBravo__factory = /** @class */ (function () {\n function GovernorCompatibilityBravo__factory() {\n }\n GovernorCompatibilityBravo__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorCompatibilityBravo__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorCompatibilityBravo__factory.abi = _abi;\n return GovernorCompatibilityBravo__factory;\n}());\nexport { GovernorCompatibilityBravo__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"againstVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"forVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"abstainVotes\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorCountingSimple__factory = /** @class */ (function () {\n function GovernorCountingSimple__factory() {\n }\n GovernorCountingSimple__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorCountingSimple__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorCountingSimple__factory.abi = _abi;\n return GovernorCountingSimple__factory;\n}());\nexport { GovernorCountingSimple__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"proposalThreshold\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorProposalThreshold__factory = /** @class */ (function () {\n function GovernorProposalThreshold__factory() {\n }\n GovernorProposalThreshold__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorProposalThreshold__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorProposalThreshold__factory.abi = _abi;\n return GovernorProposalThreshold__factory;\n}());\nexport { GovernorProposalThreshold__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalQueued\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"oldTimelock\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newTimelock\",\n type: \"address\",\n },\n ],\n name: \"TimelockChange\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"__acceptAdmin\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalEta\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"queue\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"timelock\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract ICompoundTimelock\",\n name: \"newTimelock\",\n type: \"address\",\n },\n ],\n name: \"updateTimelock\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorTimelockCompound__factory = /** @class */ (function () {\n function GovernorTimelockCompound__factory() {\n }\n GovernorTimelockCompound__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorTimelockCompound__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorTimelockCompound__factory.abi = _abi;\n return GovernorTimelockCompound__factory;\n}());\nexport { GovernorTimelockCompound__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalQueued\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"oldTimelock\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newTimelock\",\n type: \"address\",\n },\n ],\n name: \"TimelockChange\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalEta\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"queue\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"timelock\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract TimelockController\",\n name: \"newTimelock\",\n type: \"address\",\n },\n ],\n name: \"updateTimelock\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorTimelockControl__factory = /** @class */ (function () {\n function GovernorTimelockControl__factory() {\n }\n GovernorTimelockControl__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorTimelockControl__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorTimelockControl__factory.abi = _abi;\n return GovernorTimelockControl__factory;\n}());\nexport { GovernorTimelockControl__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"token\",\n outputs: [\n {\n internalType: \"contract ERC20Votes\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorVotes__factory = /** @class */ (function () {\n function GovernorVotes__factory() {\n }\n GovernorVotes__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorVotes__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorVotes__factory.abi = _abi;\n return GovernorVotes__factory;\n}());\nexport { GovernorVotes__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"token\",\n outputs: [\n {\n internalType: \"contract ERC20VotesComp\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorVotesComp__factory = /** @class */ (function () {\n function GovernorVotesComp__factory() {\n }\n GovernorVotesComp__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorVotesComp__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorVotesComp__factory.abi = _abi;\n return GovernorVotesComp__factory;\n}());\nexport { GovernorVotesComp__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"oldQuorumNumerator\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"newQuorumNumerator\",\n type: \"uint256\",\n },\n ],\n name: \"QuorumNumeratorUpdated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"BALLOT_TYPEHASH\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"quorumDenominator\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"quorumNumerator\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"token\",\n outputs: [\n {\n internalType: \"contract ERC20Votes\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"newQuorumNumerator\",\n type: \"uint256\",\n },\n ],\n name: \"updateQuorumNumerator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar GovernorVotesQuorumFraction__factory = /** @class */ (function () {\n function GovernorVotesQuorumFraction__factory() {\n }\n GovernorVotesQuorumFraction__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n GovernorVotesQuorumFraction__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n GovernorVotesQuorumFraction__factory.abi = _abi;\n return GovernorVotesQuorumFraction__factory;\n}());\nexport { GovernorVotesQuorumFraction__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IAccessControl__factory = /** @class */ (function () {\n function IAccessControl__factory() {\n }\n IAccessControl__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IAccessControl__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IAccessControl__factory.abi = _abi;\n return IAccessControl__factory;\n}());\nexport { IAccessControl__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"getRoleMember\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleMemberCount\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IAccessControlEnumerable__factory = /** @class */ (function () {\n function IAccessControlEnumerable__factory() {\n }\n IAccessControlEnumerable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IAccessControlEnumerable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IAccessControlEnumerable__factory.abi = _abi;\n return IAccessControlEnumerable__factory;\n}());\nexport { IAccessControlEnumerable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [],\n name: \"implementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IBeacon__factory = /** @class */ (function () {\n function IBeacon__factory() {\n }\n IBeacon__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IBeacon__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IBeacon__factory.abi = _abi;\n return IBeacon__factory;\n}());\nexport { IBeacon__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [],\n name: \"GRACE_PERIOD\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"MAXIMUM_DELAY\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"MINIMUM_DELAY\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"acceptAdmin\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"admin\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"signature\",\n type: \"string\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n ],\n name: \"cancelTransaction\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"delay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"signature\",\n type: \"string\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n ],\n name: \"executeTransaction\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pendingAdmin\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"signature\",\n type: \"string\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n ],\n name: \"queueTransaction\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n name: \"queuedTransactions\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n name: \"setDelay\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n name: \"setPendingAdmin\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar ICompoundTimelock__factory = /** @class */ (function () {\n function ICompoundTimelock__factory() {\n }\n ICompoundTimelock__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ICompoundTimelock__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ICompoundTimelock__factory.abi = _abi;\n return ICompoundTimelock__factory;\n}());\nexport { ICompoundTimelock__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC1155__factory = /** @class */ (function () {\n function IERC1155__factory() {\n }\n IERC1155__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1155__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1155__factory.abi = _abi;\n return IERC1155__factory;\n}());\nexport { IERC1155__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"uri\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC1155MetadataURI__factory = /** @class */ (function () {\n function IERC1155MetadataURI__factory() {\n }\n IERC1155MetadataURI__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1155MetadataURI__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1155MetadataURI__factory.abi = _abi;\n return IERC1155MetadataURI__factory;\n}());\nexport { IERC1155MetadataURI__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onERC1155BatchReceived\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onERC1155Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC1155Receiver__factory = /** @class */ (function () {\n function IERC1155Receiver__factory() {\n }\n IERC1155Receiver__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1155Receiver__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1155Receiver__factory.abi = _abi;\n return IERC1155Receiver__factory;\n}());\nexport { IERC1155Receiver__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes\",\n name: \"signature\",\n type: \"bytes\",\n },\n ],\n name: \"isValidSignature\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"magicValue\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC1271__factory = /** @class */ (function () {\n function IERC1271__factory() {\n }\n IERC1271__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1271__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1271__factory.abi = _abi;\n return IERC1271__factory;\n}());\nexport { IERC1271__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"approveAndCall\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"approveAndCall\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"transferAndCall\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"transferAndCall\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"transferFromAndCall\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"transferFromAndCall\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC1363__factory = /** @class */ (function () {\n function IERC1363__factory() {\n }\n IERC1363__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1363__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1363__factory.abi = _abi;\n return IERC1363__factory;\n}());\nexport { IERC1363__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onTransferReceived\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC1363Receiver__factory = /** @class */ (function () {\n function IERC1363Receiver__factory() {\n }\n IERC1363Receiver__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1363Receiver__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1363Receiver__factory.abi = _abi;\n return IERC1363Receiver__factory;\n}());\nexport { IERC1363Receiver__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onApprovalReceived\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC1363Spender__factory = /** @class */ (function () {\n function IERC1363Spender__factory() {\n }\n IERC1363Spender__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1363Spender__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1363Spender__factory.abi = _abi;\n return IERC1363Spender__factory;\n}());\nexport { IERC1363Spender__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC165__factory = /** @class */ (function () {\n function IERC165__factory() {\n }\n IERC165__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC165__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC165__factory.abi = _abi;\n return IERC165__factory;\n}());\nexport { IERC165__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"interfaceHash\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"canImplementInterfaceForAddress\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC1820Implementer__factory = /** @class */ (function () {\n function IERC1820Implementer__factory() {\n }\n IERC1820Implementer__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1820Implementer__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1820Implementer__factory.abi = _abi;\n return IERC1820Implementer__factory;\n}());\nexport { IERC1820Implementer__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"interfaceHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementer\",\n type: \"address\",\n },\n ],\n name: \"InterfaceImplementerSet\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newManager\",\n type: \"address\",\n },\n ],\n name: \"ManagerChanged\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"bytes32\",\n name: \"_interfaceHash\",\n type: \"bytes32\",\n },\n ],\n name: \"getInterfaceImplementer\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"getManager\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"implementsERC165Interface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"implementsERC165InterfaceNoCache\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"interfaceName\",\n type: \"string\",\n },\n ],\n name: \"interfaceHash\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"bytes32\",\n name: \"_interfaceHash\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"implementer\",\n type: \"address\",\n },\n ],\n name: \"setInterfaceImplementer\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"newManager\",\n type: \"address\",\n },\n ],\n name: \"setManager\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"updateERC165Cache\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC1820Registry__factory = /** @class */ (function () {\n function IERC1820Registry__factory() {\n }\n IERC1820Registry__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC1820Registry__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC1820Registry__factory.abi = _abi;\n return IERC1820Registry__factory;\n}());\nexport { IERC1820Registry__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC20__factory = /** @class */ (function () {\n function IERC20__factory() {\n }\n IERC20__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC20__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC20__factory.abi = _abi;\n return IERC20__factory;\n}());\nexport { IERC20__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC20Metadata__factory = /** @class */ (function () {\n function IERC20Metadata__factory() {\n }\n IERC20Metadata__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC20Metadata__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC20Metadata__factory.abi = _abi;\n return IERC20Metadata__factory;\n}());\nexport { IERC20Metadata__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [],\n name: \"DOMAIN_SEPARATOR\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"nonces\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"deadline\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"permit\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC20Permit__factory = /** @class */ (function () {\n function IERC20Permit__factory() {\n }\n IERC20Permit__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC20Permit__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC20Permit__factory.abi = _abi;\n return IERC20Permit__factory;\n}());\nexport { IERC20Permit__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [],\n name: \"DOMAIN_SEPARATOR\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"nonces\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"deadline\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"permit\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC2612__factory = /** @class */ (function () {\n function IERC2612__factory() {\n }\n IERC2612__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC2612__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC2612__factory.abi = _abi;\n return IERC2612__factory;\n}());\nexport { IERC2612__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"salePrice\",\n type: \"uint256\",\n },\n ],\n name: \"royaltyInfo\",\n outputs: [\n {\n internalType: \"address\",\n name: \"receiver\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"royaltyAmount\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC2981__factory = /** @class */ (function () {\n function IERC2981__factory() {\n }\n IERC2981__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC2981__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC2981__factory.abi = _abi;\n return IERC2981__factory;\n}());\nexport { IERC2981__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"initiator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"fee\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onFlashLoan\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC3156FlashBorrower__factory = /** @class */ (function () {\n function IERC3156FlashBorrower__factory() {\n }\n IERC3156FlashBorrower__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC3156FlashBorrower__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC3156FlashBorrower__factory.abi = _abi;\n return IERC3156FlashBorrower__factory;\n}());\nexport { IERC3156FlashBorrower__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"flashFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract IERC3156FlashBorrower\",\n name: \"receiver\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"flashLoan\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"maxFlashLoan\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC3156FlashLender__factory = /** @class */ (function () {\n function IERC3156FlashLender__factory() {\n }\n IERC3156FlashLender__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC3156FlashLender__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC3156FlashLender__factory.abi = _abi;\n return IERC3156FlashLender__factory;\n}());\nexport { IERC3156FlashLender__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"_approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC721__factory = /** @class */ (function () {\n function IERC721__factory() {\n }\n IERC721__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC721__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC721__factory.abi = _abi;\n return IERC721__factory;\n}());\nexport { IERC721__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"_approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenByIndex\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenOfOwnerByIndex\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC721Enumerable__factory = /** @class */ (function () {\n function IERC721Enumerable__factory() {\n }\n IERC721Enumerable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC721Enumerable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC721Enumerable__factory.abi = _abi;\n return IERC721Enumerable__factory;\n}());\nexport { IERC721Enumerable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"_approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC721Metadata__factory = /** @class */ (function () {\n function IERC721Metadata__factory() {\n }\n IERC721Metadata__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC721Metadata__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC721Metadata__factory.abi = _abi;\n return IERC721Metadata__factory;\n}());\nexport { IERC721Metadata__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"onERC721Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC721Receiver__factory = /** @class */ (function () {\n function IERC721Receiver__factory() {\n }\n IERC721Receiver__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC721Receiver__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC721Receiver__factory.abi = _abi;\n return IERC721Receiver__factory;\n}());\nexport { IERC721Receiver__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"AuthorizedOperator\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Burned\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Minted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"RevokedOperator\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"Sent\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"authorizeOperator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"defaultOperators\",\n outputs: [\n {\n internalType: \"address[]\",\n name: \"\",\n type: \"address[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"granularity\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"tokenHolder\",\n type: \"address\",\n },\n ],\n name: \"isOperatorFor\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"operatorBurn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"operatorSend\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"revokeOperator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"send\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IERC777__factory = /** @class */ (function () {\n function IERC777__factory() {\n }\n IERC777__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC777__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC777__factory.abi = _abi;\n return IERC777__factory;\n}());\nexport { IERC777__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"userData\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"tokensReceived\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC777Recipient__factory = /** @class */ (function () {\n function IERC777Recipient__factory() {\n }\n IERC777Recipient__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC777Recipient__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC777Recipient__factory.abi = _abi;\n return IERC777Recipient__factory;\n}());\nexport { IERC777Recipient__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"userData\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes\",\n name: \"operatorData\",\n type: \"bytes\",\n },\n ],\n name: \"tokensToSend\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IERC777Sender__factory = /** @class */ (function () {\n function IERC777Sender__factory() {\n }\n IERC777Sender__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IERC777Sender__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IERC777Sender__factory.abi = _abi;\n return IERC777Sender__factory;\n}());\nexport { IERC777Sender__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IGovernor__factory = /** @class */ (function () {\n function IGovernor__factory() {\n }\n IGovernor__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IGovernor__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IGovernor__factory.abi = _abi;\n return IGovernor__factory;\n}());\nexport { IGovernor__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"cancel\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"execute\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"getActions\",\n outputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n ],\n name: \"getReceipt\",\n outputs: [\n {\n components: [\n {\n internalType: \"bool\",\n name: \"hasVoted\",\n type: \"bool\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint96\",\n name: \"votes\",\n type: \"uint96\",\n },\n ],\n internalType: \"struct IGovernorCompatibilityBravo.Receipt\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"proposalThreshold\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n name: \"proposals\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"forVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"againstVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"abstainVotes\",\n type: \"uint256\",\n },\n {\n internalType: \"bool\",\n name: \"canceled\",\n type: \"bool\",\n },\n {\n internalType: \"bool\",\n name: \"executed\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"queue\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"quorumVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IGovernorCompatibilityBravo__factory = /** @class */ (function () {\n function IGovernorCompatibilityBravo__factory() {\n }\n IGovernorCompatibilityBravo__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IGovernorCompatibilityBravo__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IGovernorCompatibilityBravo__factory.abi = _abi;\n return IGovernorCompatibilityBravo__factory;\n}());\nexport { IGovernorCompatibilityBravo__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalCanceled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"proposer\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"string[]\",\n name: \"signatures\",\n type: \"string[]\",\n },\n {\n indexed: false,\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"endBlock\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"ProposalCreated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"eta\",\n type: \"uint256\",\n },\n ],\n name: \"ProposalQueued\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"voter\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weight\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"VoteCast\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"COUNTING_MODE\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n ],\n name: \"castVote\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n ],\n name: \"castVoteBySig\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"uint8\",\n name: \"support\",\n type: \"uint8\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n name: \"castVoteWithReason\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"getVotes\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasVoted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"hashProposal\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalDeadline\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalEta\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"proposalSnapshot\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"string\",\n name: \"description\",\n type: \"string\",\n },\n ],\n name: \"propose\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"calldatas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"descriptionHash\",\n type: \"bytes32\",\n },\n ],\n name: \"queue\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"blockNumber\",\n type: \"uint256\",\n },\n ],\n name: \"quorum\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"proposalId\",\n type: \"uint256\",\n },\n ],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum IGovernor.ProposalState\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"timelock\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"votingPeriod\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IGovernorTimelock__factory = /** @class */ (function () {\n function IGovernorTimelock__factory() {\n }\n IGovernorTimelock__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IGovernorTimelock__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IGovernorTimelock__factory.abi = _abi;\n return IGovernorTimelock__factory;\n}());\nexport { IGovernorTimelock__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransferWithPayload\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar ITokenBridge__factory = /** @class */ (function () {\n function ITokenBridge__factory() {\n }\n ITokenBridge__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ITokenBridge__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ITokenBridge__factory.abi = _abi;\n return ITokenBridge__factory;\n}());\nexport { ITokenBridge__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"deposit\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"withdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar IWETH__factory = /** @class */ (function () {\n function IWETH__factory() {\n }\n IWETH__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IWETH__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IWETH__factory.abi = _abi;\n return IWETH__factory;\n}());\nexport { IWETH__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n indexed: false,\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n ],\n name: \"LogMessagePublished\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n ],\n name: \"publishMessage\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseAndVerifyVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"guardianSet\",\n type: \"tuple\",\n },\n ],\n name: \"verifySignatures\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"getGuardianSet\",\n outputs: [\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getCurrentGuardianSetIndex\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getGuardianSetExpiry\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"messageFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar IWormhole__factory = /** @class */ (function () {\n function IWormhole__factory() {\n }\n IWormhole__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n IWormhole__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n IWormhole__factory.abi = _abi;\n return IWormhole__factory;\n}());\nexport { IWormhole__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"GuardianSetAdded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n indexed: false,\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n ],\n name: \"LogMessagePublished\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getCurrentGuardianSetIndex\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"getGuardianSet\",\n outputs: [\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getGuardianSetExpiry\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"messageFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"emitter\",\n type: \"address\",\n },\n ],\n name: \"nextSequence\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseAndVerifyVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct GovernanceStructs.ContractUpgrade\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseGuardianSetUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"newGuardianSet\",\n type: \"tuple\",\n },\n {\n internalType: \"uint32\",\n name: \"newGuardianSetIndex\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct GovernanceStructs.GuardianSetUpgrade\",\n name: \"gsu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedSetMessageFee\",\n type: \"bytes\",\n },\n ],\n name: \"parseSetMessageFee\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"messageFee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct GovernanceStructs.SetMessageFee\",\n name: \"smf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedTransferFees\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransferFees\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct GovernanceStructs.TransferFees\",\n name: \"tf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitContractUpgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitNewGuardianSet\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitSetMessageFee\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitTransferFees\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"guardianSet\",\n type: \"tuple\",\n },\n ],\n name: \"verifySignatures\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n ],\n name: \"publishMessage\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50612eb1806100206000396000f3fe6080604052600436106101445760003560e01c806393df337e116100b6578063c0fd8bde1161006f578063c0fd8bde1461054c578063d60b347f1461057b578063eb8d3f12146105b4578063f42bc641146105d7578063f951975a146105f7578063fbe3c2cd14610624576101ab565b806393df337e1461048f5780639a8a0592146104af578063a0cce1b3146104d7578063a9e11893146104f7578063b172b22214610524578063b19a437e14610539576101ab565b80634cf842b5116101085780634cf842b51461030b5780634fdc60fa14610362578063515f3247146103c55780635cb8cae21461041f5780636606b4e014610441578063875be02a14610461576101ab565b80630319e59c146101e157806304ca84cf146102535780631a90a219146102805780631cfe79511461029f5780632c3c02a4146102cb576101ab565b366101ab5760405162461bcd60e51b815260206004820152602c60248201527f74686520576f726d686f6c6520636f6e747261637420646f6573206e6f74206160448201526b63636570742061737365747360a01b60648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152600b60248201526a1d5b9cdd5c1c1bdc9d195960aa1b60448201526064016101a2565b3480156101ed57600080fd5b506102016101fc366004612731565b610643565b60405161024a9190600060a0820190508251825260ff602084015116602083015261ffff6040840151166040830152606083015160608301526080830151608083015292915050565b60405180910390f35b34801561025f57600080fd5b5061027361026e366004612731565b610799565b60405161024a9190612b27565b34801561028c57600080fd5b506007545b60405190815260200161024a565b3480156102ab57600080fd5b5060035463ffffffff165b60405163ffffffff909116815260200161024a565b3480156102d757600080fd5b506102fb6102e63660046125a6565b60009081526005602052604090205460ff1690565b604051901515815260200161024a565b34801561031757600080fd5b5061034a610326366004612585565b6001600160a01b03166000908152600460205260409020546001600160401b031690565b6040516001600160401b03909116815260200161024a565b34801561036e57600080fd5b5061038261037d366004612731565b6109cc565b60405161024a91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b3480156103d157600080fd5b506103e56103e0366004612731565b610b08565b60405161024a91908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b34801561042b57600080fd5b5061043f61043a366004612731565b610c37565b005b34801561044d57600080fd5b5061043f61045c366004612731565b610d3f565b34801561046d57600080fd5b5061048161047c36600461276b565b610f5f565b60405161024a929190612af9565b34801561049b57600080fd5b5061043f6104aa366004612731565b6110f3565b3480156104bb57600080fd5b5060005461ffff165b60405161ffff909116815260200161024a565b3480156104e357600080fd5b506104816104f23660046125be565b61123f565b34801561050357600080fd5b50610517610512366004612731565b61141c565b60405161024a9190612b97565b34801561053057600080fd5b50600154610291565b61034a6105473660046128a4565b6117fa565b34801561055857600080fd5b5061056c6105673660046126c5565b61189a565b60405161024a93929190612baa565b34801561058757600080fd5b506102fb610596366004612585565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156105c057600080fd5b50600354640100000000900463ffffffff166102b6565b3480156105e357600080fd5b5061043f6105f2366004612731565b6118fc565b34801561060357600080fd5b5061061761061236600461288a565b6119fd565b60405161024a9190612b84565b34801561063057600080fd5b5060005462010000900461ffff166104c4565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906106788382611a9c565b8252610685602082612ce3565b90506106918382611afa565b60ff1660208301526106a4600182612ce3565b9050816020015160ff166004146106f45760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101a2565b6106fe8382611b56565b61ffff166040830152610712600282612ce3565b905061071e8382611bb3565b606083015261072e602082612ce3565b905061073a8382611a9c565b608083015261074a602082612ce3565b9050808351146107935760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101a2565b50919050565b6107a16122d3565b60006107ad8382611a9c565b82526107ba602082612ce3565b90506107c68382611afa565b60ff1660208301526107d9600182612ce3565b9050816020015160ff166002146108325760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101a2565b61083c8382611b56565b61ffff166040830152610850600282612ce3565b905061085c8382611c08565b63ffffffff166080830152610872600482612ce3565b905060006108808483611afa565b905061088d600183612ce3565b915060405180604001604052808260ff166001600160401b038111156108c357634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156108ec578160200160208202803683370190505b5081526000602090910181905260608501919091525b8160ff16811015610974576109178584611c65565b60608501515180518390811061093d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0390921660209283029190910190910152610960601484612ce3565b92508061096c81612df0565b915050610902565b50818451146109c55760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101a2565b5050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906109fa8382611a9c565b8252610a07602082612ce3565b9050610a138382611afa565b60ff166020830152610a26600182612ce3565b9050816020015160ff16600114610a795760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101a2565b610a838382611b56565b61ffff166040830152610a97600282612ce3565b9050610aa38382611a9c565b6001600160a01b03166060830152610abc602082612ce3565b9050808351146107935760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101a2565b604080516080810182526000808252602082018190529181018290526060810182905290610b368382611a9c565b8252610b43602082612ce3565b9050610b4f8382611afa565b60ff166020830152610b62600182612ce3565b9050816020015160ff16600314610bb35760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101a2565b610bbd8382611b56565b61ffff166040830152610bd1600282612ce3565b9050610bdd8382611bb3565b6060830152610bed602082612ce3565b9050808351146107935760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101a2565b6000610c428261141c565b9050600080610c5083611cca565b91509150818190610c745760405162461bcd60e51b81526004016101a29190612b14565b506000610c848460e001516109cc565b805190915063436f726514610ccc5760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff1614610d1d5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101a2565b610d2b846101400151611e40565b610d388160600151611e5b565b5050505050565b6000610d4a8261141c565b9050600080610d5883611cca565b91509150818190610d7c5760405162461bcd60e51b81526004016101a29190612b14565b506000610d8c8460e00151610799565b805190915063436f726514610dd45760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff161480610dfa5750604081015161ffff16155b610e365760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101a2565b60608101515151610e895760405162461bcd60e51b815260206004820152601960248201527f6e657720677561726469616e2073657420697320656d7074790000000000000060448201526064016101a2565b60035463ffffffff16610e9d906001612cfb565b63ffffffff16816080015163ffffffff1614610f055760405162461bcd60e51b815260206004820152602160248201527f696e646578206d75737420696e63726561736520696e207374657073206f66206044820152603160f81b60648201526084016101a2565b610f13846101400151611e40565b610f2a610f2560035463ffffffff1690565b611f88565b610f3c81606001518260800151611fc0565b60808101516003805463ffffffff191663ffffffff909216919091179055610d38565b600060606000610f738461010001516119fd565b805151909150610fb6576000604051806040016040528060148152602001731a5b9d985b1a590819dd585c991a585b881cd95d60621b8152509250925050915091565b60035463ffffffff1663ffffffff1684610100015163ffffffff1614158015610fe8575042816020015163ffffffff16105b1561102f5760006040518060400160405280601881526020017f677561726469616e2073657420686173206578706972656400000000000000008152509250925050915091565b61012084015151815151600a906003906110499083612d8a565b6110539190612d6a565b61105e906002612d8a565b6110689190612d6a565b611073906001612ce3565b11156110a7576000604051806040016040528060098152602001686e6f2071756f72756d60b81b8152509250925050915091565b6000806110bf8661014001518761012001518561123f565b91509150816110d5576000969095509350505050565b60016040518060200160405280600081525094509450505050915091565b60006110fe8261141c565b905060008061110c83611cca565b915091508181906111305760405162461bcd60e51b81526004016101a29190612b14565b5060006111408460e00151610643565b805190915063436f7265146111885760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff1614806111ae5750604081015161ffff16155b6111ea5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101a2565b6111f8846101400151611e40565b608081015160608201516040516001600160a01b0383169180156108fc02916000818181858888f19350505050158015611236573d6000803e3d6000fd5b50505050505050565b600060606000805b85518110156113fb57600086828151811061127257634e487b7160e01b600052603260045260246000fd5b60200260200101519050816000148061129457508260ff16816060015160ff16115b6112ec5760405162461bcd60e51b815260206004820152602360248201527f7369676e617475726520696e6469636573206d75737420626520617363656e64604482015262696e6760e81b60648201526084016101a2565b6060810151865180519194509060ff851690811061131a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031660018983604001518460000151856020015160405160008152602001604052604051611373949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015611395573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146113e8576000604051806040016040528060148152602001731593481cda59db985d1d5c99481a5b9d985b1a5960621b81525094509450505050611414565b50806113f381612df0565b915050611247565b5060016040518060200160405280600081525092509250505b935093915050565b61142461232d565b60006114308382611afa565b60ff168252611440600182612ce3565b9050816000015160ff166001146114995760405162461bcd60e51b815260206004820152601760248201527f564d2076657273696f6e20696e636f6d70617469626c6500000000000000000060448201526064016101a2565b6114a38382611c08565b63ffffffff166101008301526114ba600482612ce3565b905060006114c88483611afa565b60ff1690506114d8600183612ce3565b9150806001600160401b0381111561150057634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561155257816020015b60408051608081018252600080825260208083018290529282018190526060820152825260001990920191018161151e5790505b5061012084015260005b818110156116c15761156e8584611afa565b846101200151828151811061159357634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166060909101526115b4600184612ce3565b92506115c08584611a9c565b84610120015182815181106115e557634e487b7160e01b600052603260045260246000fd5b602002602001015160000181815250506020836116029190612ce3565b925061160e8584611a9c565b846101200151828151811061163357634e487b7160e01b600052603260045260246000fd5b602002602001015160200181815250506020836116509190612ce3565b925061165c8584611afa565b61166790601b612d45565b846101200151828151811061168c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166040909101526116ad600184612ce3565b9250806116b981612df0565b91505061155c565b5060006116dd838487516116d59190612da9565b879190612014565b905080805190602001206040516020016116f991815260200190565b60408051601f1981840301815291905280516020909101206101408501526117218584611c08565b63ffffffff166020850152611737600484612ce3565b92506117438584611c08565b63ffffffff166040850152611759600484612ce3565b92506117658584611b56565b61ffff166060850152611779600284612ce3565b92506117858584611a9c565b6080850152611795602084612ce3565b92506117a18584612121565b6001600160401b031660a08501526117ba600884612ce3565b92506117c68584611afa565b60ff1660c08501526117d9600184612ce3565b92506117ec838487516116d59190612da9565b60e085015250919392505050565b600061180560075490565b34146118415760405162461bcd60e51b815260206004820152600b60248201526a696e76616c69642066656560a81b60448201526064016101a2565b61184a3361217e565b9050336001600160a01b03167f6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b28286868660405161188b9493929190612be1565b60405180910390a29392505050565b6118a261232d565b600060606118e585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061141c92505050565b92506118f083610f5f565b93969095509293505050565b60006119078261141c565b905060008061191583611cca565b915091508181906119395760405162461bcd60e51b81526004016101a29190612b14565b5060006119498460e00151610b08565b805190915063436f7265146119915760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101a2565b60005461ffff1661ffff16816040015161ffff16146119e25760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101a2565b6119f0846101400151611e40565b610d388160600151600755565b60408051808201825260608082526000602080840182905263ffffffff86168252600281529084902084518154928302810184018652948501828152939493909284928491840182828015611a7b57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611a5d575b50505091835250506001919091015463ffffffff1660209091015292915050565b6000611aa9826020612ce3565b83511015611af15760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016101a2565b50016020015190565b6000611b07826001612ce3565b83511015611b4d5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016101a2565b50016001015190565b6000611b63826002612ce3565b83511015611baa5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016101a2565b50016002015190565b6000611bc0826020612ce3565b83511015611af15760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b60448201526064016101a2565b6000611c15826004612ce3565b83511015611c5c5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016101a2565b50016004015190565b6000611c72826014612ce3565b83511015611cba5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016101a2565b500160200151600160601b900490565b60006060600080611cda85610f5f565b9150915081611cef5760009590945092505050565b60035463ffffffff1663ffffffff1685610100015163ffffffff1614611d35576000604051806060016040528060228152602001612e3860229139935093505050915091565b60005462010000900461ffff1661ffff16856060015161ffff1614611d90576000604051806040016040528060168152602001753bb937b7339033b7bb32b93730b731b29031b430b4b760511b815250935093505050915091565b600154856080015114611de05760006040518060400160405280601981526020017f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000815250935093505050915091565b61014085015160009081526005602052604090205460ff1615611e23576000604051806060016040528060228152602001612e5a60229139935093505050915091565b600160405180602001604052806000815250935093505050915091565b6000908152600560205260409020805460ff19166001179055565b6000611e8e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611e99826121ee565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611edc91612add565b600060405180830381855af49150503d8060008114611f17576040519150601f19603f3d011682016040523d82523d6000602084013e611f1c565b606091505b5091509150818190611f415760405162461bcd60e51b81526004016101a29190612b14565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b611f954262015180612cfb565b63ffffffff9182166000908152600260205260409020600101805463ffffffff191691909216179055565b63ffffffff81166000908152600260209081526040909120835180518593611fec928492910190612388565b50602091909101516001909101805463ffffffff191663ffffffff9092169190911790555050565b60608161202281601f612ce3565b10156120615760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016101a2565b61206b8284612ce3565b845110156120af5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016101a2565b6060821580156120ce5760405191506000825260208201604052612118565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156121075780518352602092830192016120ef565b5050858452601f01601f1916604052505b50949350505050565b600061212e826008612ce3565b835110156121755760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016101a2565b50016008015190565b6001600160a01b0381166000908152600460205260409020546001600160401b03166121e9826121af836001612d23565b6001600160a01b03919091166000908152600460205260409020805467ffffffffffffffff19166001600160401b03909216919091179055565b919050565b6121f78161222e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6122925760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016101a2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6040518060a0016040528060008019168152602001600060ff168152602001600061ffff168152602001612320604051806040016040528060608152602001600063ffffffff1681525090565b8152600060209091015290565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201819052610100820183905261012082015261014081019190915290565b8280548282559060005260206000209081019282156123dd579160200282015b828111156123dd57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906123a8565b506123e99291506123ed565b5090565b5b808211156123e957600081556001016123ee565b80356001600160a01b03811681146121e957600080fd5b600082601f830112612429578081fd5b8135602061243e61243983612cc0565b612c90565b80838252828201915082860187848660071b890101111561245d578586fd5b855b858110156124c057608080838b031215612477578788fd5b61247f612c23565b8335815286840135878201526040612498818601612574565b9082015260606124a9858201612574565b90820152855293850193919091019060010161245f565b5090979650505050505050565b600082601f8301126124dd578081fd5b81356001600160401b038111156124f6576124f6612e21565b612509601f8201601f1916602001612c90565b81815284602083860101111561251d578283fd5b816020850160208301379081016020019190915292915050565b803561ffff811681146121e957600080fd5b803563ffffffff811681146121e957600080fd5b80356001600160401b03811681146121e957600080fd5b803560ff811681146121e957600080fd5b600060208284031215612596578081fd5b61259f82612402565b9392505050565b6000602082840312156125b7578081fd5b5035919050565b6000806000606084860312156125d2578182fd5b833592506020808501356001600160401b03808211156125f0578485fd5b6125fc88838901612419565b94506040870135915080821115612611578384fd5b9086019060408289031215612624578384fd5b61262c612c4b565b82358281111561263a578586fd5b83019150601f8201891361264c578485fd5b813561265a61243982612cc0565b8082825286820191508685018c888560051b8801011115612679578889fd5b8895505b838610156126a25761268e81612402565b83526001959095019491870191870161267d565b508352506126b39050838501612549565b84820152809450505050509250925092565b600080602083850312156126d7578182fd5b82356001600160401b03808211156126ed578384fd5b818501915085601f830112612700578384fd5b81358181111561270e578485fd5b86602082850101111561271f578485fd5b60209290920196919550909350505050565b600060208284031215612742578081fd5b81356001600160401b03811115612757578182fd5b612763848285016124cd565b949350505050565b60006020828403121561277c578081fd5b81356001600160401b0380821115612792578283fd5b9083019061016082860312156127a6578283fd5b6127ae612c6d565b6127b783612574565b81526127c560208401612549565b60208201526127d660408401612549565b60408201526127e760608401612537565b60608201526080830135608082015261280260a0840161255d565b60a082015261281360c08401612574565b60c082015260e083013582811115612829578485fd5b612835878286016124cd565b60e083015250610100612849818501612549565b908201526101208381013583811115612860578586fd5b61286c88828701612419565b91830191909152506101409283013592810192909252509392505050565b60006020828403121561289b578081fd5b61259f82612549565b6000806000606084860312156128b8578081fd5b6128c184612549565b925060208401356001600160401b038111156128db578182fd5b6128e7868287016124cd565b9250506128f660408501612574565b90509250925092565b6000815180845260208085019450808401835b8381101561295757815180518852838101518489015260408082015160ff908116918a0191909152606091820151169088015260809096019590820190600101612912565b509495945050505050565b6000815180845261297a816020860160208601612dc0565b601f01601f19169290920160200192915050565b805160408084528151908401819052600091602091908201906060860190845b818110156129d35783516001600160a01b0316835292840192918401916001016129ae565b50509382015163ffffffff16949091019390935250919050565b805160ff16825260006101606020830151612a10602086018263ffffffff169052565b506040830151612a28604086018263ffffffff169052565b506060830151612a3e606086018261ffff169052565b506080830151608085015260a0830151612a6360a08601826001600160401b03169052565b5060c0830151612a7860c086018260ff169052565b5060e08301518160e0860152612a9082860182612962565b91505061010080840151612aab8287018263ffffffff169052565b50506101208084015185830382870152612ac583826128ff565b61014095860151969095019590955250919392505050565b60008251612aef818460208701612dc0565b9190910192915050565b82151581526040602082015260006127636040830184612962565b60208152600061259f6020830184612962565b602081528151602082015260ff602083015116604082015261ffff60408301511660608201526000606083015160a06080840152612b6860c084018261298e565b905063ffffffff60808501511660a08401528091505092915050565b60208152600061259f602083018461298e565b60208152600061259f60208301846129ed565b606081526000612bbd60608301866129ed565b84151560208401528281036040840152612bd78185612962565b9695505050505050565b6001600160401b038516815263ffffffff84166020820152608060408201526000612c0f6080830185612962565b905060ff8316606083015295945050505050565b604051608081016001600160401b0381118282101715612c4557612c45612e21565b60405290565b604080519081016001600160401b0381118282101715612c4557612c45612e21565b60405161016081016001600160401b0381118282101715612c4557612c45612e21565b604051601f8201601f191681016001600160401b0381118282101715612cb857612cb8612e21565b604052919050565b60006001600160401b03821115612cd957612cd9612e21565b5060051b60200190565b60008219821115612cf657612cf6612e0b565b500190565b600063ffffffff808316818516808303821115612d1a57612d1a612e0b565b01949350505050565b60006001600160401b03808316818516808303821115612d1a57612d1a612e0b565b600060ff821660ff84168060ff03821115612d6257612d62612e0b565b019392505050565b600082612d8557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612da457612da4612e0b565b500290565b600082821015612dbb57612dbb612e0b565b500390565b60005b83811015612ddb578181015183820152602001612dc3565b83811115612dea576000848401525b50505050565b6000600019821415612e0457612e04612e0b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfe6e6f74207369676e65642062792063757272656e7420677561726469616e20736574676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a264697066735822122042c40a33cbb5c7ae2dfd339b23293dd079cc42ced6a918d8a77b14d476f5a0b464736f6c63430008040033\";\nvar Implementation__factory = /** @class */ (function (_super) {\n __extends(Implementation__factory, _super);\n function Implementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Implementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Implementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Implementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Implementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Implementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Implementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Implementation__factory.bytecode = _bytecode;\n Implementation__factory.abi = _abi;\n return Implementation__factory;\n}(ContractFactory));\nexport { Implementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getCurrentGuardianSetIndex\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"getGuardianSet\",\n outputs: [\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getGuardianSetExpiry\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"messageFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"emitter\",\n type: \"address\",\n },\n ],\n name: \"nextSequence\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseAndVerifyVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"guardianSet\",\n type: \"tuple\",\n },\n ],\n name: \"verifySignatures\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50611722806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a9e118931161008c578063d60b347f11610066578063d60b347f1461023b578063eb8d3f1214610267578063f951975a1461027d578063fbe3c2cd1461029d57600080fd5b8063a9e11893146101f1578063b172b22214610211578063c0fd8bde1461021957600080fd5b80634cf842b5116100c85780634cf842b514610158578063875be02a146101a25780639a8a0592146101c3578063a0cce1b3146101de57600080fd5b80631a90a219146100ef5780631cfe7951146101065780632c3c02a414610125575b600080fd5b6007545b6040519081526020015b60405180910390f35b60035463ffffffff165b60405163ffffffff90911681526020016100fd565b610148610133366004610fe6565b60009081526005602052604090205460ff1690565b60405190151581526020016100fd565b61018a610166366004610fc5565b6001600160a01b03166000908152600460205260409020546001600160401b031690565b6040516001600160401b0390911681526020016100fd565b6101b56101b03660046111ab565b6102af565b6040516100fd929190611482565b60005461ffff165b60405161ffff90911681526020016100fd565b6101b56101ec366004610ffe565b610443565b6102046101ff366004611171565b610625565b6040516100fd9190611508565b6001546100f3565b61022c610227366004611105565b610a03565b6040516100fd9392919061151b565b610148610249366004610fc5565b6001600160a01b031660009081526006602052604090205460ff1690565b600354640100000000900463ffffffff16610110565b61029061028b3660046112ca565b610a65565b6040516100fd919061149d565b60005462010000900461ffff166101cb565b6000606060006102c3846101000151610a65565b805151909150610306576000604051806040016040528060148152602001731a5b9d985b1a590819dd585c991a585b881cd95d60621b8152509250925050915091565b60035463ffffffff1663ffffffff1684610100015163ffffffff1614158015610338575042816020015163ffffffff16105b1561037f5760006040518060400160405280601881526020017f677561726469616e2073657420686173206578706972656400000000000000008152509250925050915091565b61012084015151815151600a90600390610399908361166f565b6103a3919061164f565b6103ae90600261166f565b6103b8919061164f565b6103c3906001611612565b11156103f7576000604051806040016040528060098152602001686e6f2071756f72756d60b81b8152509250925050915091565b60008061040f86610140015187610120015185610443565b9150915081610425576000969095509350505050565b60016040518060200160405280600081525094509450505050915091565b600060606000805b855181101561060457600086828151811061047657634e487b7160e01b600052603260045260246000fd5b60200260200101519050816000148061049857508260ff16816060015160ff16115b6104f55760405162461bcd60e51b815260206004820152602360248201527f7369676e617475726520696e6469636573206d75737420626520617363656e64604482015262696e6760e81b60648201526084015b60405180910390fd5b6060810151865180519194509060ff851690811061052357634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001898360400151846000015185602001516040516000815260200160405260405161057c949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa15801561059e573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146105f1576000604051806040016040528060148152602001731593481cda59db985d1d5c99481a5b9d985b1a5960621b8152509450945050505061061d565b50806105fc816116a5565b91505061044b565b5060016040518060200160405280600081525092509250505b935093915050565b61062d610de2565b60006106398382610b04565b60ff168252610649600182611612565b9050816000015160ff166001146106a25760405162461bcd60e51b815260206004820152601760248201527f564d2076657273696f6e20696e636f6d70617469626c6500000000000000000060448201526064016104ec565b6106ac8382610b60565b63ffffffff166101008301526106c3600482611612565b905060006106d18483610b04565b60ff1690506106e1600183611612565b9150806001600160401b0381111561070957634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561075b57816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816107275790505b5061012084015260005b818110156108ca576107778584610b04565b846101200151828151811061079c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166060909101526107bd600184611612565b92506107c98584610bbd565b84610120015182815181106107ee57634e487b7160e01b600052603260045260246000fd5b6020026020010151600001818152505060208361080b9190611612565b92506108178584610bbd565b846101200151828151811061083c57634e487b7160e01b600052603260045260246000fd5b602002602001015160200181815250506020836108599190611612565b92506108658584610b04565b61087090601b61162a565b846101200151828151811061089557634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166040909101526108b6600184611612565b9250806108c2816116a5565b915050610765565b5060006108e6838487516108de919061168e565b879190610c1b565b9050808051906020012060405160200161090291815260200190565b60408051601f19818403018152919052805160209091012061014085015261092a8584610b60565b63ffffffff166020850152610940600484611612565b925061094c8584610b60565b63ffffffff166040850152610962600484611612565b925061096e8584610d28565b61ffff166060850152610982600284611612565b925061098e8584610bbd565b608085015261099e602084611612565b92506109aa8584610d85565b6001600160401b031660a08501526109c3600884611612565b92506109cf8584610b04565b60ff1660c08501526109e2600184611612565b92506109f5838487516108de919061168e565b60e085015250919392505050565b610a0b610de2565b60006060610a4e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062592505050565b9250610a59836102af565b93969095509293505050565b60408051808201825260608082526000602080840182905263ffffffff86168252600281529084902084518154928302810184018652948501828152939493909284928491840182828015610ae357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac5575b50505091835250506001919091015463ffffffff1660209091015292915050565b6000610b11826001611612565b83511015610b575760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016104ec565b50016001015190565b6000610b6d826004611612565b83511015610bb45760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016104ec565b50016004015190565b6000610bca826020611612565b83511015610c125760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016104ec565b50016020015190565b606081610c2981601f611612565b1015610c685760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016104ec565b610c728284611612565b84511015610cb65760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016104ec565b606082158015610cd55760405191506000825260208201604052610d1f565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015610d0e578051835260209283019201610cf6565b5050858452601f01601f1916604052505b50949350505050565b6000610d35826002611612565b83511015610d7c5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016104ec565b50016002015190565b6000610d92826008611612565b83511015610dd95760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016104ec565b50016008015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201819052610100820183905261012082015261014081019190915290565b80356001600160a01b0381168114610e5457600080fd5b919050565b600082601f830112610e69578081fd5b81356020610e7e610e79836115ef565b6115bf565b80838252828201915082860187848660071b8901011115610e9d578586fd5b855b85811015610f0057608080838b031215610eb7578788fd5b610ebf611552565b8335815286840135878201526040610ed8818601610fb4565b908201526060610ee9858201610fb4565b908201528552938501939190910190600101610e9f565b5090979650505050505050565b600082601f830112610f1d578081fd5b81356001600160401b03811115610f3657610f366116d6565b610f49601f8201601f19166020016115bf565b818152846020838601011115610f5d578283fd5b816020850160208301379081016020019190915292915050565b803561ffff81168114610e5457600080fd5b803563ffffffff81168114610e5457600080fd5b80356001600160401b0381168114610e5457600080fd5b803560ff81168114610e5457600080fd5b600060208284031215610fd6578081fd5b610fdf82610e3d565b9392505050565b600060208284031215610ff7578081fd5b5035919050565b600080600060608486031215611012578182fd5b833592506020808501356001600160401b0380821115611030578485fd5b61103c88838901610e59565b94506040870135915080821115611051578384fd5b9086019060408289031215611064578384fd5b61106c61157a565b82358281111561107a578586fd5b83019150601f8201891361108c578485fd5b813561109a610e79826115ef565b8082825286820191508685018c888560051b88010111156110b9578889fd5b8895505b838610156110e2576110ce81610e3d565b8352600195909501949187019187016110bd565b508352506110f39050838501610f89565b84820152809450505050509250925092565b60008060208385031215611117578182fd5b82356001600160401b038082111561112d578384fd5b818501915085601f830112611140578384fd5b81358181111561114e578485fd5b86602082850101111561115f578485fd5b60209290920196919550909350505050565b600060208284031215611182578081fd5b81356001600160401b03811115611197578182fd5b6111a384828501610f0d565b949350505050565b6000602082840312156111bc578081fd5b81356001600160401b03808211156111d2578283fd5b9083019061016082860312156111e6578283fd5b6111ee61159c565b6111f783610fb4565b815261120560208401610f89565b602082015261121660408401610f89565b604082015261122760608401610f77565b60608201526080830135608082015261124260a08401610f9d565b60a082015261125360c08401610fb4565b60c082015260e083013582811115611269578485fd5b61127587828601610f0d565b60e083015250610100611289818501610f89565b9082015261012083810135838111156112a0578586fd5b6112ac88828701610e59565b91830191909152506101409283013592810192909252509392505050565b6000602082840312156112db578081fd5b610fdf82610f89565b6000815180845260208085019450808401835b8381101561133c57815180518852838101518489015260408082015160ff908116918a01919091526060918201511690880152608090960195908201906001016112f7565b509495945050505050565b60008151808452815b8181101561136c57602081850181015186830182015201611350565b8181111561137d5782602083870101525b50601f01601f19169290920160200192915050565b805160ff168252600061016060208301516113b5602086018263ffffffff169052565b5060408301516113cd604086018263ffffffff169052565b5060608301516113e3606086018261ffff169052565b506080830151608085015260a083015161140860a08601826001600160401b03169052565b5060c083015161141d60c086018260ff169052565b5060e08301518160e086015261143582860182611347565b915050610100808401516114508287018263ffffffff169052565b5050610120808401518583038287015261146a83826112e4565b61014095860151969095019590955250919392505050565b82151581526040602082015260006111a36040830184611347565b6020808252825160408383015280516060840181905260009291820190839060808601905b808310156114eb5783516001600160a01b031682529284019260019290920191908401906114c2565b5063ffffffff848801511660408701528094505050505092915050565b602081526000610fdf6020830184611392565b60608152600061152e6060830186611392565b841515602084015282810360408401526115488185611347565b9695505050505050565b604051608081016001600160401b0381118282101715611574576115746116d6565b60405290565b604080519081016001600160401b0381118282101715611574576115746116d6565b60405161016081016001600160401b0381118282101715611574576115746116d6565b604051601f8201601f191681016001600160401b03811182821017156115e7576115e76116d6565b604052919050565b60006001600160401b03821115611608576116086116d6565b5060051b60200190565b60008219821115611625576116256116c0565b500190565b600060ff821660ff84168060ff03821115611647576116476116c0565b019392505050565b60008261166a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611689576116896116c0565b500290565b6000828210156116a0576116a06116c0565b500390565b60006000198214156116b9576116b96116c0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220863b3f073227824a01a091ff721a6cca3a68dcbc45c1aab0f0b47231bf68fc0d64736f6c63430008040033\";\nvar Messages__factory = /** @class */ (function (_super) {\n __extends(Messages__factory, _super);\n function Messages__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Messages__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Messages__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Messages__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Messages__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Messages__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Messages__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Messages__factory.bytecode = _bytecode;\n Messages__factory.abi = _abi;\n return Messages__factory;\n}(ContractFactory));\nexport { Messages__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [],\n name: \"last_completed_migration\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n constant: true,\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n constant: true,\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"completed\",\n type: \"uint256\",\n },\n ],\n name: \"setCompleted\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x6080604052600080546001600160a01b0319163317905534801561002257600080fd5b5061016f806100326000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610062578063fdacd5761461008d575b600080fd5b61004f60015481565b6040519081526020015b60405180910390f35b600054610075906001600160a01b031681565b6040516001600160a01b039091168152602001610059565b6100a061009b366004610121565b6100a2565b005b6000546001600160a01b0316331461011c5760405162461bcd60e51b815260206004820152603360248201527f546869732066756e6374696f6e206973207265737472696374656420746f207460448201527234329031b7b73a3930b1ba13b99037bbb732b960691b606482015260840160405180910390fd5b600155565b600060208284031215610132578081fd5b503591905056fea26469706673582212207b2f9522f0d055c7392478410b29558c7e466717fefd7b3fb26bef10badc57c564736f6c63430008040033\";\nvar Migrations__factory = /** @class */ (function (_super) {\n __extends(Migrations__factory, _super);\n function Migrations__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Migrations__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Migrations__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Migrations__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Migrations__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Migrations__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Migrations__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Migrations__factory.bytecode = _bytecode;\n Migrations__factory.abi = _abi;\n return Migrations__factory;\n}(ContractFactory));\nexport { Migrations__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_fromAsset\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"_toAsset\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"fromAsset\",\n outputs: [\n {\n internalType: \"contract IERC20\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"fromDecimals\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"toAsset\",\n outputs: [\n {\n internalType: \"contract IERC20\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"toDecimals\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"_amount\",\n type: \"uint256\",\n },\n ],\n name: \"add\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"_amount\",\n type: \"uint256\",\n },\n ],\n name: \"remove\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"_amount\",\n type: \"uint256\",\n },\n ],\n name: \"claim\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"_amount\",\n type: \"uint256\",\n },\n ],\n name: \"migrate\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b50604051620014f8380380620014f88339810160408190526200003491620002a6565b604080518082018252601481527f546f6b656e204d6967726174696f6e20506f6f6c00000000000000000000000060208083019182528351808501909452600b84526a04d69677261746f722d4c560ac1b9084015281519192916200009c91600391620001e3565b508051620000b2906004906020840190620001e3565b5050600580546001600160a01b038086166001600160a01b0319928316811790935560068054918616919092161790556040805163313ce56760e01b8152905191925063313ce567916004808301926020929190829003018186803b1580156200011b57600080fd5b505afa15801562000130573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001569190620002dd565b60ff16600781905550806001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200019957600080fd5b505afa158015620001ae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001d49190620002dd565b60ff1660085550620003449050565b828054620001f19062000307565b90600052602060002090601f01602090048101928262000215576000855562000260565b82601f106200023057805160ff191683800117855562000260565b8280016001018555821562000260579182015b828111156200026057825182559160200191906001019062000243565b506200026e92915062000272565b5090565b5b808211156200026e576000815560010162000273565b80516001600160a01b0381168114620002a157600080fd5b919050565b60008060408385031215620002b9578182fd5b620002c48362000289565b9150620002d46020840162000289565b90509250929050565b600060208284031215620002ef578081fd5b815160ff8116811462000300578182fd5b9392505050565b600181811c908216806200031c57607f821691505b602082108114156200033e57634e487b7160e01b600052602260045260246000fd5b50919050565b6111a480620003546000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80634cc82215116100ad57806395d89b411161007157806395d89b4114610262578063a457c2d71461026a578063a9059cbb1461027d578063dd62ed3e14610290578063f1354c08146102c957600080fd5b80634cc82215146101e95780634d92626a146101fc57806370a082311461020557806386e898431461022e57806392e404111461025957600080fd5b806323b872dd116100f457806323b872dd1461018e578063313ce567146101a1578063379607f5146101b057806339509351146101c3578063454b0608146101d657600080fd5b806306fdde0314610126578063095ea7b3146101445780631003e2d21461016757806318160ddd1461017c575b600080fd5b61012e6102dc565b60405161013b9190610f65565b60405180910390f35b610157610152366004610ee8565b61036e565b604051901515815260200161013b565b61017a610175366004610f31565b610385565b005b6002545b60405190815260200161013b565b61015761019c366004610ead565b6103aa565b6040516012815260200161013b565b61017a6101be366004610f31565b61045b565b6101576101d1366004610ee8565b61048e565b61017a6101e4366004610f31565b6104ca565b61017a6101f7366004610f31565b610506565b61018060075481565b610180610213366004610e61565b6001600160a01b031660009081526020819052604090205490565b600554610241906001600160a01b031681565b6040516001600160a01b03909116815260200161013b565b61018060085481565b61012e610527565b610157610278366004610ee8565b610536565b61015761028b366004610ee8565b6105cf565b61018061029e366004610e7b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600654610241906001600160a01b031681565b6060600380546102eb9061111d565b80601f01602080910402602001604051908101604052809291908181526020018280546103179061111d565b80156103645780601f1061033957610100808354040283529160200191610364565b820191906000526020600020905b81548152906001019060200180831161034757829003601f168201915b5050505050905090565b600061037b3384846105dc565b5060015b92915050565b60065461039d906001600160a01b0316333084610701565b6103a73382610772565b50565b60006103b7848484610851565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156104415760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61044e85338584036105dc565b60019150505b9392505050565b6104653382610a1f565b6005546008546007546103a7926001600160a01b0316913391610489919086610b6a565b610bcb565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161037b9185906104c5908690610f98565b6105dc565b6005546104e2906001600160a01b0316333084610701565b6006546007546008546103a7926001600160a01b0316913391610489919086610b6a565b6105103382610a1f565b6006546103a7906001600160a01b03163383610bcb565b6060600480546102eb9061111d565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156105b85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610438565b6105c533858584036105dc565b5060019392505050565b600061037b338484610851565b6001600160a01b03831661063e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610438565b6001600160a01b03821661069f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610438565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6040516001600160a01b038085166024830152831660448201526064810182905261076c9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610bfb565b50505050565b6001600160a01b0382166107c85760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610438565b80600260008282546107da9190610f98565b90915550506001600160a01b03821660009081526020819052604081208054839290610807908490610f98565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b0383166108b55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610438565b6001600160a01b0382166109175760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610438565b6001600160a01b0383166000908152602081905260409020548181101561098f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610438565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906109c6908490610f98565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a1291815260200190565b60405180910390a361076c565b6001600160a01b038216610a7f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610438565b6001600160a01b03821660009081526020819052604090205481811015610af35760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610438565b6001600160a01b0383166000908152602081905260408120838303905560028054849290610b229084906110da565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016106f4565b505050565b600082841115610b9a57610b7e83856110da565b610b8990600a611013565b610b939083610fb0565b9150610bc4565b82841015610bc457610bac84846110da565b610bb790600a611013565b610bc190836110bb565b91505b5092915050565b6040516001600160a01b038316602482015260448101829052610b6590849063a9059cbb60e01b90606401610735565b6000610c50826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610ccd9092919063ffffffff16565b805190915015610b655780806020019051810190610c6e9190610f11565b610b655760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610438565b6060610cdc8484600085610ce4565b949350505050565b606082471015610d455760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610438565b843b610d935760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610438565b600080866001600160a01b03168587604051610daf9190610f49565b60006040518083038185875af1925050503d8060008114610dec576040519150601f19603f3d011682016040523d82523d6000602084013e610df1565b606091505b5091509150610e01828286610e0c565b979650505050505050565b60608315610e1b575081610454565b825115610e2b5782518084602001fd5b8160405162461bcd60e51b81526004016104389190610f65565b80356001600160a01b0381168114610e5c57600080fd5b919050565b600060208284031215610e72578081fd5b61045482610e45565b60008060408385031215610e8d578081fd5b610e9683610e45565b9150610ea460208401610e45565b90509250929050565b600080600060608486031215610ec1578081fd5b610eca84610e45565b9250610ed860208501610e45565b9150604084013590509250925092565b60008060408385031215610efa578182fd5b610f0383610e45565b946020939093013593505050565b600060208284031215610f22578081fd5b81518015158114610454578182fd5b600060208284031215610f42578081fd5b5035919050565b60008251610f5b8184602087016110f1565b9190910192915050565b6020815260008251806020840152610f848160408501602087016110f1565b601f01601f19169190910160400192915050565b60008219821115610fab57610fab611158565b500190565b600082610fcb57634e487b7160e01b81526012600452602481fd5b500490565b600181815b8085111561100b578160001904821115610ff157610ff1611158565b80851615610ffe57918102915b93841c9390800290610fd5565b509250929050565b600061045483836000826110295750600161037f565b816110365750600061037f565b816001811461104c576002811461105657611072565b600191505061037f565b60ff84111561106757611067611158565b50506001821b61037f565b5060208310610133831016604e8410600b8410161715611095575081810a61037f565b61109f8383610fd0565b80600019048211156110b3576110b3611158565b029392505050565b60008160001904831182151516156110d5576110d5611158565b500290565b6000828210156110ec576110ec611158565b500390565b60005b8381101561110c5781810151838201526020016110f4565b8381111561076c5750506000910152565b600181811c9082168061113157607f821691505b6020821081141561115257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220d67982d65a0322ade3d9a38a36fb46dcea62d226886e73f6d270d2089a5c617f64736f6c63430008040033\";\nvar Migrator__factory = /** @class */ (function (_super) {\n __extends(Migrator__factory, _super);\n function Migrator__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Migrator__factory.prototype.deploy = function (_fromAsset, _toAsset, overrides) {\n return _super.prototype.deploy.call(this, _fromAsset, _toAsset, overrides || {});\n };\n Migrator__factory.prototype.getDeployTransaction = function (_fromAsset, _toAsset, overrides) {\n return _super.prototype.getDeployTransaction.call(this, _fromAsset, _toAsset, overrides || {});\n };\n Migrator__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Migrator__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Migrator__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Migrator__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Migrator__factory.bytecode = _bytecode;\n Migrator__factory.abi = _abi;\n return Migrator__factory;\n}(ContractFactory));\nexport { Migrator__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"gas\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n internalType: \"struct MinimalForwarder.ForwardRequest\",\n name: \"req\",\n type: \"tuple\",\n },\n {\n internalType: \"bytes\",\n name: \"signature\",\n type: \"bytes\",\n },\n ],\n name: \"execute\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n ],\n name: \"getNonce\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"gas\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n internalType: \"struct MinimalForwarder.ForwardRequest\",\n name: \"req\",\n type: \"tuple\",\n },\n {\n internalType: \"bytes\",\n name: \"signature\",\n type: \"bytes\",\n },\n ],\n name: \"verify\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x61012060405234801561001157600080fd5b50604080518082018252601081526f26b4b734b6b0b62337b93bb0b93232b960811b6020808301918252835180850185526005815264302e302e3160d81b908201529151902060c08181527fae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc19916381188560e08190524660a081815286517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818901969096526060810193909352608080840192909252308382015286518084039091018152919092019094528351939092019290922090526101005260805160a05160c05160e05161010051610b4461013360003960006104ce0152600061051d015260006104f80152600061047a015260006104a30152610b446000f3fe6080604052600436106100345760003560e01c80632d0335ab1461003957806347153f8214610082578063bf5d3bdb146100a3575b600080fd5b34801561004557600080fd5b5061006f6100543660046108fe565b6001600160a01b031660009081526020819052604090205490565b6040519081526020015b60405180910390f35b61009561009036600461092c565b6100d3565b604051610079929190610a19565b3480156100af57600080fd5b506100c36100be36600461092c565b610280565b6040519015158152602001610079565b600060606100e2858585610280565b61014e5760405162461bcd60e51b815260206004820152603260248201527f4d696e696d616c466f727761726465723a207369676e617475726520646f6573604482015271081b9bdd081b585d18da081c995c5d595cdd60721b60648201526084015b60405180910390fd5b61015d60808601356001610a9a565b60008061016d60208901896108fe565b6001600160a01b03166001600160a01b03168152602001908152602001600020819055506000808660200160208101906101a791906108fe565b6001600160a01b0316606088013560408901356101c760a08b018b610a55565b6101d460208d018d6108fe565b6040516020016101e6939291906109d4565b60408051601f1981840301815290829052610200916109fd565b600060405180830381858888f193505050503d806000811461023e576040519150601f19603f3d011682016040523d82523d6000602084013e610243565b606091505b509092509050610258603f6060890135610abe565b5a1161027457634e487b7160e01b600052600160045260246000fd5b90969095509350505050565b60008061039384848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061038d92507fdd8f4b70b0f4393e889bd39128a30628a78b61816a9eb8199759e7a349657e4891506102f0905060208a018a6108fe565b61030060408b0160208c016108fe565b60408b013560608c013560808d013561031c60a08f018f610a55565b60405161032a9291906109c4565b6040805191829003822060208301989098526001600160a01b0396871690820152949093166060850152608084019190915260a083015260c082015260e081019190915261010001604051602081830303815290604052805190602001206103fe565b90610452565b905060808501356000806103aa60208901896108fe565b6001600160a01b03166001600160a01b03168152602001908152602001600020541480156103f557506103e060208601866108fe565b6001600160a01b0316816001600160a01b0316145b95945050505050565b600061044c61040b610476565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b92915050565b6000806000610461858561056c565b9150915061046e816105dc565b509392505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614156104c757507f0000000000000000000000000000000000000000000000000000000000000000610569565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c090920190925280519101205b90565b6000808251604114156105a35760208301516040840151606085015160001a610597878285856107e2565b945094505050506105d5565b8251604014156105cd57602083015160408401516105c28683836108cf565b9350935050506105d5565b506000905060025b9250929050565b60008160048111156105fe57634e487b7160e01b600052602160045260246000fd5b1415610609576107df565b600181600481111561062b57634e487b7160e01b600052602160045260246000fd5b14156106795760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610145565b600281600481111561069b57634e487b7160e01b600052602160045260246000fd5b14156106e95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610145565b600381600481111561070b57634e487b7160e01b600052602160045260246000fd5b14156107645760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610145565b600481600481111561078657634e487b7160e01b600052602160045260246000fd5b14156107df5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610145565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561081957506000905060036108c6565b8460ff16601b1415801561083157508460ff16601c14155b1561084257506000905060046108c6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610896573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166108bf576000600192509250506108c6565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016108f0878288856107e2565b935093505050935093915050565b60006020828403121561090f578081fd5b81356001600160a01b0381168114610925578182fd5b9392505050565b600080600060408486031215610940578182fd5b833567ffffffffffffffff80821115610957578384fd5b9085019060c0828803121561096a578384fd5b9093506020850135908082111561097f578384fd5b818601915086601f830112610992578384fd5b8135818111156109a0578485fd5b8760208285010111156109b1578485fd5b6020830194508093505050509250925092565b6000828483379101908152919050565b6000838583375060609190911b6bffffffffffffffffffffffff19169101908152601401919050565b60008251610a0f818460208701610ade565b9190910192915050565b60008315158252604060208301528251806040840152610a40816060850160208701610ade565b601f01601f1916919091016060019392505050565b6000808335601e19843603018112610a6b578283fd5b83018035915067ffffffffffffffff821115610a85578283fd5b6020019150368190038213156105d557600080fd5b60008219821115610ab957634e487b7160e01b81526011600452602481fd5b500190565b600082610ad957634e487b7160e01b81526012600452602481fd5b500490565b60005b83811015610af9578181015183820152602001610ae1565b83811115610b08576000848401525b5050505056fea264697066735822122053d18eea9cfddf3496703497ba0711c4caff2d2220280bab4776f1f67731324c64736f6c63430008030033\";\nvar MinimalForwarder__factory = /** @class */ (function (_super) {\n __extends(MinimalForwarder__factory, _super);\n function MinimalForwarder__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MinimalForwarder__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MinimalForwarder__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MinimalForwarder__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MinimalForwarder__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MinimalForwarder__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MinimalForwarder__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MinimalForwarder__factory.bytecode = _bytecode;\n MinimalForwarder__factory.abi = _abi;\n return MinimalForwarder__factory;\n}(ContractFactory));\nexport { MinimalForwarder__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"WETH\",\n outputs: [\n {\n internalType: \"contract IWETH\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"tokenAddress\",\n type: \"address\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"attestToken\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransfer\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransferAndUnwrapETH\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"createWrapped\",\n outputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.AssetMeta\",\n name: \"meta\",\n type: \"tuple\",\n },\n ],\n name: \"encodeAssetMeta\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"fee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct BridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n name: \"encodeTransfer\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"outstandingBridged\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseAssetMeta\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.AssetMeta\",\n name: \"meta\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransfer\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"payloadID\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"fee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct BridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct BridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"arbiterFee\",\n type: \"uint256\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"transferTokens\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"updateWrapped\",\n outputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"arbiterFee\",\n type: \"uint256\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"wrapAndTransferETH\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n {\n inputs: [],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"testNewImplementationActive\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"WETH\",\n type: \"address\",\n },\n ],\n name: \"testUpdateWETHAddress\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50614deb806100206000396000f3fe6080604052600436106200020f5760003560e01c8063a5799f931162000117578063c48fa11511620000a1578063f768441f116200006c578063f768441f14620007bf578063fbe3c2cd14620007e4578063fbeeacd91462000805578063ff200cde146200086557600080fd5b8063c48fa1151462000721578063c68785191462000738578063d60b347f146200075d578063e8059810146200079a57600080fd5b8063b046223b11620000e2578063b046223b146200066e578063b172b2221462000693578063b626814614620006aa578063b96c7e4d14620006e757600080fd5b8063a5799f9314620005b1578063aa4efa5b14620005d6578063ad5c4648146200060a578063ad66a5f1146200062a57600080fd5b80632c3c02a411620001995780638129fc1c11620001645780638129fc1c146200053857806384acd1bb14620005505780639981509f14620005705780639a8a0592146200058757600080fd5b80632c3c02a414620004985780632f3a3d5d14620004cc5780635c60da1b14620004ec5780635f854266146200050457600080fd5b80631f8cdb2b11620001da5780631f8cdb2b14620003945780631ff1e28614620003aa5780632539464514620003e85780632b511375146200040f57600080fd5b806301f53255146200021c57806307dfd8fb146200029a5780630f5287b014620003165780631a2be4da146200034657600080fd5b366200021757005b600080fd5b3480156200022957600080fd5b50620002416200023b36600462003ae4565b6200088a565b604051620002919190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620002a757600080fd5b50620002bf620002b936600462003ae4565b62000a94565b604051620002919190600060c08201905060ff83511682526020830151602083015261ffff604084015116604083015260ff60608401511660608301526080830151608083015260a083015160a083015292915050565b6200032d62000327366004620039ef565b62000c23565b6040516001600160401b03909116815260200162000291565b3480156200035357600080fd5b506200038362000365366004620039d2565b6001600160a01b031660009081526009602052604090205460ff1690565b604051901515815260200162000291565b348015620003a157600080fd5b50600162000383565b348015620003b757600080fd5b50620003cf620003c936600462003e80565b620010b0565b6040516001600160a01b03909116815260200162000291565b348015620003f557600080fd5b506200040d6200040736600462003ae4565b620010df565b005b3480156200041c57600080fd5b50620004346200042e36600462003ae4565b620011c3565b604051620002919190600060e08201905060ff83511682526020830151602083015260408301516040830152606083015161ffff8082166060850152608085015160808501528060a08601511660a0850152505060c083015160c083015292915050565b348015620004a557600080fd5b5062000383620004b736600462003ab2565b60009081526005602052604090205460ff1690565b348015620004d957600080fd5b506001546001600160a01b0316620003cf565b348015620004f957600080fd5b50620003cf62001378565b3480156200051157600080fd5b50620005296200052336600462003c2e565b62001392565b60405162000291919062003fdd565b3480156200054557600080fd5b506200040d62001427565b3480156200055d57600080fd5b506000546001600160a01b0316620003cf565b6200032d6200058136600462003eae565b620014f1565b3480156200059457600080fd5b5060025461ffff165b60405161ffff909116815260200162000291565b348015620005be57600080fd5b506200040d620005d036600462003ae4565b6200177f565b348015620005e357600080fd5b5062000383620005f536600462003ab2565b60009081526006602052604090205460ff1690565b3480156200061757600080fd5b506004546001600160a01b0316620003cf565b3480156200063757600080fd5b506200065f6200064936600462003e42565b61ffff166000908152600b602052604090205490565b60405190815260200162000291565b3480156200067b57600080fd5b50620005296200068d36600462003b94565b620018ec565b348015620006a057600080fd5b506003546200065f565b348015620006b757600080fd5b506200040d620006c9366004620039d2565b600480546001600160a01b0319166001600160a01b03831617905550565b348015620006f457600080fd5b506200065f62000706366004620039d2565b6001600160a01b03166000908152600a602052604090205490565b6200032d6200073236600462003a5a565b62001965565b3480156200074557600080fd5b506200040d6200075736600462003ae4565b62001c65565b3480156200076a57600080fd5b50620003836200077c366004620039d2565b6001600160a01b031660009081526007602052604090205460ff1690565b348015620007a757600080fd5b50620003cf620007b936600462003ae4565b62001c72565b348015620007cc57600080fd5b50620003cf620007de36600462003ae4565b62001d91565b348015620007f157600080fd5b5060025462010000900461ffff166200059d565b3480156200081257600080fd5b506200082a6200082436600462003ae4565b62001ea6565b6040516200029191908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b3480156200087257600080fd5b506200040d6200088436600462003ae4565b62002081565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290620008c183826200208e565b8252620008d0602082620041ad565b82519091506a546f6b656e42726964676514620009405760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b6200094c8382620020f0565b60ff16602083015262000961600182620041ad565b9050816020015160ff16600114620009c85760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840162000937565b620009d4838262002150565b61ffff166040830152620009ea600282620041ad565b9050620009f8838262002150565b61ffff16606083015262000a0e600282620041ad565b905062000a1c83826200208e565b608083015262000a2e602082620041ad565b90508083511462000a8e5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840162000937565b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529062000ad28382620020f0565b60ff16825262000ae4600182620041ad565b9050816000015160ff1660021462000b335760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000937565b62000b3f83826200208e565b60208084019190915262000b549082620041ad565b905062000b62838262002150565b61ffff16604083015262000b78600282620041ad565b905062000b868382620020f0565b60ff16606083015262000b9b600182620041ad565b905062000ba983826200208e565b608083015262000bbb602082620041ad565b905062000bc983826200208e565b60a083015262000bdb602082620041ad565b90508083511462000a8e5760405162461bcd60e51b8152602060048201526011602482015270696e76616c69642041737365744d65746160781b604482015260640162000937565b600080600062000c4b896001600160a01b031660009081526009602052604090205460ff1690565b1562000d4557886001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000c8b57600080fd5b505afa15801562000ca0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cc6919062003e61565b9150886001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000d0257600080fd5b505afa15801562000d17573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d3d919062003acb565b905062000d59565b505060025461ffff166001600160a01b0388165b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b038c169162000d9d919062003f66565b600060405180830381855afa9150503d806000811462000dda576040519150601f19603f3d011682016040523d82523d6000602084013e62000ddf565b606091505b5091505060008180602001905181019062000dfb919062003f19565b905062000e1462000e0d8b83620021b1565b82620021f0565b995062000e2460025461ffff1690565b61ffff168461ffff16141562000fd257604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17905290516000916001600160a01b038e169162000e89919062003f66565b600060405180830381855afa9150503d806000811462000ec6576040519150601f19603f3d011682016040523d82523d6000602084013e62000ecb565b606091505b5091505060008180602001905181019062000ee7919062003acb565b905062000ef78d33308f62002225565b6040513060248201526000906001600160a01b038f16906370a0823160e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000f5a919062003f66565b600060405180830381855afa9150503d806000811462000f97576040519150601f19603f3d011682016040523d82523d6000602084013e62000f9c565b606091505b5091505060008180602001905181019062000fb8919062003acb565b905062000fc6838262004313565b9d505050505062001043565b62000fe08b33308d62002225565b604051632770a7eb60e21b8152306004820152602481018b90526001600160a01b038c1690639dc29fac90604401600060405180830381600087803b1580156200102957600080fd5b505af11580156200103e573d6000803e3d6000fd5b505050505b6000620010518b83620021b1565b90506000620010618984620021b1565b90506200107160025461ffff1690565b61ffff168661ffff1614156200108d576200108d8d8362002298565b6200109f8686848e8e86348f62002365565b9d9c50505050505050505050505050565b61ffff821660009081526008602090815260408083208484529091529020546001600160a01b03165b92915050565b6000806000620010ef84620024a3565b925092509250818190620011185760405162461bcd60e51b815260040162000937919062003fdd565b506200113e8361014001516000908152600560205260409020805460ff19166001179055565b60006200114f8460e0015162001ea6565b90506200115f60025461ffff1690565b61ffff16816040015161ffff1614620011ac5760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640162000937565b6060810151620011bc90620026d2565b5050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905290620012088382620020f0565b60ff1682526200121a600182620041ad565b9050816000015160ff16600114620012685760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000937565b62001274838262002809565b602080840191909152620012899082620041ad565b90506200129783826200208e565b6040830152620012a9602082620041ad565b9050620012b7838262002150565b61ffff166060830152620012cd600282620041ad565b9050620012db83826200208e565b6080830152620012ed602082620041ad565b9050620012fb838262002150565b61ffff1660a083015262001311600282620041ad565b90506200131f838262002809565b60c083015262001331602082620041ad565b90508083511462000a8e5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000937565b60006200138d6001546001600160a01b031690565b905090565b8051602080830151604080850151606080870151608088015160a089015160c08a0151955160f89990991b6001600160f81b031916978901979097526021880195909552604187019290925260f091821b6001600160f01b03199081166061880152606387019490945293901b909116608384015260858301529060a5015b6040516020818303038152906040529050919050565b60006200145b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001480816001600160a01b031660009081526007602052604090205460ff1690565b15620014c55760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640162000937565b620014ee816001600160a01b03166000908152600760205260409020805460ff19166001179055565b50565b600080620015076000546001600160a01b031690565b6001600160a01b0316631a90a2196040518163ffffffff1660e01b815260040160206040518083038186803b1580156200154057600080fd5b505afa15801562001555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200157b919062003acb565b9050348110620015d95760405162461bcd60e51b815260206004820152602260248201527f76616c756520697320736d616c6c6572207468616e20776f726d686f6c652066604482015261656560f01b606482015260840162000937565b6000620015e7823462004313565b905080851115620016505760405162461bcd60e51b815260206004820152602c60248201527f66656520697320626967676572207468616e20616d6f756e74206d696e75732060448201526b776f726d686f6c652066656560a01b606482015260840162000937565b60006200165f826012620021b1565b9050600062001670876012620021b1565b9050600062001681836012620021f0565b6200168d908562004313565b90508015620016c657604051339082156108fc029083906000818181858888f19350505050158015620016c4573d6000803e3d6000fd5b505b6004546001600160a01b031663d0e30db0620016e3838762004313565b6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156200170f57600080fd5b505af115801562001724573d6000803e3d6000fd5b505050505062001747620017406004546001600160a01b031690565b8462002298565b620017716200175960025461ffff1690565b6004546001600160a01b0316858d8d878b8e62002365565b9a9950505050505050505050565b60008060006200178f84620024a3565b925092509250818190620017b85760405162461bcd60e51b815260040162000937919062003fdd565b50620017de8361014001516000908152600560205260409020805460ff19166001179055565b6000620017ef8460e001516200088a565b9050620017ff60025461ffff1690565b61ffff16816040015161ffff1614806200181f5750604081015161ffff16155b620018605760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640162000937565b606081015161ffff166000908152600b602052604081205414620018c75760405162461bcd60e51b815260206004820152601860248201527f636861696e20616c726561647920726567697374657265640000000000000000604482015260640162000937565b620011bc8160600151826080015161ffff9091166000908152600b6020526040902055565b8051602080830151604080850151606080870151608088015160a0890151945160f898891b6001600160f81b031990811698820198909852602181019690965260f09390931b6001600160f01b031916604186015290951b90931660438301526044820192909252606481019190915260840162001411565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b179052905160009182916001600160a01b03861691620019aa9162003f66565b600060405180830381855afa9150503d8060008114620019e7576040519150601f19603f3d011682016040523d82523d6000602084013e620019ec565b606091505b5060408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b1790529051919350600092506001600160a01b0387169162001a35919062003f66565b600060405180830381855afa9150503d806000811462001a72576040519150601f19603f3d011682016040523d82523d6000602084013e62001a77565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b0388169162001ac0919062003f66565b600060405180830381855afa9150503d806000811462001afd576040519150601f19603f3d011682016040523d82523d6000602084013e62001b02565b606091505b5091505060008380602001905181019062001b1e919062003f19565b905060008380602001905181019062001b38919062003b5e565b905060008380602001905181019062001b52919062003b5e565b9050600080602084015191506020830151905060006040518060c00160405280600260ff1681526020018d6001600160a01b031660001b815260200162001b9c60025461ffff1690565b61ffff1681526020018760ff168152602001848152602001838152509050600062001bc782620018ec565b905062001bdc6000546001600160a01b031690565b6001600160a01b031663b19a437e348e84600f6040518563ffffffff1660e01b815260040162001c0f93929190620040cb565b6020604051808303818588803b15801562001c2957600080fd5b505af115801562001c3e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906200109f919062003efc565b620014ee81600062002862565b60008060008062001c8b6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001cb8919062003fdd565b60006040518083038186803b15801562001cd157600080fd5b505afa15801562001ce6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001d10919081019062003cd3565b92509250925081819062001d395760405162461bcd60e51b815260040162000937919062003fdd565b5062001d458362002f3d565b62001d645760405162461bcd60e51b81526004016200093790620040a2565b600062001d758460e0015162000a94565b905062001d87818560a0015162002f7a565b9695505050505050565b60008060008062001daa6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b815260040162001dd7919062003fdd565b60006040518083038186803b15801562001df057600080fd5b505afa15801562001e05573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001e2f919081019062003cd3565b92509250925081819062001e585760405162461bcd60e51b815260040162000937919062003fdd565b5062001e648362002f3d565b62001e835760405162461bcd60e51b81526004016200093790620040a2565b600062001e948460e0015162000a94565b905062001d87818560a001516200322b565b60408051608081018252600080825260208201819052918101829052606081018290529062001ed683826200208e565b825262001ee5602082620041ad565b82519091506a546f6b656e4272696467651462001f535760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840162000937565b62001f5f8382620020f0565b60ff16602083015262001f74600182620041ad565b9050816020015160ff1660021462001fdd5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840162000937565b62001fe9838262002150565b61ffff16604083015262001fff600282620041ad565b90506200200d83826200208e565b60608301526200201f602082620041ad565b90508083511462000a8e5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840162000937565b620014ee81600162002862565b60006200209d826020620041ad565b83511015620020e75760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640162000937565b50016020015190565b6000620020ff826001620041ad565b83511015620021475760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640162000937565b50016001015190565b60006200215f826002620041ad565b83511015620021a85760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640162000937565b50016002015190565b600060088260ff161115620021e957620021cd6008836200432d565b620021da90600a62004232565b620021e69084620041c8565b92505b5090919050565b600060088260ff161115620021e9576200220c6008836200432d565b6200221990600a62004232565b620021e69084620042f1565b6040516001600160a01b0380851660248301528316604482015260648101829052620022929085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262003326565b50505050565b6001600160a01b0382166000908152600a60205260409020546001600160401b03620022c58383620041ad565b1115620023335760405162461bcd60e51b815260206004820152603560248201527f7472616e736665722065786365656473206d6178206f75747374616e64696e6760448201527408189c9a5919d959081d1bdad95b88185b5bdd5b9d605a1b606482015260840162000937565b6200236083620023448484620041ad565b6001600160a01b039091166000908152600a6020526040902055565b505050565b600086841115620023ae5760405162461bcd60e51b815260206004820152601260248201527119995948195e18d959591cc8185b5bdd5b9d60721b604482015260640162000937565b6040805160e081018252600181526020810189905290810189905261ffff808b16606083015260808201879052871660a082015260c081018590526000620023f68262001392565b90506200240b6000546001600160a01b031690565b6001600160a01b031663b19a437e868684600f6040518563ffffffff1660e01b81526004016200243e93929190620040cb565b6020604051808303818588803b1580156200245857600080fd5b505af11580156200246d573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002494919062003efc565b9b9a5050505050505050505050565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620025176000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b815260040162002544919062003fdd565b60006040518083038186803b1580156200255d57600080fd5b505afa15801562002572573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200259c919081019062003cd3565b92509250925081620025b55791945092509050620026cb565b60025462010000900461ffff1661ffff16836060015161ffff1614620026135750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050620026cb565b6003548360800151146200266657505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050620026cb565b61014083015160009081526005602052604090205460ff1615620026b05782600060405180606001604052806022815260200162004d9460229139955095509550505050620026cb565b50506040805160208101909152600081529093506001925090505b9193909250565b6000620027067f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506200271382620033ff565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620027589162003f66565b600060405180830381855af49150503d806000811462002795576040519150601f19603f3d011682016040523d82523d6000602084013e6200279a565b606091505b5091509150818190620027c25760405162461bcd60e51b815260040162000937919062003fdd565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062002818826020620041ad565b83511015620020e75760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b604482015260640162000937565b60008060006200287a6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b8152600401620028a7919062003fdd565b60006040518083038186803b158015620028c057600080fd5b505afa158015620028d5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620028ff919081019062003cd3565b925092509250818190620029285760405162461bcd60e51b815260040162000937919062003fdd565b50620029348362002f3d565b620029535760405162461bcd60e51b81526004016200093790620040a2565b6000620029648460e00151620011c3565b90506200298584610140015160009081526006602052604090205460ff1690565b15620029d45760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c65746564000000000000604482015260640162000937565b620029f98461014001516000908152600660205260409020805460ff19166001179055565b60025461ffff1661ffff168160a0015161ffff161462002a535760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b604482015260640162000937565b600062002a6360025461ffff1690565b61ffff16826060015161ffff16141562002a9557506040810151602082015162002a8f90829062003441565b62002b16565b600062002aab83606001518460400151620010b0565b90506001600160a01b03811662002b135760405162461bcd60e51b815260206004820152602560248201527f6e6f207772617070657220666f72207468697320746f6b656e2063726561746560448201526419081e595d60da1b606482015260840162000937565b90505b85158062002b3157506004546001600160a01b038281169116145b62002b8b5760405162461bcd60e51b815260206004820152602360248201527f696e76616c696420746f6b656e2c2063616e206f6e6c7920756e77726170205760448201526208aa8960eb1b606482015260840162000937565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000916001600160a01b0384169162002bcf919062003f66565b600060405180830381855afa9150503d806000811462002c0c576040519150601f19603f3d011682016040523d82523d6000602084013e62002c11565b606091505b5091505060008180602001905181019062002c2d919062003f19565b9050600062002c41856020015183620021f0565b9050600062002c558660c0015184620021f0565b9050801562002de4578181111562002cbb5760405162461bcd60e51b815260206004820152602260248201527f66656520686967686572207468616e207472616e7366657272656420616d6f756044820152611b9d60f21b606482015260840162000937565b891562002d555760048054604051632e1a7d4d60e01b81529182018390526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002d0757600080fd5b505af115801562002d1c573d6000803e3d6000fd5b505060405133925083156108fc02915083906000818181858888f1935050505015801562002d4e573d6000803e3d6000fd5b5062002de4565b60025461ffff1661ffff16866060015161ffff161462002dd7576040516340c10f1960e01b8152336004820152602481018290526001600160a01b038616906340c10f1990604401600060405180830381600087803b15801562002db857600080fd5b505af115801562002dcd573d6000803e3d6000fd5b5050505062002de4565b62002de485338362003477565b600062002df2828462004313565b60808801519091508b1562002e9d5760048054604051632e1a7d4d60e01b81529182018490526001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801562002e4657600080fd5b505af115801562002e5b573d6000803e3d6000fd5b50506040516001600160a01b038416925084156108fc02915084906000818181858888f1935050505015801562002e96573d6000803e3d6000fd5b5062002f2e565b60025461ffff1661ffff16886060015161ffff161462002f21576040516340c10f1960e01b81526001600160a01b038281166004830152602482018490528816906340c10f1990604401600060405180830381600087803b15801562002f0257600080fd5b505af115801562002f17573d6000803e3d6000fd5b5050505062002f2e565b62002f2e87828462003477565b50505050505050505050505050565b6000816080015162002f63836060015161ffff166000908152600b602052604090205490565b141562002f7257506001919050565b506000919050565b600062002f8a60025461ffff1690565b61ffff16836040015161ffff16141562002ff85760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b606482015260840162000937565b60006001600160a01b03166200301784604001518560200151620010b0565b6001600160a01b0316146200306f5760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c72656164792065786973747300000000604482015260640162000937565b600063c71f461560e01b620030888560a00151620034a9565b620030978660800151620034a9565b8660600151863089604001518a60200151604051602401620030c0979695949392919062004035565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b031990951694909417909352519092506000916200310a91309185910162003fb7565b60405160208183030381529060405290506000604051806020016200312f9062003816565b601f1982820381018352601f909101166040819052620031559190849060200162003f84565b60405160208183030381529060405290506000866040015187602001516040516020016200319c92919060f09290921b6001600160f01b0319168252600282015260220190565b604051602081830303815290604052805190602001209050808251602084016000f59450843b620031cc57600080fd5b6040808801516020808a015161ffff90921660009081526008825283812092815291815282822080546001600160a01b0319166001600160a01b038a1690811790915582526009905220805460ff191660011790555050505092915050565b6000806200324284604001518560200151620010b0565b90506001600160a01b0381166200329c5760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420617373657420646f6573206e6f7420657869737473000000604482015260640162000937565b806001600160a01b031663a18cd7c6620032ba8660a00151620034a9565b620032c98760800151620034a9565b866040518463ffffffff1660e01b8152600401620032ea9392919062003ff2565b600060405180830381600087803b1580156200330557600080fd5b505af11580156200331a573d6000803e3d6000fd5b50929695505050505050565b60006200337d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620035e49092919063ffffffff16565b8051909150156200236057808060200190518101906200339e919062003a95565b620023605760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000937565b6200340a81620035ff565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b62003473828262003467856001600160a01b03166000908152600a602052604090205490565b62002344919062004313565b5050565b6040516001600160a01b0383166024820152604481018290526200236090849063a9059cbb60e01b906064016200225a565b606060005b602081108015620034ec5750828160208110620034db57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b15620035075780620034fe8162004382565b915050620034ae565b6000816001600160401b038111156200353057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156200355b576020820181803683370190505b50905060005b82811015620035dc578481602081106200358b57634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110620035b057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620035d38162004382565b91505062003561565b509392505050565b6060620035f58484600085620036a6565b90505b9392505050565b803b620036655760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000937565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606082471015620037095760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000937565b843b620037595760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000937565b600080866001600160a01b0316858760405162003777919062003f66565b60006040518083038185875af1925050503d8060008114620037b6576040519150601f19603f3d011682016040523d82523d6000602084013e620037bb565b606091505b5091509150620037cd828286620037d8565b979650505050505050565b60608315620037e9575081620035f8565b825115620037fa5782518084602001fd5b8160405162461bcd60e51b815260040162000937919062003fdd565b610993806200440183390190565b80356001600160a01b03811681146200383c57600080fd5b919050565b600082601f83011262003852578081fd5b815160206001600160401b03821115620038705762003870620043b6565b62003880818360051b0162004150565b80838252828201915082860187848660071b8901011115620038a0578586fd5b855b858110156200391057608080838b031215620038bc578788fd5b620038c6620040ff565b835181528684015187820152604080850151620038e381620043f0565b90820152606084810151620038f881620043f0565b908201528552938501939190910190600101620038a2565b5090979650505050505050565b805180151581146200383c57600080fd5b600082601f8301126200393f578081fd5b815162003956620039508262004183565b62004150565b8181528460208386010111156200396b578283fd5b6200397e82602083016020870162004353565b949350505050565b80356200383c81620043cc565b80516200383c81620043cc565b80516200383c81620043dd565b80516001600160401b03811681146200383c57600080fd5b80516200383c81620043f0565b600060208284031215620039e4578081fd5b620035f88262003824565b60008060008060008060c0878903121562003a08578182fd5b62003a138762003824565b955060208701359450604087013562003a2c81620043cc565b9350606087013592506080870135915060a087013562003a4c81620043dd565b809150509295509295509295565b6000806040838503121562003a6d578182fd5b62003a788362003824565b9150602083013562003a8a81620043dd565b809150509250929050565b60006020828403121562003aa7578081fd5b620035f8826200391d565b60006020828403121562003ac4578081fd5b5035919050565b60006020828403121562003add578081fd5b5051919050565b60006020828403121562003af6578081fd5b81356001600160401b0381111562003b0c578182fd5b8201601f8101841362003b1d578182fd5b803562003b2e620039508262004183565b81815285602083850101111562003b43578384fd5b81602084016020830137908101602001929092525092915050565b60006020828403121562003b70578081fd5b81516001600160401b0381111562003b86578182fd5b6200397e848285016200392e565b600060c0828403121562003ba6578081fd5b60405160c081018181106001600160401b038211171562003bcb5762003bcb620043b6565b604052823562003bdb81620043f0565b815260208381013590820152604083013562003bf781620043cc565b6040820152606083013562003c0c81620043f0565b60608201526080838101359082015260a0928301359281019290925250919050565b600060e0828403121562003c40578081fd5b60405160e081018181106001600160401b038211171562003c655762003c65620043b6565b604052823562003c7581620043f0565b808252506020830135602082015260408301356040820152606083013562003c9d81620043cc565b60608201526080838101359082015262003cba60a0840162003986565b60a082015260c083013560c08201528091505092915050565b60008060006060848603121562003ce8578081fd5b83516001600160401b038082111562003cff578283fd5b90850190610160828803121562003d14578283fd5b62003d1e6200412a565b62003d2983620039c5565b815262003d3960208401620039a0565b602082015262003d4c60408401620039a0565b604082015262003d5f6060840162003993565b60608201526080830151608082015262003d7c60a08401620039ad565b60a082015262003d8f60c08401620039c5565b60c082015260e08301518281111562003da6578485fd5b62003db4898286016200392e565b60e08301525061010062003dca818501620039a0565b90820152610120838101518381111562003de2578586fd5b62003df08a82870162003841565b91830191909152506101408381015190820152945062003e13602087016200391d565b9350604086015191508082111562003e29578283fd5b5062003e38868287016200392e565b9150509250925092565b60006020828403121562003e54578081fd5b8135620035f881620043cc565b60006020828403121562003e73578081fd5b8151620035f881620043cc565b6000806040838503121562003e93578182fd5b823562003ea081620043cc565b946020939093013593505050565b6000806000806080858703121562003ec4578182fd5b843562003ed181620043cc565b93506020850135925060408501359150606085013562003ef181620043dd565b939692955090935050565b60006020828403121562003f0e578081fd5b620035f882620039ad565b60006020828403121562003f2b578081fd5b8151620035f881620043f0565b6000815180845262003f5281602086016020860162004353565b601f01601f19169290920160200192915050565b6000825162003f7a81846020870162004353565b9190910192915050565b6000835162003f9881846020880162004353565b83519083019062003fae81836020880162004353565b01949350505050565b6001600160a01b0383168152604060208201819052600090620035f59083018462003f38565b602081526000620035f8602083018462003f38565b60608152600062004007606083018662003f38565b82810360208401526200401b818662003f38565b9150506001600160401b0383166040830152949350505050565b60e0815260006200404a60e083018a62003f38565b82810360208401526200405e818a62003f38565b60ff98909816604084015250506001600160401b039490941660608501526001600160a01b0392909216608084015261ffff1660a083015260c09091015292915050565b6020808252600f908201526e34b73b30b634b21032b6b4ba3a32b960891b604082015260600190565b63ffffffff84168152606060208201526000620040ec606083018562003f38565b905060ff83166040830152949350505050565b604051608081016001600160401b0381118282101715620041245762004124620043b6565b60405290565b60405161016081016001600160401b0381118282101715620041245762004124620043b6565b604051601f8201601f191681016001600160401b03811182821017156200417b576200417b620043b6565b604052919050565b60006001600160401b038211156200419f576200419f620043b6565b50601f01601f191660200190565b60008219821115620041c357620041c3620043a0565b500190565b600082620041e457634e487b7160e01b81526012600452602481fd5b500490565b600181815b808511156200422a5781600019048211156200420e576200420e620043a0565b808516156200421c57918102915b93841c9390800290620041ee565b509250929050565b6000620035f860ff8416836000826200424e57506001620010d9565b816200425d57506000620010d9565b81600181146200427657600281146200428157620042a1565b6001915050620010d9565b60ff841115620042955762004295620043a0565b50506001821b620010d9565b5060208310610133831016604e8410600b8410161715620042c6575081810a620010d9565b620042d28383620041e9565b8060001904821115620042e957620042e9620043a0565b029392505050565b60008160001904831182151516156200430e576200430e620043a0565b500290565b600082821015620043285762004328620043a0565b500390565b600060ff821660ff8416808210156200434a576200434a620043a0565b90039392505050565b60005b838110156200437057818101518382015260200162004356565b83811115620022925750506000910152565b6000600019821415620043995762004399620043a0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff81168114620014ee57600080fd5b63ffffffff81168114620014ee57600080fd5b60ff81168114620014ee57600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220521d7daf3182891ba7cea317a1611cd4f09f466d5b9033e1aa90969dca97253d64736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a264697066735822122039ec556fbe32839cf73a76e40bab4dae4f8d22cac8a8cd125be4ab6f3dc8b5b564736f6c63430008040033\";\nvar MockBridgeImplementation__factory = /** @class */ (function (_super) {\n __extends(MockBridgeImplementation__factory, _super);\n function MockBridgeImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockBridgeImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockBridgeImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockBridgeImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockBridgeImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockBridgeImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockBridgeImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockBridgeImplementation__factory.bytecode = _bytecode;\n MockBridgeImplementation__factory.abi = _abi;\n return MockBridgeImplementation__factory;\n}(ContractFactory));\nexport { MockBridgeImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"GuardianSetAdded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n indexed: false,\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n ],\n name: \"LogMessagePublished\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getCurrentGuardianSetIndex\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"index\",\n type: \"uint32\",\n },\n ],\n name: \"getGuardianSet\",\n outputs: [\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getGuardianSetExpiry\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"messageFee\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"emitter\",\n type: \"address\",\n },\n ],\n name: \"nextSequence\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseAndVerifyVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct GovernanceStructs.ContractUpgrade\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseGuardianSetUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"newGuardianSet\",\n type: \"tuple\",\n },\n {\n internalType: \"uint32\",\n name: \"newGuardianSetIndex\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct GovernanceStructs.GuardianSetUpgrade\",\n name: \"gsu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedSetMessageFee\",\n type: \"bytes\",\n },\n ],\n name: \"parseSetMessageFee\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"messageFee\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct GovernanceStructs.SetMessageFee\",\n name: \"smf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedTransferFees\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransferFees\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct GovernanceStructs.TransferFees\",\n name: \"tf\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"parseVM\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n ],\n name: \"publishMessage\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitContractUpgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitNewGuardianSet\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitSetMessageFee\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"_vm\",\n type: \"bytes\",\n },\n ],\n name: \"submitTransferFees\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n components: [\n {\n internalType: \"address[]\",\n name: \"keys\",\n type: \"address[]\",\n },\n {\n internalType: \"uint32\",\n name: \"expirationTime\",\n type: \"uint32\",\n },\n ],\n internalType: \"struct Structs.GuardianSet\",\n name: \"guardianSet\",\n type: \"tuple\",\n },\n ],\n name: \"verifySignatures\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n {\n internalType: \"string\",\n name: \"reason\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n {\n inputs: [],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"testNewImplementationActive\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50612fc1806100206000396000f3fe60806040526004361061016a5760003560e01c8063875be02a116100d1578063b19a437e1161008a578063eb8d3f1211610064578063eb8d3f12146105ff578063f42bc64114610622578063f951975a14610642578063fbe3c2cd1461066f576101d1565b8063b19a437e14610584578063c0fd8bde14610597578063d60b347f146105c6576101d1565b8063875be02a146104ac57806393df337e146104da5780639a8a0592146104fa578063a0cce1b314610522578063a9e1189314610542578063b172b2221461056f576101d1565b80634cf842b5116101235780634cf842b5146103415780634fdc60fa14610398578063515f3247146103fb5780635cb8cae2146104555780636606b4e0146104775780638129fc1c14610497576101d1565b80630319e59c1461020757806304ca84cf146102795780631a90a219146102a65780631cfe7951146102c55780631f8cdb2b146102f15780632c3c02a414610311576101d1565b366101d15760405162461bcd60e51b815260206004820152602c60248201527f74686520576f726d686f6c6520636f6e747261637420646f6573206e6f74206160448201526b63636570742061737365747360a01b60648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152600b60248201526a1d5b9cdd5c1c1bdc9d195960aa1b60448201526064016101c8565b34801561021357600080fd5b50610227610222366004612841565b61068e565b6040516102709190600060a0820190508251825260ff602084015116602083015261ffff6040840151166040830152606083015160608301526080830151608083015292915050565b60405180910390f35b34801561028557600080fd5b50610299610294366004612841565b6107e4565b6040516102709190612c37565b3480156102b257600080fd5b506007545b604051908152602001610270565b3480156102d157600080fd5b5060035463ffffffff165b60405163ffffffff9091168152602001610270565b3480156102fd57600080fd5b5060015b6040519015158152602001610270565b34801561031d57600080fd5b5061030161032c3660046126b6565b60009081526005602052604090205460ff1690565b34801561034d57600080fd5b5061038061035c366004612695565b6001600160a01b03166000908152600460205260409020546001600160401b031690565b6040516001600160401b039091168152602001610270565b3480156103a457600080fd5b506103b86103b3366004612841565b610a17565b60405161027091908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b34801561040757600080fd5b5061041b610416366004612841565b610b53565b60405161027091908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b34801561046157600080fd5b50610475610470366004612841565b610c82565b005b34801561048357600080fd5b50610475610492366004612841565b610d8a565b3480156104a357600080fd5b50610475610faa565b3480156104b857600080fd5b506104cc6104c736600461287b565b61106f565b604051610270929190612c09565b3480156104e657600080fd5b506104756104f5366004612841565b611203565b34801561050657600080fd5b5060005461ffff165b60405161ffff9091168152602001610270565b34801561052e57600080fd5b506104cc61053d3660046126ce565b61134f565b34801561054e57600080fd5b5061056261055d366004612841565b61152c565b6040516102709190612ca7565b34801561057b57600080fd5b506001546102b7565b6103806105923660046129b4565b61190a565b3480156105a357600080fd5b506105b76105b23660046127d5565b6119aa565b60405161027093929190612cba565b3480156105d257600080fd5b506103016105e1366004612695565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561060b57600080fd5b50600354640100000000900463ffffffff166102dc565b34801561062e57600080fd5b5061047561063d366004612841565b611a0c565b34801561064e57600080fd5b5061066261065d36600461299a565b611b0d565b6040516102709190612c94565b34801561067b57600080fd5b5060005462010000900461ffff1661050f565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906106c38382611bac565b82526106d0602082612df3565b90506106dc8382611c0a565b60ff1660208301526106ef600182612df3565b9050816020015160ff1660041461073f5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101c8565b6107498382611c66565b61ffff16604083015261075d600282612df3565b90506107698382611cc3565b6060830152610779602082612df3565b90506107858382611bac565b6080830152610795602082612df3565b9050808351146107de5760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964205472616e736665724665657360601b60448201526064016101c8565b50919050565b6107ec6123e3565b60006107f88382611bac565b8252610805602082612df3565b90506108118382611c0a565b60ff166020830152610824600182612df3565b9050816020015160ff1660021461087d5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101c8565b6108878382611c66565b61ffff16604083015261089b600282612df3565b90506108a78382611d18565b63ffffffff1660808301526108bd600482612df3565b905060006108cb8483611c0a565b90506108d8600183612df3565b915060405180604001604052808260ff166001600160401b0381111561090e57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610937578160200160208202803683370190505b5081526000602090910181905260608501919091525b8160ff168110156109bf576109628584611d75565b60608501515180518390811061098857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101526109ab601484612df3565b9250806109b781612f00565b91505061094d565b5081845114610a105760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420477561726469616e5365745570677261646500000000000060448201526064016101c8565b5050919050565b604080516080810182526000808252602082018190529181018290526060810182905290610a458382611bac565b8252610a52602082612df3565b9050610a5e8382611c0a565b60ff166020830152610a71600182612df3565b9050816020015160ff16600114610ac45760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101c8565b610ace8382611c66565b61ffff166040830152610ae2600282612df3565b9050610aee8382611bac565b6001600160a01b03166060830152610b07602082612df3565b9050808351146107de5760405162461bcd60e51b8152602060048201526017602482015276696e76616c696420436f6e74726163745570677261646560481b60448201526064016101c8565b604080516080810182526000808252602082018190529181018290526060810182905290610b818382611bac565b8252610b8e602082612df3565b9050610b9a8382611c0a565b60ff166020830152610bad600182612df3565b9050816020015160ff16600314610bfe5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101c8565b610c088382611c66565b61ffff166040830152610c1c600282612df3565b9050610c288382611cc3565b6060830152610c38602082612df3565b9050808351146107de5760405162461bcd60e51b8152602060048201526015602482015274696e76616c6964205365744d65737361676546656560581b60448201526064016101c8565b6000610c8d8261152c565b9050600080610c9b83611dda565b91509150818190610cbf5760405162461bcd60e51b81526004016101c89190612c24565b506000610ccf8460e00151610a17565b805190915063436f726514610d175760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff1614610d685760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101c8565b610d76846101400151611f50565b610d838160600151611f6b565b5050505050565b6000610d958261152c565b9050600080610da383611dda565b91509150818190610dc75760405162461bcd60e51b81526004016101c89190612c24565b506000610dd78460e001516107e4565b805190915063436f726514610e1f5760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff161480610e455750604081015161ffff16155b610e815760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101c8565b60608101515151610ed45760405162461bcd60e51b815260206004820152601960248201527f6e657720677561726469616e2073657420697320656d7074790000000000000060448201526064016101c8565b60035463ffffffff16610ee8906001612e0b565b63ffffffff16816080015163ffffffff1614610f505760405162461bcd60e51b815260206004820152602160248201527f696e646578206d75737420696e63726561736520696e207374657073206f66206044820152603160f81b60648201526084016101c8565b610f5e846101400151611f50565b610f75610f7060035463ffffffff1690565b612098565b610f87816060015182608001516120d0565b60808101516003805463ffffffff191663ffffffff909216919091179055610d83565b6000610fdd7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611001816001600160a01b031660009081526006602052604090205460ff1690565b156110445760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064016101c8565b61106c816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b600060606000611083846101000151611b0d565b8051519091506110c6576000604051806040016040528060148152602001731a5b9d985b1a590819dd585c991a585b881cd95d60621b8152509250925050915091565b60035463ffffffff1663ffffffff1684610100015163ffffffff16141580156110f8575042816020015163ffffffff16105b1561113f5760006040518060400160405280601881526020017f677561726469616e2073657420686173206578706972656400000000000000008152509250925050915091565b61012084015151815151600a906003906111599083612e9a565b6111639190612e7a565b61116e906002612e9a565b6111789190612e7a565b611183906001612df3565b11156111b7576000604051806040016040528060098152602001686e6f2071756f72756d60b81b8152509250925050915091565b6000806111cf8661014001518761012001518561134f565b91509150816111e5576000969095509350505050565b60016040518060200160405280600081525094509450505050915091565b600061120e8261152c565b905060008061121c83611dda565b915091508181906112405760405162461bcd60e51b81526004016101c89190612c24565b5060006112508460e0015161068e565b805190915063436f7265146112985760405162461bcd60e51b815260206004820152600e60248201526d696e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff1614806112be5750604081015161ffff16155b6112fa5760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b21021b430b4b760991b60448201526064016101c8565b611308846101400151611f50565b608081015160608201516040516001600160a01b0383169180156108fc02916000818181858888f19350505050158015611346573d6000803e3d6000fd5b50505050505050565b600060606000805b855181101561150b57600086828151811061138257634e487b7160e01b600052603260045260246000fd5b6020026020010151905081600014806113a457508260ff16816060015160ff16115b6113fc5760405162461bcd60e51b815260206004820152602360248201527f7369676e617475726520696e6469636573206d75737420626520617363656e64604482015262696e6760e81b60648201526084016101c8565b6060810151865180519194509060ff851690811061142a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031660018983604001518460000151856020015160405160008152602001604052604051611483949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa1580156114a5573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146114f8576000604051806040016040528060148152602001731593481cda59db985d1d5c99481a5b9d985b1a5960621b81525094509450505050611524565b508061150381612f00565b915050611357565b5060016040518060200160405280600081525092509250505b935093915050565b61153461243d565b60006115408382611c0a565b60ff168252611550600182612df3565b9050816000015160ff166001146115a95760405162461bcd60e51b815260206004820152601760248201527f564d2076657273696f6e20696e636f6d70617469626c6500000000000000000060448201526064016101c8565b6115b38382611d18565b63ffffffff166101008301526115ca600482612df3565b905060006115d88483611c0a565b60ff1690506115e8600183612df3565b9150806001600160401b0381111561161057634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561166257816020015b60408051608081018252600080825260208083018290529282018190526060820152825260001990920191018161162e5790505b5061012084015260005b818110156117d15761167e8584611c0a565b84610120015182815181106116a357634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166060909101526116c4600184612df3565b92506116d08584611bac565b84610120015182815181106116f557634e487b7160e01b600052603260045260246000fd5b602002602001015160000181815250506020836117129190612df3565b925061171e8584611bac565b846101200151828151811061174357634e487b7160e01b600052603260045260246000fd5b602002602001015160200181815250506020836117609190612df3565b925061176c8584611c0a565b61177790601b612e55565b846101200151828151811061179c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015160ff9091166040909101526117bd600184612df3565b9250806117c981612f00565b91505061166c565b5060006117ed838487516117e59190612eb9565b879190612124565b9050808051906020012060405160200161180991815260200190565b60408051601f1981840301815291905280516020909101206101408501526118318584611d18565b63ffffffff166020850152611847600484612df3565b92506118538584611d18565b63ffffffff166040850152611869600484612df3565b92506118758584611c66565b61ffff166060850152611889600284612df3565b92506118958584611bac565b60808501526118a5602084612df3565b92506118b18584612231565b6001600160401b031660a08501526118ca600884612df3565b92506118d68584611c0a565b60ff1660c08501526118e9600184612df3565b92506118fc838487516117e59190612eb9565b60e085015250919392505050565b600061191560075490565b34146119515760405162461bcd60e51b815260206004820152600b60248201526a696e76616c69642066656560a81b60448201526064016101c8565b61195a3361228e565b9050336001600160a01b03167f6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b28286868660405161199b9493929190612cf1565b60405180910390a29392505050565b6119b261243d565b600060606119f585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061152c92505050565b9250611a008361106f565b93969095509293505050565b6000611a178261152c565b9050600080611a2583611dda565b91509150818190611a495760405162461bcd60e51b81526004016101c89190612c24565b506000611a598460e00151610b53565b805190915063436f726514611aa15760405162461bcd60e51b815260206004820152600e60248201526d496e76616c6964204d6f64756c6560901b60448201526064016101c8565b60005461ffff1661ffff16816040015161ffff1614611af25760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21021b430b4b760991b60448201526064016101c8565b611b00846101400151611f50565b610d838160600151600755565b60408051808201825260608082526000602080840182905263ffffffff86168252600281529084902084518154928302810184018652948501828152939493909284928491840182828015611b8b57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611b6d575b50505091835250506001919091015463ffffffff1660209091015292915050565b6000611bb9826020612df3565b83511015611c015760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016101c8565b50016020015190565b6000611c17826001612df3565b83511015611c5d5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016101c8565b50016001015190565b6000611c73826002612df3565b83511015611cba5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016101c8565b50016002015190565b6000611cd0826020612df3565b83511015611c015760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b60448201526064016101c8565b6000611d25826004612df3565b83511015611d6c5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016101c8565b50016004015190565b6000611d82826014612df3565b83511015611dca5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016101c8565b500160200151600160601b900490565b60006060600080611dea8561106f565b9150915081611dff5760009590945092505050565b60035463ffffffff1663ffffffff1685610100015163ffffffff1614611e45576000604051806060016040528060228152602001612f4860229139935093505050915091565b60005462010000900461ffff1661ffff16856060015161ffff1614611ea0576000604051806040016040528060168152602001753bb937b7339033b7bb32b93730b731b29031b430b4b760511b815250935093505050915091565b600154856080015114611ef05760006040518060400160405280601981526020017f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000815250935093505050915091565b61014085015160009081526005602052604090205460ff1615611f33576000604051806060016040528060228152602001612f6a60229139935093505050915091565b600160405180602001604052806000815250935093505050915091565b6000908152600560205260409020805460ff19166001179055565b6000611f9e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611fa9826122fe565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611fec91612bed565b600060405180830381855af49150503d8060008114612027576040519150601f19603f3d011682016040523d82523d6000602084013e61202c565b606091505b50915091508181906120515760405162461bcd60e51b81526004016101c89190612c24565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b6120a54262015180612e0b565b63ffffffff9182166000908152600260205260409020600101805463ffffffff191691909216179055565b63ffffffff811660009081526002602090815260409091208351805185936120fc928492910190612498565b50602091909101516001909101805463ffffffff191663ffffffff9092169190911790555050565b60608161213281601f612df3565b10156121715760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016101c8565b61217b8284612df3565b845110156121bf5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016101c8565b6060821580156121de5760405191506000825260208201604052612228565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156122175780518352602092830192016121ff565b5050858452601f01601f1916604052505b50949350505050565b600061223e826008612df3565b835110156122855760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016101c8565b50016008015190565b6001600160a01b0381166000908152600460205260409020546001600160401b03166122f9826122bf836001612e33565b6001600160a01b03919091166000908152600460205260409020805467ffffffffffffffff19166001600160401b03909216919091179055565b919050565b6123078161233e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6123a25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016101c8565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6040518060a0016040528060008019168152602001600060ff168152602001600061ffff168152602001612430604051806040016040528060608152602001600063ffffffff1681525090565b8152600060209091015290565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201819052610100820183905261012082015261014081019190915290565b8280548282559060005260206000209081019282156124ed579160200282015b828111156124ed57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906124b8565b506124f99291506124fd565b5090565b5b808211156124f957600081556001016124fe565b80356001600160a01b03811681146122f957600080fd5b600082601f830112612539578081fd5b8135602061254e61254983612dd0565b612da0565b80838252828201915082860187848660071b890101111561256d578586fd5b855b858110156125d057608080838b031215612587578788fd5b61258f612d33565b83358152868401358782015260406125a8818601612684565b9082015260606125b9858201612684565b90820152855293850193919091019060010161256f565b5090979650505050505050565b600082601f8301126125ed578081fd5b81356001600160401b0381111561260657612606612f31565b612619601f8201601f1916602001612da0565b81815284602083860101111561262d578283fd5b816020850160208301379081016020019190915292915050565b803561ffff811681146122f957600080fd5b803563ffffffff811681146122f957600080fd5b80356001600160401b03811681146122f957600080fd5b803560ff811681146122f957600080fd5b6000602082840312156126a6578081fd5b6126af82612512565b9392505050565b6000602082840312156126c7578081fd5b5035919050565b6000806000606084860312156126e2578182fd5b833592506020808501356001600160401b0380821115612700578485fd5b61270c88838901612529565b94506040870135915080821115612721578384fd5b9086019060408289031215612734578384fd5b61273c612d5b565b82358281111561274a578586fd5b83019150601f8201891361275c578485fd5b813561276a61254982612dd0565b8082825286820191508685018c888560051b8801011115612789578889fd5b8895505b838610156127b25761279e81612512565b83526001959095019491870191870161278d565b508352506127c39050838501612659565b84820152809450505050509250925092565b600080602083850312156127e7578182fd5b82356001600160401b03808211156127fd578384fd5b818501915085601f830112612810578384fd5b81358181111561281e578485fd5b86602082850101111561282f578485fd5b60209290920196919550909350505050565b600060208284031215612852578081fd5b81356001600160401b03811115612867578182fd5b612873848285016125dd565b949350505050565b60006020828403121561288c578081fd5b81356001600160401b03808211156128a2578283fd5b9083019061016082860312156128b6578283fd5b6128be612d7d565b6128c783612684565b81526128d560208401612659565b60208201526128e660408401612659565b60408201526128f760608401612647565b60608201526080830135608082015261291260a0840161266d565b60a082015261292360c08401612684565b60c082015260e083013582811115612939578485fd5b612945878286016125dd565b60e083015250610100612959818501612659565b908201526101208381013583811115612970578586fd5b61297c88828701612529565b91830191909152506101409283013592810192909252509392505050565b6000602082840312156129ab578081fd5b6126af82612659565b6000806000606084860312156129c8578081fd5b6129d184612659565b925060208401356001600160401b038111156129eb578182fd5b6129f7868287016125dd565b925050612a0660408501612684565b90509250925092565b6000815180845260208085019450808401835b83811015612a6757815180518852838101518489015260408082015160ff908116918a0191909152606091820151169088015260809096019590820190600101612a22565b509495945050505050565b60008151808452612a8a816020860160208601612ed0565b601f01601f19169290920160200192915050565b805160408084528151908401819052600091602091908201906060860190845b81811015612ae35783516001600160a01b031683529284019291840191600101612abe565b50509382015163ffffffff16949091019390935250919050565b805160ff16825260006101606020830151612b20602086018263ffffffff169052565b506040830151612b38604086018263ffffffff169052565b506060830151612b4e606086018261ffff169052565b506080830151608085015260a0830151612b7360a08601826001600160401b03169052565b5060c0830151612b8860c086018260ff169052565b5060e08301518160e0860152612ba082860182612a72565b91505061010080840151612bbb8287018263ffffffff169052565b50506101208084015185830382870152612bd58382612a0f565b61014095860151969095019590955250919392505050565b60008251612bff818460208701612ed0565b9190910192915050565b82151581526040602082015260006128736040830184612a72565b6020815260006126af6020830184612a72565b602081528151602082015260ff602083015116604082015261ffff60408301511660608201526000606083015160a06080840152612c7860c0840182612a9e565b905063ffffffff60808501511660a08401528091505092915050565b6020815260006126af6020830184612a9e565b6020815260006126af6020830184612afd565b606081526000612ccd6060830186612afd565b84151560208401528281036040840152612ce78185612a72565b9695505050505050565b6001600160401b038516815263ffffffff84166020820152608060408201526000612d1f6080830185612a72565b905060ff8316606083015295945050505050565b604051608081016001600160401b0381118282101715612d5557612d55612f31565b60405290565b604080519081016001600160401b0381118282101715612d5557612d55612f31565b60405161016081016001600160401b0381118282101715612d5557612d55612f31565b604051601f8201601f191681016001600160401b0381118282101715612dc857612dc8612f31565b604052919050565b60006001600160401b03821115612de957612de9612f31565b5060051b60200190565b60008219821115612e0657612e06612f1b565b500190565b600063ffffffff808316818516808303821115612e2a57612e2a612f1b565b01949350505050565b60006001600160401b03808316818516808303821115612e2a57612e2a612f1b565b600060ff821660ff84168060ff03821115612e7257612e72612f1b565b019392505050565b600082612e9557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612eb457612eb4612f1b565b500290565b600082821015612ecb57612ecb612f1b565b500390565b60005b83811015612eeb578181015183820152602001612ed3565b83811115612efa576000848401525b50505050565b6000600019821415612f1457612f14612f1b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfe6e6f74207369676e65642062792063757272656e7420677561726469616e20736574676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220c02c8068c96005b29d58ae98b32720b3ecf9bb0911966c19bff9382caf08a2d164736f6c63430008040033\";\nvar MockImplementation__factory = /** @class */ (function (_super) {\n __extends(MockImplementation__factory, _super);\n function MockImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockImplementation__factory.bytecode = _bytecode;\n MockImplementation__factory.abi = _abi;\n return MockImplementation__factory;\n}(ContractFactory));\nexport { MockImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransfer\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n name: \"encodeTransfer\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n name: \"onERC721Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransfer\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"splCache\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStorage.SPLCache\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"transferNFT\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"testNewImplementationActive\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50613b94806100206000396000f3fe608060405260043610620001675760003560e01c806384acd1bb11620000c5578063c68785191162000078578063c68785191462000521578063c96616e11462000546578063d60b347f1462000576578063e6a853e014620005b3578063fbe3c2cd14620005e7578063fbeeacd9146200060857600080fd5b806384acd1bb14620004235780639a8a05921462000443578063a5799f93146200046d578063aa4efa5b1462000492578063ad66a5f114620004c6578063b172b222146200050a57600080fd5b80632b511375116200011e5780632b51137514620002f25780632c3c02a414620003265780632f3a3d5d146200035a5780633ca64826146200037a5780635c60da1b14620003f35780638129fc1c146200040b57600080fd5b806301f53255146200016c578063150b7a0214620001ea5780631a2be4da14620002295780631f8cdb2b14620002775780631ff1e286146200028d5780632539464514620002cb575b600080fd5b3480156200017957600080fd5b50620001916200018b36600462002a55565b62000668565b604051620001e19190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620001f757600080fd5b506200020f6200020936600462002905565b62000870565b6040516001600160e01b03199091168152602001620001e1565b3480156200023657600080fd5b506200026662000248366004620028e8565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001620001e1565b3480156200028457600080fd5b50600162000266565b3480156200029a57600080fd5b50620002b2620002ac36600462002d4b565b620008f4565b6040516001600160a01b039091168152602001620001e1565b348015620002d857600080fd5b50620002f0620002ea36600462002a55565b62000920565b005b348015620002ff57600080fd5b50620003176200031136600462002a55565b62000a04565b604051620001e1919062002f4d565b3480156200033357600080fd5b50620002666200034536600462002a23565b60009081526004602052604090205460ff1690565b3480156200036757600080fd5b506001546001600160a01b0316620002b2565b3480156200038757600080fd5b50620003d76200039936600462002a23565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201620001e1565b3480156200040057600080fd5b50620002b262000bda565b3480156200041857600080fd5b50620002f062000bf4565b3480156200043057600080fd5b506000546001600160a01b0316620002b2565b3480156200045057600080fd5b5060025461ffff165b60405161ffff9091168152602001620001e1565b3480156200047a57600080fd5b50620002f06200048c36600462002a55565b62000cbe565b3480156200049f57600080fd5b5062000266620004b136600462002a23565b60009081526005602052604090205460ff1690565b348015620004d357600080fd5b50620004fb620004e536600462002d0d565b61ffff1660009081526009602052604090205490565b604051908152602001620001e1565b3480156200051757600080fd5b50600354620004fb565b3480156200052e57600080fd5b50620002f06200054036600462002a55565b62000dc4565b6200055d62000557366004620029a3565b62000dcf565b6040516001600160401b039091168152602001620001e1565b3480156200058357600080fd5b506200026662000595366004620028e8565b6001600160a01b031660009081526006602052604090205460ff1690565b348015620005c057600080fd5b50620005d8620005d236600462002ad5565b6200148e565b604051620001e1919062002ee4565b348015620005f457600080fd5b5060025462010000900461ffff1662000459565b3480156200061557600080fd5b506200062d6200062736600462002a55565b6200154a565b604051620001e191908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906200069f838262001723565b8252620006ae602082620030d3565b8251909150684e4654427269646765146200071c5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b62000728838262001785565b60ff1660208301526200073d600182620030d3565b9050816020015160ff16600114620007a45760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840162000713565b620007b08382620017e5565b61ffff166040830152620007c6600282620030d3565b9050620007d48382620017e5565b61ffff166060830152620007ea600282620030d3565b9050620007f8838262001723565b60808301526200080a602082620030d3565b9050808351146200086a5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840162000713565b50919050565b60006001600160a01b0386163014620008e25760405162461bcd60e51b815260206004820152602d60248201527f63616e206f6e6c792062726964676520746f6b656e7320766961207472616e7360448201526c19995c939195081b595d1a1bd9609a1b606482015260840162000713565b50630a85bd0160e11b95945050505050565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6000806000620009308462001846565b925092509250818190620009595760405162461bcd60e51b815260040162000713919062002ee4565b506200097f8361014001516000908152600460205260409020805460ff19166001179055565b6000620009908460e001516200154a565b9050620009a060025461ffff1690565b61ffff16816040015161ffff1614620009ed5760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640162000713565b6060810151620009fd9062001a75565b5050505050565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082015260c0810182905260e08101829052908062000a51848262001785565b905062000a60600183620030d3565b91508060ff1660011462000aaa5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b604482015260640162000713565b62000ab6848362001723565b835262000ac5602083620030d3565b915062000ad38483620017e5565b61ffff16602084015262000ae9600283620030d3565b915062000af7848362001723565b604084015262000b09602083620030d3565b915062000b17848362001723565b606084015262000b29602083620030d3565b915062000b37848362001bac565b608084015262000b49602083620030d3565b915062000b58600183620030d3565b915062000b8582602284875162000b709190620030ee565b62000b7c9190620030ee565b86919062001c05565b60a08401528351915062000b9b600283620030ee565b915062000ba98483620017e5565b61ffff1660e084015262000bbf602083620030ee565b915062000bcd848362001723565b60c0840152509092915050565b600062000bef6001546001600160a01b031690565b905090565b600062000c287f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062000c4d816001600160a01b031660009081526006602052604090205460ff1690565b1562000c925760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640162000713565b62000cbb816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b600080600062000cce8462001846565b92509250925081819062000cf75760405162461bcd60e51b815260040162000713919062002ee4565b5062000d1d8361014001516000908152600460205260409020805460ff19166001179055565b600062000d2e8460e0015162000668565b905062000d3e60025461ffff1690565b61ffff16816040015161ffff16148062000d5e5750604081015161ffff16155b62000d9f5760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640162000713565b620009fd8160600151826080015161ffff909116600090815260096020526040902055565b62000cbb8162001d1e565b600080600062000df7886001600160a01b031660009081526008602052604090205460ff1690565b1562000ef157876001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e3757600080fd5b505afa15801562000e4c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e72919062002d2c565b9150876001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000eae57600080fd5b505afa15801562000ec3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ee9919062002a3c565b9050620010bb565b60025461ffff166040516301ffc9a760e01b81526380ac58cd60e01b60048201529092506001600160a01b038916915081906301ffc9a79060240160206040518083038186803b15801562000f4557600080fd5b505afa15801562000f5a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f80919062002a06565b62000fd85760405162461bcd60e51b815260206004820152602160248201527f6d75737420737570706f7274207468652045524337323120696e7465726661636044820152606560f81b606482015260840162000713565b6040516301ffc9a760e01b8152635b5e139f60e01b60048201526001600160a01b038916906301ffc9a79060240160206040518083038186803b1580156200101f57600080fd5b505afa15801562001034573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200105a919062002a06565b620010bb5760405162461bcd60e51b815260206004820152602a60248201527f6d75737420737570706f727420746865204552433732312d4d657461646174616044820152691032bc3a32b739b4b7b760b11b606482015260840162000713565b60608060608461ffff16600114620012155760408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b17905290516000916001600160a01b038e169162001111919062002dc4565b600060405180830381855afa9150503d80600081146200114e576040519150601f19603f3d011682016040523d82523d6000602084013e62001153565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b038f16916200119c919062002dc4565b600060405180830381855afa9150503d8060008114620011d9576040519150601f19603f3d011682016040523d82523d6000602084013e620011de565b606091505b5091505081806020019051810190620011f8919062002a9f565b94508080602001905181019062001210919062002a9f565b935050505b60008b6001600160a01b03168b6040516024016200123591815260200190565b60408051601f198184030181529181526020820180516001600160e01b031663c87b56dd60e01b179052516200126c919062002dc4565b600060405180830381855afa9150503d8060008114620012a9576040519150601f19603f3d011682016040523d82523d6000602084013e620012ae565b606091505b5091505080806020019051810190620012c8919062002a9f565b9150506000808661ffff16600114156200134557604080518082018252600080825260209182018190528e8152600a825282812083518085019094528054845260010154918301919091529060208101518151909450925090506200133e8d6000908152600a6020526040812081815560010155565b5062001352565b5050602083810151908301515b60025461ffff88811691161415620013d257604051632142170760e11b8152336004820152306024820152604481018d90526001600160a01b038e16906342842e0e90606401600060405180830381600087803b158015620013b357600080fd5b505af1158015620013c8573d6000803e3d6000fd5b505050506200142f565b604051630852cd8d60e31b8152600481018d90526001600160a01b038e16906342966c6890602401600060405180830381600087803b1580156200141557600080fd5b505af11580156200142a573d6000803e3d6000fd5b505050505b6200147d6040518061010001604052808881526020018961ffff1681526020018481526020018381526020018e81526020018581526020018c81526020018d61ffff16815250348b62002102565b9d9c50505050505050505050505050565b606060c88260a00151511115620014f35760405162461bcd60e51b815260206004820152602260248201527f746f6b656e555249206d757374206e6f74206578636565642032303020627974604482015261657360f01b606482015260840162000713565b81516020808401516040808601516060870151608088015160a0890151805160c08b015160e08c01519651620015349a60019a909998939493910162002e15565b6040516020818303038152906040529050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906200157a838262001723565b825262001589602082620030d3565b8251909150684e465442726964676514620015f55760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840162000713565b62001601838262001785565b60ff16602083015262001616600182620030d3565b9050816020015160ff166002146200167f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840162000713565b6200168b8382620017e5565b61ffff166040830152620016a1600282620030d3565b9050620016af838262001723565b6060830152620016c1602082620030d3565b9050808351146200086a5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840162000713565b600062001732826020620030d3565b835110156200177c5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640162000713565b50016020015190565b600062001794826001620030d3565b83511015620017dc5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640162000713565b50016001015190565b6000620017f4826002620030d3565b835110156200183d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640162000713565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620018ba6000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620018e7919062002ee4565b60006040518083038186803b1580156200190057600080fd5b505afa15801562001915573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200193f919081019062002b9e565b9250925092508162001958579194509250905062001a6e565b60025462010000900461ffff1661ffff16836060015161ffff1614620019b65750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062001a6e565b60035483608001511462001a0957505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062001a6e565b61014083015160009081526004602052604090205460ff161562001a535782600060405180606001604052806022815260200162003b3d6022913995509550955050505062001a6e565b50506040805160208101909152600081529093506001925090505b9193909250565b600062001aa97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001ab682620021b7565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169162001afb9162002dc4565b600060405180830381855af49150503d806000811462001b38576040519150601f19603f3d011682016040523d82523d6000602084013e62001b3d565b606091505b509150915081819062001b655760405162461bcd60e51b815260040162000713919062002ee4565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062001bbb826020620030d3565b835110156200177c5760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b604482015260640162000713565b60608162001c1581601f620030d3565b101562001c565760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b604482015260640162000713565b62001c628284620030d3565b8451101562001ca85760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b604482015260640162000713565b60608215801562001cc9576040519150600082526020820160405262001d15565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101562001d0457805183526020928301920162001cea565b5050858452601f01601f1916604052505b50949350505050565b600080600062001d366000546001600160a01b031690565b6001600160a01b031663c0fd8bde856040518263ffffffff1660e01b815260040162001d63919062002ee4565b60006040518083038186803b15801562001d7c57600080fd5b505afa15801562001d91573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001dbb919081019062002b9e565b92509250925081819062001de45760405162461bcd60e51b815260040162000713919062002ee4565b5062001df083620021f9565b62001e305760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b604482015260640162000713565b600062001e418460e0015162000a04565b905062001e6284610140015160009081526005602052604090205460ff1690565b1562001eb15760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c65746564000000000000604482015260640162000713565b62001ed68461014001516000908152600560205260409020805460ff19166001179055565b60025461ffff1661ffff168160e0015161ffff161462001f305760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b604482015260640162000713565b600062001f4060025461ffff1690565b61ffff16826020015161ffff16141562001f5d5750805162001fa8565b600062001f7383602001518460000151620008f4565b90506001600160a01b03811662001fa55762001fa2836020015184600001518560600151866040015162002236565b90505b90505b60c082015160025461ffff1661ffff16836020015161ffff16146200208757826020015161ffff166001141562002013576080830151604080518082018252606086015181528186015160208083019182526000948552600a90529190922091518255516001909101555b608083015160a08401516040516334ff261960e21b81526001600160a01b0385169263d3fc9864926200204d928692919060040162002ebb565b600060405180830381600087803b1580156200206857600080fd5b505af11580156200207d573d6000803e3d6000fd5b50505050620020f9565b6080830151604051632142170760e11b81523060048201526001600160a01b0383811660248301526044820192909252908316906342842e0e90606401600060405180830381600087803b158015620020df57600080fd5b505af1158015620020f4573d6000803e3d6000fd5b505050505b50505050505050565b60008062002110856200148e565b9050620021256000546001600160a01b031690565b6001600160a01b031663b19a437e858584600f6040518563ffffffff1660e01b8152600401620021589392919062002fcb565b6020604051808303818588803b1580156200217257600080fd5b505af115801562002187573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190620021ae919062002d79565b95945050505050565b620021c281620024e3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600081608001516200221f836060015161ffff1660009081526009602052604090205490565b14156200222e57506001919050565b506000919050565b60006200224660025461ffff1690565b61ffff168561ffff161415620022b05760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b606482015260840162000713565b6000620022be8686620008f4565b6001600160a01b031614620023165760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c72656164792065786973747300000000604482015260640162000713565b8461ffff166001141562002358577f576f726d686f6c65204272696467656420536f6c616e612d4e4654000000000092506915d3d49354d41313919560b21b91505b6000627ce50b60e31b6200236c856200258a565b62002377856200258a565b3089896040516024016200239095949392919062002ef9565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b03199095169490941790935251909250600091620023da91309185910162002e95565b6040516020818303038152906040529050600060405180602001620023ff90620026c5565b601f1982820381018352601f909101166040819052620024259190849060200162002de2565b60408051601f19818403018152908290526001600160f01b031960f08b901b166020830152602282018990529150600090604201604051602081830303815290604052805190602001209050808251602084016000f59450843b6200248957600080fd5b61ffff891660009081526007602090815260408083208b8452825280832080546001600160a01b0319166001600160a01b038a16908117909155835260089091529020805460ff1916600117905550505050949350505050565b803b620025495760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000713565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606060005b602081108015620025cd5750828160208110620025bc57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b15620025e85780620025df816200313b565b9150506200258f565b6000816001600160401b038111156200261157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156200263c576020820181803683370190505b50905060005b82811015620026bd578481602081106200266c57634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200269157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620026b4816200313b565b91505062002642565b509392505050565b61099380620031aa83390190565b6000620026ea620026e484620030a9565b62003076565b9050828152838383011115620026ff57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146200272e57600080fd5b919050565b600082601f83011262002744578081fd5b815160206001600160401b038211156200276257620027626200316f565b62002772818360051b0162003076565b80838252828201915082860187848660071b890101111562002792578586fd5b855b85811015620027fe57608080838b031215620027ae578788fd5b620027b862002fff565b8351815286840151878201526040620027d3818601620028d6565b908201526060620027e6858201620028d6565b90820152855293850193919091019060010162002794565b5090979650505050505050565b805180151581146200272e57600080fd5b600082601f8301126200282d578081fd5b81516200283e620026e482620030a9565b81815284602083860101111562002853578283fd5b6200286682602083016020870162003108565b949350505050565b600082601f8301126200287f578081fd5b6200289083833560208501620026d3565b9392505050565b80356200272e8162003185565b80516200272e8162003185565b80516200272e8162003196565b80516001600160401b03811681146200272e57600080fd5b805160ff811681146200272e57600080fd5b600060208284031215620028fa578081fd5b620028908262002716565b6000806000806000608086880312156200291d578081fd5b620029288662002716565b9450620029386020870162002716565b93506040860135925060608601356001600160401b03808211156200295b578283fd5b818801915088601f8301126200296f578283fd5b8135818111156200297e578384fd5b89602082850101111562002990578384fd5b9699959850939650602001949392505050565b600080600080600060a08688031215620029bb578283fd5b620029c68662002716565b9450602086013593506040860135620029df8162003185565b9250606086013591506080860135620029f88162003196565b809150509295509295909350565b60006020828403121562002a18578081fd5b62002890826200280b565b60006020828403121562002a35578081fd5b5035919050565b60006020828403121562002a4e578081fd5b5051919050565b60006020828403121562002a67578081fd5b81356001600160401b0381111562002a7d578182fd5b8201601f8101841362002a8e578182fd5b6200286684823560208401620026d3565b60006020828403121562002ab1578081fd5b81516001600160401b0381111562002ac7578182fd5b62002866848285016200281c565b60006020828403121562002ae7578081fd5b81356001600160401b038082111562002afe578283fd5b90830190610100828603121562002b13578283fd5b62002b1d6200302a565b8235815262002b2f6020840162002897565b602082015260408301356040820152606083013560608201526080830135608082015260a08301358281111562002b64578485fd5b62002b72878286016200286e565b60a08301525060c083013560c082015262002b9060e0840162002897565b60e082015295945050505050565b60008060006060848603121562002bb3578081fd5b83516001600160401b038082111562002bca578283fd5b90850190610160828803121562002bdf578283fd5b62002be962003050565b62002bf483620028d6565b815262002c0460208401620028b1565b602082015262002c1760408401620028b1565b604082015262002c2a60608401620028a4565b60608201526080830151608082015262002c4760a08401620028be565b60a082015262002c5a60c08401620028d6565b60c082015260e08301518281111562002c71578485fd5b62002c7f898286016200281c565b60e08301525061010062002c95818501620028b1565b90820152610120838101518381111562002cad578586fd5b62002cbb8a82870162002733565b91830191909152506101408381015190820152945062002cde602087016200280b565b9350604086015191508082111562002cf4578283fd5b5062002d03868287016200281c565b9150509250925092565b60006020828403121562002d1f578081fd5b8135620028908162003185565b60006020828403121562002d3e578081fd5b8151620028908162003185565b6000806040838503121562002d5e578182fd5b823562002d6b8162003185565b946020939093013593505050565b60006020828403121562002d8b578081fd5b6200289082620028be565b6000815180845262002db081602086016020860162003108565b601f01601f19169290920160200192915050565b6000825162002dd881846020870162003108565b9190910192915050565b6000835162002df681846020880162003108565b83519083019062002e0c81836020880162003108565b01949350505050565b600060ff60f81b808d60f81b1683528b600184015261ffff60f01b808c60f01b1660218501528a6023850152896043850152886063850152818860f81b1660838501528651915062002e6f826084860160208a0162003108565b920160848101949094525060f09190911b1660a482015260a60198975050505050505050565b6001600160a01b0383168152604060208201819052600090620028669083018462002d96565b60018060a01b0384168152826020820152606060408201526000620021ae606083018462002d96565b60208152600062002890602083018462002d96565b60a08152600062002f0e60a083018862002d96565b828103602084015262002f22818862002d96565b6001600160a01b03969096166040840152505061ffff92909216606083015260809091015292915050565b60208152815160208201526000602083015161ffff80821660408501526040850151606085015260608501516080850152608085015160a085015260a085015191506101008060c086015262002fa861012086018462002d96565b925060c086015160e08601528160e0870151168186015250508091505092915050565b63ffffffff8416815260606020820152600062002fec606083018562002d96565b905060ff83166040830152949350505050565b604051608081016001600160401b03811182821017156200302457620030246200316f565b60405290565b60405161010081016001600160401b03811182821017156200302457620030246200316f565b60405161016081016001600160401b03811182821017156200302457620030246200316f565b604051601f8201601f191681016001600160401b0381118282101715620030a157620030a16200316f565b604052919050565b60006001600160401b03821115620030c557620030c56200316f565b50601f01601f191660200190565b60008219821115620030e957620030e962003159565b500190565b60008282101562003103576200310362003159565b500390565b60005b83811015620031255781810151838201526020016200310b565b8381111562003135576000848401525b50505050565b600060001982141562003152576200315262003159565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462000cbb57600080fd5b63ffffffff8116811462000cbb57600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220d2a684029c88acf93f33a810282bf99adc095daa9da1a2bf6344e706b7bbdb7d64736f6c63430008040033\";\nvar MockNFTBridgeImplementation__factory = /** @class */ (function (_super) {\n __extends(MockNFTBridgeImplementation__factory, _super);\n function MockNFTBridgeImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockNFTBridgeImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockNFTBridgeImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockNFTBridgeImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockNFTBridgeImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockNFTBridgeImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockNFTBridgeImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockNFTBridgeImplementation__factory.bytecode = _bytecode;\n MockNFTBridgeImplementation__factory.abi = _abi;\n return MockNFTBridgeImplementation__factory;\n}(ContractFactory));\nexport { MockNFTBridgeImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"nativeContract_\",\n type: \"bytes32\",\n },\n ],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"nativeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"testNewImplementationActive\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b506116dd806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80636352211e116100ad578063a22cb46511610071578063a22cb46514610273578063b88d4fde14610286578063c87b56dd14610299578063d3fc9864146102ac578063e985e9c5146102bf57600080fd5b80636352211e1461021357806370a08231146102265780638da5cb5b1461023957806395d89b411461024a5780639a8a05921461025257600080fd5b80631f8cdb2b116100f45780631f8cdb2b146101c157806323b872dd146101c85780633d6c043b146101db57806342842e0e146101ed57806342966c681461020057600080fd5b806301ffc9a71461013157806303e728581461015957806306fdde031461016e578063081812fc14610183578063095ea7b3146101ae575b600080fd5b61014461013f3660046113db565b6102fb565b60405190151581526020015b60405180910390f35b61016c610167366004611413565b61034d565b005b610176610418565b6040516101509190611545565b6101966101913660046114a5565b6104ac565b6040516001600160a01b039091168152602001610150565b61016c6101bc36600461135d565b610541565b6001610144565b61016c6101d636600461126f565b610657565b6008545b604051908152602001610150565b61016c6101fb36600461126f565b610688565b61016c61020e3660046114a5565b6106a3565b6101966102213660046114a5565b610703565b6101df610234366004611223565b61077a565b6007546001600160a01b0316610196565b610176610801565b600754600160a81b900461ffff1660405161ffff9091168152602001610150565b61016c610281366004611323565b610813565b61016c6102943660046112aa565b6108d8565b6101766102a73660046114a5565b610910565b61016c6102ba366004611386565b610a2d565b6101446102cd36600461123d565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b148061032c57506001600160e01b03198216635b5e139f60e01b145b8061034757506301ffc9a760e01b6001600160e01b03198316145b92915050565b600754600160a01b900460ff16156103a25760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b6007805460ff60a01b1916600160a01b17905584516103c89060009060208801906110d2565b5083516103dc9060019060208701906110d2565b506007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b0390941693909317919091179091556008555050565b60606000800180546104299061162a565b80601f01602080910402602001604051908101604052809291908181526020018280546104559061162a565b80156104a25780601f10610477576101008083540402835291602001916104a2565b820191906000526020600020905b81548152906001019060200180831161048557829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166105255760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610399565b506000908152600460205260409020546001600160a01b031690565b600061054c82610703565b9050806001600160a01b0316836001600160a01b031614156105ba5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610399565b336001600160a01b03821614806105d657506105d681336102cd565b6106485760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610399565b6106528383610a8c565b505050565b6106613382610afa565b61067d5760405162461bcd60e51b8152600401610399906115aa565b610652838383610bf1565b610652838383604051806020016040528060008152506108d8565b6007546001600160a01b031633146106f75760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610399565b61070081610d91565b50565b6000818152600260205260408120546001600160a01b0316806103475760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610399565b60006001600160a01b0382166107e55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610399565b506001600160a01b031660009081526003602052604090205490565b6060600060010180546104299061162a565b6001600160a01b03821633141561086c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610399565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6108e23383610afa565b6108fe5760405162461bcd60e51b8152600401610399906115aa565b61090a84848484610e2c565b50505050565b6000818152600260205260409020546060906001600160a01b031661098f5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610399565b600082815260056020526040902080546109a89061162a565b80601f01602080910402602001604051908101604052809291908181526020018280546109d49061162a565b8015610a215780601f106109f657610100808354040283529160200191610a21565b820191906000526020600020905b815481529060010190602001808311610a0457829003601f168201915b50505050509050919050565b6007546001600160a01b03163314610a815760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610399565b610652838383610e5f565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610ac182610703565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316610b735760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610399565b6000610b7e83610703565b9050806001600160a01b0316846001600160a01b03161480610bb95750836001600160a01b0316610bae846104ac565b6001600160a01b0316145b80610be957506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610c0482610703565b6001600160a01b031614610c6c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610399565b6001600160a01b038216610cce5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610399565b610cd9600082610a8c565b6001600160a01b0383166000908152600360205260408120805460019290610d02908490611613565b90915550506001600160a01b0382166000908152600360205260408120805460019290610d309084906115fb565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610d9c82610703565b9050610da9600083610a8c565b6001600160a01b0381166000908152600360205260408120805460019290610dd2908490611613565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610e37848484610bf1565b610e4384848484610fc5565b61090a5760405162461bcd60e51b815260040161039990611558565b6001600160a01b038316610eb55760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610399565b6000828152600260205260409020546001600160a01b031615610f1a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610399565b6001600160a01b0383166000908152600360205260408120805460019290610f439084906115fb565b9091555050600082815260026020908152604080832080546001600160a01b0319166001600160a01b038816179055600582529091208251610f87928401906110d2565b5060405182906001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b60006001600160a01b0384163b156110c757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611009903390899088908890600401611508565b602060405180830381600087803b15801561102357600080fd5b505af1925050508015611053575060408051601f3d908101601f19168201909252611050918101906113f7565b60015b6110ad573d808015611081576040519150601f19603f3d011682016040523d82523d6000602084013e611086565b606091505b5080516110a55760405162461bcd60e51b815260040161039990611558565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610be9565b506001949350505050565b8280546110de9061162a565b90600052602060002090601f0160209004810192826111005760008555611146565b82601f1061111957805160ff1916838001178555611146565b82800160010185558215611146579182015b8281111561114657825182559160200191906001019061112b565b50611152929150611156565b5090565b5b808211156111525760008155600101611157565b600067ffffffffffffffff808411156111865761118661167b565b604051601f8501601f19908116603f011681019082821181831017156111ae576111ae61167b565b816040528093508581528686860111156111c757600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146111f857600080fd5b919050565b600082601f83011261120d578081fd5b61121c8383356020850161116b565b9392505050565b600060208284031215611234578081fd5b61121c826111e1565b6000806040838503121561124f578081fd5b611258836111e1565b9150611266602084016111e1565b90509250929050565b600080600060608486031215611283578081fd5b61128c846111e1565b925061129a602085016111e1565b9150604084013590509250925092565b600080600080608085870312156112bf578081fd5b6112c8856111e1565b93506112d6602086016111e1565b925060408501359150606085013567ffffffffffffffff8111156112f8578182fd5b8501601f81018713611308578182fd5b6113178782356020840161116b565b91505092959194509250565b60008060408385031215611335578182fd5b61133e836111e1565b915060208301358015158114611352578182fd5b809150509250929050565b6000806040838503121561136f578182fd5b611378836111e1565b946020939093013593505050565b60008060006060848603121561139a578283fd5b6113a3846111e1565b925060208401359150604084013567ffffffffffffffff8111156113c5578182fd5b6113d1868287016111fd565b9150509250925092565b6000602082840312156113ec578081fd5b813561121c81611691565b600060208284031215611408578081fd5b815161121c81611691565b600080600080600060a0868803121561142a578081fd5b853567ffffffffffffffff80821115611441578283fd5b61144d89838a016111fd565b96506020880135915080821115611462578283fd5b5061146f888289016111fd565b94505061147e604087016111e1565b9250606086013561ffff81168114611494578182fd5b949793965091946080013592915050565b6000602082840312156114b6578081fd5b5035919050565b60008151808452815b818110156114e2576020818501810151868301820152016114c6565b818111156114f35782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061153b908301846114bd565b9695505050505050565b60208152600061121c60208301846114bd565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000821982111561160e5761160e611665565b500190565b60008282101561162557611625611665565b500390565b600181811c9082168061163e57607f821691505b6020821081141561165f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461070057600080fdfea264697066735822122053e675a795521297531732450a74100ca5d6a904df7cba45e128e39d6f4f416c64736f6c63430008040033\";\nvar MockNFTImplementation__factory = /** @class */ (function (_super) {\n __extends(MockNFTImplementation__factory, _super);\n function MockNFTImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockNFTImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockNFTImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockNFTImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockNFTImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockNFTImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockNFTImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockNFTImplementation__factory.bytecode = _bytecode;\n MockNFTImplementation__factory.abi = _abi;\n return MockNFTImplementation__factory;\n}(ContractFactory));\nexport { MockNFTImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"attestPrice\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"pa\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"product\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n ],\n name: \"latestAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"attestation\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct PythStructs.UpgradeContract\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedPriceAttestation\",\n type: \"bytes\",\n },\n ],\n name: \"parsePriceAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"pa\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyPythVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"testNewImplementationActive\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50611e1b806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80638129fc1c11610097578063b172b22211610066578063b172b22214610251578063d60b347f14610259578063f0a0de0c14610285578063fbe3c2cd1461029857600080fd5b80638129fc1c1461020f57806384acd1bb14610217578063970994ab146102325780639a8a05921461024557600080fd5b80632d3b5b2b116100d35780632d3b5b2b1461016c5780633cb0031e1461018c57806343aac090146101a75780634fdc60fa146101b957600080fd5b806318e3ab1c146101055780631f8cdb2b1461012d57806325394645146101345780632c3c02a414610149575b600080fd5b610118610113366004611847565b6102aa565b60405190151581526020015b60405180910390f35b6001610118565b610147610142366004611815565b6102f0565b005b6101186101573660046117ce565b60009081526005602052604090205460ff1690565b61017f61017a366004611815565b61040d565b6040516101249190611b12565b60035461ffff165b60405161ffff9091168152602001610124565b6004545b604051908152602001610124565b6101cc6101c7366004611815565b610762565b60405161012491908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6101476108b0565b6000546040516001600160a01b039091168152602001610124565b61017f6102403660046117e6565b610975565b60015461ffff16610194565b6002546101ab565b6101186102673660046117a0565b6001600160a01b031660009081526006602052604090205460ff1690565b61017f610293366004611815565b610ada565b60015462010000900461ffff16610194565b60006102b960035461ffff1690565b61ffff16826060015161ffff16146102d357506000919050565b6004548260800151146102e857506000919050565b506001919050565b60008060006102fe84610e9d565b92509250925081819061032d5760405162461bcd60e51b81526004016103249190611aff565b60405180910390fd5b506103528361014001516000908152600560205260409020805460ff19166001179055565b60006103618460e00151610762565b80519091506350797468146103a75760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b6044820152606401610324565b60015461ffff1661ffff16816040015161ffff16146103f95760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401610324565b61040681606001516110bc565b5050505050565b61041561149f565b600080600061042c6000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016104579190611aff565b60006040518083038186803b15801561046f57600080fd5b505afa158015610483573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104ab9190810190611966565b9250925092508181906104d15760405162461bcd60e51b81526004016103249190611aff565b506104db836102aa565b6105195760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b6044820152606401610324565b60006105288460e00151610ada565b9050600061053e82606001518360a00151610975565b9050806101a001516001600160401b0316826101a001516001600160401b031611156107585760608201805160a084018051600092835260076020818152604080862060ff948516875282529485902088518154838b0151888c0151871666010000000000000266ff0000000000001961ffff9092166401000000000265ffffffffffff1990931663ffffffff948516179290921716178255965160018201556080890151600282015593516003808601805460c08c015160e08d015190930b909916600160481b9081026cffffffff0000000000000000001993870b6001600160401b0390811661010090810268ffffffffffffffffff199d8e16978b1697909717969096179490941617909155918a0151805160048801805483870151938b0151880b8516600160801b90810267ffffffffffffffff60801b19958a0b8716600160401b9081026fffffffffffffffffffffffffffffffff19948516968c0b891696909617959095178616179092556101208e0151805160058c0180549983015192909d01518a0b871690930290890b86168402979091169190970b841617949094171693909317909555610140880151600690940180546101608a01516101808b01516101a08c01518616600160501b0267ffffffffffffffff60501b199188169099021671ffffffffffffffffff0000000000000000001991909616909302971694909216939093179490941791909116171790555b5095945050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061079083826111e9565b825261079d602082611d13565b90506107a98382611247565b60ff1660208301526107bc600182611d13565b9050816020015160ff166001146108155760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e7472616374557067726164652031000000000000006044820152606401610324565b61081f83826112a3565b61ffff166040830152610833600282611d13565b905061083f83826111e9565b6001600160a01b03166060830152610858602082611d13565b9050808351146108aa5760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e7472616374557067726164652032000000000000006044820152606401610324565b50919050565b60006108e37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050610907816001600160a01b031660009081526006602052604090205460ff1690565b1561094a5760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610324565b610972816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b61097d61149f565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152600160481b91829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252600160401b8082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b96810196909652610120810195909552600601546001600160401b038082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b610ae261149f565b6000610aee8382611300565b63ffffffff168252610b01600482611d13565b9050816000015163ffffffff16635032574814610b535760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b6044820152606401610324565b610b5d83826112a3565b61ffff166020830152610b71600282611d13565b9050816020015161ffff16600114610bbe5760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b6044820152606401610324565b610bc88382611247565b60ff166040830152610bdb600182611d13565b9050816040015160ff16600114610c2f5760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b6044820152606401610324565b610c3983826111e9565b6060830152610c49602082611d13565b9050610c5583826111e9565b6080830152610c65602082611d13565b9050610c718382611247565b60ff1660a0830152610c84600182611d13565b9050610c90838261135d565b600790810b900b60c0830152610ca7600882611d13565b9050610cb38382611300565b600390810b900b60e0830152610cca600482611d13565b9050610cd6838261135d565b610100830151600791820b90910b9052610cf1600882611d13565b9050610cfd838261135d565b610100830151600791820b90910b602090910152610d1c600882611d13565b9050610d28838261135d565b610100830151600791820b90910b604090910152610d47600882611d13565b9050610d53838261135d565b610120830151600791820b90910b9052610d6e600882611d13565b9050610d7a838261135d565b610120830151600791820b90910b602090910152610d99600882611d13565b9050610da5838261135d565b610120830151600791820b90910b604090910152610dc4600882611d13565b9050610dd0838261135d565b6001600160401b0316610140830152610dea600882611d13565b9050610df68382611247565b60ff16610160830152610e0a600182611d13565b9050610e168382611247565b60ff16610180830152610e2a600182611d13565b9050610e36838261135d565b6001600160401b03166101a0830152610e50600882611d13565b9050808351146108aa5760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b6044820152606401610324565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610f106000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610f3b9190611aff565b60006040518083038186803b158015610f5357600080fd5b505afa158015610f67573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f8f9190810190611966565b92509250925081610fa657919450925090506110b5565b60015462010000900461ffff1661ffff16836060015161ffff16146110025750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b60208201529093506000925090506110b5565b60025483608001511461105357505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e74726163740000000000000060208201529093506000925090506110b5565b61014083015160009081526005602052604090205460ff161561109a57826000604051806060016040528060228152602001611dc4602291399550955095505050506110b5565b50506040805160208101909152600081529093506001925090505b9193909250565b60006110ef7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506110fa826113ba565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169161113d91611ae3565b600060405180830381855af49150503d8060008114611178576040519150601f19603f3d011682016040523d82523d6000602084013e61117d565b606091505b50915091508181906111a25760405162461bcd60e51b81526004016103249190611aff565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b60006111f6826020611d13565b8351101561123e5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401610324565b50016020015190565b6000611254826001611d13565b8351101561129a5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401610324565b50016001015190565b60006112b0826002611d13565b835110156112f75760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610324565b50016002015190565b600061130d826004611d13565b835110156113545760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b6044820152606401610324565b50016004015190565b600061136a826008611d13565b835110156113b15760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b6044820152606401610324565b50016008015190565b6113c3816113fa565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b61145e5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610324565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b600082601f83011261154e578081fd5b8135602061156361155e83611cc9565b611c99565b80838252828201915082860187848660071b8901011115611582578586fd5b855b858110156115e957608080838b03121561159c578788fd5b6115a4611c4e565b8335815286840135878201526040808501356115bf81611db4565b908201526060848101356115d281611db4565b908201528552938501939190910190600101611584565b5090979650505050505050565b600082601f830112611606578081fd5b8151602061161661155e83611cc9565b80838252828201915082860187848660071b8901011115611635578586fd5b855b858110156115e957608080838b03121561164f578788fd5b611657611c4e565b83518152868401518782015260408085015161167281611db4565b9082015260608481015161168581611db4565b908201528552938501939190910190600101611637565b805180151581146116ac57600080fd5b919050565b600082601f8301126116c1578081fd5b81356116cf61155e82611cec565b8181528460208386010111156116e3578283fd5b816020850160208301379081016020019190915292915050565b600082601f83011261170d578081fd5b815161171b61155e82611cec565b81815284602083860101111561172f578283fd5b611740826020830160208701611d37565b949350505050565b80356116ac81611d7d565b80516116ac81611d7d565b80356116ac81611d8d565b80516116ac81611d8d565b80356116ac81611d9f565b80516116ac81611d9f565b80356116ac81611db4565b80516116ac81611db4565b6000602082840312156117b1578081fd5b81356001600160a01b03811681146117c7578182fd5b9392505050565b6000602082840312156117df578081fd5b5035919050565b600080604083850312156117f8578081fd5b82359150602083013561180a81611db4565b809150509250929050565b600060208284031215611826578081fd5b81356001600160401b0381111561183b578182fd5b611740848285016116b1565b600060208284031215611858578081fd5b81356001600160401b038082111561186e578283fd5b908301906101608286031215611882578283fd5b61188a611c76565b6118938361178a565b81526118a16020840161175e565b60208201526118b26040840161175e565b60408201526118c360608401611748565b6060820152608083013560808201526118de60a08401611774565b60a08201526118ef60c0840161178a565b60c082015260e083013582811115611905578485fd5b611911878286016116b1565b60e08301525061010061192581850161175e565b90820152610120838101358381111561193c578586fd5b6119488882870161153e565b91830191909152506101409283013592810192909252509392505050565b60008060006060848603121561197a578081fd5b83516001600160401b0380821115611990578283fd5b9085019061016082880312156119a4578283fd5b6119ac611c76565b6119b583611795565b81526119c360208401611769565b60208201526119d460408401611769565b60408201526119e560608401611753565b606082015260808301516080820152611a0060a0840161177f565b60a0820152611a1160c08401611795565b60c082015260e083015182811115611a27578485fd5b611a33898286016116fd565b60e083015250610100611a47818501611769565b908201526101208381015183811115611a5e578586fd5b611a6a8a8287016115f6565b918301919091525061014083810151908201529450611a8b6020870161169c565b93506040860151915080821115611aa0578283fd5b50611aad868287016116fd565b9150509250925092565b60008151808452611acf816020860160208601611d37565b601f01601f19169290920160200192915050565b60008251611af5818460208701611d37565b9190910192915050565b6020815260006117c76020830184611ab7565b815163ffffffff16815261024081016020830151611b36602084018261ffff169052565b506040830151611b4b604084018260ff169052565b50606083015160608301526080830151608083015260a0830151611b7460a084018260ff169052565b5060c0830151611b8960c084018260070b9052565b5060e0830151611b9e60e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b6101408501525050610120830151610160611c0281850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b6101408501516001600160401b039081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b604051608081016001600160401b0381118282101715611c7057611c70611d67565b60405290565b60405161016081016001600160401b0381118282101715611c7057611c70611d67565b604051601f8201601f191681016001600160401b0381118282101715611cc157611cc1611d67565b604052919050565b60006001600160401b03821115611ce257611ce2611d67565b5060051b60200190565b60006001600160401b03821115611d0557611d05611d67565b50601f01601f191660200190565b60008219821115611d3257634e487b7160e01b81526011600452602481fd5b500190565b60005b83811015611d52578181015183820152602001611d3a565b83811115611d61576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff8116811461097257600080fd5b63ffffffff8116811461097257600080fd5b6001600160401b038116811461097257600080fd5b60ff8116811461097257600080fdfe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a26469706673582212200117c9e690e88f20773bd2f5e60ac882a461f050459fde4859e0a534a819fc6e64736f6c63430008040033\";\nvar MockPythImplementation__factory = /** @class */ (function (_super) {\n __extends(MockPythImplementation__factory, _super);\n function MockPythImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockPythImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockPythImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockPythImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockPythImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockPythImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockPythImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockPythImplementation__factory.bytecode = _bytecode;\n MockPythImplementation__factory.abi = _abi;\n return MockPythImplementation__factory;\n}(ContractFactory));\nexport { MockPythImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransferAndSwap\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_tokenBridge\",\n type: \"address\",\n },\n ],\n name: \"setup\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610ce9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806301c3ac6b1461003b57806366d3820314610050575b600080fd5b61004e610049366004610963565b610080565b005b61004e61005e36600461090b565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600061009a608483516100939190610c28565b8390610440565b905060006100b6606484516100af9190610c28565b849061049e565b905060006100cc6000546001600160a01b031690565b604051630ff8f14360e11b815261ffff84166004820152602481018590526001600160a01b039190911690631ff1e2869060440160206040518083038186803b15801561011857600080fd5b505afa15801561012c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101509190610927565b6040516370a0823160e01b815230600482015290915081906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561019757600080fd5b505afa1580156101ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cf9190610af7565b905060006101e56000546001600160a01b031690565b6001600160a01b031663c3f511c1886040518263ffffffff1660e01b81526004016102109190610b57565b600060405180830381600087803b15801561022a57600080fd5b505af115801561023e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261026691908101906109d7565b9050600061028260218360e0015161044090919063ffffffff16565b90508087146102f15760405162461bcd60e51b815260206004820152603060248201527f41646472657373207061727365642066726f6d2056414120616e64207061796c60448201526f0dec2c840c8de40dcdee840dac2e8c6d60831b60648201526084015b60405180910390fd5b60e082015160009061030490604161049e565b90508061ffff168761ffff16146103765760405162461bcd60e51b815260206004820152603060248201527f436861696e4964207061727365642066726f6d2056414120616e64207061796c60448201526f0dec2c840c8de40dcdee840dac2e8c6d60831b60648201526084016102e8565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b1580156103b857600080fd5b505afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f09190610af7565b905060006103fe8683610c28565b9050600061041a60858760e0015161044090919063ffffffff16565b9050806104316001600160a01b038a1682856104fb565b50505050505050505050505050565b600061044d826020610c10565b835110156104955760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016102e8565b50016020015190565b60006104ab826002610c10565b835110156104f25760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016102e8565b50016002015190565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261054d908490610552565b505050565b60006105a7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166106249092919063ffffffff16565b80519091501561054d57808060200190518101906105c59190610943565b61054d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102e8565b6060610633848460008561063d565b90505b9392505050565b60608247101561069e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102e8565b843b6106ec5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102e8565b600080866001600160a01b031685876040516107089190610b3b565b60006040518083038185875af1925050503d8060008114610745576040519150601f19603f3d011682016040523d82523d6000602084013e61074a565b606091505b509150915061075a828286610765565b979650505050505050565b60608315610774575081610636565b8251156107845782518084602001fd5b8160405162461bcd60e51b81526004016102e89190610b57565b600082601f8301126107ae578081fd5b8151602067ffffffffffffffff8211156107ca576107ca610c85565b6107d8818360051b01610bb7565b80838252828201915082860187848660071b89010111156107f7578586fd5b855b8581101561085a57608080838b031215610811578788fd5b610819610b6a565b83518152868401518782015260406108328186016108fa565b9082015260606108438582016108fa565b9082015285529385019391909101906001016107f9565b5090979650505050505050565b600082601f830112610877578081fd5b815161088a61088582610be8565b610bb7565b81815284602083860101111561089e578283fd5b6108af826020830160208701610c3f565b949350505050565b805161ffff811681146108c957600080fd5b919050565b805163ffffffff811681146108c957600080fd5b805167ffffffffffffffff811681146108c957600080fd5b805160ff811681146108c957600080fd5b60006020828403121561091c578081fd5b813561063681610c9b565b600060208284031215610938578081fd5b815161063681610c9b565b600060208284031215610954578081fd5b81518015158114610636578182fd5b600060208284031215610974578081fd5b813567ffffffffffffffff81111561098a578182fd5b8201601f8101841361099a578182fd5b80356109a861088582610be8565b8181528560208385010111156109bc578384fd5b81602084016020830137908101602001929092525092915050565b6000602082840312156109e8578081fd5b815167ffffffffffffffff808211156109ff578283fd5b908301906101608286031215610a13578283fd5b610a1b610b93565b610a24836108fa565b8152610a32602084016108ce565b6020820152610a43604084016108ce565b6040820152610a54606084016108b7565b606082015260808301516080820152610a6f60a084016108e2565b60a0820152610a8060c084016108fa565b60c082015260e083015182811115610a96578485fd5b610aa287828601610867565b60e083015250610100610ab68185016108ce565b908201526101208381015183811115610acd578586fd5b610ad98882870161079e565b91830191909152506101409283015192810192909252509392505050565b600060208284031215610b08578081fd5b5051919050565b60008151808452610b27816020860160208601610c3f565b601f01601f19169290920160200192915050565b60008251610b4d818460208701610c3f565b9190910192915050565b6020815260006106366020830184610b0f565b6040516080810167ffffffffffffffff81118282101715610b8d57610b8d610c85565b60405290565b604051610160810167ffffffffffffffff81118282101715610b8d57610b8d610c85565b604051601f8201601f1916810167ffffffffffffffff81118282101715610be057610be0610c85565b604052919050565b600067ffffffffffffffff821115610c0257610c02610c85565b50601f01601f191660200190565b60008219821115610c2357610c23610c6f565b500190565b600082821015610c3a57610c3a610c6f565b500390565b60005b83811015610c5a578181015183820152602001610c42565b83811115610c69576000848401525b50505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610cb057600080fd5b5056fea26469706673582212204b0dc1525c10e0aefe5eb46fb61065973685ddf07d5a7e84070f45b23261bb3964736f6c63430008040033\";\nvar MockTokenBridgeIntegration__factory = /** @class */ (function (_super) {\n __extends(MockTokenBridgeIntegration__factory, _super);\n function MockTokenBridgeIntegration__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockTokenBridgeIntegration__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockTokenBridgeIntegration__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockTokenBridgeIntegration__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockTokenBridgeIntegration__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockTokenBridgeIntegration__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockTokenBridgeIntegration__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockTokenBridgeIntegration__factory.bytecode = _bytecode;\n MockTokenBridgeIntegration__factory.abi = _abi;\n return MockTokenBridgeIntegration__factory;\n}(ContractFactory));\nexport { MockTokenBridgeIntegration__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue_\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue_\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals_\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence_\",\n type: \"uint64\",\n },\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"nativeContract_\",\n type: \"bytes32\",\n },\n ],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"nativeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence_\",\n type: \"uint64\",\n },\n ],\n name: \"updateDetails\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"testNewImplementationActive\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b506111fb806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063a18cd7c611610071578063a18cd7c614610258578063a457c2d71461026b578063a9059cbb1461027e578063c71f461514610291578063dd62ed3e146102a457600080fd5b806370a08231146101d85780638da5cb5b1461020157806395d89b411461021c5780639a8a0592146102245780639dc29fac1461024557600080fd5b806323b872dd116100f457806323b872dd14610180578063313ce5671461019357806339509351146101a85780633d6c043b146101bb57806340c10f19146101c357600080fd5b806306fdde0314610126578063095ea7b31461014457806318160ddd146101675780631f8cdb2b14610179575b600080fd5b61012e6102dd565b60405161013b91906110a5565b60405180910390f35b610157610152366004610e97565b610306565b604051901515815260200161013b565b6003545b60405190815260200161013b565b6001610157565b61015761018e366004610e5c565b61031c565b60045460405160ff909116815260200161013b565b6101576101b6366004610e97565b6103d2565b60085461016b565b6101d66101d1366004610e97565b610409565b005b61016b6101e6366004610e09565b6001600160a01b031660009081526005602052604090205490565b6007546040516001600160a01b03909116815260200161013b565b61012e610441565b600754600160a81b900461ffff1660405161ffff909116815260200161013b565b6101d6610253366004610e97565b6104d6565b6101d6610266366004610ec0565b61050a565b610157610279366004610e97565b6105e0565b61015761028c366004610e97565b61067b565b6101d661029f366004610f31565b610688565b61016b6102b2366004610e2a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6040516060906102f290600090602001610fef565b604051602081830303815290604052905090565b6000610313338484610787565b50600192915050565b60006103298484846108ac565b6001600160a01b0384166000908152600660209081526040808320338452909152902054828110156103b35760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103c785336103c28685611147565b610787565b506001949350505050565b3360008181526006602090815260408083206001600160a01b038716845290915281205490916103139185906103c290869061112f565b6007546001600160a01b031633146104335760405162461bcd60e51b81526004016103aa906110f8565b61043d8282610a84565b5050565b6060600060010180546104539061115e565b80601f016020809104026020016040519081016040528092919081815260200182805461047f9061115e565b80156104cc5780601f106104a1576101008083540402835291602001916104cc565b820191906000526020600020905b8154815290600101906020018083116104af57829003601f168201915b5050505050905090565b6007546001600160a01b031633146105005760405162461bcd60e51b81526004016103aa906110f8565b61043d8282610b66565b6007546001600160a01b031633146105345760405162461bcd60e51b81526004016103aa906110f8565b60025467ffffffffffffffff8083169116106105925760405162461bcd60e51b815260206004820152601e60248201527f63757272656e74206d6574616461746120697320757020746f2064617465000060448201526064016103aa565b82516105a5906000906020860190610cb5565b5081516105b9906001906020850190610cb5565b506002805467ffffffffffffffff191667ffffffffffffffff929092169190911790555050565b3360009081526006602090815260408083206001600160a01b0386168452909152812054828110156106625760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103aa565b61067133856103c28685611147565b5060019392505050565b60006103133384846108ac565b600754600160a01b900460ff16156106d85760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064016103aa565b6007805460ff60a01b1916600160a01b17905586516106fe9060009060208a0190610cb5565b508551610712906001906020890190610cb5565b506004805460ff90961660ff19909616959095179094556002805467ffffffffffffffff90941667ffffffffffffffff19909416939093179092556007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b03909216919091179190911790556008555050565b6001600160a01b0383166107e95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103aa565b6001600160a01b03821661084a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103aa565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166109105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103aa565b6001600160a01b0382166109725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103aa565b6001600160a01b038316600090815260056020526040902054818110156109ea5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103aa565b6109f48282611147565b6001600160a01b038086166000908152600560205260408082209390935590851681529081208054849290610a2a90849061112f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a7691815260200190565b60405180910390a350505050565b6001600160a01b038216610ada5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103aa565b8060006003016000828254610aef919061112f565b90915550506001600160a01b03821660009081526005602052604081208054839290610b1c90849061112f565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610bc65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103aa565b6001600160a01b03821660009081526005602052604090205481811015610c3a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103aa565b610c448282611147565b6001600160a01b03841660009081526005602052604081209190915560038054849290610c72908490611147565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161089f565b828054610cc19061115e565b90600052602060002090601f016020900481019282610ce35760008555610d29565b82601f10610cfc57805160ff1916838001178555610d29565b82800160010185558215610d29579182015b82811115610d29578251825591602001919060010190610d0e565b50610d35929150610d39565b5090565b5b80821115610d355760008155600101610d3a565b80356001600160a01b0381168114610d6557600080fd5b919050565b600082601f830112610d7a578081fd5b813567ffffffffffffffff80821115610d9557610d956111af565b604051601f8301601f19908116603f01168101908282118183101715610dbd57610dbd6111af565b81604052838152866020858801011115610dd5578485fd5b8360208701602083013792830160200193909352509392505050565b803567ffffffffffffffff81168114610d6557600080fd5b600060208284031215610e1a578081fd5b610e2382610d4e565b9392505050565b60008060408385031215610e3c578081fd5b610e4583610d4e565b9150610e5360208401610d4e565b90509250929050565b600080600060608486031215610e70578081fd5b610e7984610d4e565b9250610e8760208501610d4e565b9150604084013590509250925092565b60008060408385031215610ea9578182fd5b610eb283610d4e565b946020939093013593505050565b600080600060608486031215610ed4578283fd5b833567ffffffffffffffff80821115610eeb578485fd5b610ef787838801610d6a565b94506020860135915080821115610f0c578384fd5b50610f1986828701610d6a565b925050610f2860408501610df1565b90509250925092565b600080600080600080600060e0888a031215610f4b578283fd5b873567ffffffffffffffff80821115610f62578485fd5b610f6e8b838c01610d6a565b985060208a0135915080821115610f83578485fd5b50610f908a828b01610d6a565b965050604088013560ff81168114610fa6578384fd5b9450610fb460608901610df1565b9350610fc260808901610d4e565b925060a088013561ffff81168114610fd8578283fd5b8092505060c0880135905092959891949750929550565b600080835482600182811c91508083168061100b57607f831692505b602080841082141561102b57634e487b7160e01b87526022600452602487fd5b81801561103f57600181146110505761107c565b60ff1986168952848901965061107c565b60008a815260209020885b868110156110745781548b82015290850190830161105b565b505084890196505b50505050505061109d816a2028576f726d686f6c652960a81b8152600b0190565b949350505050565b6000602080835283518082850152825b818110156110d1578581018301518582016040015282016110b5565b818111156110e25783604083870101525b50601f01601f1916929092016040019392505050565b60208082526017908201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604082015260600190565b6000821982111561114257611142611199565b500190565b60008282101561115957611159611199565b500390565b600181811c9082168061117257607f821691505b6020821081141561119357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220245c5f21ec2c446dcf8c00bc9781df538e807284c03eacdb4bca734cee373c2964736f6c63430008040033\";\nvar MockTokenImplementation__factory = /** @class */ (function (_super) {\n __extends(MockTokenImplementation__factory, _super);\n function MockTokenImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockTokenImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockTokenImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockTokenImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockTokenImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockTokenImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockTokenImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockTokenImplementation__factory.bytecode = _bytecode;\n MockTokenImplementation__factory.abi = _abi;\n return MockTokenImplementation__factory;\n}(ContractFactory));\nexport { MockTokenImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"src\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"guy\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"dst\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Deposit\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"src\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"dst\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"src\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Withdrawal\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n {\n inputs: [],\n name: \"deposit\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"withdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"guy\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"dst\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"src\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"dst\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b5061014e565b82805461008690610113565b90600052602060002090601f0160209004810192826100a857600085556100ee565b82601f106100c157805160ff19168380011785556100ee565b828001600101855582156100ee579182015b828111156100ee5782518255916020019190600101906100d3565b506100fa9291506100fe565b5090565b5b808211156100fa57600081556001016100ff565b600181811c9082168061012757607f821691505b6020821081141561014857634e487b7160e01b600052602260045260246000fd5b50919050565b6107c28061015d6000396000f3fe6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461016f57806370a082311461019b57806395d89b41146101c8578063a9059cbb146101dd578063d0e30db0146100af578063dd62ed3e146101fd576100af565b806306fdde03146100b7578063095ea7b3146100e257806318160ddd1461011257806323b872dd1461012f5780632e1a7d4d1461014f576100af565b366100af576100ad610235565b005b6100ad610235565b3480156100c357600080fd5b506100cc610290565b6040516100d991906106b9565b60405180910390f35b3480156100ee57600080fd5b506101026100fd366004610678565b61031e565b60405190151581526020016100d9565b34801561011e57600080fd5b50475b6040519081526020016100d9565b34801561013b57600080fd5b5061010261014a36600461063d565b61038a565b34801561015b57600080fd5b506100ad61016a3660046106a1565b61050e565b34801561017b57600080fd5b506002546101899060ff1681565b60405160ff90911681526020016100d9565b3480156101a757600080fd5b506101216101b63660046105f1565b60036020526000908152604090205481565b3480156101d457600080fd5b506100cc6105b4565b3480156101e957600080fd5b506101026101f8366004610678565b6105c1565b34801561020957600080fd5b5061012161021836600461060b565b600460209081526000928352604080842090915290825290205481565b336000908152600360205260408120805434929061025490849061070c565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b6000805461029d9061073b565b80601f01602080910402602001604051908101604052809291908181526020018280546102c99061073b565b80156103165780601f106102eb57610100808354040283529160200191610316565b820191906000526020600020905b8154815290600101906020018083116102f957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103799086815260200190565b60405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156103af57600080fd5b6001600160a01b03841633148015906103ed57506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b1561045b576001600160a01b038416600090815260046020908152604080832033845290915290205482111561042257600080fd5b6001600160a01b038416600090815260046020908152604080832033845290915281208054849290610455908490610724565b90915550505b6001600160a01b03841660009081526003602052604081208054849290610483908490610724565b90915550506001600160a01b038316600090815260036020526040812080548492906104b090849061070c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104fc91815260200190565b60405180910390a35060019392505050565b3360009081526003602052604090205481111561052a57600080fd5b3360009081526003602052604081208054839290610549908490610724565b9091555050604051339082156108fc029083906000818181858888f1935050505015801561057b573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b6001805461029d9061073b565b60006105ce33848461038a565b9392505050565b80356001600160a01b03811681146105ec57600080fd5b919050565b600060208284031215610602578081fd5b6105ce826105d5565b6000806040838503121561061d578081fd5b610626836105d5565b9150610634602084016105d5565b90509250929050565b600080600060608486031215610651578081fd5b61065a846105d5565b9250610668602085016105d5565b9150604084013590509250925092565b6000806040838503121561068a578182fd5b610693836105d5565b946020939093013593505050565b6000602082840312156106b2578081fd5b5035919050565b6000602080835283518082850152825b818110156106e5578581018301518582016040015282016106c9565b818111156106f65783604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561071f5761071f610776565b500190565b60008282101561073657610736610776565b500390565b600181811c9082168061074f57607f821691505b6020821081141561077057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220cdda305249dfc988c440acc7f04cbd9b2fbb38999d839781f9b949fcd59468de64736f6c63430008040033\";\nvar MockWETH9__factory = /** @class */ (function (_super) {\n __extends(MockWETH9__factory, _super);\n function MockWETH9__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n MockWETH9__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n MockWETH9__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n MockWETH9__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n MockWETH9__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n MockWETH9__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n MockWETH9__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n MockWETH9__factory.bytecode = _bytecode;\n MockWETH9__factory.abi = _abi;\n return MockWETH9__factory;\n}(ContractFactory));\nexport { MockWETH9__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes[]\",\n name: \"data\",\n type: \"bytes[]\",\n },\n ],\n name: \"multicall\",\n outputs: [\n {\n internalType: \"bytes[]\",\n name: \"results\",\n type: \"bytes[]\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar Multicall__factory = /** @class */ (function () {\n function Multicall__factory() {\n }\n Multicall__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Multicall__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Multicall__factory.abi = _abi;\n return Multicall__factory;\n}());\nexport { Multicall__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"splCache\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStorage.SPLCache\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"transferNFT\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransfer\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n name: \"encodeTransfer\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransfer\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n name: \"onERC721Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50613a49806100206000396000f3fe608060405260043610620001435760003560e01c80639a8a059211620000b9578063c68785191162000078578063c687851914620004b7578063c96616e114620004dc578063d60b347f146200050c578063e6a853e01462000549578063fbe3c2cd146200057d578063fbeeacd9146200059e57600080fd5b80639a8a059214620003d9578063a5799f931462000403578063aa4efa5b1462000428578063ad66a5f1146200045c578063b172b22214620004a057600080fd5b80632b51137511620001065780632b51137514620002b85780632c3c02a414620002ec5780632f3a3d5d14620003205780633ca64826146200034057806384acd1bb14620003b957600080fd5b806301f532551462000148578063150b7a0214620001c65780631a2be4da14620002055780631ff1e2861462000253578063253946451462000291575b600080fd5b3480156200015557600080fd5b506200016d620001673660046200290a565b620005fe565b604051620001bd9190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620001d357600080fd5b50620001eb620001e5366004620027ba565b62000806565b6040516001600160e01b03199091168152602001620001bd565b3480156200021257600080fd5b5062000242620002243660046200279d565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001620001bd565b3480156200026057600080fd5b50620002786200027236600462002c00565b6200088a565b6040516001600160a01b039091168152602001620001bd565b3480156200029e57600080fd5b50620002b6620002b03660046200290a565b620008b6565b005b348015620002c557600080fd5b50620002dd620002d73660046200290a565b6200099a565b604051620001bd919062002e02565b348015620002f957600080fd5b50620002426200030b366004620028d8565b60009081526004602052604090205460ff1690565b3480156200032d57600080fd5b506001546001600160a01b031662000278565b3480156200034d57600080fd5b506200039d6200035f366004620028d8565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201620001bd565b348015620003c657600080fd5b506000546001600160a01b031662000278565b348015620003e657600080fd5b5060025461ffff165b60405161ffff9091168152602001620001bd565b3480156200041057600080fd5b50620002b6620004223660046200290a565b62000b70565b3480156200043557600080fd5b506200024262000447366004620028d8565b60009081526005602052604090205460ff1690565b3480156200046957600080fd5b50620004916200047b36600462002bc2565b61ffff1660009081526009602052604090205490565b604051908152602001620001bd565b348015620004ad57600080fd5b5060035462000491565b348015620004c457600080fd5b50620002b6620004d63660046200290a565b62000c76565b620004f3620004ed36600462002858565b62000c84565b6040516001600160401b039091168152602001620001bd565b3480156200051957600080fd5b50620002426200052b3660046200279d565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156200055657600080fd5b506200056e620005683660046200298a565b62001343565b604051620001bd919062002d99565b3480156200058a57600080fd5b5060025462010000900461ffff16620003ef565b348015620005ab57600080fd5b50620005c3620005bd3660046200290a565b620013ff565b604051620001bd91908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a081018252600080825260208201819052918101829052606081018290526080810182905290620006358382620015d8565b82526200064460208262002f88565b8251909150684e465442726964676514620006b25760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b620006be83826200163a565b60ff166020830152620006d360018262002f88565b9050816020015160ff166001146200073a5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b6064820152608401620006a9565b6200074683826200169a565b61ffff1660408301526200075c60028262002f88565b90506200076a83826200169a565b61ffff1660608301526200078060028262002f88565b90506200078e8382620015d8565b6080830152620007a060208262002f88565b905080835114620008005760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b6064820152608401620006a9565b50919050565b60006001600160a01b0386163014620008785760405162461bcd60e51b815260206004820152602d60248201527f63616e206f6e6c792062726964676520746f6b656e7320766961207472616e7360448201526c19995c939195081b595d1a1bd9609a1b6064820152608401620006a9565b50630a85bd0160e11b95945050505050565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6000806000620008c684620016fb565b925092509250818190620008ef5760405162461bcd60e51b8152600401620006a9919062002d99565b50620009158361014001516000908152600460205260409020805460ff19166001179055565b6000620009268460e00151620013ff565b90506200093660025461ffff1690565b61ffff16816040015161ffff1614620009835760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401620006a9565b606081015162000993906200192a565b5050505050565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082015260c0810182905260e081018290529080620009e784826200163a565b9050620009f660018362002f88565b91508060ff1660011462000a405760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620006a9565b62000a4c8483620015d8565b835262000a5b60208362002f88565b915062000a6984836200169a565b61ffff16602084015262000a7f60028362002f88565b915062000a8d8483620015d8565b604084015262000a9f60208362002f88565b915062000aad8483620015d8565b606084015262000abf60208362002f88565b915062000acd848362001a61565b608084015262000adf60208362002f88565b915062000aee60018362002f88565b915062000b1b82602284875162000b06919062002fa3565b62000b12919062002fa3565b86919062001aba565b60a08401528351915062000b3160028362002fa3565b915062000b3f84836200169a565b61ffff1660e084015262000b5560208362002fa3565b915062000b638483620015d8565b60c0840152509092915050565b600080600062000b8084620016fb565b92509250925081819062000ba95760405162461bcd60e51b8152600401620006a9919062002d99565b5062000bcf8361014001516000908152600460205260409020805460ff19166001179055565b600062000be08460e00151620005fe565b905062000bf060025461ffff1690565b61ffff16816040015161ffff16148062000c105750604081015161ffff16155b62000c515760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b6044820152606401620006a9565b620009938160600151826080015161ffff909116600090815260096020526040902055565b62000c818162001bd3565b50565b600080600062000cac886001600160a01b031660009081526008602052604090205460ff1690565b1562000da657876001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000cec57600080fd5b505afa15801562000d01573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d27919062002be1565b9150876001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000d6357600080fd5b505afa15801562000d78573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d9e9190620028f1565b905062000f70565b60025461ffff166040516301ffc9a760e01b81526380ac58cd60e01b60048201529092506001600160a01b038916915081906301ffc9a79060240160206040518083038186803b15801562000dfa57600080fd5b505afa15801562000e0f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e359190620028bb565b62000e8d5760405162461bcd60e51b815260206004820152602160248201527f6d75737420737570706f7274207468652045524337323120696e7465726661636044820152606560f81b6064820152608401620006a9565b6040516301ffc9a760e01b8152635b5e139f60e01b60048201526001600160a01b038916906301ffc9a79060240160206040518083038186803b15801562000ed457600080fd5b505afa15801562000ee9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f0f9190620028bb565b62000f705760405162461bcd60e51b815260206004820152602a60248201527f6d75737420737570706f727420746865204552433732312d4d657461646174616044820152691032bc3a32b739b4b7b760b11b6064820152608401620006a9565b60608060608461ffff16600114620010ca5760408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b17905290516000916001600160a01b038e169162000fc6919062002c79565b600060405180830381855afa9150503d806000811462001003576040519150601f19603f3d011682016040523d82523d6000602084013e62001008565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b038f169162001051919062002c79565b600060405180830381855afa9150503d80600081146200108e576040519150601f19603f3d011682016040523d82523d6000602084013e62001093565b606091505b5091505081806020019051810190620010ad919062002954565b945080806020019051810190620010c5919062002954565b935050505b60008b6001600160a01b03168b604051602401620010ea91815260200190565b60408051601f198184030181529181526020820180516001600160e01b031663c87b56dd60e01b1790525162001121919062002c79565b600060405180830381855afa9150503d80600081146200115e576040519150601f19603f3d011682016040523d82523d6000602084013e62001163565b606091505b50915050808060200190518101906200117d919062002954565b9150506000808661ffff1660011415620011fa57604080518082018252600080825260209182018190528e8152600a82528281208351808501909452805484526001015491830191909152906020810151815190945092509050620011f38d6000908152600a6020526040812081815560010155565b5062001207565b5050602083810151908301515b60025461ffff888116911614156200128757604051632142170760e11b8152336004820152306024820152604481018d90526001600160a01b038e16906342842e0e90606401600060405180830381600087803b1580156200126857600080fd5b505af11580156200127d573d6000803e3d6000fd5b50505050620012e4565b604051630852cd8d60e31b8152600481018d90526001600160a01b038e16906342966c6890602401600060405180830381600087803b158015620012ca57600080fd5b505af1158015620012df573d6000803e3d6000fd5b505050505b620013326040518061010001604052808881526020018961ffff1681526020018481526020018381526020018e81526020018581526020018c81526020018d61ffff16815250348b62001fb7565b9d9c50505050505050505050505050565b606060c88260a00151511115620013a85760405162461bcd60e51b815260206004820152602260248201527f746f6b656e555249206d757374206e6f74206578636565642032303020627974604482015261657360f01b6064820152608401620006a9565b81516020808401516040808601516060870151608088015160a0890151805160c08b015160e08c01519651620013e99a60019a909998939493910162002cca565b6040516020818303038152906040529050919050565b6040805160808101825260008082526020820181905291810182905260608101829052906200142f8382620015d8565b82526200143e60208262002f88565b8251909150684e465442726964676514620014aa5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b6064820152608401620006a9565b620014b683826200163a565b60ff166020830152620014cb60018262002f88565b9050816020015160ff16600214620015345760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b6064820152608401620006a9565b6200154083826200169a565b61ffff1660408301526200155660028262002f88565b9050620015648382620015d8565b60608301526200157660208262002f88565b905080835114620008005760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b6064820152608401620006a9565b6000620015e782602062002f88565b83511015620016315760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401620006a9565b50016020015190565b60006200164982600162002f88565b83511015620016915760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401620006a9565b50016001015190565b6000620016a982600262002f88565b83511015620016f25760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401620006a9565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820181905261010082018390526101208201526101408101919091526000606060008060006200176f6000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b81526004016200179c919062002d99565b60006040518083038186803b158015620017b557600080fd5b505afa158015620017ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620017f4919081019062002a53565b925092509250816200180d579194509250905062001923565b60025462010000900461ffff1661ffff16836060015161ffff16146200186b5750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062001923565b600354836080015114620018be57505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062001923565b61014083015160009081526004602052604090205460ff16156200190857826000604051806060016040528060228152602001620039f26022913995509550955050505062001923565b50506040805160208101909152600081529093506001925090505b9193909250565b60006200195e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506200196b826200206c565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691620019b09162002c79565b600060405180830381855af49150503d8060008114620019ed576040519150601f19603f3d011682016040523d82523d6000602084013e620019f2565b606091505b509150915081819062001a1a5760405162461bcd60e51b8152600401620006a9919062002d99565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062001a7082602062002f88565b83511015620016315760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401620006a9565b60608162001aca81601f62002f88565b101562001b0b5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401620006a9565b62001b17828462002f88565b8451101562001b5d5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401620006a9565b60608215801562001b7e576040519150600082526020820160405262001bca565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101562001bb957805183526020928301920162001b9f565b5050858452601f01601f1916604052505b50949350505050565b600080600062001beb6000546001600160a01b031690565b6001600160a01b031663c0fd8bde856040518263ffffffff1660e01b815260040162001c18919062002d99565b60006040518083038186803b15801562001c3157600080fd5b505afa15801562001c46573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001c70919081019062002a53565b92509250925081819062001c995760405162461bcd60e51b8152600401620006a9919062002d99565b5062001ca583620020ae565b62001ce55760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b6044820152606401620006a9565b600062001cf68460e001516200099a565b905062001d1784610140015160009081526005602052604090205460ff1690565b1562001d665760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c657465640000000000006044820152606401620006a9565b62001d8b8461014001516000908152600560205260409020805460ff19166001179055565b60025461ffff1661ffff168160e0015161ffff161462001de55760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b6044820152606401620006a9565b600062001df560025461ffff1690565b61ffff16826020015161ffff16141562001e125750805162001e5d565b600062001e28836020015184600001516200088a565b90506001600160a01b03811662001e5a5762001e578360200151846000015185606001518660400151620020eb565b90505b90505b60c082015160025461ffff1661ffff16836020015161ffff161462001f3c57826020015161ffff166001141562001ec8576080830151604080518082018252606086015181528186015160208083019182526000948552600a90529190922091518255516001909101555b608083015160a08401516040516334ff261960e21b81526001600160a01b0385169263d3fc98649262001f02928692919060040162002d70565b600060405180830381600087803b15801562001f1d57600080fd5b505af115801562001f32573d6000803e3d6000fd5b5050505062001fae565b6080830151604051632142170760e11b81523060048201526001600160a01b0383811660248301526044820192909252908316906342842e0e90606401600060405180830381600087803b15801562001f9457600080fd5b505af115801562001fa9573d6000803e3d6000fd5b505050505b50505050505050565b60008062001fc58562001343565b905062001fda6000546001600160a01b031690565b6001600160a01b031663b19a437e858584600f6040518563ffffffff1660e01b81526004016200200d9392919062002e80565b6020604051808303818588803b1580156200202757600080fd5b505af11580156200203c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019062002063919062002c2e565b95945050505050565b620020778162002398565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60008160800151620020d4836060015161ffff1660009081526009602052604090205490565b1415620020e357506001919050565b506000919050565b6000620020fb60025461ffff1690565b61ffff168561ffff161415620021655760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b6064820152608401620006a9565b60006200217386866200088a565b6001600160a01b031614620021cb5760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c726561647920657869737473000000006044820152606401620006a9565b8461ffff16600114156200220d577f576f726d686f6c65204272696467656420536f6c616e612d4e4654000000000092506915d3d49354d41313919560b21b91505b6000627ce50b60e31b62002221856200243f565b6200222c856200243f565b3089896040516024016200224595949392919062002dae565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b031990951694909417909352519092506000916200228f91309185910162002d4a565b6040516020818303038152906040529050600060405180602001620022b4906200257a565b601f1982820381018352601f909101166040819052620022da9190849060200162002c97565b60408051601f19818403018152908290526001600160f01b031960f08b901b166020830152602282018990529150600090604201604051602081830303815290604052805190602001209050808251602084016000f59450843b6200233e57600080fd5b61ffff891660009081526007602090815260408083208b8452825280832080546001600160a01b0319166001600160a01b038a16908117909155835260089091529020805460ff1916600117905550505050949350505050565b803b620023fe5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620006a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606060005b6020811080156200248257508281602081106200247157634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b156200249d5780620024948162002ff0565b91505062002444565b6000816001600160401b03811115620024c657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015620024f1576020820181803683370190505b50905060005b8281101562002572578481602081106200252157634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200254657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620025698162002ff0565b915050620024f7565b509392505050565b610993806200305f83390190565b60006200259f620025998462002f5e565b62002f2b565b9050828152838383011115620025b457600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114620025e357600080fd5b919050565b600082601f830112620025f9578081fd5b815160206001600160401b0382111562002617576200261762003024565b62002627818360051b0162002f2b565b80838252828201915082860187848660071b890101111562002647578586fd5b855b85811015620026b357608080838b03121562002663578788fd5b6200266d62002eb4565b8351815286840151878201526040620026888186016200278b565b9082015260606200269b8582016200278b565b90820152855293850193919091019060010162002649565b5090979650505050505050565b80518015158114620025e357600080fd5b600082601f830112620026e2578081fd5b8151620026f3620025998262002f5e565b81815284602083860101111562002708578283fd5b6200271b82602083016020870162002fbd565b949350505050565b600082601f83011262002734578081fd5b620027458383356020850162002588565b9392505050565b8035620025e3816200303a565b8051620025e3816200303a565b8051620025e3816200304b565b80516001600160401b0381168114620025e357600080fd5b805160ff81168114620025e357600080fd5b600060208284031215620027af578081fd5b6200274582620025cb565b600080600080600060808688031215620027d2578081fd5b620027dd86620025cb565b9450620027ed60208701620025cb565b93506040860135925060608601356001600160401b038082111562002810578283fd5b818801915088601f83011262002824578283fd5b81358181111562002833578384fd5b89602082850101111562002845578384fd5b9699959850939650602001949392505050565b600080600080600060a0868803121562002870578283fd5b6200287b86620025cb565b945060208601359350604086013562002894816200303a565b9250606086013591506080860135620028ad816200304b565b809150509295509295909350565b600060208284031215620028cd578081fd5b6200274582620026c0565b600060208284031215620028ea578081fd5b5035919050565b60006020828403121562002903578081fd5b5051919050565b6000602082840312156200291c578081fd5b81356001600160401b0381111562002932578182fd5b8201601f8101841362002943578182fd5b6200271b8482356020840162002588565b60006020828403121562002966578081fd5b81516001600160401b038111156200297c578182fd5b6200271b84828501620026d1565b6000602082840312156200299c578081fd5b81356001600160401b0380821115620029b3578283fd5b908301906101008286031215620029c8578283fd5b620029d262002edf565b82358152620029e4602084016200274c565b602082015260408301356040820152606083013560608201526080830135608082015260a08301358281111562002a19578485fd5b62002a278782860162002723565b60a08301525060c083013560c082015262002a4560e084016200274c565b60e082015295945050505050565b60008060006060848603121562002a68578081fd5b83516001600160401b038082111562002a7f578283fd5b90850190610160828803121562002a94578283fd5b62002a9e62002f05565b62002aa9836200278b565b815262002ab96020840162002766565b602082015262002acc6040840162002766565b604082015262002adf6060840162002759565b60608201526080830151608082015262002afc60a0840162002773565b60a082015262002b0f60c084016200278b565b60c082015260e08301518281111562002b26578485fd5b62002b3489828601620026d1565b60e08301525061010062002b4a81850162002766565b90820152610120838101518381111562002b62578586fd5b62002b708a828701620025e8565b91830191909152506101408381015190820152945062002b9360208701620026c0565b9350604086015191508082111562002ba9578283fd5b5062002bb886828701620026d1565b9150509250925092565b60006020828403121562002bd4578081fd5b813562002745816200303a565b60006020828403121562002bf3578081fd5b815162002745816200303a565b6000806040838503121562002c13578182fd5b823562002c20816200303a565b946020939093013593505050565b60006020828403121562002c40578081fd5b620027458262002773565b6000815180845262002c6581602086016020860162002fbd565b601f01601f19169290920160200192915050565b6000825162002c8d81846020870162002fbd565b9190910192915050565b6000835162002cab81846020880162002fbd565b83519083019062002cc181836020880162002fbd565b01949350505050565b600060ff60f81b808d60f81b1683528b600184015261ffff60f01b808c60f01b1660218501528a6023850152896043850152886063850152818860f81b1660838501528651915062002d24826084860160208a0162002fbd565b920160848101949094525060f09190911b1660a482015260a60198975050505050505050565b6001600160a01b03831681526040602082018190526000906200271b9083018462002c4b565b60018060a01b038416815282602082015260606040820152600062002063606083018462002c4b565b60208152600062002745602083018462002c4b565b60a08152600062002dc360a083018862002c4b565b828103602084015262002dd7818862002c4b565b6001600160a01b03969096166040840152505061ffff92909216606083015260809091015292915050565b60208152815160208201526000602083015161ffff80821660408501526040850151606085015260608501516080850152608085015160a085015260a085015191506101008060c086015262002e5d61012086018462002c4b565b925060c086015160e08601528160e0870151168186015250508091505092915050565b63ffffffff8416815260606020820152600062002ea1606083018562002c4b565b905060ff83166040830152949350505050565b604051608081016001600160401b038111828210171562002ed95762002ed962003024565b60405290565b60405161010081016001600160401b038111828210171562002ed95762002ed962003024565b60405161016081016001600160401b038111828210171562002ed95762002ed962003024565b604051601f8201601f191681016001600160401b038111828210171562002f565762002f5662003024565b604052919050565b60006001600160401b0382111562002f7a5762002f7a62003024565b50601f01601f191660200190565b6000821982111562002f9e5762002f9e6200300e565b500190565b60008282101562002fb85762002fb86200300e565b500390565b60005b8381101562002fda57818101518382015260200162002fc0565b8381111562002fea576000848401525b50505050565b60006000198214156200300757620030076200300e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462000c8157600080fd5b63ffffffff8116811462000c8157600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220edbb83504df0192a37d3d17c6b0e90c1b1b370eb0b0ef4bcebc298f7ff73f8bb64736f6c63430008040033\";\nvar NFTBridge__factory = /** @class */ (function (_super) {\n __extends(NFTBridge__factory, _super);\n function NFTBridge__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n NFTBridge__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n NFTBridge__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n NFTBridge__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n NFTBridge__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n NFTBridge__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n NFTBridge__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n NFTBridge__factory.bytecode = _bytecode;\n NFTBridge__factory.abi = _abi;\n return NFTBridge__factory;\n}(ContractFactory));\nexport { NFTBridge__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"initData\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220fa72c28af80846ec0b7d8c02ad2f267d128c8f1fe45e0269edefa8a19ab2524564736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar NFTBridgeEntrypoint__factory = /** @class */ (function (_super) {\n __extends(NFTBridgeEntrypoint__factory, _super);\n function NFTBridgeEntrypoint__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n NFTBridgeEntrypoint__factory.prototype.deploy = function (implementation, initData, overrides) {\n return _super.prototype.deploy.call(this, implementation, initData, overrides || {});\n };\n NFTBridgeEntrypoint__factory.prototype.getDeployTransaction = function (implementation, initData, overrides) {\n return _super.prototype.getDeployTransaction.call(this, implementation, initData, overrides || {});\n };\n NFTBridgeEntrypoint__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n NFTBridgeEntrypoint__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n NFTBridgeEntrypoint__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n NFTBridgeEntrypoint__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n NFTBridgeEntrypoint__factory.bytecode = _bytecode;\n NFTBridgeEntrypoint__factory.abi = _abi;\n return NFTBridgeEntrypoint__factory;\n}(ContractFactory));\nexport { NFTBridgeEntrypoint__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"splCache\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStorage.SPLCache\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610384806100206000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80639a8a0592116100715780639a8a0592146101f8578063aa4efa5b14610213578063ad66a5f114610236578063b172b22214610268578063d60b347f14610270578063fbe3c2cd1461029c57600080fd5b80631a2be4da146100b95780631ff1e286146100fa5780632c3c02a41461014c5780632f3a3d5d1461016f5780633ca648261461018057806384acd1bb146101e7575b600080fd5b6100e56100c73660046102c5565b6001600160a01b031660009081526008602052604090205460ff1690565b60405190151581526020015b60405180910390f35b610134610108366004610325565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b0390911681526020016100f1565b6100e561015a3660046102f3565b60009081526004602052604090205460ff1690565b6001546001600160a01b0316610134565b6101cc61018e3660046102f3565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b604080518251815260209283015192810192909252016100f1565b6000546001600160a01b0316610134565b60025461ffff165b60405161ffff90911681526020016100f1565b6100e56102213660046102f3565b60009081526005602052604090205460ff1690565b61025a61024436600461030b565b61ffff1660009081526009602052604090205490565b6040519081526020016100f1565b60035461025a565b6100e561027e3660046102c5565b6001600160a01b031660009081526006602052604090205460ff1690565b60025462010000900461ffff16610200565b803561ffff811681146102c057600080fd5b919050565b6000602082840312156102d6578081fd5b81356001600160a01b03811681146102ec578182fd5b9392505050565b600060208284031215610304578081fd5b5035919050565b60006020828403121561031c578081fd5b6102ec826102ae565b60008060408385031215610337578081fd5b610340836102ae565b94602093909301359350505056fea2646970667358221220b572dc8ef622565026fb159c235320b9db8f2e2eb246e10a6438608b3883a02364736f6c63430008040033\";\nvar NFTBridgeGetters__factory = /** @class */ (function (_super) {\n __extends(NFTBridgeGetters__factory, _super);\n function NFTBridgeGetters__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n NFTBridgeGetters__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n NFTBridgeGetters__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n NFTBridgeGetters__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n NFTBridgeGetters__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n NFTBridgeGetters__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n NFTBridgeGetters__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n NFTBridgeGetters__factory.bytecode = _bytecode;\n NFTBridgeGetters__factory.abi = _abi;\n return NFTBridgeGetters__factory;\n}(ContractFactory));\nexport { NFTBridgeGetters__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"splCache\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStorage.SPLCache\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5061143e806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639a8a059211610097578063b172b22211610066578063b172b22214610342578063d60b347f1461034a578063fbe3c2cd14610376578063fbeeacd91461038857600080fd5b80639a8a0592146102bf578063a5799f93146102da578063aa4efa5b146102ed578063ad66a5f11461031057600080fd5b80632c3c02a4116100d35780632c3c02a4146102135780632f3a3d5d146102365780633ca648261461024757806384acd1bb146102ae57600080fd5b806301f53255146101055780631a2be4da146101705780631ff1e286146101ac57806325394645146101fe575b600080fd5b61011861011336600461105b565b6103d5565b6040516101679190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b61019c61017e366004611015565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001610167565b6101e66101ba36600461123d565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b6040516001600160a01b039091168152602001610167565b61021161020c36600461105b565b6105c4565b005b61019c610221366004611043565b60009081526004602052604090205460ff1690565b6001546001600160a01b03166101e6565b610293610255366004611043565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201610167565b6000546001600160a01b03166101e6565b60025461ffff165b60405161ffff9091168152602001610167565b6102116102e836600461105b565b61069b565b61019c6102fb366004611043565b60009081526005602052604090205460ff1690565b61033461031e366004611221565b61ffff1660009081526009602052604090205490565b604051908152602001610167565b600354610334565b61019c610358366004611015565b6001600160a01b031660009081526006602052604090205460ff1690565b60025462010000900461ffff166102c7565b61039b61039636600461105b565b610794565b60405161016791908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a08101825260008082526020820181905291810182905260608101829052608081018290529061040a8382610957565b8252610417602082611369565b8251909150684e4654427269646765146104845760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b61048e83826109b5565b60ff1660208301526104a1600182611369565b9050816020015160ff166001146105065760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b606482015260840161047b565b6105108382610a11565b61ffff166040830152610524600282611369565b90506105308382610a11565b61ffff166060830152610544600282611369565b90506105508382610957565b6080830152610560602082611369565b9050808351146105be5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b606482015260840161047b565b50919050565b60008060006105d284610a6e565b9250925092508181906105f85760405162461bcd60e51b815260040161047b91906112b0565b5061061d8361014001516000908152600460205260409020805460ff19166001179055565b600061062c8460e00151610794565b905061063b60025461ffff1690565b61ffff16816040015161ffff16146106865760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640161047b565b606081015161069490610c8d565b5050505050565b60008060006106a984610a6e565b9250925092508181906106cf5760405162461bcd60e51b815260040161047b91906112b0565b506106f48361014001516000908152600460205260409020805460ff19166001179055565b60006107038460e001516103d5565b905061071260025461ffff1690565b61ffff16816040015161ffff1614806107315750604081015161ffff16155b6107705760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b604482015260640161047b565b6106948160600151826080015161ffff909116600090815260096020526040902055565b6040805160808101825260008082526020820181905291810182905260608101829052906107c28382610957565b82526107cf602082611369565b8251909150684e4654427269646765146108395760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b606482015260840161047b565b61084383826109b5565b60ff166020830152610856600182611369565b9050816020015160ff166002146108bd5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b606482015260840161047b565b6108c78382610a11565b61ffff1660408301526108db600282611369565b90506108e78382610957565b60608301526108f7602082611369565b9050808351146105be5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b606482015260840161047b565b6000610964826020611369565b835110156109ac5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640161047b565b50016020015190565b60006109c2826001611369565b83511015610a085760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640161047b565b50016001015190565b6000610a1e826002611369565b83511015610a655760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640161047b565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610ae16000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610b0c91906112b0565b60006040518083038186803b158015610b2457600080fd5b505afa158015610b38573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b6091908101906110cf565b92509250925081610b775791945092509050610c86565b60025462010000900461ffff1661ffff16836060015161ffff1614610bd35750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610c86565b600354836080015114610c2457505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610c86565b61014083015160009081526004602052604090205460ff1615610c6b578260006040518060600160405280602281526020016113e760229139955095509550505050610c86565b50506040805160208101909152600081529093506001925090505b9193909250565b6000610cc07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050610ccb82610dba565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691610d0e91611294565b600060405180830381855af49150503d8060008114610d49576040519150601f19603f3d011682016040523d82523d6000602084013e610d4e565b606091505b5091509150818190610d735760405162461bcd60e51b815260040161047b91906112b0565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b610dc381610dfa565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610e5e5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161047b565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b600082601f830112610eaf578081fd5b8151602067ffffffffffffffff821115610ecb57610ecb6113bd565b610ed9818360051b01611310565b80838252828201915082860187848660071b8901011115610ef8578586fd5b855b85811015610f5b57608080838b031215610f12578788fd5b610f1a6112c3565b8351815286840151878201526040610f33818601611004565b908201526060610f44858201611004565b908201528552938501939190910190600101610efa565b5090979650505050505050565b80518015158114610f7857600080fd5b919050565b600082601f830112610f8d578081fd5b8151610fa0610f9b82611341565b611310565b818152846020838601011115610fb4578283fd5b610fc582602083016020870161138d565b949350505050565b8051610f78816113d3565b805163ffffffff81168114610f7857600080fd5b805167ffffffffffffffff81168114610f7857600080fd5b805160ff81168114610f7857600080fd5b600060208284031215611026578081fd5b81356001600160a01b038116811461103c578182fd5b9392505050565b600060208284031215611054578081fd5b5035919050565b60006020828403121561106c578081fd5b813567ffffffffffffffff811115611082578182fd5b8201601f81018413611092578182fd5b80356110a0610f9b82611341565b8181528560208385010111156110b4578384fd5b81602084016020830137908101602001929092525092915050565b6000806000606084860312156110e3578182fd5b835167ffffffffffffffff808211156110fa578384fd5b90850190610160828803121561110e578384fd5b6111166112ec565b61111f83611004565b815261112d60208401610fd8565b602082015261113e60408401610fd8565b604082015261114f60608401610fcd565b60608201526080830151608082015261116a60a08401610fec565b60a082015261117b60c08401611004565b60c082015260e083015182811115611191578586fd5b61119d89828601610f7d565b60e0830152506101006111b1818501610fd8565b9082015261012083810151838111156111c8578687fd5b6111d48a828701610e9f565b9183019190915250610140838101519082015294506111f560208701610f68565b9350604086015191508082111561120a578283fd5b5061121786828701610f7d565b9150509250925092565b600060208284031215611232578081fd5b813561103c816113d3565b6000806040838503121561124f578182fd5b823561125a816113d3565b946020939093013593505050565b6000815180845261128081602086016020860161138d565b601f01601f19169290920160200192915050565b600082516112a681846020870161138d565b9190910192915050565b60208152600061103c6020830184611268565b6040516080810167ffffffffffffffff811182821017156112e6576112e66113bd565b60405290565b604051610160810167ffffffffffffffff811182821017156112e6576112e66113bd565b604051601f8201601f1916810167ffffffffffffffff81118282101715611339576113396113bd565b604052919050565b600067ffffffffffffffff82111561135b5761135b6113bd565b50601f01601f191660200190565b6000821982111561138857634e487b7160e01b81526011600452602481fd5b500190565b60005b838110156113a8578181015183820152602001611390565b838111156113b7576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff811681146113e357600080fd5b5056fe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220953e4ca64aaf1738f34834b1797570079f7ef37e5430dad5e283f07b1fb1ded264736f6c63430008040033\";\nvar NFTBridgeGovernance__factory = /** @class */ (function (_super) {\n __extends(NFTBridgeGovernance__factory, _super);\n function NFTBridgeGovernance__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n NFTBridgeGovernance__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n NFTBridgeGovernance__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n NFTBridgeGovernance__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n NFTBridgeGovernance__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n NFTBridgeGovernance__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n NFTBridgeGovernance__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n NFTBridgeGovernance__factory.bytecode = _bytecode;\n NFTBridgeGovernance__factory.abi = _abi;\n return NFTBridgeGovernance__factory;\n}(ContractFactory));\nexport { NFTBridgeGovernance__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n ],\n name: \"bridgeContracts\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"completeTransfer\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n name: \"encodeTransfer\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"isTransferCompleted\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n ],\n name: \"isWrappedAsset\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n name: \"onERC721Received\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseRegisterChain\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainID\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.RegisterChain\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseTransfer\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"tokenChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n {\n internalType: \"bytes32\",\n name: \"to\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"toChain\",\n type: \"uint16\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.Transfer\",\n name: \"transfer\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encoded\",\n type: \"bytes\",\n },\n ],\n name: \"parseUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"newContract\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStructs.UpgradeContract\",\n name: \"chain\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"registerChain\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"splCache\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"name\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"symbol\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct NFTBridgeStorage.SPLCache\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"tokenImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"token\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenID\",\n type: \"uint256\",\n },\n {\n internalType: \"uint16\",\n name: \"recipientChain\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"recipient\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n ],\n name: \"transferNFT\",\n outputs: [\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"tokenChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"tokenAddress\",\n type: \"bytes32\",\n },\n ],\n name: \"wrappedAsset\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50613b72806100206000396000f3fe6080604052600436106200015b5760003560e01c806384acd1bb11620000c5578063c68785191162000078578063c687851914620004ff578063c96616e11462000524578063d60b347f1462000554578063e6a853e01462000591578063fbe3c2cd14620005c5578063fbeeacd914620005e657600080fd5b806384acd1bb14620004015780639a8a05921462000421578063a5799f93146200044b578063aa4efa5b1462000470578063ad66a5f114620004a4578063b172b22214620004e857600080fd5b80632b511375116200011e5780632b51137514620002d05780632c3c02a414620003045780632f3a3d5d14620003385780633ca6482614620003585780635c60da1b14620003d15780638129fc1c14620003e957600080fd5b806301f532551462000160578063150b7a0214620001de5780631a2be4da146200021d5780631ff1e286146200026b5780632539464514620002a9575b600080fd5b3480156200016d57600080fd5b50620001856200017f36600462002a33565b62000646565b604051620001d59190600060a0820190508251825260ff6020840151166020830152604083015161ffff808216604085015280606086015116606085015250506080830151608083015292915050565b60405180910390f35b348015620001eb57600080fd5b5062000203620001fd366004620028e3565b6200084e565b6040516001600160e01b03199091168152602001620001d5565b3480156200022a57600080fd5b506200025a6200023c366004620028c6565b6001600160a01b031660009081526008602052604090205460ff1690565b6040519015158152602001620001d5565b3480156200027857600080fd5b50620002906200028a36600462002d29565b620008d2565b6040516001600160a01b039091168152602001620001d5565b348015620002b657600080fd5b50620002ce620002c836600462002a33565b620008fe565b005b348015620002dd57600080fd5b50620002f5620002ef36600462002a33565b620009e2565b604051620001d5919062002f2b565b3480156200031157600080fd5b506200025a6200032336600462002a01565b60009081526004602052604090205460ff1690565b3480156200034557600080fd5b506001546001600160a01b031662000290565b3480156200036557600080fd5b50620003b56200037736600462002a01565b6040805180820190915260008082526020820152506000908152600a6020908152604091829020825180840190935280548352600101549082015290565b60408051825181526020928301519281019290925201620001d5565b348015620003de57600080fd5b506200029062000bb8565b348015620003f657600080fd5b50620002ce62000bd2565b3480156200040e57600080fd5b506000546001600160a01b031662000290565b3480156200042e57600080fd5b5060025461ffff165b60405161ffff9091168152602001620001d5565b3480156200045857600080fd5b50620002ce6200046a36600462002a33565b62000c9c565b3480156200047d57600080fd5b506200025a6200048f36600462002a01565b60009081526005602052604090205460ff1690565b348015620004b157600080fd5b50620004d9620004c336600462002ceb565b61ffff1660009081526009602052604090205490565b604051908152602001620001d5565b348015620004f557600080fd5b50600354620004d9565b3480156200050c57600080fd5b50620002ce6200051e36600462002a33565b62000da2565b6200053b6200053536600462002981565b62000dad565b6040516001600160401b039091168152602001620001d5565b3480156200056157600080fd5b506200025a62000573366004620028c6565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156200059e57600080fd5b50620005b6620005b036600462002ab3565b6200146c565b604051620001d5919062002ec2565b348015620005d257600080fd5b5060025462010000900461ffff1662000437565b348015620005f357600080fd5b506200060b6200060536600462002a33565b62001528565b604051620001d591908151815260208083015160ff169082015260408083015161ffff16908201526060918201519181019190915260800190565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906200067d838262001701565b82526200068c602082620030b1565b8251909150684e465442726964676514620006fa5760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206d6f64604482015262756c6560e81b60648201526084015b60405180910390fd5b62000706838262001763565b60ff1660208301526200071b600182620030b1565b9050816020015160ff16600114620007825760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e672061637460448201526234b7b760e91b6064820152608401620006f1565b6200078e8382620017c3565b61ffff166040830152620007a4600282620030b1565b9050620007b28382620017c3565b61ffff166060830152620007c8600282620030b1565b9050620007d6838262001701565b6080830152620007e8602082620030b1565b905080835114620008485760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964205265676973746572436861696e3a2077726f6e67206c656e6044820152620cee8d60eb1b6064820152608401620006f1565b50919050565b60006001600160a01b0386163014620008c05760405162461bcd60e51b815260206004820152602d60248201527f63616e206f6e6c792062726964676520746f6b656e7320766961207472616e7360448201526c19995c939195081b595d1a1bd9609a1b6064820152608401620006f1565b50630a85bd0160e11b95945050505050565b61ffff91909116600090815260076020908152604080832093835292905220546001600160a01b031690565b60008060006200090e8462001824565b925092509250818190620009375760405162461bcd60e51b8152600401620006f1919062002ec2565b506200095d8361014001516000908152600460205260409020805460ff19166001179055565b60006200096e8460e0015162001528565b90506200097e60025461ffff1690565b61ffff16816040015161ffff1614620009cb5760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b6044820152606401620006f1565b6060810151620009db9062001a53565b5050505050565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082015260c0810182905260e08101829052908062000a2f848262001763565b905062000a3e600183620030b1565b91508060ff1660011462000a885760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b2102a3930b739b332b960811b6044820152606401620006f1565b62000a94848362001701565b835262000aa3602083620030b1565b915062000ab18483620017c3565b61ffff16602084015262000ac7600283620030b1565b915062000ad5848362001701565b604084015262000ae7602083620030b1565b915062000af5848362001701565b606084015262000b07602083620030b1565b915062000b15848362001b8a565b608084015262000b27602083620030b1565b915062000b36600183620030b1565b915062000b6382602284875162000b4e9190620030cc565b62000b5a9190620030cc565b86919062001be3565b60a08401528351915062000b79600283620030cc565b915062000b878483620017c3565b61ffff1660e084015262000b9d602083620030cc565b915062000bab848362001701565b60c0840152509092915050565b600062000bcd6001546001600160a01b031690565b905090565b600062000c067f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062000c2b816001600160a01b031660009081526006602052604090205460ff1690565b1562000c705760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401620006f1565b62000c99816001600160a01b03166000908152600660205260409020805460ff19166001179055565b50565b600080600062000cac8462001824565b92509250925081819062000cd55760405162461bcd60e51b8152600401620006f1919062002ec2565b5062000cfb8361014001516000908152600460205260409020805460ff19166001179055565b600062000d0c8460e0015162000646565b905062000d1c60025461ffff1690565b61ffff16816040015161ffff16148062000d3c5750604081015161ffff16155b62000d7d5760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590818da185a5b881a5960821b6044820152606401620006f1565b620009db8160600151826080015161ffff909116600090815260096020526040902055565b62000c998162001cfc565b600080600062000dd5886001600160a01b031660009081526008602052604090205460ff1690565b1562000ecf57876001600160a01b0316639a8a05926040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e1557600080fd5b505afa15801562000e2a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e50919062002d0a565b9150876001600160a01b0316633d6c043b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e8c57600080fd5b505afa15801562000ea1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ec7919062002a1a565b905062001099565b60025461ffff166040516301ffc9a760e01b81526380ac58cd60e01b60048201529092506001600160a01b038916915081906301ffc9a79060240160206040518083038186803b15801562000f2357600080fd5b505afa15801562000f38573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f5e9190620029e4565b62000fb65760405162461bcd60e51b815260206004820152602160248201527f6d75737420737570706f7274207468652045524337323120696e7465726661636044820152606560f81b6064820152608401620006f1565b6040516301ffc9a760e01b8152635b5e139f60e01b60048201526001600160a01b038916906301ffc9a79060240160206040518083038186803b15801562000ffd57600080fd5b505afa15801562001012573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010389190620029e4565b620010995760405162461bcd60e51b815260206004820152602a60248201527f6d75737420737570706f727420746865204552433732312d4d657461646174616044820152691032bc3a32b739b4b7b760b11b6064820152608401620006f1565b60608060608461ffff16600114620011f35760408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b17905290516000916001600160a01b038e1691620010ef919062002da2565b600060405180830381855afa9150503d80600081146200112c576040519150601f19603f3d011682016040523d82523d6000602084013e62001131565b606091505b5060408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b1790529051919350600092506001600160a01b038f16916200117a919062002da2565b600060405180830381855afa9150503d8060008114620011b7576040519150601f19603f3d011682016040523d82523d6000602084013e620011bc565b606091505b5091505081806020019051810190620011d6919062002a7d565b945080806020019051810190620011ee919062002a7d565b935050505b60008b6001600160a01b03168b6040516024016200121391815260200190565b60408051601f198184030181529181526020820180516001600160e01b031663c87b56dd60e01b179052516200124a919062002da2565b600060405180830381855afa9150503d806000811462001287576040519150601f19603f3d011682016040523d82523d6000602084013e6200128c565b606091505b5091505080806020019051810190620012a6919062002a7d565b9150506000808661ffff16600114156200132357604080518082018252600080825260209182018190528e8152600a825282812083518085019094528054845260010154918301919091529060208101518151909450925090506200131c8d6000908152600a6020526040812081815560010155565b5062001330565b5050602083810151908301515b60025461ffff88811691161415620013b057604051632142170760e11b8152336004820152306024820152604481018d90526001600160a01b038e16906342842e0e90606401600060405180830381600087803b1580156200139157600080fd5b505af1158015620013a6573d6000803e3d6000fd5b505050506200140d565b604051630852cd8d60e31b8152600481018d90526001600160a01b038e16906342966c6890602401600060405180830381600087803b158015620013f357600080fd5b505af115801562001408573d6000803e3d6000fd5b505050505b6200145b6040518061010001604052808881526020018961ffff1681526020018481526020018381526020018e81526020018581526020018c81526020018d61ffff16815250348b620020e0565b9d9c50505050505050505050505050565b606060c88260a00151511115620014d15760405162461bcd60e51b815260206004820152602260248201527f746f6b656e555249206d757374206e6f74206578636565642032303020627974604482015261657360f01b6064820152608401620006f1565b81516020808401516040808601516060870151608088015160a0890151805160c08b015160e08c01519651620015129a60019a909998939493910162002df3565b6040516020818303038152906040529050919050565b60408051608081018252600080825260208201819052918101829052606081018290529062001558838262001701565b825262001567602082620030b1565b8251909150684e465442726964676514620015d35760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206d6044820152646f64756c6560d81b6064820152608401620006f1565b620015df838262001763565b60ff166020830152620015f4600182620030b1565b9050816020015160ff166002146200165d5760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206160448201526431ba34b7b760d91b6064820152608401620006f1565b620016698382620017c3565b61ffff1660408301526200167f600282620030b1565b90506200168d838262001701565b60608301526200169f602082620030b1565b905080835114620008485760405162461bcd60e51b815260206004820152602560248201527f696e76616c69642055706772616465436f6e74726163743a2077726f6e67206c6044820152640cadccee8d60db1b6064820152608401620006f1565b600062001710826020620030b1565b835110156200175a5760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b6044820152606401620006f1565b50016020015190565b600062001772826001620030b1565b83511015620017ba5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b6044820152606401620006f1565b50016001015190565b6000620017d2826002620030b1565b835110156200181b5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401620006f1565b50016002015190565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000620018986000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401620018c5919062002ec2565b60006040518083038186803b158015620018de57600080fd5b505afa158015620018f3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200191d919081019062002b7c565b9250925092508162001936579194509250905062001a4c565b60025462010000900461ffff1661ffff16836060015161ffff1614620019945750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b602082015290935060009250905062001a4c565b600354836080015114620019e757505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e747261637400000000000000602082015290935060009250905062001a4c565b61014083015160009081526004602052604090205460ff161562001a315782600060405180606001604052806022815260200162003b1b6022913995509550955050505062001a4c565b50506040805160208101909152600081529093506001925090505b9193909250565b600062001a877f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905062001a948262002195565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169162001ad99162002da2565b600060405180830381855af49150503d806000811462001b16576040519150601f19603f3d011682016040523d82523d6000602084013e62001b1b565b606091505b509150915081819062001b435760405162461bcd60e51b8152600401620006f1919062002ec2565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600062001b99826020620030b1565b835110156200175a5760405162461bcd60e51b8152602060048201526015602482015274746f55696e743235365f6f75744f66426f756e647360581b6044820152606401620006f1565b60608162001bf381601f620030b1565b101562001c345760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401620006f1565b62001c408284620030b1565b8451101562001c865760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401620006f1565b60608215801562001ca7576040519150600082526020820160405262001cf3565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101562001ce257805183526020928301920162001cc8565b5050858452601f01601f1916604052505b50949350505050565b600080600062001d146000546001600160a01b031690565b6001600160a01b031663c0fd8bde856040518263ffffffff1660e01b815260040162001d41919062002ec2565b60006040518083038186803b15801562001d5a57600080fd5b505afa15801562001d6f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001d99919081019062002b7c565b92509250925081819062001dc25760405162461bcd60e51b8152600401620006f1919062002ec2565b5062001dce83620021d7565b62001e0e5760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b6044820152606401620006f1565b600062001e1f8460e00151620009e2565b905062001e4084610140015160009081526005602052604090205460ff1690565b1562001e8f5760405162461bcd60e51b815260206004820152601a60248201527f7472616e7366657220616c726561647920636f6d706c657465640000000000006044820152606401620006f1565b62001eb48461014001516000908152600560205260409020805460ff19166001179055565b60025461ffff1661ffff168160e0015161ffff161462001f0e5760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103a30b933b2ba1031b430b4b760611b6044820152606401620006f1565b600062001f1e60025461ffff1690565b61ffff16826020015161ffff16141562001f3b5750805162001f86565b600062001f5183602001518460000151620008d2565b90506001600160a01b03811662001f835762001f80836020015184600001518560600151866040015162002214565b90505b90505b60c082015160025461ffff1661ffff16836020015161ffff16146200206557826020015161ffff166001141562001ff1576080830151604080518082018252606086015181528186015160208083019182526000948552600a90529190922091518255516001909101555b608083015160a08401516040516334ff261960e21b81526001600160a01b0385169263d3fc9864926200202b928692919060040162002e99565b600060405180830381600087803b1580156200204657600080fd5b505af11580156200205b573d6000803e3d6000fd5b50505050620020d7565b6080830151604051632142170760e11b81523060048201526001600160a01b0383811660248301526044820192909252908316906342842e0e90606401600060405180830381600087803b158015620020bd57600080fd5b505af1158015620020d2573d6000803e3d6000fd5b505050505b50505050505050565b600080620020ee856200146c565b9050620021036000546001600160a01b031690565b6001600160a01b031663b19a437e858584600f6040518563ffffffff1660e01b8152600401620021369392919062002fa9565b6020604051808303818588803b1580156200215057600080fd5b505af115801562002165573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906200218c919062002d57565b95945050505050565b620021a081620024c1565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60008160800151620021fd836060015161ffff1660009081526009602052604090205490565b14156200220c57506001919050565b506000919050565b60006200222460025461ffff1690565b61ffff168561ffff1614156200228e5760405162461bcd60e51b815260206004820152602860248201527f63616e206f6e6c79207772617020746f6b656e732066726f6d20666f726569676044820152676e20636861696e7360c01b6064820152608401620006f1565b60006200229c8686620008d2565b6001600160a01b031614620022f45760405162461bcd60e51b815260206004820152601c60248201527f7772617070656420617373657420616c726561647920657869737473000000006044820152606401620006f1565b8461ffff166001141562002336577f576f726d686f6c65204272696467656420536f6c616e612d4e4654000000000092506915d3d49354d41313919560b21b91505b6000627ce50b60e31b6200234a8562002568565b620023558562002568565b3089896040516024016200236e95949392919062002ed7565b60408051601f19818403018152918152602080830180516001600160e01b03166001600160e01b03199095169490941790935251909250600091620023b891309185910162002e73565b6040516020818303038152906040529050600060405180602001620023dd90620026a3565b601f1982820381018352601f909101166040819052620024039190849060200162002dc0565b60408051601f19818403018152908290526001600160f01b031960f08b901b166020830152602282018990529150600090604201604051602081830303815290604052805190602001209050808251602084016000f59450843b6200246757600080fd5b61ffff891660009081526007602090815260408083208b8452825280832080546001600160a01b0319166001600160a01b038a16908117909155835260089091529020805460ff1916600117905550505050949350505050565b803b620025275760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620006f1565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b606060005b602081108015620025ab57508281602081106200259a57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b15620025c65780620025bd8162003119565b9150506200256d565b6000816001600160401b03811115620025ef57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156200261a576020820181803683370190505b50905060005b828110156200269b578481602081106200264a57634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200266f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080620026928162003119565b91505062002620565b509392505050565b610993806200318883390190565b6000620026c8620026c28462003087565b62003054565b9050828152838383011115620026dd57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146200270c57600080fd5b919050565b600082601f83011262002722578081fd5b815160206001600160401b038211156200274057620027406200314d565b62002750818360051b0162003054565b80838252828201915082860187848660071b890101111562002770578586fd5b855b85811015620027dc57608080838b0312156200278c578788fd5b6200279662002fdd565b8351815286840151878201526040620027b1818601620028b4565b908201526060620027c4858201620028b4565b90820152855293850193919091019060010162002772565b5090979650505050505050565b805180151581146200270c57600080fd5b600082601f8301126200280b578081fd5b81516200281c620026c28262003087565b81815284602083860101111562002831578283fd5b62002844826020830160208701620030e6565b949350505050565b600082601f8301126200285d578081fd5b6200286e83833560208501620026b1565b9392505050565b80356200270c8162003163565b80516200270c8162003163565b80516200270c8162003174565b80516001600160401b03811681146200270c57600080fd5b805160ff811681146200270c57600080fd5b600060208284031215620028d8578081fd5b6200286e82620026f4565b600080600080600060808688031215620028fb578081fd5b6200290686620026f4565b94506200291660208701620026f4565b93506040860135925060608601356001600160401b038082111562002939578283fd5b818801915088601f8301126200294d578283fd5b8135818111156200295c578384fd5b8960208285010111156200296e578384fd5b9699959850939650602001949392505050565b600080600080600060a0868803121562002999578283fd5b620029a486620026f4565b9450602086013593506040860135620029bd8162003163565b9250606086013591506080860135620029d68162003174565b809150509295509295909350565b600060208284031215620029f6578081fd5b6200286e82620027e9565b60006020828403121562002a13578081fd5b5035919050565b60006020828403121562002a2c578081fd5b5051919050565b60006020828403121562002a45578081fd5b81356001600160401b0381111562002a5b578182fd5b8201601f8101841362002a6c578182fd5b6200284484823560208401620026b1565b60006020828403121562002a8f578081fd5b81516001600160401b0381111562002aa5578182fd5b6200284484828501620027fa565b60006020828403121562002ac5578081fd5b81356001600160401b038082111562002adc578283fd5b90830190610100828603121562002af1578283fd5b62002afb62003008565b8235815262002b0d6020840162002875565b602082015260408301356040820152606083013560608201526080830135608082015260a08301358281111562002b42578485fd5b62002b50878286016200284c565b60a08301525060c083013560c082015262002b6e60e0840162002875565b60e082015295945050505050565b60008060006060848603121562002b91578081fd5b83516001600160401b038082111562002ba8578283fd5b90850190610160828803121562002bbd578283fd5b62002bc76200302e565b62002bd283620028b4565b815262002be2602084016200288f565b602082015262002bf5604084016200288f565b604082015262002c086060840162002882565b60608201526080830151608082015262002c2560a084016200289c565b60a082015262002c3860c08401620028b4565b60c082015260e08301518281111562002c4f578485fd5b62002c5d89828601620027fa565b60e08301525061010062002c738185016200288f565b90820152610120838101518381111562002c8b578586fd5b62002c998a82870162002711565b91830191909152506101408381015190820152945062002cbc60208701620027e9565b9350604086015191508082111562002cd2578283fd5b5062002ce186828701620027fa565b9150509250925092565b60006020828403121562002cfd578081fd5b81356200286e8162003163565b60006020828403121562002d1c578081fd5b81516200286e8162003163565b6000806040838503121562002d3c578182fd5b823562002d498162003163565b946020939093013593505050565b60006020828403121562002d69578081fd5b6200286e826200289c565b6000815180845262002d8e816020860160208601620030e6565b601f01601f19169290920160200192915050565b6000825162002db6818460208701620030e6565b9190910192915050565b6000835162002dd4818460208801620030e6565b83519083019062002dea818360208801620030e6565b01949350505050565b600060ff60f81b808d60f81b1683528b600184015261ffff60f01b808c60f01b1660218501528a6023850152896043850152886063850152818860f81b1660838501528651915062002e4d826084860160208a01620030e6565b920160848101949094525060f09190911b1660a482015260a60198975050505050505050565b6001600160a01b0383168152604060208201819052600090620028449083018462002d74565b60018060a01b03841681528260208201526060604082015260006200218c606083018462002d74565b6020815260006200286e602083018462002d74565b60a08152600062002eec60a083018862002d74565b828103602084015262002f00818862002d74565b6001600160a01b03969096166040840152505061ffff92909216606083015260809091015292915050565b60208152815160208201526000602083015161ffff80821660408501526040850151606085015260608501516080850152608085015160a085015260a085015191506101008060c086015262002f8661012086018462002d74565b925060c086015160e08601528160e0870151168186015250508091505092915050565b63ffffffff8416815260606020820152600062002fca606083018562002d74565b905060ff83166040830152949350505050565b604051608081016001600160401b03811182821017156200300257620030026200314d565b60405290565b60405161010081016001600160401b03811182821017156200300257620030026200314d565b60405161016081016001600160401b03811182821017156200300257620030026200314d565b604051601f8201601f191681016001600160401b03811182821017156200307f576200307f6200314d565b604052919050565b60006001600160401b03821115620030a357620030a36200314d565b50601f01601f191660200190565b60008219821115620030c757620030c762003137565b500190565b600082821015620030e157620030e162003137565b500390565b60005b8381101562003103578181015183820152602001620030e9565b8381111562003113576000848401525b50505050565b600060001982141562003130576200313062003137565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b61ffff8116811462000c9957600080fd5b63ffffffff8116811462000c9957600080fdfe608060405234801561001057600080fd5b5060405161099338038061099383398101604081905261002f9161048e565b818161005c60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d51610599565b60008051602061094c8339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b505050506105fe565b6100a483610175565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100e55750805b156101705761016e836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015e9190610474565b8361031560201b6100291760201c565b505b505050565b6101888161034160201b6100551760201c565b6101e75760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61026a816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022357600080fd5b505afa158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610474565b61034160201b6100551760201c565b6102cf5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101de565b806102f460008051602061094c83398151915260001b61034760201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061033a838360405180606001604052806027815260200161096c6027913961034a565b9392505050565b3b151590565b90565b6060833b6103a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101de565b600080856001600160a01b0316856040516103c4919061054a565b600060405180830381855af49150503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b50909250905061041582828661041f565b9695505050505050565b6060831561042e57508161033a565b82511561043e5782518084602001fd5b8160405162461bcd60e51b81526004016101de9190610566565b80516001600160a01b038116811461046f57600080fd5b919050565b600060208284031215610485578081fd5b61033a82610458565b600080604083850312156104a0578081fd5b6104a983610458565b60208401519092506001600160401b03808211156104c5578283fd5b818501915085601f8301126104d8578283fd5b8151818111156104ea576104ea6105e8565b604051601f8201601f19908116603f01168101908382118183101715610512576105126105e8565b8160405282815288602084870101111561052a578586fd5b61053b8360208301602088016105bc565b80955050505050509250929050565b6000825161055c8184602087016105bc565b9190910192915050565b60208152600082518060208401526105858160408501602087016105bc565b601f01601f19169190910160400192915050565b6000828210156105b757634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105d75781810151838201526020016105bf565b8381111561016e5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f8061060d6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b602081526000825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220db7a2777c6b1ddfb0f9f24176e91b7e47f3d7bb5084853c5eadb2ecc2b57b05264736f6c63430008040033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a26469706673582212200ebafc498d19e44a45471c07fba4c37909cb4590c32e480b30fa07623fa70a5b64736f6c63430008040033\";\nvar NFTBridgeImplementation__factory = /** @class */ (function (_super) {\n __extends(NFTBridgeImplementation__factory, _super);\n function NFTBridgeImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n NFTBridgeImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n NFTBridgeImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n NFTBridgeImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n NFTBridgeImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n NFTBridgeImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n NFTBridgeImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n NFTBridgeImplementation__factory.bytecode = _bytecode;\n NFTBridgeImplementation__factory.abi = _abi;\n return NFTBridgeImplementation__factory;\n}(ContractFactory));\nexport { NFTBridgeImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"wormhole\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"governanceChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"governanceContract\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"tokenImplementation\",\n type: \"address\",\n },\n ],\n name: \"setup\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5061026b806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80637e89644614610030575b600080fd5b61004361003e3660046101c9565b610045565b005b60028054600080546001600160a01b0388166001600160a01b031990911617905561ffff858116620100000263ffffffff19909216908816171790556003829055600180546001600160a01b0319166001600160a01b0383161790556100aa866100b2565b505050505050565b6100bb816100f2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b61015a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146101b257600080fd5b919050565b803561ffff811681146101b257600080fd5b60008060008060008060c087890312156101e1578182fd5b6101ea8761019b565b95506101f8602088016101b7565b94506102066040880161019b565b9350610214606088016101b7565b92506080870135915061022960a0880161019b565b9050929550929550929556fea26469706673582212206c5de73b33bd16db0a207bba6fd4066cd37fa1b5afe129c72e2dbd6a2b8daf1764736f6c63430008040033\";\nvar NFTBridgeSetup__factory = /** @class */ (function (_super) {\n __extends(NFTBridgeSetup__factory, _super);\n function NFTBridgeSetup__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n NFTBridgeSetup__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n NFTBridgeSetup__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n NFTBridgeSetup__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n NFTBridgeSetup__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n NFTBridgeSetup__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n NFTBridgeSetup__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n NFTBridgeSetup__factory.bytecode = _bytecode;\n NFTBridgeSetup__factory.abi = _abi;\n return NFTBridgeSetup__factory;\n}(ContractFactory));\nexport { NFTBridgeSetup__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"nativeContract_\",\n type: \"bytes32\",\n },\n ],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"nativeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"string\",\n name: \"uri\",\n type: \"string\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b506116cb806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80636352211e116100ad578063a22cb46511610071578063a22cb46514610261578063b88d4fde14610274578063c87b56dd14610287578063d3fc98641461029a578063e985e9c5146102ad57600080fd5b80636352211e1461020157806370a08231146102145780638da5cb5b1461022757806395d89b41146102385780639a8a05921461024057600080fd5b8063095ea7b3116100f4578063095ea7b3146101a357806323b872dd146101b65780633d6c043b146101c957806342842e0e146101db57806342966c68146101ee57600080fd5b806301ffc9a71461012657806303e728581461014e57806306fdde0314610163578063081812fc14610178575b600080fd5b6101396101343660046113c9565b6102e9565b60405190151581526020015b60405180910390f35b61016161015c366004611401565b61033b565b005b61016b610406565b6040516101459190611533565b61018b610186366004611493565b61049a565b6040516001600160a01b039091168152602001610145565b6101616101b136600461134b565b61052f565b6101616101c436600461125d565b610645565b6008545b604051908152602001610145565b6101616101e936600461125d565b610676565b6101616101fc366004611493565b610691565b61018b61020f366004611493565b6106f1565b6101cd610222366004611211565b610768565b6007546001600160a01b031661018b565b61016b6107ef565b600754600160a81b900461ffff1660405161ffff9091168152602001610145565b61016161026f366004611311565b610801565b610161610282366004611298565b6108c6565b61016b610295366004611493565b6108fe565b6101616102a8366004611374565b610a1b565b6101396102bb36600461122b565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b148061031a57506001600160e01b03198216635b5e139f60e01b145b8061033557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600754600160a01b900460ff16156103905760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b6007805460ff60a01b1916600160a01b17905584516103b69060009060208801906110c0565b5083516103ca9060019060208701906110c0565b506007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b0390941693909317919091179091556008555050565b606060008001805461041790611618565b80601f016020809104026020016040519081016040528092919081815260200182805461044390611618565b80156104905780601f1061046557610100808354040283529160200191610490565b820191906000526020600020905b81548152906001019060200180831161047357829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166105135760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610387565b506000908152600460205260409020546001600160a01b031690565b600061053a826106f1565b9050806001600160a01b0316836001600160a01b031614156105a85760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610387565b336001600160a01b03821614806105c457506105c481336102bb565b6106365760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610387565b6106408383610a7a565b505050565b61064f3382610ae8565b61066b5760405162461bcd60e51b815260040161038790611598565b610640838383610bdf565b610640838383604051806020016040528060008152506108c6565b6007546001600160a01b031633146106e55760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610387565b6106ee81610d7f565b50565b6000818152600260205260408120546001600160a01b0316806103355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610387565b60006001600160a01b0382166107d35760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610387565b506001600160a01b031660009081526003602052604090205490565b60606000600101805461041790611618565b6001600160a01b03821633141561085a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610387565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6108d03383610ae8565b6108ec5760405162461bcd60e51b815260040161038790611598565b6108f884848484610e1a565b50505050565b6000818152600260205260409020546060906001600160a01b031661097d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610387565b6000828152600560205260409020805461099690611618565b80601f01602080910402602001604051908101604052809291908181526020018280546109c290611618565b8015610a0f5780601f106109e457610100808354040283529160200191610a0f565b820191906000526020600020905b8154815290600101906020018083116109f257829003601f168201915b50505050509050919050565b6007546001600160a01b03163314610a6f5760405162461bcd60e51b815260206004820152601760248201527631b0b63632b91034b9903737ba103a34329037bbb732b960491b6044820152606401610387565b610640838383610e4d565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610aaf826106f1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316610b615760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610387565b6000610b6c836106f1565b9050806001600160a01b0316846001600160a01b03161480610ba75750836001600160a01b0316610b9c8461049a565b6001600160a01b0316145b80610bd757506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610bf2826106f1565b6001600160a01b031614610c5a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610387565b6001600160a01b038216610cbc5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610387565b610cc7600082610a7a565b6001600160a01b0383166000908152600360205260408120805460019290610cf0908490611601565b90915550506001600160a01b0382166000908152600360205260408120805460019290610d1e9084906115e9565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610d8a826106f1565b9050610d97600083610a7a565b6001600160a01b0381166000908152600360205260408120805460019290610dc0908490611601565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610e25848484610bdf565b610e3184848484610fb3565b6108f85760405162461bcd60e51b815260040161038790611546565b6001600160a01b038316610ea35760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610387565b6000828152600260205260409020546001600160a01b031615610f085760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610387565b6001600160a01b0383166000908152600360205260408120805460019290610f319084906115e9565b9091555050600082815260026020908152604080832080546001600160a01b0319166001600160a01b038816179055600582529091208251610f75928401906110c0565b5060405182906001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b60006001600160a01b0384163b156110b557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610ff79033908990889088906004016114f6565b602060405180830381600087803b15801561101157600080fd5b505af1925050508015611041575060408051601f3d908101601f1916820190925261103e918101906113e5565b60015b61109b573d80801561106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b5080516110935760405162461bcd60e51b815260040161038790611546565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610bd7565b506001949350505050565b8280546110cc90611618565b90600052602060002090601f0160209004810192826110ee5760008555611134565b82601f1061110757805160ff1916838001178555611134565b82800160010185558215611134579182015b82811115611134578251825591602001919060010190611119565b50611140929150611144565b5090565b5b808211156111405760008155600101611145565b600067ffffffffffffffff8084111561117457611174611669565b604051601f8501601f19908116603f0116810190828211818310171561119c5761119c611669565b816040528093508581528686860111156111b557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146111e657600080fd5b919050565b600082601f8301126111fb578081fd5b61120a83833560208501611159565b9392505050565b600060208284031215611222578081fd5b61120a826111cf565b6000806040838503121561123d578081fd5b611246836111cf565b9150611254602084016111cf565b90509250929050565b600080600060608486031215611271578081fd5b61127a846111cf565b9250611288602085016111cf565b9150604084013590509250925092565b600080600080608085870312156112ad578081fd5b6112b6856111cf565b93506112c4602086016111cf565b925060408501359150606085013567ffffffffffffffff8111156112e6578182fd5b8501601f810187136112f6578182fd5b61130587823560208401611159565b91505092959194509250565b60008060408385031215611323578182fd5b61132c836111cf565b915060208301358015158114611340578182fd5b809150509250929050565b6000806040838503121561135d578182fd5b611366836111cf565b946020939093013593505050565b600080600060608486031215611388578283fd5b611391846111cf565b925060208401359150604084013567ffffffffffffffff8111156113b3578182fd5b6113bf868287016111eb565b9150509250925092565b6000602082840312156113da578081fd5b813561120a8161167f565b6000602082840312156113f6578081fd5b815161120a8161167f565b600080600080600060a08688031215611418578081fd5b853567ffffffffffffffff8082111561142f578283fd5b61143b89838a016111eb565b96506020880135915080821115611450578283fd5b5061145d888289016111eb565b94505061146c604087016111cf565b9250606086013561ffff81168114611482578182fd5b949793965091946080013592915050565b6000602082840312156114a4578081fd5b5035919050565b60008151808452815b818110156114d0576020818501810151868301820152016114b4565b818111156114e15782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611529908301846114ab565b9695505050505050565b60208152600061120a60208301846114ab565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156115fc576115fc611653565b500190565b60008282101561161357611613611653565b500390565b600181811c9082168061162c57607f821691505b6020821081141561164d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b0319811681146106ee57600080fdfea2646970667358221220402158da80c02b774b61211b9afa6342a1a5a9d20ac945ec30ddf0d040dc1c4164736f6c63430008040033\";\nvar NFTImplementation__factory = /** @class */ (function (_super) {\n __extends(NFTImplementation__factory, _super);\n function NFTImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n NFTImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n NFTImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n NFTImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n NFTImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n NFTImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n NFTImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n NFTImplementation__factory.bytecode = _bytecode;\n NFTImplementation__factory.abi = _abi;\n return NFTImplementation__factory;\n}(ContractFactory));\nexport { NFTImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar Ownable__factory = /** @class */ (function () {\n function Ownable__factory() {\n }\n Ownable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Ownable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Ownable__factory.abi = _abi;\n return Ownable__factory;\n}());\nexport { Ownable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Paused\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"Unpaused\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"paused\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar Pausable__factory = /** @class */ (function () {\n function Pausable__factory() {\n }\n Pausable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Pausable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Pausable__factory.abi = _abi;\n return Pausable__factory;\n}());\nexport { Pausable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"payees\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"shares_\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"shares\",\n type: \"uint256\",\n },\n ],\n name: \"PayeeAdded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"PaymentReceived\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"PaymentReleased\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"payee\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"release\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"released\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"shares\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalReleased\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalShares\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405260405162000b6a38038062000b6a8339810160408190526200002691620003db565b8051825114620000985760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620000eb5760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f2070617965657300000000000060448201526064016200008f565b60005b82518110156200016f576200015a8382815181106200011d57634e487b7160e01b600052603260045260246000fd5b60200260200101518383815181106200014657634e487b7160e01b600052603260045260246000fd5b60200260200101516200017860201b60201c565b8062000166816200052c565b915050620000ee565b50505062000576565b6001600160a01b038216620001e55760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b60648201526084016200008f565b60008111620002375760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a2073686172657320617265203000000060448201526064016200008f565b6001600160a01b03821660009081526002602052604090205415620002b35760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b60648201526084016200008f565b60048054600181019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0384169081179091556000908152600260205260408120829055546200031b90829062000511565b600055604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b600082601f83011262000375578081fd5b815160206200038e6200038883620004eb565b620004b8565b80838252828201915082860187848660051b8901011115620003ae578586fd5b855b85811015620003ce57815184529284019290840190600101620003b0565b5090979650505050505050565b60008060408385031215620003ee578182fd5b82516001600160401b038082111562000405578384fd5b818501915085601f83011262000419578384fd5b815160206200042c6200038883620004eb565b8083825282820191508286018a848660051b89010111156200044c578889fd5b8896505b84871015620004855780516001600160a01b03811681146200047057898afd5b83526001969096019591830191830162000450565b50918801519196509093505050808211156200049f578283fd5b50620004ae8582860162000364565b9150509250929050565b604051601f8201601f191681016001600160401b0381118282101715620004e357620004e362000560565b604052919050565b60006001600160401b0382111562000507576200050762000560565b5060051b60200190565b600082198211156200052757620005276200054a565b500190565b60006000198214156200054357620005436200054a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6105e480620005866000396000f3fe6080604052600436106100595760003560e01c806319165587146100a75780633a98ef39146100c95780638b83209b146100ed5780639852595c14610125578063ce7c2ac21461015b578063e33b7de314610191576100a2565b366100a2577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156100b357600080fd5b506100c76100c23660046104d7565b6101a6565b005b3480156100d557600080fd5b506000545b6040519081526020015b60405180910390f35b3480156100f957600080fd5b5061010d6101083660046104fa565b61037b565b6040516001600160a01b0390911681526020016100e4565b34801561013157600080fd5b506100da6101403660046104d7565b6001600160a01b031660009081526003602052604090205490565b34801561016757600080fd5b506100da6101763660046104d7565b6001600160a01b031660009081526002602052604090205490565b34801561019d57600080fd5b506001546100da565b6001600160a01b03811660009081526002602052604090205461021f5760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201526573686172657360d01b60648201526084015b60405180910390fd5b60006001544761022f9190610512565b6001600160a01b03831660009081526003602090815260408083205483546002909352908320549394509192610265908561054a565b61026f919061052a565b6102799190610569565b9050806102dc5760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201526a191d59481c185e5b595b9d60aa1b6064820152608401610216565b6001600160a01b038316600090815260036020526040902054610300908290610512565b6001600160a01b038416600090815260036020526040902055600154610327908290610512565b60015561033483826103b9565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b60006004828154811061039e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031692915050565b804710156104095760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610216565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610456576040519150601f19603f3d011682016040523d82523d6000602084013e61045b565b606091505b50509050806104d25760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610216565b505050565b6000602082840312156104e8578081fd5b81356104f381610596565b9392505050565b60006020828403121561050b578081fd5b5035919050565b6000821982111561052557610525610580565b500190565b60008261054557634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561056457610564610580565b500290565b60008282101561057b5761057b610580565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105ab57600080fd5b5056fea2646970667358221220fd47b4c67cba81d391f2a7510b725d33aab03c0d4da3265f86bffb2017e1ec8c64736f6c63430008030033\";\nvar PaymentSplitter__factory = /** @class */ (function (_super) {\n __extends(PaymentSplitter__factory, _super);\n function PaymentSplitter__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n PaymentSplitter__factory.prototype.deploy = function (payees, shares_, overrides) {\n return _super.prototype.deploy.call(this, payees, shares_, overrides || {});\n };\n PaymentSplitter__factory.prototype.getDeployTransaction = function (payees, shares_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, payees, shares_, overrides || {});\n };\n PaymentSplitter__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n PaymentSplitter__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n PaymentSplitter__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n PaymentSplitter__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n PaymentSplitter__factory.bytecode = _bytecode;\n PaymentSplitter__factory.abi = _abi;\n return PaymentSplitter__factory;\n}(ContractFactory));\nexport { PaymentSplitter__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar Proxy__factory = /** @class */ (function () {\n function Proxy__factory() {\n }\n Proxy__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Proxy__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Proxy__factory.abi = _abi;\n return Proxy__factory;\n}());\nexport { Proxy__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"contract TransparentUpgradeableProxy\",\n name: \"proxy\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"changeProxyAdmin\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract TransparentUpgradeableProxy\",\n name: \"proxy\",\n type: \"address\",\n },\n ],\n name: \"getProxyAdmin\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract TransparentUpgradeableProxy\",\n name: \"proxy\",\n type: \"address\",\n },\n ],\n name: \"getProxyImplementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract TransparentUpgradeableProxy\",\n name: \"proxy\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract TransparentUpgradeableProxy\",\n name: \"proxy\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"upgradeAndCall\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6107198061007e6000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead146101645761007b565b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104d8565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610517565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461054f565b6102de565b34801561013057600080fd5b506100d161013f366004610517565b61036f565b34801561015057600080fd5b506100d161015f3660046104d8565b6103c7565b34801561017057600080fd5b506100a061017f3660046104d8565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d91906104fb565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610683565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610683565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610683565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610620565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610683565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610683565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104e9578081fd5b81356104f4816106ce565b9392505050565b60006020828403121561050c578081fd5b81516104f4816106ce565b60008060408385031215610529578081fd5b8235610534816106ce565b91506020830135610544816106ce565b809150509250929050565b600080600060608486031215610563578081fd5b833561056e816106ce565b9250602084013561057e816106ce565b9150604084013567ffffffffffffffff8082111561059a578283fd5b818601915086601f8301126105ad578283fd5b8135818111156105bf576105bf6106b8565b604051601f8201601f19908116603f011681019083821181831017156105e7576105e76106b8565b816040528281528960208487010111156105ff578586fd5b82602086016020830137856020848301015280955050505050509250925092565b600060018060a01b038416825260206040818401528351806040850152825b8181101561065b5785810183015185820160600152820161063f565b8181111561066c5783606083870101525b50601f01601f191692909201606001949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461045f57600080fdfea264697066735822122055d89c2449fb1dbc93789ed0dbadfb30c56205789c038ea1f880e9dc7291281964736f6c63430008030033\";\nvar ProxyAdmin__factory = /** @class */ (function (_super) {\n __extends(ProxyAdmin__factory, _super);\n function ProxyAdmin__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n ProxyAdmin__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n ProxyAdmin__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n ProxyAdmin__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n ProxyAdmin__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n ProxyAdmin__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n ProxyAdmin__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n ProxyAdmin__factory.bytecode = _bytecode;\n ProxyAdmin__factory.abi = _abi;\n return ProxyAdmin__factory;\n}(ContractFactory));\nexport { ProxyAdmin__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"dest\",\n type: \"address\",\n },\n ],\n name: \"payments\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"withdrawPayments\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar PullPayment__factory = /** @class */ (function () {\n function PullPayment__factory() {\n }\n PullPayment__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n PullPayment__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n PullPayment__factory.abi = _abi;\n return PullPayment__factory;\n}());\nexport { PullPayment__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"product\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n ],\n name: \"latestAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"attestation\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct PythStructs.UpgradeContract\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"attestPrice\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"pa\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyPythVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedPriceAttestation\",\n type: \"bytes\",\n },\n ],\n name: \"parsePriceAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"pa\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50611d34806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806384acd1bb1161008c578063b172b22211610066578063b172b2221461022c578063d60b347f14610234578063f0a0de0c14610260578063fbe3c2cd1461027357600080fd5b806384acd1bb146101f2578063970994ab1461020d5780639a8a05921461022057600080fd5b80632d3b5b2b116100c85780632d3b5b2b1461014f5780633cb0031e1461016f57806343aac0901461018a5780634fdc60fa1461019c57600080fd5b806318e3ab1c146100ef57806325394645146101175780632c3c02a41461012c575b600080fd5b6101026100fd36600461175d565b610285565b60405190151581526020015b60405180910390f35b61012a61012536600461172b565b6102cb565b005b61010261013a3660046116e4565b60009081526005602052604090205460ff1690565b61016261015d36600461172b565b6103e8565b60405161010e9190611a28565b60035461ffff165b60405161ffff909116815260200161010e565b6004545b60405190815260200161010e565b6101af6101aa36600461172b565b61073d565b60405161010e91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6000546040516001600160a01b03909116815260200161010e565b61016261021b3660046116fc565b61088b565b60015461ffff16610177565b60025461018e565b6101026102423660046116b6565b6001600160a01b031660009081526006602052604090205460ff1690565b61016261026e36600461172b565b6109f0565b60015462010000900461ffff16610177565b600061029460035461ffff1690565b61ffff16826060015161ffff16146102ae57506000919050565b6004548260800151146102c357506000919050565b506001919050565b60008060006102d984610db3565b9250925092508181906103085760405162461bcd60e51b81526004016102ff9190611a15565b60405180910390fd5b5061032d8361014001516000908152600560205260409020805460ff19166001179055565b600061033c8460e0015161073d565b80519091506350797468146103825760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b60448201526064016102ff565b60015461ffff1661ffff16816040015161ffff16146103d45760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b60448201526064016102ff565b6103e18160600151610fd2565b5050505050565b6103f06113b5565b60008060006104076000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016104329190611a15565b60006040518083038186803b15801561044a57600080fd5b505afa15801561045e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610486919081019061187c565b9250925092508181906104ac5760405162461bcd60e51b81526004016102ff9190611a15565b506104b683610285565b6104f45760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b60448201526064016102ff565b60006105038460e001516109f0565b9050600061051982606001518360a0015161088b565b9050806101a001516001600160401b0316826101a001516001600160401b031611156107335760608201805160a084018051600092835260076020818152604080862060ff948516875282529485902088518154838b0151888c0151871666010000000000000266ff0000000000001961ffff9092166401000000000265ffffffffffff1990931663ffffffff948516179290921716178255965160018201556080890151600282015593516003808601805460c08c015160e08d015190930b909916600160481b9081026cffffffff0000000000000000001993870b6001600160401b0390811661010090810268ffffffffffffffffff199d8e16978b1697909717969096179490941617909155918a0151805160048801805483870151938b0151880b8516600160801b90810267ffffffffffffffff60801b19958a0b8716600160401b9081026fffffffffffffffffffffffffffffffff19948516968c0b891696909617959095178616179092556101208e0151805160058c0180549983015192909d01518a0b871690930290890b86168402979091169190970b841617949094171693909317909555610140880151600690940180546101608a01516101808b01516101a08c01518616600160501b0267ffffffffffffffff60501b199188169099021671ffffffffffffffffff0000000000000000001991909616909302971694909216939093179490941791909116171790555b5095945050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061076b83826110ff565b8252610778602082611c29565b9050610784838261115d565b60ff166020830152610797600182611c29565b9050816020015160ff166001146107f05760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520310000000000000060448201526064016102ff565b6107fa83826111b9565b61ffff16604083015261080e600282611c29565b905061081a83826110ff565b6001600160a01b03166060830152610833602082611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520320000000000000060448201526064016102ff565b50919050565b6108936113b5565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152600160481b91829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252600160401b8082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b96810196909652610120810195909552600601546001600160401b038082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b6109f86113b5565b6000610a048382611216565b63ffffffff168252610a17600482611c29565b9050816000015163ffffffff16635032574814610a695760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610a7383826111b9565b61ffff166020830152610a87600282611c29565b9050816020015161ffff16600114610ad45760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610ade838261115d565b60ff166040830152610af1600182611c29565b9050816040015160ff16600114610b455760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b610b4f83826110ff565b6060830152610b5f602082611c29565b9050610b6b83826110ff565b6080830152610b7b602082611c29565b9050610b87838261115d565b60ff1660a0830152610b9a600182611c29565b9050610ba68382611273565b600790810b900b60c0830152610bbd600882611c29565b9050610bc98382611216565b600390810b900b60e0830152610be0600482611c29565b9050610bec8382611273565b610100830151600791820b90910b9052610c07600882611c29565b9050610c138382611273565b610100830151600791820b90910b602090910152610c32600882611c29565b9050610c3e8382611273565b610100830151600791820b90910b604090910152610c5d600882611c29565b9050610c698382611273565b610120830151600791820b90910b9052610c84600882611c29565b9050610c908382611273565b610120830151600791820b90910b602090910152610caf600882611c29565b9050610cbb8382611273565b610120830151600791820b90910b604090910152610cda600882611c29565b9050610ce68382611273565b6001600160401b0316610140830152610d00600882611c29565b9050610d0c838261115d565b60ff16610160830152610d20600182611c29565b9050610d2c838261115d565b60ff16610180830152610d40600182611c29565b9050610d4c8382611273565b6001600160401b03166101a0830152610d66600882611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610e266000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610e519190611a15565b60006040518083038186803b158015610e6957600080fd5b505afa158015610e7d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ea5919081019061187c565b92509250925081610ebc5791945092509050610fcb565b60015462010000900461ffff1661ffff16836060015161ffff1614610f185750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610fcb565b600254836080015114610f6957505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610fcb565b61014083015160009081526005602052604090205460ff1615610fb057826000604051806060016040528060228152602001611cdd60229139955095509550505050610fcb565b50506040805160208101909152600081529093506001925090505b9193909250565b60006110057f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611010826112d0565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611053916119f9565b600060405180830381855af49150503d806000811461108e576040519150601f19603f3d011682016040523d82523d6000602084013e611093565b606091505b50915091508181906110b85760405162461bcd60e51b81526004016102ff9190611a15565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600061110c826020611c29565b835110156111545760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016102ff565b50016020015190565b600061116a826001611c29565b835110156111b05760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016102ff565b50016001015190565b60006111c6826002611c29565b8351101561120d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016102ff565b50016002015190565b6000611223826004611c29565b8351101561126a5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016102ff565b50016004015190565b6000611280826008611c29565b835110156112c75760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016102ff565b50016008015190565b6112d981611310565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6113745760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102ff565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b600082601f830112611464578081fd5b8135602061147961147483611bdf565b611baf565b80838252828201915082860187848660071b8901011115611498578586fd5b855b858110156114ff57608080838b0312156114b2578788fd5b6114ba611b64565b8335815286840135878201526040808501356114d581611ccd565b908201526060848101356114e881611ccd565b90820152855293850193919091019060010161149a565b5090979650505050505050565b600082601f83011261151c578081fd5b8151602061152c61147483611bdf565b80838252828201915082860187848660071b890101111561154b578586fd5b855b858110156114ff57608080838b031215611565578788fd5b61156d611b64565b83518152868401518782015260408085015161158881611ccd565b9082015260608481015161159b81611ccd565b90820152855293850193919091019060010161154d565b805180151581146115c257600080fd5b919050565b600082601f8301126115d7578081fd5b81356115e561147482611c02565b8181528460208386010111156115f9578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112611623578081fd5b815161163161147482611c02565b818152846020838601011115611645578283fd5b611656826020830160208701611c4d565b949350505050565b80356115c281611c93565b80516115c281611c93565b80356115c281611ca6565b80516115c281611ca6565b80356115c281611cb8565b80516115c281611cb8565b80356115c281611ccd565b80516115c281611ccd565b6000602082840312156116c7578081fd5b81356001600160a01b03811681146116dd578182fd5b9392505050565b6000602082840312156116f5578081fd5b5035919050565b6000806040838503121561170e578081fd5b82359150602083013561172081611ccd565b809150509250929050565b60006020828403121561173c578081fd5b81356001600160401b03811115611751578182fd5b611656848285016115c7565b60006020828403121561176e578081fd5b81356001600160401b0380821115611784578283fd5b908301906101608286031215611798578283fd5b6117a0611b8c565b6117a9836116a0565b81526117b760208401611674565b60208201526117c860408401611674565b60408201526117d96060840161165e565b6060820152608083013560808201526117f460a0840161168a565b60a082015261180560c084016116a0565b60c082015260e08301358281111561181b578485fd5b611827878286016115c7565b60e08301525061010061183b818501611674565b908201526101208381013583811115611852578586fd5b61185e88828701611454565b91830191909152506101409283013592810192909252509392505050565b600080600060608486031215611890578081fd5b83516001600160401b03808211156118a6578283fd5b9085019061016082880312156118ba578283fd5b6118c2611b8c565b6118cb836116ab565b81526118d96020840161167f565b60208201526118ea6040840161167f565b60408201526118fb60608401611669565b60608201526080830151608082015261191660a08401611695565b60a082015261192760c084016116ab565b60c082015260e08301518281111561193d578485fd5b61194989828601611613565b60e08301525061010061195d81850161167f565b908201526101208381015183811115611974578586fd5b6119808a82870161150c565b9183019190915250610140838101519082015294506119a1602087016115b2565b935060408601519150808211156119b6578283fd5b506119c386828701611613565b9150509250925092565b600081518084526119e5816020860160208601611c4d565b601f01601f19169290920160200192915050565b60008251611a0b818460208701611c4d565b9190910192915050565b6020815260006116dd60208301846119cd565b815163ffffffff16815261024081016020830151611a4c602084018261ffff169052565b506040830151611a61604084018260ff169052565b50606083015160608301526080830151608083015260a0830151611a8a60a084018260ff169052565b5060c0830151611a9f60c084018260070b9052565b5060e0830151611ab460e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b6101408501525050610120830151610160611b1881850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b6101408501516001600160401b039081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b604051608081016001600160401b0381118282101715611b8657611b86611c7d565b60405290565b60405161016081016001600160401b0381118282101715611b8657611b86611c7d565b604051601f8201601f191681016001600160401b0381118282101715611bd757611bd7611c7d565b604052919050565b60006001600160401b03821115611bf857611bf8611c7d565b5060051b60200190565b60006001600160401b03821115611c1b57611c1b611c7d565b50601f01601f191660200190565b60008219821115611c4857634e487b7160e01b81526011600452602481fd5b500190565b60005b83811015611c68578181015183820152602001611c50565b83811115611c77576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff81168114611ca357600080fd5b50565b63ffffffff81168114611ca357600080fd5b6001600160401b0381168114611ca357600080fd5b60ff81168114611ca357600080fdfe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220bc3e79776b99f2c8176f773466b4cc3831615634837880168a40f25c759d0b9b64736f6c63430008040033\";\nvar Pyth__factory = /** @class */ (function (_super) {\n __extends(Pyth__factory, _super);\n function Pyth__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Pyth__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Pyth__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Pyth__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Pyth__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Pyth__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Pyth__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Pyth__factory.bytecode = _bytecode;\n Pyth__factory.abi = _abi;\n return Pyth__factory;\n}(ContractFactory));\nexport { Pyth__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"initData\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122053fad7d73ac14ca89bd1b14cef0273109fd66529c0a6215e0cabdc255813dc5064736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar PythDataBridge__factory = /** @class */ (function (_super) {\n __extends(PythDataBridge__factory, _super);\n function PythDataBridge__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n PythDataBridge__factory.prototype.deploy = function (implementation, initData, overrides) {\n return _super.prototype.deploy.call(this, implementation, initData, overrides || {});\n };\n PythDataBridge__factory.prototype.getDeployTransaction = function (implementation, initData, overrides) {\n return _super.prototype.getDeployTransaction.call(this, implementation, initData, overrides || {});\n };\n PythDataBridge__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n PythDataBridge__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n PythDataBridge__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n PythDataBridge__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n PythDataBridge__factory.bytecode = _bytecode;\n PythDataBridge__factory.abi = _abi;\n return PythDataBridge__factory;\n}(ContractFactory));\nexport { PythDataBridge__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"product\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n ],\n name: \"latestAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"attestation\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610582806100206000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063970994ab11610066578063970994ab146101185780639a8a059214610138578063b172b22214610144578063d60b347f1461014c578063fbe3c2cd1461017857600080fd5b80632c3c02a4146100985780633cb0031e146100d057806343aac090146100eb57806384acd1bb146100fd575b600080fd5b6100bb6100a63660046103c3565b60009081526005602052604090205460ff1690565b60405190151581526020015b60405180910390f35b60035461ffff165b60405161ffff90911681526020016100c7565b6004545b6040519081526020016100c7565b6000546040516001600160a01b0390911681526020016100c7565b61012b6101263660046103db565b61018a565b6040516100c7919061040f565b60015461ffff166100d8565b6002546100ef565b6100bb61015a366004610395565b6001600160a01b031660009081526006602052604090205460ff1690565b60015462010000900461ffff166100d8565b61022c604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152690100000000000000000091829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252680100000000000000008082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b968101969096526101208101959095526006015467ffffffffffffffff8082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b6000602082840312156103a6578081fd5b81356001600160a01b03811681146103bc578182fd5b9392505050565b6000602082840312156103d4578081fd5b5035919050565b600080604083850312156103ed578081fd5b82359150602083013560ff81168114610404578182fd5b809150509250929050565b815163ffffffff16815261024081016020830151610433602084018261ffff169052565b506040830151610448604084018260ff169052565b50606083015160608301526080830151608083015260a083015161047160a084018260ff169052565b5060c083015161048660c084018260070b9052565b5060e083015161049b60e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b61014085015250506101208301516101606104ff81850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b61014085015167ffffffffffffffff9081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a0909401519093166102209092019190915291905056fea2646970667358221220427410f6ce5dea2533daa2b7bcefb3c919f305057f6990b6b61c5296c4920f6364736f6c63430008040033\";\nvar PythGetters__factory = /** @class */ (function (_super) {\n __extends(PythGetters__factory, _super);\n function PythGetters__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n PythGetters__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n PythGetters__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n PythGetters__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n PythGetters__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n PythGetters__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n PythGetters__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n PythGetters__factory.bytecode = _bytecode;\n PythGetters__factory.abi = _abi;\n return PythGetters__factory;\n}(ContractFactory));\nexport { PythGetters__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"product\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n ],\n name: \"latestAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"attestation\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct PythStructs.UpgradeContract\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50611291806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806384acd1bb1161007157806384acd1bb1461017e578063970994ab146101995780639a8a0592146101b9578063b172b222146101c5578063d60b347f146101cd578063fbe3c2cd146101f957600080fd5b806325394645146100ae5780632c3c02a4146100c35780633cb0031e146100fb57806343aac090146101165780634fdc60fa14610128575b600080fd5b6100c16100bc366004610db9565b61020b565b005b6100e66100d1366004610d72565b60009081526005602052604090205460ff1690565b60405190151581526020015b60405180910390f35b60035461ffff165b60405161ffff90911681526020016100f2565b6004545b6040519081526020016100f2565b61013b610136366004610db9565b610328565b6040516100f291908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6000546040516001600160a01b0390911681526020016100f2565b6101ac6101a7366004610d8a565b610476565b6040516100f29190610fda565b60015461ffff16610103565b60025461011a565b6100e66101db366004610d44565b6001600160a01b031660009081526006602052604090205460ff1690565b60015462010000900461ffff16610103565b600080600061021984610681565b9250925092508181906102485760405162461bcd60e51b815260040161023f9190610fc7565b60405180910390fd5b5061026d8361014001516000908152600560205260409020805460ff19166001179055565b600061027c8460e00151610328565b80519091506350797468146102c25760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b604482015260640161023f565b60015461ffff1661ffff16816040015161ffff16146103145760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b604482015260640161023f565b61032181606001516108a0565b5050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061035683826109cd565b82526103636020826111bd565b905061036f8382610a2b565b60ff1660208301526103826001826111bd565b9050816020015160ff166001146103db5760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e747261637455706772616465203100000000000000604482015260640161023f565b6103e58382610a87565b61ffff1660408301526103f96002826111bd565b905061040583826109cd565b6001600160a01b0316606083015261041e6020826111bd565b9050808351146104705760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e747261637455706772616465203200000000000000604482015260640161023f565b50919050565b610518604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152690100000000000000000091829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252680100000000000000008082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b968101969096526101208101959095526006015467ffffffffffffffff8082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820181905261010082018390526101208201526101408101919091526000606060008060006106f46000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b815260040161071f9190610fc7565b60006040518083038186803b15801561073757600080fd5b505afa15801561074b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107739190810190610e2d565b9250925092508161078a5791945092509050610899565b60015462010000900461ffff1661ffff16836060015161ffff16146107e65750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610899565b60025483608001511461083757505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610899565b61014083015160009081526005602052604090205460ff161561087e5782600060405180606001604052806022815260200161123a60229139955095509550505050610899565b50506040805160208101909152600081529093506001925090505b9193909250565b60006108d37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b90506108de82610ae4565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b0386169161092191610fab565b600060405180830381855af49150503d806000811461095c576040519150601f19603f3d011682016040523d82523d6000602084013e610961565b606091505b50915091508181906109865760405162461bcd60e51b815260040161023f9190610fc7565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b60006109da8260206111bd565b83511015610a225760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b604482015260640161023f565b50016020015190565b6000610a388260016111bd565b83511015610a7e5760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b604482015260640161023f565b50016001015190565b6000610a948260026111bd565b83511015610adb5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b604482015260640161023f565b50016002015190565b610aed81610b24565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610b885760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161023f565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b600082601f830112610bd9578081fd5b8151602067ffffffffffffffff821115610bf557610bf5611211565b610c03818360051b01611164565b80838252828201915082860187848660071b8901011115610c22578586fd5b855b85811015610c8957608080838b031215610c3c578788fd5b610c44611117565b835181528684015187820152604080850151610c5f81611227565b90820152606084810151610c7281611227565b908201528552938501939190910190600101610c24565b5090979650505050505050565b80518015158114610ca657600080fd5b919050565b600082601f830112610cbb578081fd5b8151610cce610cc982611195565b611164565b818152846020838601011115610ce2578283fd5b610cf38260208301602087016111e1565b949350505050565b805161ffff81168114610ca657600080fd5b805163ffffffff81168114610ca657600080fd5b805167ffffffffffffffff81168114610ca657600080fd5b8051610ca681611227565b600060208284031215610d55578081fd5b81356001600160a01b0381168114610d6b578182fd5b9392505050565b600060208284031215610d83578081fd5b5035919050565b60008060408385031215610d9c578081fd5b823591506020830135610dae81611227565b809150509250929050565b600060208284031215610dca578081fd5b813567ffffffffffffffff811115610de0578182fd5b8201601f81018413610df0578182fd5b8035610dfe610cc982611195565b818152856020838501011115610e12578384fd5b81602084016020830137908101602001929092525092915050565b600080600060608486031215610e41578081fd5b835167ffffffffffffffff80821115610e58578283fd5b908501906101608288031215610e6c578283fd5b610e74611140565b610e7d83610d39565b8152610e8b60208401610d0d565b6020820152610e9c60408401610d0d565b6040820152610ead60608401610cfb565b606082015260808301516080820152610ec860a08401610d21565b60a0820152610ed960c08401610d39565b60c082015260e083015182811115610eef578485fd5b610efb89828601610cab565b60e083015250610100610f0f818501610d0d565b908201526101208381015183811115610f26578586fd5b610f328a828701610bc9565b918301919091525061014083810151908201529450610f5360208701610c96565b93506040860151915080821115610f68578283fd5b50610f7586828701610cab565b9150509250925092565b60008151808452610f978160208601602086016111e1565b601f01601f19169290920160200192915050565b60008251610fbd8184602087016111e1565b9190910192915050565b602081526000610d6b6020830184610f7f565b815163ffffffff16815261024081016020830151610ffe602084018261ffff169052565b506040830151611013604084018260ff169052565b50606083015160608301526080830151608083015260a083015161103c60a084018260ff169052565b5060c083015161105160c084018260070b9052565b5060e083015161106660e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b61014085015250506101208301516101606110ca81850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b61014085015167ffffffffffffffff9081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b6040516080810167ffffffffffffffff8111828210171561113a5761113a611211565b60405290565b604051610160810167ffffffffffffffff8111828210171561113a5761113a611211565b604051601f8201601f1916810167ffffffffffffffff8111828210171561118d5761118d611211565b604052919050565b600067ffffffffffffffff8211156111af576111af611211565b50601f01601f191660200190565b600082198211156111dc57634e487b7160e01b81526011600452602481fd5b500190565b60005b838110156111fc5781810151838201526020016111e4565b8381111561120b576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b60ff8116811461123657600080fd5b5056fe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220898d65b7f1e50a3c7c8c6cd9bba77ff84fc9589eb5975b63f089e830cab5f7e264736f6c63430008040033\";\nvar PythGovernance__factory = /** @class */ (function (_super) {\n __extends(PythGovernance__factory, _super);\n function PythGovernance__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n PythGovernance__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n PythGovernance__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n PythGovernance__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n PythGovernance__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n PythGovernance__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n PythGovernance__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n PythGovernance__factory.bytecode = _bytecode;\n PythGovernance__factory.abi = _abi;\n return PythGovernance__factory;\n}(ContractFactory));\nexport { PythGovernance__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldContract\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n name: \"ContractUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVm\",\n type: \"bytes\",\n },\n ],\n name: \"attestPrice\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"pa\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n name: \"governanceActionIsConsumed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"governanceContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"impl\",\n type: \"address\",\n },\n ],\n name: \"isInitialized\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"product\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n ],\n name: \"latestAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"attestation\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedUpgrade\",\n type: \"bytes\",\n },\n ],\n name: \"parseContractUpgrade\",\n outputs: [\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"module\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"action\",\n type: \"uint8\",\n },\n {\n internalType: \"uint16\",\n name: \"chain\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"newContract\",\n type: \"address\",\n },\n ],\n internalType: \"struct PythStructs.UpgradeContract\",\n name: \"cu\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedPriceAttestation\",\n type: \"bytes\",\n },\n ],\n name: \"parsePriceAttestation\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint32\",\n name: \"magic\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"version\",\n type: \"uint16\",\n },\n {\n internalType: \"uint8\",\n name: \"payloadId\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes32\",\n name: \"productId\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"priceId\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"priceType\",\n type: \"uint8\",\n },\n {\n internalType: \"int64\",\n name: \"price\",\n type: \"int64\",\n },\n {\n internalType: \"int32\",\n name: \"exponent\",\n type: \"int32\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twap\",\n type: \"tuple\",\n },\n {\n components: [\n {\n internalType: \"int64\",\n name: \"value\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"numerator\",\n type: \"int64\",\n },\n {\n internalType: \"int64\",\n name: \"denominator\",\n type: \"int64\",\n },\n ],\n internalType: \"struct PythStructs.Ema\",\n name: \"twac\",\n type: \"tuple\",\n },\n {\n internalType: \"uint64\",\n name: \"confidenceInterval\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"corpAct\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"timestamp\",\n type: \"uint64\",\n },\n ],\n internalType: \"struct PythStructs.PriceAttestation\",\n name: \"pa\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeChainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pyth2WormholeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes\",\n name: \"encodedVM\",\n type: \"bytes\",\n },\n ],\n name: \"upgrade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: \"uint8\",\n name: \"version\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"timestamp\",\n type: \"uint32\",\n },\n {\n internalType: \"uint32\",\n name: \"nonce\",\n type: \"uint32\",\n },\n {\n internalType: \"uint16\",\n name: \"emitterChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"emitterAddress\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence\",\n type: \"uint64\",\n },\n {\n internalType: \"uint8\",\n name: \"consistencyLevel\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"payload\",\n type: \"bytes\",\n },\n {\n internalType: \"uint32\",\n name: \"guardianSetIndex\",\n type: \"uint32\",\n },\n {\n components: [\n {\n internalType: \"bytes32\",\n name: \"r\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"s\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"v\",\n type: \"uint8\",\n },\n {\n internalType: \"uint8\",\n name: \"guardianIndex\",\n type: \"uint8\",\n },\n ],\n internalType: \"struct Structs.Signature[]\",\n name: \"signatures\",\n type: \"tuple[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n internalType: \"struct Structs.VM\",\n name: \"vm\",\n type: \"tuple\",\n },\n ],\n name: \"verifyPythVM\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"valid\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"wormhole\",\n outputs: [\n {\n internalType: \"contract IWormhole\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50611d34806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806384acd1bb1161008c578063b172b22211610066578063b172b2221461022c578063d60b347f14610234578063f0a0de0c14610260578063fbe3c2cd1461027357600080fd5b806384acd1bb146101f2578063970994ab1461020d5780639a8a05921461022057600080fd5b80632d3b5b2b116100c85780632d3b5b2b1461014f5780633cb0031e1461016f57806343aac0901461018a5780634fdc60fa1461019c57600080fd5b806318e3ab1c146100ef57806325394645146101175780632c3c02a41461012c575b600080fd5b6101026100fd36600461175d565b610285565b60405190151581526020015b60405180910390f35b61012a61012536600461172b565b6102cb565b005b61010261013a3660046116e4565b60009081526005602052604090205460ff1690565b61016261015d36600461172b565b6103e8565b60405161010e9190611a28565b60035461ffff165b60405161ffff909116815260200161010e565b6004545b60405190815260200161010e565b6101af6101aa36600461172b565b61073d565b60405161010e91908151815260208083015160ff169082015260408083015161ffff16908201526060918201516001600160a01b03169181019190915260800190565b6000546040516001600160a01b03909116815260200161010e565b61016261021b3660046116fc565b61088b565b60015461ffff16610177565b60025461018e565b6101026102423660046116b6565b6001600160a01b031660009081526006602052604090205460ff1690565b61016261026e36600461172b565b6109f0565b60015462010000900461ffff16610177565b600061029460035461ffff1690565b61ffff16826060015161ffff16146102ae57506000919050565b6004548260800151146102c357506000919050565b506001919050565b60008060006102d984610db3565b9250925092508181906103085760405162461bcd60e51b81526004016102ff9190611a15565b60405180910390fd5b5061032d8361014001516000908152600560205260409020805460ff19166001179055565b600061033c8460e0015161073d565b80519091506350797468146103825760405162461bcd60e51b815260206004820152600c60248201526b77726f6e67206d6f64756c6560a01b60448201526064016102ff565b60015461ffff1661ffff16816040015161ffff16146103d45760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c818da185a5b881a5960921b60448201526064016102ff565b6103e18160600151610fd2565b5050505050565b6103f06113b5565b60008060006104076000546001600160a01b031690565b6001600160a01b031663c0fd8bde866040518263ffffffff1660e01b81526004016104329190611a15565b60006040518083038186803b15801561044a57600080fd5b505afa15801561045e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610486919081019061187c565b9250925092508181906104ac5760405162461bcd60e51b81526004016102ff9190611a15565b506104b683610285565b6104f45760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b21032b6b4ba3a32b960891b60448201526064016102ff565b60006105038460e001516109f0565b9050600061051982606001518360a0015161088b565b9050806101a001516001600160401b0316826101a001516001600160401b031611156107335760608201805160a084018051600092835260076020818152604080862060ff948516875282529485902088518154838b0151888c0151871666010000000000000266ff0000000000001961ffff9092166401000000000265ffffffffffff1990931663ffffffff948516179290921716178255965160018201556080890151600282015593516003808601805460c08c015160e08d015190930b909916600160481b9081026cffffffff0000000000000000001993870b6001600160401b0390811661010090810268ffffffffffffffffff199d8e16978b1697909717969096179490941617909155918a0151805160048801805483870151938b0151880b8516600160801b90810267ffffffffffffffff60801b19958a0b8716600160401b9081026fffffffffffffffffffffffffffffffff19948516968c0b891696909617959095178616179092556101208e0151805160058c0180549983015192909d01518a0b871690930290890b86168402979091169190970b841617949094171693909317909555610140880151600690940180546101608a01516101808b01516101a08c01518616600160501b0267ffffffffffffffff60501b199188169099021671ffffffffffffffffff0000000000000000001991909616909302971694909216939093179490941791909116171790555b5095945050505050565b60408051608081018252600080825260208201819052918101829052606081018290529061076b83826110ff565b8252610778602082611c29565b9050610784838261115d565b60ff166020830152610797600182611c29565b9050816020015160ff166001146107f05760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520310000000000000060448201526064016102ff565b6107fa83826111b9565b61ffff16604083015261080e600282611c29565b905061081a83826110ff565b6001600160a01b03166060830152610833602082611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420436f6e74726163745570677261646520320000000000000060448201526064016102ff565b50919050565b6108936113b5565b50600091825260076020818152604080852060ff948516865282529384902084516101c081018652815463ffffffff81168252640100000000810461ffff16828501526601000000000000900485168187015260018201546060808301919091526002830154608083015260038084015480881660a0850152610100808204880b880b880b60c0860152600160481b91829004830b830b90920b60e085015288518084018a52600486015480890b890b890b8252600160401b8082048a0b8a0b8a0b838a0152600160801b918290048a0b8a0b8a0b838d01529386019190915289519384018a52600586015480890b890b890b8552838104890b890b890b97850197909752909504860b860b90950b96810196909652610120810195909552600601546001600160401b038082166101408701529281048416610160860152908104909216610180840152600160501b909104166101a082015290565b6109f86113b5565b6000610a048382611216565b63ffffffff168252610a17600482611c29565b9050816000015163ffffffff16635032574814610a695760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610a7383826111b9565b61ffff166020830152610a87600282611c29565b9050816020015161ffff16600114610ad45760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bdd1bd8dbdb60821b60448201526064016102ff565b610ade838261115d565b60ff166040830152610af1600182611c29565b9050816040015160ff16600114610b455760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b610b4f83826110ff565b6060830152610b5f602082611c29565b9050610b6b83826110ff565b6080830152610b7b602082611c29565b9050610b87838261115d565b60ff1660a0830152610b9a600182611c29565b9050610ba68382611273565b600790810b900b60c0830152610bbd600882611c29565b9050610bc98382611216565b600390810b900b60e0830152610be0600482611c29565b9050610bec8382611273565b610100830151600791820b90910b9052610c07600882611c29565b9050610c138382611273565b610100830151600791820b90910b602090910152610c32600882611c29565b9050610c3e8382611273565b610100830151600791820b90910b604090910152610c5d600882611c29565b9050610c698382611273565b610120830151600791820b90910b9052610c84600882611c29565b9050610c908382611273565b610120830151600791820b90910b602090910152610caf600882611c29565b9050610cbb8382611273565b610120830151600791820b90910b604090910152610cda600882611c29565b9050610ce68382611273565b6001600160401b0316610140830152610d00600882611c29565b9050610d0c838261115d565b60ff16610160830152610d20600182611c29565b9050610d2c838261115d565b60ff16610180830152610d40600182611c29565b9050610d4c8382611273565b6001600160401b03166101a0830152610d66600882611c29565b9050808351146108855760405162461bcd60e51b815260206004820152601860248201527734b73b30b634b210283934b1b2a0ba3a32b9ba30ba34b7b760411b60448201526064016102ff565b604080516101608101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082018190526101008201839052610120820152610140810191909152600060606000806000610e266000546001600160a01b031690565b6001600160a01b031663c0fd8bde886040518263ffffffff1660e01b8152600401610e519190611a15565b60006040518083038186803b158015610e6957600080fd5b505afa158015610e7d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ea5919081019061187c565b92509250925081610ebc5791945092509050610fcb565b60015462010000900461ffff1661ffff16836060015161ffff1614610f185750506040805180820190915260168152753bb937b7339033b7bb32b93730b731b29031b430b4b760511b6020820152909350600092509050610fcb565b600254836080015114610f6957505060408051808201909152601981527f77726f6e6720676f7665726e616e636520636f6e7472616374000000000000006020820152909350600092509050610fcb565b61014083015160009081526005602052604090205460ff1615610fb057826000604051806060016040528060228152602001611cdd60229139955095509550505050610fcb565b50506040805160208101909152600081529093506001925090505b9193909250565b60006110057f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b9050611010826112d0565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b179052905160009182916001600160a01b03861691611053916119f9565b600060405180830381855af49150503d806000811461108e576040519150601f19603f3d011682016040523d82523d6000602084013e611093565b606091505b50915091508181906110b85760405162461bcd60e51b81526004016102ff9190611a15565b50836001600160a01b0316836001600160a01b03167f2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a4960405160405180910390a350505050565b600061110c826020611c29565b835110156111545760405162461bcd60e51b8152602060048201526015602482015274746f427974657333325f6f75744f66426f756e647360581b60448201526064016102ff565b50016020015190565b600061116a826001611c29565b835110156111b05760405162461bcd60e51b8152602060048201526013602482015272746f55696e74385f6f75744f66426f756e647360681b60448201526064016102ff565b50016001015190565b60006111c6826002611c29565b8351101561120d5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b60448201526064016102ff565b50016002015190565b6000611223826004611c29565b8351101561126a5760405162461bcd60e51b8152602060048201526014602482015273746f55696e7433325f6f75744f66426f756e647360601b60448201526064016102ff565b50016004015190565b6000611280826008611c29565b835110156112c75760405162461bcd60e51b8152602060048201526014602482015273746f55696e7436345f6f75744f66426f756e647360601b60448201526064016102ff565b50016008015190565b6112d981611310565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6113745760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102ff565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b604080516101c0810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e0840183905284519081018552828152908101829052928301529061010082019081526040805160608101825260008082526020828101829052928201529101908152600060208201819052604082018190526060820181905260809091015290565b600082601f830112611464578081fd5b8135602061147961147483611bdf565b611baf565b80838252828201915082860187848660071b8901011115611498578586fd5b855b858110156114ff57608080838b0312156114b2578788fd5b6114ba611b64565b8335815286840135878201526040808501356114d581611ccd565b908201526060848101356114e881611ccd565b90820152855293850193919091019060010161149a565b5090979650505050505050565b600082601f83011261151c578081fd5b8151602061152c61147483611bdf565b80838252828201915082860187848660071b890101111561154b578586fd5b855b858110156114ff57608080838b031215611565578788fd5b61156d611b64565b83518152868401518782015260408085015161158881611ccd565b9082015260608481015161159b81611ccd565b90820152855293850193919091019060010161154d565b805180151581146115c257600080fd5b919050565b600082601f8301126115d7578081fd5b81356115e561147482611c02565b8181528460208386010111156115f9578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112611623578081fd5b815161163161147482611c02565b818152846020838601011115611645578283fd5b611656826020830160208701611c4d565b949350505050565b80356115c281611c93565b80516115c281611c93565b80356115c281611ca6565b80516115c281611ca6565b80356115c281611cb8565b80516115c281611cb8565b80356115c281611ccd565b80516115c281611ccd565b6000602082840312156116c7578081fd5b81356001600160a01b03811681146116dd578182fd5b9392505050565b6000602082840312156116f5578081fd5b5035919050565b6000806040838503121561170e578081fd5b82359150602083013561172081611ccd565b809150509250929050565b60006020828403121561173c578081fd5b81356001600160401b03811115611751578182fd5b611656848285016115c7565b60006020828403121561176e578081fd5b81356001600160401b0380821115611784578283fd5b908301906101608286031215611798578283fd5b6117a0611b8c565b6117a9836116a0565b81526117b760208401611674565b60208201526117c860408401611674565b60408201526117d96060840161165e565b6060820152608083013560808201526117f460a0840161168a565b60a082015261180560c084016116a0565b60c082015260e08301358281111561181b578485fd5b611827878286016115c7565b60e08301525061010061183b818501611674565b908201526101208381013583811115611852578586fd5b61185e88828701611454565b91830191909152506101409283013592810192909252509392505050565b600080600060608486031215611890578081fd5b83516001600160401b03808211156118a6578283fd5b9085019061016082880312156118ba578283fd5b6118c2611b8c565b6118cb836116ab565b81526118d96020840161167f565b60208201526118ea6040840161167f565b60408201526118fb60608401611669565b60608201526080830151608082015261191660a08401611695565b60a082015261192760c084016116ab565b60c082015260e08301518281111561193d578485fd5b61194989828601611613565b60e08301525061010061195d81850161167f565b908201526101208381015183811115611974578586fd5b6119808a82870161150c565b9183019190915250610140838101519082015294506119a1602087016115b2565b935060408601519150808211156119b6578283fd5b506119c386828701611613565b9150509250925092565b600081518084526119e5816020860160208601611c4d565b601f01601f19169290920160200192915050565b60008251611a0b818460208701611c4d565b9190910192915050565b6020815260006116dd60208301846119cd565b815163ffffffff16815261024081016020830151611a4c602084018261ffff169052565b506040830151611a61604084018260ff169052565b50606083015160608301526080830151608083015260a0830151611a8a60a084018260ff169052565b5060c0830151611a9f60c084018260070b9052565b5060e0830151611ab460e084018260030b9052565b50610100838101518051600790810b858401526020820151810b6101208601526040820151900b6101408501525050610120830151610160611b1881850183805160070b8252602081015160070b6020830152604081015160070b60408301525050565b6101408501516001600160401b039081166101c08601529085015160ff9081166101e0860152610180860151166102008501526101a09094015190931661022090920191909152919050565b604051608081016001600160401b0381118282101715611b8657611b86611c7d565b60405290565b60405161016081016001600160401b0381118282101715611b8657611b86611c7d565b604051601f8201601f191681016001600160401b0381118282101715611bd757611bd7611c7d565b604052919050565b60006001600160401b03821115611bf857611bf8611c7d565b5060051b60200190565b60006001600160401b03821115611c1b57611c1b611c7d565b50601f01601f191660200190565b60008219821115611c4857634e487b7160e01b81526011600452602481fd5b500190565b60005b83811015611c68578181015183820152602001611c50565b83811115611c77576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b61ffff81168114611ca357600080fd5b50565b63ffffffff81168114611ca357600080fd5b6001600160401b0381168114611ca357600080fd5b60ff81168114611ca357600080fdfe676f7665726e616e636520616374696f6e20616c726561647920636f6e73756d6564a2646970667358221220137b0e0f9e2c8b62b5cb38ca79b86a3c635c93ba31ee647e94a2f378a16f303364736f6c63430008040033\";\nvar PythImplementation__factory = /** @class */ (function (_super) {\n __extends(PythImplementation__factory, _super);\n function PythImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n PythImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n PythImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n PythImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n PythImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n PythImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n PythImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n PythImplementation__factory.bytecode = _bytecode;\n PythImplementation__factory.abi = _abi;\n return PythImplementation__factory;\n}(ContractFactory));\nexport { PythImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"address\",\n name: \"wormhole\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"governanceChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"governanceContract\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint16\",\n name: \"pyth2WormholeChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"pyth2WormholeContract\",\n type: \"bytes32\",\n },\n ],\n name: \"setup\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b50610276806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063129acf8d14610030575b600080fd5b61004361003e3660046101c9565b610045565b005b60018054600080546001600160a01b0389166001600160a01b031990911617905561ffff868116620100000263ffffffff199092169089161717905560028390556003805461ffff191661ffff84161790556100a081600455565b6100a9876100b2565b50505050505050565b6100bb816100f2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b61015a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146101b257600080fd5b919050565b803561ffff811681146101b257600080fd5b600080600080600080600060e0888a0312156101e3578283fd5b6101ec8861019b565b96506101fa602089016101b7565b95506102086040890161019b565b9450610216606089016101b7565b93506080880135925061022b60a089016101b7565b915060c088013590509295989194975092955056fea2646970667358221220e87375c0b2c6f061ee0ec12dcca76ab0174d0ac62b0470eed5524f498e6348e964736f6c63430008040033\";\nvar PythSetup__factory = /** @class */ (function (_super) {\n __extends(PythSetup__factory, _super);\n function PythSetup__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n PythSetup__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n PythSetup__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n PythSetup__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n PythSetup__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n PythSetup__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n PythSetup__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n PythSetup__factory.bytecode = _bytecode;\n PythSetup__factory.abi = _abi;\n return PythSetup__factory;\n}(ContractFactory));\nexport { PythSetup__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"beneficiary_\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weiAmount\",\n type: \"uint256\",\n },\n ],\n name: \"Deposited\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [],\n name: \"RefundsClosed\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [],\n name: \"RefundsEnabled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"weiAmount\",\n type: \"uint256\",\n },\n ],\n name: \"Withdrawn\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"beneficiary\",\n outputs: [\n {\n internalType: \"address payable\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"beneficiaryWithdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"close\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"refundee\",\n type: \"address\",\n },\n ],\n name: \"deposit\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"depositsOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"enableRefunds\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"state\",\n outputs: [\n {\n internalType: \"enum RefundEscrow.State\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"payee\",\n type: \"address\",\n },\n ],\n name: \"withdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n name: \"withdrawalAllowed\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60a060405234801561001057600080fd5b50604051610c17380380610c1783398101604081905261002f91610117565b610038336100c7565b6001600160a01b0381166100a85760405162461bcd60e51b815260206004820152602d60248201527f526566756e64457363726f773a2062656e65666963696172792069732074686560448201526c207a65726f206164647265737360981b606482015260840160405180910390fd5b60601b6001600160601b0319166080526002805460ff19169055610145565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610128578081fd5b81516001600160a01b038116811461013e578182fd5b9392505050565b60805160601c610aae6101696000396000818160bb01526105cf0152610aae6000f3fe6080604052600436106100a75760003560e01c80638da5cb5b116100645780638da5cb5b146101895780639af6549a146101a7578063c19d93fb146101bc578063e3a9db1a146101dc578063f2fde38b14610220578063f340fa0114610240576100a7565b806338af3eed146100ac57806343d726d6146100f857806351cff8d91461010f578063685ca1941461012f578063715018a61461015f5780638c52dc4114610174575b600080fd5b3480156100b857600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b34801561010457600080fd5b5061010d610253565b005b34801561011b57600080fd5b5061010d61012a3660046109bf565b610349565b34801561013b57600080fd5b5061014f61014a3660046109bf565b6103c6565b60405190151581526020016100ef565b34801561016b57600080fd5b5061010d6103fc565b34801561018057600080fd5b5061010d610432565b34801561019557600080fd5b506000546001600160a01b03166100db565b3480156101b357600080fd5b5061010d610529565b3480156101c857600080fd5b5060025460ff166040516100ef91906109e2565b3480156101e857600080fd5b506102126101f73660046109bf565b6001600160a01b031660009081526001602052604090205490565b6040519081526020016100ef565b34801561022c57600080fd5b5061010d61023b3660046109bf565b6105f5565b61010d61024e3660046109bf565b61068d565b6000546001600160a01b031633146102865760405162461bcd60e51b815260040161027d90610a0a565b60405180910390fd5b600061029460025460ff1690565b60028111156102b357634e487b7160e01b600052602160045260246000fd5b146103125760405162461bcd60e51b815260206004820152602960248201527f526566756e64457363726f773a2063616e206f6e6c7920636c6f7365207768696044820152686c652061637469766560b81b606482015260840161027d565b6002805460ff1916811790556040517f088672c3a6e342f7cd94a65ba63b79df24a8973927b4d05d803c44bbf787d12f90600090a1565b610352816103c6565b6103ba5760405162461bcd60e51b815260206004820152603360248201527f436f6e646974696f6e616c457363726f773a207061796565206973206e6f7420604482015272616c6c6f77656420746f20776974686472617760681b606482015260840161027d565b6103c381610724565b50565b600060016103d660025460ff1690565b60028111156103f557634e487b7160e01b600052602160045260246000fd5b1492915050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161027d90610a0a565b61043060006107bd565b565b6000546001600160a01b0316331461045c5760405162461bcd60e51b815260040161027d90610a0a565b600061046a60025460ff1690565b600281111561048957634e487b7160e01b600052602160045260246000fd5b146104f15760405162461bcd60e51b815260206004820152603260248201527f526566756e64457363726f773a2063616e206f6e6c7920656e61626c6520726560448201527166756e6473207768696c652061637469766560701b606482015260840161027d565b6002805460ff191660011790556040517f599d8e5a83cffb867d051598c4d70e805d59802d8081c1c7d6dffc5b6aca2b8990600090a1565b6002805460ff16600281111561054f57634e487b7160e01b600052602160045260246000fd5b146105c25760405162461bcd60e51b815260206004820152603860248201527f526566756e64457363726f773a2062656e65666963696172792063616e206f6e60448201527f6c79207769746864726177207768696c6520636c6f7365640000000000000000606482015260840161027d565b6104306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000164761080d565b6000546001600160a01b0316331461061f5760405162461bcd60e51b815260040161027d90610a0a565b6001600160a01b0381166106845760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161027d565b6103c3816107bd565b600061069b60025460ff1690565b60028111156106ba57634e487b7160e01b600052602160045260246000fd5b1461071b5760405162461bcd60e51b815260206004820152602b60248201527f526566756e64457363726f773a2063616e206f6e6c79206465706f736974207760448201526a68696c652061637469766560a81b606482015260840161027d565b6103c38161092b565b6000546001600160a01b0316331461074e5760405162461bcd60e51b815260040161027d90610a0a565b6001600160a01b0381166000818152600160205260408120805491905590610776908261080d565b816001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516107b191815260200190565b60405180910390a25050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8047101561085d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161027d565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146108aa576040519150601f19603f3d011682016040523d82523d6000602084013e6108af565b606091505b50509050806109265760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161027d565b505050565b6000546001600160a01b031633146109555760405162461bcd60e51b815260040161027d90610a0a565b6001600160a01b03811660009081526001602052604081208054349283929161097f908490610a3f565b90915550506040518181526001600160a01b038316907f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4906020016107b1565b6000602082840312156109d0578081fd5b81356109db81610a63565b9392505050565b6020810160038310610a0457634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610a5e57634e487b7160e01b81526011600452602481fd5b500190565b6001600160a01b03811681146103c357600080fdfea2646970667358221220fcf0fd8037f372c1eae94dba60e7f9dc6b92aaa5db82e6051e33f045d837612c64736f6c63430008030033\";\nvar RefundEscrow__factory = /** @class */ (function (_super) {\n __extends(RefundEscrow__factory, _super);\n function RefundEscrow__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n RefundEscrow__factory.prototype.deploy = function (beneficiary_, overrides) {\n return _super.prototype.deploy.call(this, beneficiary_, overrides || {});\n };\n RefundEscrow__factory.prototype.getDeployTransaction = function (beneficiary_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, beneficiary_, overrides || {});\n };\n RefundEscrow__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n RefundEscrow__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n RefundEscrow__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n RefundEscrow__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n RefundEscrow__factory.bytecode = _bytecode;\n RefundEscrow__factory.abi = _abi;\n return RefundEscrow__factory;\n}(ContractFactory));\nexport { RefundEscrow__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"address[]\",\n name: \"initialGuardians\",\n type: \"address[]\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId\",\n type: \"uint16\",\n },\n {\n internalType: \"uint16\",\n name: \"governanceChainId\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"governanceContract\",\n type: \"bytes32\",\n },\n ],\n name: \"setup\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5061041a806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806334a5fcd414610030575b600080fd5b61004361003e3660046102cb565b610045565b005b60008451116100945760405162461bcd60e51b81526020600482015260166024820152751b9bc819dd585c991a585b9cc81cdc1958da599a595960521b60448201526064015b60405180910390fd5b604080518082019091528481526000602082018190526100b59082906100ea565b6000805461ffff858116620100000263ffffffff199092169087161717905560018290556100e28661013e565b505050505050565b63ffffffff81166000908152600260209081526040909120835180518593610116928492910190610223565b50602091909101516001909101805463ffffffff191663ffffffff9092169190911790555050565b6101478161017e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6101e25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161008b565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b828054828255906000526020600020908101928215610278579160200282015b8281111561027857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610243565b50610284929150610288565b5090565b5b808211156102845760008155600101610289565b80356001600160a01b03811681146102b457600080fd5b919050565b803561ffff811681146102b457600080fd5b600080600080600060a086880312156102e2578081fd5b6102eb8661029d565b945060208087013567ffffffffffffffff80821115610308578384fd5b818901915089601f83011261031b578384fd5b81358181111561032d5761032d6103ce565b8060051b604051601f19603f83011681018181108582111715610352576103526103ce565b604052828152858101935084860182860187018e1015610370578788fd5b8795505b83861015610399576103858161029d565b855260019590950194938601938601610374565b508099505050505050506103af604087016102b9565b92506103bd606087016102b9565b949793965091946080013592915050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220fae4e6991bd977fb8425ad5da77dcfd9d5213f10e30e7773019e0bd6d579bf4b64736f6c63430008040033\";\nvar Setup__factory = /** @class */ (function (_super) {\n __extends(Setup__factory, _super);\n function Setup__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Setup__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n Setup__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n Setup__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Setup__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Setup__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Setup__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Setup__factory.bytecode = _bytecode;\n Setup__factory.abi = _abi;\n return Setup__factory;\n}(ContractFactory));\nexport { Setup__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"minDelay\",\n type: \"uint256\",\n },\n {\n internalType: \"address[]\",\n name: \"proposers\",\n type: \"address[]\",\n },\n {\n internalType: \"address[]\",\n name: \"executors\",\n type: \"address[]\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"CallExecuted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"predecessor\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"delay\",\n type: \"uint256\",\n },\n ],\n name: \"CallScheduled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n ],\n name: \"Cancelled\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"oldDuration\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"newDuration\",\n type: \"uint256\",\n },\n ],\n name: \"MinDelayChange\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"previousAdminRole\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"newAdminRole\",\n type: \"bytes32\",\n },\n ],\n name: \"RoleAdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleGranted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n ],\n name: \"RoleRevoked\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"DEFAULT_ADMIN_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"EXECUTOR_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"PROPOSER_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"TIMELOCK_ADMIN_ROLE\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n ],\n name: \"cancel\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes32\",\n name: \"predecessor\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"salt\",\n type: \"bytes32\",\n },\n ],\n name: \"execute\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"datas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"predecessor\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"salt\",\n type: \"bytes32\",\n },\n ],\n name: \"executeBatch\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getMinDelay\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"duration\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n ],\n name: \"getRoleAdmin\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n ],\n name: \"getTimestamp\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"timestamp\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"grantRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"hasRole\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes32\",\n name: \"predecessor\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"salt\",\n type: \"bytes32\",\n },\n ],\n name: \"hashOperation\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"datas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"predecessor\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"salt\",\n type: \"bytes32\",\n },\n ],\n name: \"hashOperationBatch\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"hash\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n ],\n name: \"isOperation\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"pending\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n ],\n name: \"isOperationDone\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"done\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n ],\n name: \"isOperationPending\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"pending\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"id\",\n type: \"bytes32\",\n },\n ],\n name: \"isOperationReady\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"ready\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"renounceRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"role\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"revokeRole\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"target\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"bytes32\",\n name: \"predecessor\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"salt\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"delay\",\n type: \"uint256\",\n },\n ],\n name: \"schedule\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"targets\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes[]\",\n name: \"datas\",\n type: \"bytes[]\",\n },\n {\n internalType: \"bytes32\",\n name: \"predecessor\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32\",\n name: \"salt\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"delay\",\n type: \"uint256\",\n },\n ],\n name: \"scheduleBatch\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"newDelay\",\n type: \"uint256\",\n },\n ],\n name: \"updateDelay\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x60806040523480156200001157600080fd5b5060405162001e8238038062001e828339810160408190526200003491620003c6565b6200004f60008051602062001e2283398151915280620001e1565b6200007960008051602062001e4283398151915260008051602062001e22833981519152620001e1565b620000a360008051602062001e6283398151915260008051602062001e22833981519152620001e1565b620000be60008051602062001e228339815191523362000236565b620000d960008051602062001e228339815191523062000236565b60005b825181101562000142576200012f60008051602062001e428339815191528483815181106200011b57634e487b7160e01b600052603260045260246000fd5b60200260200101516200023660201b60201c565b6200013a8162000437565b9050620000dc565b5060005b815181101562000198576200018560008051602062001e628339815191528383815181106200011b57634e487b7160e01b600052603260045260246000fd5b620001908162000437565b905062000146565b5060028390556040805160008152602081018590527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a150505062000475565b6000620001ee8362000246565b600084815260208190526040808220600101859055519192508391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6200024282826200025e565b5050565b6000818152602081905260409020600101545b919050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000242576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002ba3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200025957600080fd5b600082601f83011262000327578081fd5b815160206001600160401b03808311156200034657620003466200045f565b8260051b604051601f19603f830116810181811084821117156200036e576200036e6200045f565b604052848152838101925086840182880185018910156200038d578687fd5b8692505b85831015620003ba57620003a581620002fe565b84529284019260019290920191840162000391565b50979650505050505050565b600080600060608486031215620003db578283fd5b835160208501519093506001600160401b0380821115620003fa578384fd5b620004088783880162000316565b935060408601519150808211156200041e578283fd5b506200042d8682870162000316565b9150509250925092565b60006000198214156200045857634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b61199d80620004856000396000f3fe60806040526004361061014f5760003560e01c806364d62353116100b6578063b1c5f4271161006f578063b1c5f427146103f3578063c4d252f514610413578063d45c443514610433578063d547741f14610460578063e38335e514610480578063f27a0c921461049357610156565b806364d623531461033c5780638065657f1461035c5780638f2a0bb01461037c5780638f61f4f51461039c57806391d14854146103be578063a217fddf146103de57610156565b8063248a9ca311610108578063248a9ca31461025b5780632ab0f5291461028b5780632f2ff15d146102bc57806331d50750146102dc57806336568abe146102fc578063584b153e1461031c57610156565b806301d5062a1461015b57806301ffc9a71461017d57806307bd0265146101b25780630d3cf6fc146101f4578063134008d31461022857806313bc9f201461023b57610156565b3661015657005b600080fd5b34801561016757600080fd5b5061017b610176366004611312565b6104a8565b005b34801561018957600080fd5b5061019d61019836600461151b565b61052d565b60405190151581526020015b60405180910390f35b3480156101be57600080fd5b506101e67fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6381565b6040519081526020016101a9565b34801561020057600080fd5b506101e67f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b61017b6102363660046112a8565b610566565b34801561024757600080fd5b5061019d6102563660046114d8565b6105de565b34801561026757600080fd5b506101e66102763660046114d8565b60009081526020819052604090206001015490565b34801561029757600080fd5b5061019d6102a63660046114d8565b6000908152600160208190526040909120541490565b3480156102c857600080fd5b5061017b6102d73660046114f0565b610604565b3480156102e857600080fd5b5061019d6102f73660046114d8565b61062f565b34801561030857600080fd5b5061017b6103173660046114f0565b610648565b34801561032857600080fd5b5061019d6103373660046114d8565b6106cb565b34801561034857600080fd5b5061017b6103573660046114d8565b6106e1565b34801561036857600080fd5b506101e66103773660046112a8565b610785565b34801561038857600080fd5b5061017b61039736600461142a565b6107c4565b3480156103a857600080fd5b506101e660008051602061194883398151915281565b3480156103ca57600080fd5b5061019d6103d93660046114f0565b61092f565b3480156103ea57600080fd5b506101e6600081565b3480156103ff57600080fd5b506101e661040e366004611385565b610958565b34801561041f57600080fd5b5061017b61042e3660046114d8565b61099d565b34801561043f57600080fd5b506101e661044e3660046114d8565b60009081526001602052604090205490565b34801561046c57600080fd5b5061017b61047b3660046114f0565b610a61565b61017b61048e366004611385565b610a87565b34801561049f57600080fd5b506002546101e6565b6000805160206119488339815191526104c281335b610be6565b60006104d2898989898989610785565b90506104de8184610c4a565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a60405161051a969594939291906116b1565b60405180910390a3505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061055e57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6361059281600061092f565b6105a0576105a081336104bd565b60006105b0888888888888610785565b90506105bc8185610d39565b6105cb8160008a8a8a8a610dd5565b6105d481610ee9565b5050505050505050565b6000818152600160205260408120546001811180156105fd5750428111155b9392505050565b60008281526020819052604090206001015461062081336104bd565b61062a8383610f22565b505050565b60008181526001602052604081205481905b1192915050565b6001600160a01b03811633146106bd5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106c78282610fa6565b5050565b6000818152600160208190526040822054610641565b3330146107445760405162461bcd60e51b815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201526a62652074696d656c6f636b60a81b60648201526084016106b4565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b60008686868686866040516020016107a2969594939291906116b1565b6040516020818303038152906040528051906020012090509695505050505050565b6000805160206119488339815191526107dd81336104bd565b8887146107fc5760405162461bcd60e51b81526004016106b4906117c6565b88851461081b5760405162461bcd60e51b81526004016106b4906117c6565b600061082d8b8b8b8b8b8b8b8b610958565b90506108398184610c4a565b60005b8a8110156109215780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e8581811061088757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061089c919061128e565b8d8d868181106108bc57634e487b7160e01b600052603260045260246000fd5b905060200201358c8c878181106108e357634e487b7160e01b600052603260045260246000fd5b90506020028101906108f59190611853565b8c8b604051610909969594939291906116b1565b60405180910390a361091a81611916565b905061083c565b505050505050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600088888888888888886040516020016109799897969594939291906116ee565b60405160208183030381529060405280519060200120905098975050505050505050565b6000805160206119488339815191526109b681336104bd565b6109bf826106cb565b610a255760405162461bcd60e51b815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e2063616044820152701b9b9bdd0818994818d85b98d95b1b1959607a1b60648201526084016106b4565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610a7d81336104bd565b61062a8383610fa6565b7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63610ab381600061092f565b610ac157610ac181336104bd565b878614610ae05760405162461bcd60e51b81526004016106b4906117c6565b878414610aff5760405162461bcd60e51b81526004016106b4906117c6565b6000610b118a8a8a8a8a8a8a8a610958565b9050610b1d8185610d39565b60005b89811015610bd057610bc082828d8d85818110610b4d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b62919061128e565b8c8c86818110610b8257634e487b7160e01b600052603260045260246000fd5b905060200201358b8b87818110610ba957634e487b7160e01b600052603260045260246000fd5b9050602002810190610bbb9190611853565b610dd5565b610bc981611916565b9050610b20565b50610bda81610ee9565b50505050505050505050565b610bf0828261092f565b6106c757610c08816001600160a01b0316601461100b565b610c1383602061100b565b604051602001610c2492919061160a565b60408051601f198184030181529082905262461bcd60e51b82526106b491600401611793565b610c538261062f565b15610cb85760405162461bcd60e51b815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201526e1c9958591e481cd8da19591d5b1959608a1b60648201526084016106b4565b600254811015610d195760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e746044820152652064656c617960d01b60648201526084016106b4565b610d238142611898565b6000928352600160205260409092209190915550565b610d42826105de565b610d5e5760405162461bcd60e51b81526004016106b490611809565b801580610d7a5750600081815260016020819052604090912054145b6106c75760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e6720646570656044820152656e64656e637960d01b60648201526084016106b4565b6000846001600160a01b0316848484604051610df29291906115fa565b60006040518083038185875af1925050503d8060008114610e2f576040519150601f19603f3d011682016040523d82523d6000602084013e610e34565b606091505b5050905080610ea15760405162461bcd60e51b815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e6720746044820152721c985b9cd858dd1a5bdb881c995d995c9d1959606a1b60648201526084016106b4565b85877fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b5887878787604051610ed8949392919061167f565b60405180910390a350505050505050565b610ef2816105de565b610f0e5760405162461bcd60e51b81526004016106b490611809565b600090815260016020819052604090912055565b610f2c828261092f565b6106c7576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610f623390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610fb0828261092f565b156106c7576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060600061101a8360026118b0565b611025906002611898565b67ffffffffffffffff81111561104b57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611075576020820181803683370190505b509050600360fc1b8160008151811061109e57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106110db57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006110ff8460026118b0565b61110a906001611898565b90505b600181111561119e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061114c57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061117057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93611197816118ff565b905061110d565b5083156105fd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106b4565b80356001600160a01b038116811461056157600080fd5b60008083601f840112611215578182fd5b50813567ffffffffffffffff81111561122c578182fd5b6020830191508360208260051b850101111561124757600080fd5b9250929050565b60008083601f84011261125f578182fd5b50813567ffffffffffffffff811115611276578182fd5b60208301915083602082850101111561124757600080fd5b60006020828403121561129f578081fd5b6105fd826111ed565b60008060008060008060a087890312156112c0578182fd5b6112c9876111ed565b955060208701359450604087013567ffffffffffffffff8111156112eb578283fd5b6112f789828a0161124e565b979a9699509760608101359660809091013595509350505050565b600080600080600080600060c0888a03121561132c578081fd5b611335886111ed565b965060208801359550604088013567ffffffffffffffff811115611357578182fd5b6113638a828b0161124e565b989b979a50986060810135976080820135975060a09091013595509350505050565b60008060008060008060008060a0898b0312156113a0578081fd5b883567ffffffffffffffff808211156113b7578283fd5b6113c38c838d01611204565b909a50985060208b01359150808211156113db578283fd5b6113e78c838d01611204565b909850965060408b01359150808211156113ff578283fd5b5061140c8b828c01611204565b999c989b509699959896976060870135966080013595509350505050565b600080600080600080600080600060c08a8c031215611447578081fd5b893567ffffffffffffffff8082111561145e578283fd5b61146a8d838e01611204565b909b50995060208c0135915080821115611482578283fd5b61148e8d838e01611204565b909950975060408c01359150808211156114a6578283fd5b506114b38c828d01611204565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b6000602082840312156114e9578081fd5b5035919050565b60008060408385031215611502578182fd5b82359150611512602084016111ed565b90509250929050565b60006020828403121561152c578081fd5b81356001600160e01b0319811681146105fd578182fd5b60008284526020808501808196508560051b8101915084845b878110156115c35782840389528135601e1988360301811261157c578687fd5b8701803567ffffffffffffffff811115611594578788fd5b8036038913156115a2578788fd5b6115af86828985016115d0565b9a87019a955050509084019060010161155c565b5091979650505050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6000828483379101908152919050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516116428160178501602088016118cf565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516116738160288401602088016118cf565b01602801949350505050565b600060018060a01b0386168252846020830152606060408301526116a76060830184866115d0565b9695505050505050565b600060018060a01b038816825286602083015260a060408301526116d960a0830186886115d0565b60608301949094525060800152949350505050565b60a0808252810188905260008960c08301825b8b81101561172f576001600160a01b0361171a846111ed565b16825260209283019290910190600101611701565b5083810360208501528881526001600160fb1b0389111561174e578283fd5b8860051b9150818a6020830137016020818101838152848303909101604085015261177a81888a611543565b6060850196909652505050608001529695505050505050565b60006020825282518060208401526117b28160408501602087016118cf565b601f01601f19169190910160400192915050565b60208082526023908201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d616040820152620e8c6d60eb1b606082015260800190565b6020808252602a908201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e206973604082015269206e6f7420726561647960b01b606082015260800190565b6000808335601e19843603018112611869578283fd5b83018035915067ffffffffffffffff821115611883578283fd5b60200191503681900382131561124757600080fd5b600082198211156118ab576118ab611931565b500190565b60008160001904831182151516156118ca576118ca611931565b500290565b60005b838110156118ea5781810151838201526020016118d2565b838111156118f9576000848401525b50505050565b60008161190e5761190e611931565b506000190190565b600060001982141561192a5761192a611931565b5060010190565b634e487b7160e01b600052601160045260246000fdfeb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1a2646970667358221220361a1d1e9106ffc77cb76ed529f6648bc4105a53ba3e6687320a78e96c57c24d64736f6c634300080300335f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1d8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63\";\nvar TimelockController__factory = /** @class */ (function (_super) {\n __extends(TimelockController__factory, _super);\n function TimelockController__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n TimelockController__factory.prototype.deploy = function (minDelay, proposers, executors, overrides) {\n return _super.prototype.deploy.call(this, minDelay, proposers, executors, overrides || {});\n };\n TimelockController__factory.prototype.getDeployTransaction = function (minDelay, proposers, executors, overrides) {\n return _super.prototype.getDeployTransaction.call(this, minDelay, proposers, executors, overrides || {});\n };\n TimelockController__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n TimelockController__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n TimelockController__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n TimelockController__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n TimelockController__factory.bytecode = _bytecode;\n TimelockController__factory.abi = _abi;\n return TimelockController__factory;\n}(ContractFactory));\nexport { TimelockController__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"initData\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201b49b5823aab14d5504be8d7e590628153258568864f5149e68e8bbfadf20e5a64736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar TokenBridge__factory = /** @class */ (function (_super) {\n __extends(TokenBridge__factory, _super);\n function TokenBridge__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n TokenBridge__factory.prototype.deploy = function (implementation, initData, overrides) {\n return _super.prototype.deploy.call(this, implementation, initData, overrides || {});\n };\n TokenBridge__factory.prototype.getDeployTransaction = function (implementation, initData, overrides) {\n return _super.prototype.getDeployTransaction.call(this, implementation, initData, overrides || {});\n };\n TokenBridge__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n TokenBridge__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n TokenBridge__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n TokenBridge__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n TokenBridge__factory.bytecode = _bytecode;\n TokenBridge__factory.abi = _abi;\n return TokenBridge__factory;\n}(ContractFactory));\nexport { TokenBridge__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"uint8\",\n name: \"decimals_\",\n type: \"uint8\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence_\",\n type: \"uint64\",\n },\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"uint16\",\n name: \"chainId_\",\n type: \"uint16\",\n },\n {\n internalType: \"bytes32\",\n name: \"nativeContract_\",\n type: \"bytes32\",\n },\n ],\n name: \"initialize\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"chainId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"nativeContract\",\n outputs: [\n {\n internalType: \"bytes32\",\n name: \"\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue_\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue_\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount_\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"name_\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"symbol_\",\n type: \"string\",\n },\n {\n internalType: \"uint64\",\n name: \"sequence_\",\n type: \"uint64\",\n },\n ],\n name: \"updateDetails\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b506111e9806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063a18cd7c611610071578063a18cd7c614610246578063a457c2d714610259578063a9059cbb1461026c578063c71f46151461027f578063dd62ed3e1461029257600080fd5b80638da5cb5b146101ef57806395d89b411461020a5780639a8a0592146102125780639dc29fac1461023357600080fd5b8063313ce567116100e9578063313ce5671461018157806339509351146101965780633d6c043b146101a957806340c10f19146101b157806370a08231146101c657600080fd5b806306fdde031461011b578063095ea7b31461013957806318160ddd1461015c57806323b872dd1461016e575b600080fd5b6101236102cb565b6040516101309190611093565b60405180910390f35b61014c610147366004610e85565b6102f4565b6040519015158152602001610130565b6003545b604051908152602001610130565b61014c61017c366004610e4a565b61030a565b60045460405160ff9091168152602001610130565b61014c6101a4366004610e85565b6103c0565b600854610160565b6101c46101bf366004610e85565b6103f7565b005b6101606101d4366004610df7565b6001600160a01b031660009081526005602052604090205490565b6007546040516001600160a01b039091168152602001610130565b61012361042f565b600754600160a81b900461ffff1660405161ffff9091168152602001610130565b6101c4610241366004610e85565b6104c4565b6101c4610254366004610eae565b6104f8565b61014c610267366004610e85565b6105ce565b61014c61027a366004610e85565b610669565b6101c461028d366004610f1f565b610676565b6101606102a0366004610e18565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6040516060906102e090600090602001610fdd565b604051602081830303815290604052905090565b6000610301338484610775565b50600192915050565b600061031784848461089a565b6001600160a01b0384166000908152600660209081526040808320338452909152902054828110156103a15760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103b585336103b08685611135565b610775565b506001949350505050565b3360008181526006602090815260408083206001600160a01b038716845290915281205490916103019185906103b090869061111d565b6007546001600160a01b031633146104215760405162461bcd60e51b8152600401610398906110e6565b61042b8282610a72565b5050565b6060600060010180546104419061114c565b80601f016020809104026020016040519081016040528092919081815260200182805461046d9061114c565b80156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b5050505050905090565b6007546001600160a01b031633146104ee5760405162461bcd60e51b8152600401610398906110e6565b61042b8282610b54565b6007546001600160a01b031633146105225760405162461bcd60e51b8152600401610398906110e6565b60025467ffffffffffffffff8083169116106105805760405162461bcd60e51b815260206004820152601e60248201527f63757272656e74206d6574616461746120697320757020746f206461746500006044820152606401610398565b8251610593906000906020860190610ca3565b5081516105a7906001906020850190610ca3565b506002805467ffffffffffffffff191667ffffffffffffffff929092169190911790555050565b3360009081526006602090815260408083206001600160a01b0386168452909152812054828110156106505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610398565b61065f33856103b08685611135565b5060019392505050565b600061030133848461089a565b600754600160a01b900460ff16156106c65760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610398565b6007805460ff60a01b1916600160a01b17905586516106ec9060009060208a0190610ca3565b508551610700906001906020890190610ca3565b506004805460ff90961660ff19909616959095179094556002805467ffffffffffffffff90941667ffffffffffffffff19909416939093179092556007805461ffff909316600160a81b02600162ffff0160a01b03199093166001600160a01b03909216919091179190911790556008555050565b6001600160a01b0383166107d75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610398565b6001600160a01b0382166108385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610398565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166108fe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610398565b6001600160a01b0382166109605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610398565b6001600160a01b038316600090815260056020526040902054818110156109d85760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610398565b6109e28282611135565b6001600160a01b038086166000908152600560205260408082209390935590851681529081208054849290610a1890849061111d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a6491815260200190565b60405180910390a350505050565b6001600160a01b038216610ac85760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610398565b8060006003016000828254610add919061111d565b90915550506001600160a01b03821660009081526005602052604081208054839290610b0a90849061111d565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610bb45760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610398565b6001600160a01b03821660009081526005602052604090205481811015610c285760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610398565b610c328282611135565b6001600160a01b03841660009081526005602052604081209190915560038054849290610c60908490611135565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161088d565b828054610caf9061114c565b90600052602060002090601f016020900481019282610cd15760008555610d17565b82601f10610cea57805160ff1916838001178555610d17565b82800160010185558215610d17579182015b82811115610d17578251825591602001919060010190610cfc565b50610d23929150610d27565b5090565b5b80821115610d235760008155600101610d28565b80356001600160a01b0381168114610d5357600080fd5b919050565b600082601f830112610d68578081fd5b813567ffffffffffffffff80821115610d8357610d8361119d565b604051601f8301601f19908116603f01168101908282118183101715610dab57610dab61119d565b81604052838152866020858801011115610dc3578485fd5b8360208701602083013792830160200193909352509392505050565b803567ffffffffffffffff81168114610d5357600080fd5b600060208284031215610e08578081fd5b610e1182610d3c565b9392505050565b60008060408385031215610e2a578081fd5b610e3383610d3c565b9150610e4160208401610d3c565b90509250929050565b600080600060608486031215610e5e578081fd5b610e6784610d3c565b9250610e7560208501610d3c565b9150604084013590509250925092565b60008060408385031215610e97578182fd5b610ea083610d3c565b946020939093013593505050565b600080600060608486031215610ec2578283fd5b833567ffffffffffffffff80821115610ed9578485fd5b610ee587838801610d58565b94506020860135915080821115610efa578384fd5b50610f0786828701610d58565b925050610f1660408501610ddf565b90509250925092565b600080600080600080600060e0888a031215610f39578283fd5b873567ffffffffffffffff80821115610f50578485fd5b610f5c8b838c01610d58565b985060208a0135915080821115610f71578485fd5b50610f7e8a828b01610d58565b965050604088013560ff81168114610f94578384fd5b9450610fa260608901610ddf565b9350610fb060808901610d3c565b925060a088013561ffff81168114610fc6578283fd5b8092505060c0880135905092959891949750929550565b600080835482600182811c915080831680610ff957607f831692505b602080841082141561101957634e487b7160e01b87526022600452602487fd5b81801561102d576001811461103e5761106a565b60ff1986168952848901965061106a565b60008a815260209020885b868110156110625781548b820152908501908301611049565b505084890196505b50505050505061108b816a2028576f726d686f6c652960a81b8152600b0190565b949350505050565b6000602080835283518082850152825b818110156110bf578581018301518582016040015282016110a3565b818111156110d05783604083870101525b50601f01601f1916929092016040019392505050565b60208082526017908201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604082015260600190565b6000821982111561113057611130611187565b500190565b60008282101561114757611147611187565b500390565b600181811c9082168061116057607f821691505b6020821081141561118157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220b95441ce5c32d3a4f1e35bef3162f4248a97a9c7bfc685ef9090cd15fbc712fb64736f6c63430008040033\";\nvar TokenImplementation__factory = /** @class */ (function (_super) {\n __extends(TokenImplementation__factory, _super);\n function TokenImplementation__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n TokenImplementation__factory.prototype.deploy = function (overrides) {\n return _super.prototype.deploy.call(this, overrides || {});\n };\n TokenImplementation__factory.prototype.getDeployTransaction = function (overrides) {\n return _super.prototype.getDeployTransaction.call(this, overrides || {});\n };\n TokenImplementation__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n TokenImplementation__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n TokenImplementation__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n TokenImplementation__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n TokenImplementation__factory.bytecode = _bytecode;\n TokenImplementation__factory.abi = _abi;\n return TokenImplementation__factory;\n}(ContractFactory));\nexport { TokenImplementation__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"contract IERC20\",\n name: \"token_\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"beneficiary_\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"releaseTime_\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n inputs: [],\n name: \"beneficiary\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"release\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"releaseTime\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"token\",\n outputs: [\n {\n internalType: \"contract IERC20\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x60e060405234801561001057600080fd5b506040516107c63803806107c683398101604081905261002f916100c0565b42811161009d5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2072656c656173652074696d65206973206260448201527165666f72652063757272656e742074696d6560701b606482015260840160405180910390fd5b6001600160601b0319606093841b81166080529190921b1660a05260c05261011a565b6000806000606084860312156100d4578283fd5b83516100df81610102565b60208501519093506100f081610102565b80925050604084015190509250925092565b6001600160a01b038116811461011757600080fd5b50565b60805160601c60a05160601c60c05161065f61016760003960008181609f015260f0015260008181605301526102a701526000818160ca015281816101820152610285015261065f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f14610090578063b91d40011461009a578063fc0c546a146100c8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b6100986100ee565b005b6040517f00000000000000000000000000000000000000000000000000000000000000008152602001610087565b7f0000000000000000000000000000000000000000000000000000000000000000610073565b7f000000000000000000000000000000000000000000000000000000000000000042101561017e5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260448201527165666f72652072656c656173652074696d6560701b60648201526084015b60405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b1580156101e257600080fd5b505afa1580156101f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021a9190610592565b9050600081116102785760405162461bcd60e51b815260206004820152602360248201527f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560448201526261736560e81b6064820152608401610175565b6102cc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000836102cf565b50565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610321908490610326565b505050565b600061037b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166103f89092919063ffffffff16565b80519091501561032157808060200190518101906103999190610572565b6103215760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610175565b60606104078484600085610411565b90505b9392505050565b6060824710156104725760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610175565b843b6104c05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610175565b600080866001600160a01b031685876040516104dc91906105aa565b60006040518083038185875af1925050503d8060008114610519576040519150601f19603f3d011682016040523d82523d6000602084013e61051e565b606091505b509150915061052e828286610539565b979650505050505050565b6060831561054857508161040a565b8251156105585782518084602001fd5b8160405162461bcd60e51b815260040161017591906105c6565b600060208284031215610583578081fd5b8151801515811461040a578182fd5b6000602082840312156105a3578081fd5b5051919050565b600082516105bc8184602087016105f9565b9190910192915050565b60006020825282518060208401526105e58160408501602087016105f9565b601f01601f19169190910160400192915050565b60005b838110156106145781810151838201526020016105fc565b83811115610623576000848401525b5050505056fea2646970667358221220a696bd4fbc0c665d610e6795ee54246e0b323242a27ba1351ea2095433e92cba64736f6c63430008030033\";\nvar TokenTimelock__factory = /** @class */ (function (_super) {\n __extends(TokenTimelock__factory, _super);\n function TokenTimelock__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n TokenTimelock__factory.prototype.deploy = function (token_, beneficiary_, releaseTime_, overrides) {\n return _super.prototype.deploy.call(this, token_, beneficiary_, releaseTime_, overrides || {});\n };\n TokenTimelock__factory.prototype.getDeployTransaction = function (token_, beneficiary_, releaseTime_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, token_, beneficiary_, releaseTime_, overrides || {});\n };\n TokenTimelock__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n TokenTimelock__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n TokenTimelock__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n TokenTimelock__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n TokenTimelock__factory.bytecode = _bytecode;\n TokenTimelock__factory.abi = _abi;\n return TokenTimelock__factory;\n}(ContractFactory));\nexport { TokenTimelock__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_logic\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"admin_\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"_data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n inputs: [],\n name: \"admin\",\n outputs: [\n {\n internalType: \"address\",\n name: \"admin_\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"changeAdmin\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"implementation_\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newImplementation\",\n type: \"address\",\n },\n ],\n name: \"upgradeTo\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newImplementation\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"upgradeToAndCall\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405260405162000f5a38038062000f5a8339810160408190526200002691620004e2565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd62000611565b60008051602062000f13833981519152146200008157634e487b7160e01b600052600160045260246000fd5b6200008f82826000620000ff565b50620000bf905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610462000611565b60008051602062000ef383398151915214620000eb57634e487b7160e01b600052600160045260246000fd5b620000f6826200013c565b5050506200067a565b6200010a8362000197565b600082511180620001185750805b156200013757620001358383620001d960201b6200026c1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200016762000208565b604080516001600160a01b03928316815291841660208301520160405180910390a1620001948162000241565b50565b620001a281620002f6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000201838360405180606001604052806027815260200162000f336027913962000399565b9392505050565b60006200023260008051602062000ef383398151915260001b6200047f60201b620002141760201c565b546001600160a01b0316905090565b6001600160a01b038116620002ac5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002d560008051602062000ef383398151915260001b6200047f60201b620002141760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6200030c816200048260201b620002981760201c565b620003705760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620002a3565b80620002d560008051602062000f1383398151915260001b6200047f60201b620002141760201c565b6060620003a68462000482565b620004035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620002a3565b600080856001600160a01b031685604051620004209190620005be565b600060405180830381855af49150503d80600081146200045d576040519150601f19603f3d011682016040523d82523d6000602084013e62000462565b606091505b509092509050620004758282866200048c565b9695505050505050565b90565b803b15155b919050565b606083156200049d57508162000201565b825115620004ae5782518084602001fd5b8160405162461bcd60e51b8152600401620002a39190620005dc565b80516001600160a01b03811681146200048757600080fd5b600080600060608486031215620004f7578283fd5b6200050284620004ca565b92506200051260208501620004ca565b60408501519092506001600160401b03808211156200052f578283fd5b818601915086601f83011262000543578283fd5b81518181111562000558576200055862000664565b604051601f8201601f19908116603f0116810190838211818310171562000583576200058362000664565b816040528281528960208487010111156200059c578586fd5b620005af83602083016020880162000635565b80955050505050509250925092565b60008251620005d281846020870162000635565b9190910192915050565b6000602082528251806020840152620005fd81604085016020870162000635565b601f01601f19169190910160400192915050565b6000828210156200063057634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156200065257818101518382015260200162000638565b83811115620001355750506000910152565b634e487b7160e01b600052604160045260246000fd5b610869806200068a6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106f9565b610118565b61005b610093366004610713565b610164565b3480156100a457600080fd5b506100ad6101da565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106f9565b610217565b3480156100f557600080fd5b506100ad610241565b6101066102a2565b610116610111610346565b610355565b565b610120610379565b6001600160a01b0316336001600160a01b0316141561015957610154816040518060200160405280600081525060006103ac565b610161565b6101616100fe565b50565b61016c610379565b6001600160a01b0316336001600160a01b031614156101cd576101c88383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103ac915050565b6101d5565b6101d56100fe565b505050565b60006101e4610379565b6001600160a01b0316336001600160a01b0316141561020c57610205610346565b9050610214565b6102146100fe565b90565b61021f610379565b6001600160a01b0316336001600160a01b0316141561015957610154816103d7565b600061024b610379565b6001600160a01b0316336001600160a01b0316141561020c57610205610379565b6060610291838360405180606001604052806027815260200161080d6027913961042b565b9392505050565b803b15155b919050565b6102aa610379565b6001600160a01b0316336001600160a01b031614156103415760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b610116565b6000610350610506565b905090565b3660008037600080366000845af43d6000803e808015610374573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316905090565b6103b58361052e565b6000825111806103c25750805b156101d5576103d1838361026c565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610400610379565b604080516001600160a01b03928316815291841660208301520160405180910390a16101618161056e565b606061043684610298565b6104915760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610338565b600080856001600160a01b0316856040516104ac9190610791565b600060405180830381855af49150503d80600081146104e7576040519150601f19603f3d011682016040523d82523d6000602084013e6104ec565b606091505b50915091506104fc828286610617565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61039d565b61053781610650565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152608401610338565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60608315610626575081610291565b8251156106365782518084602001fd5b8160405162461bcd60e51b815260040161033891906107ad565b61065981610298565b6106bb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610338565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105f6565b80356001600160a01b038116811461029d57600080fd5b60006020828403121561070a578081fd5b610291826106e2565b600080600060408486031215610727578182fd5b610730846106e2565b9250602084013567ffffffffffffffff8082111561074c578384fd5b818601915086601f83011261075f578384fd5b81358181111561076d578485fd5b87602082850101111561077e578485fd5b6020830194508093505050509250925092565b600082516107a38184602087016107e0565b9190910192915050565b60006020825282518060208401526107cc8160408501602087016107e0565b601f01601f19169190910160400192915050565b60005b838110156107fb5781810151838201526020016107e3565b838111156103d1575050600091015256fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220ddc0838f0b211b6b7e8eccfec1e8a5a9dd7934cff71defb09a0bae61e9135fe164736f6c63430008030033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar TransparentUpgradeableProxy__factory = /** @class */ (function (_super) {\n __extends(TransparentUpgradeableProxy__factory, _super);\n function TransparentUpgradeableProxy__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n TransparentUpgradeableProxy__factory.prototype.deploy = function (_logic, admin_, _data, overrides) {\n return _super.prototype.deploy.call(this, _logic, admin_, _data, overrides || {});\n };\n TransparentUpgradeableProxy__factory.prototype.getDeployTransaction = function (_logic, admin_, _data, overrides) {\n return _super.prototype.getDeployTransaction.call(this, _logic, admin_, _data, overrides || {});\n };\n TransparentUpgradeableProxy__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n TransparentUpgradeableProxy__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n TransparentUpgradeableProxy__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n TransparentUpgradeableProxy__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n TransparentUpgradeableProxy__factory.bytecode = _bytecode;\n TransparentUpgradeableProxy__factory.abi = _abi;\n return TransparentUpgradeableProxy__factory;\n}(ContractFactory));\nexport { TransparentUpgradeableProxy__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, utils } from \"ethers\";\nvar _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newImplementation\",\n type: \"address\",\n },\n ],\n name: \"upgradeTo\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newImplementation\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"upgradeToAndCall\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n];\nvar UUPSUpgradeable__factory = /** @class */ (function () {\n function UUPSUpgradeable__factory() {\n }\n UUPSUpgradeable__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n UUPSUpgradeable__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n UUPSUpgradeable__factory.abi = _abi;\n return UUPSUpgradeable__factory;\n}());\nexport { UUPSUpgradeable__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"implementation_\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newImplementation\",\n type: \"address\",\n },\n ],\n name: \"upgradeTo\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5060405161050a38038061050a83398101604081905261002f91610148565b61003833610047565b61004181610097565b50610176565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100aa8161014260201b61020a1760201c565b6101205760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3b151590565b600060208284031215610159578081fd5b81516001600160a01b038116811461016f578182fd5b9392505050565b610385806101856000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a3660046102ec565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f610139565b6000546001600160a01b031661007e565b61006f6100c13660046102ec565b61016f565b6000546001600160a01b031633146100f95760405162461bcd60e51b81526004016100f09061031a565b60405180910390fd5b61010281610210565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6000546001600160a01b031633146101635760405162461bcd60e51b81526004016100f09061031a565b61016d600061029c565b565b6000546001600160a01b031633146101995760405162461bcd60e51b81526004016100f09061031a565b6001600160a01b0381166101fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f0565b6102078161029c565b50565b3b151590565b803b61027a5760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b60648201526084016100f0565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156102fd578081fd5b81356001600160a01b0381168114610313578182fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220f45bbe0d068c96fcc0c4e81cd5b0324b02af392f0e4eb101c8be8a0bc2b35bbf64736f6c63430008030033\";\nvar UpgradeableBeacon__factory = /** @class */ (function (_super) {\n __extends(UpgradeableBeacon__factory, _super);\n function UpgradeableBeacon__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n UpgradeableBeacon__factory.prototype.deploy = function (implementation_, overrides) {\n return _super.prototype.deploy.call(this, implementation_, overrides || {});\n };\n UpgradeableBeacon__factory.prototype.getDeployTransaction = function (implementation_, overrides) {\n return _super.prototype.getDeployTransaction.call(this, implementation_, overrides || {});\n };\n UpgradeableBeacon__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n UpgradeableBeacon__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n UpgradeableBeacon__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n UpgradeableBeacon__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n UpgradeableBeacon__factory.bytecode = _bytecode;\n UpgradeableBeacon__factory.abi = _abi;\n return UpgradeableBeacon__factory;\n}(ContractFactory));\nexport { UpgradeableBeacon__factory };\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { utils, Contract, ContractFactory, } from \"ethers\";\nvar _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"setup\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"initData\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"address\",\n name: \"previousAdmin\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"newAdmin\",\n type: \"address\",\n },\n ],\n name: \"AdminChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"beacon\",\n type: \"address\",\n },\n ],\n name: \"BeaconUpgraded\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n stateMutability: \"payable\",\n type: \"receive\",\n },\n];\nvar _bytecode = \"0x608060405234801561001057600080fd5b5060405161078f38038061078f83398101604081905261002f91610314565b818161005c60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61042c565b6000805160206107488339815191521461008657634e487b7160e01b600052600160045260246000fd5b6100928282600061009b565b50505050610491565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b6100291760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101368383604051806060016040528060278152602001610768602791396101fd565b9392505050565b610150816102d260201b6100551760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061074883398151915260001b6102d860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060833b61025c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161027791906103dd565b600060405180830381855af49150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5090925090506102c88282866102db565b9695505050505050565b3b151590565b90565b606083156102ea575081610136565b8251156102fa5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103f9565b60008060408385031215610326578182fd5b82516001600160a01b038116811461033c578283fd5b60208401519092506001600160401b0380821115610358578283fd5b818501915085601f83011261036b578283fd5b81518181111561037d5761037d61047b565b604051601f8201601f19908116603f011681019083821181831017156103a5576103a561047b565b816040528281528860208487010111156103bd578586fd5b6103ce83602083016020880161044f565b80955050505050509250929050565b600082516103ef81846020870161044f565b9190910192915050565b602081526000825180602084015261041881604085016020870161044f565b601f01601f19169190910160400192915050565b60008282101561044a57634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101561046a578181015183820152602001610452565b838111156100ca5750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102a8806104a06000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b6060833b61011e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b03168560405161013991906101cc565b600060405180830381855af49150503d8060008114610174576040519150601f19603f3d011682016040523d82523d6000602084013e610179565b606091505b5091509150610189828286610193565b9695505050505050565b606083156101a257508161004e565b8251156101b25782518084602001fd5b8160405162461bcd60e51b815260040161011591906101e8565b600082516101de81846020870161021b565b9190910192915050565b602081526000825180602084015261020781604085016020870161021b565b601f01601f19169190910160400192915050565b60005b8381101561023657818101518382015260200161021e565b83811115610245576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212202cd71139025b84fb6f5d407d71cc99d5b83f17745ad316ca6f13cdf1b0ff6f7964736f6c63430008040033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564\";\nvar Wormhole__factory = /** @class */ (function (_super) {\n __extends(Wormhole__factory, _super);\n function Wormhole__factory(signer) {\n return _super.call(this, _abi, _bytecode, signer) || this;\n }\n Wormhole__factory.prototype.deploy = function (setup, initData, overrides) {\n return _super.prototype.deploy.call(this, setup, initData, overrides || {});\n };\n Wormhole__factory.prototype.getDeployTransaction = function (setup, initData, overrides) {\n return _super.prototype.getDeployTransaction.call(this, setup, initData, overrides || {});\n };\n Wormhole__factory.prototype.attach = function (address) {\n return _super.prototype.attach.call(this, address);\n };\n Wormhole__factory.prototype.connect = function (signer) {\n return _super.prototype.connect.call(this, signer);\n };\n Wormhole__factory.createInterface = function () {\n return new utils.Interface(_abi);\n };\n Wormhole__factory.connect = function (address, signerOrProvider) {\n return new Contract(address, _abi, signerOrProvider);\n };\n Wormhole__factory.bytecode = _bytecode;\n Wormhole__factory.abi = _abi;\n return Wormhole__factory;\n}(ContractFactory));\nexport { Wormhole__factory };\n","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","\"use strict\";\nimport { AbiCoder, checkResultErrors, ConstructorFragment, defaultAbiCoder, ErrorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, LogDescription, ParamType, TransactionDescription } from \"@ethersproject/abi\";\nimport { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from \"@ethersproject/address\";\nimport * as base64 from \"@ethersproject/base64\";\nimport { Base58 as base58 } from \"@ethersproject/basex\";\nimport { arrayify, concat, hexConcat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isBytes, isBytesLike, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from \"@ethersproject/bytes\";\nimport { _TypedDataEncoder, hashMessage, id, isValidName, namehash } from \"@ethersproject/hash\";\nimport { defaultPath, entropyToMnemonic, getAccountPath, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from \"@ethersproject/hdnode\";\nimport { getJsonWalletAddress } from \"@ethersproject/json-wallets\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { computeHmac, ripemd160, sha256, sha512 } from \"@ethersproject/sha2\";\nimport { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from \"@ethersproject/solidity\";\nimport { randomBytes, shuffled } from \"@ethersproject/random\";\nimport { checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport * as RLP from \"@ethersproject/rlp\";\nimport { computePublicKey, recoverPublicKey, SigningKey } from \"@ethersproject/signing-key\";\nimport { formatBytes32String, nameprep, parseBytes32String, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs } from \"@ethersproject/strings\";\nimport { accessListify, computeAddress, parse as parseTransaction, recoverAddress, serialize as serializeTransaction, TransactionTypes } from \"@ethersproject/transactions\";\nimport { commify, formatEther, parseEther, formatUnits, parseUnits } from \"@ethersproject/units\";\nimport { verifyMessage, verifyTypedData } from \"@ethersproject/wallet\";\nimport { _fetchData, fetchJson, poll } from \"@ethersproject/web\";\n////////////////////////\n// Enums\nimport { SupportedAlgorithm } from \"@ethersproject/sha2\";\nimport { UnicodeNormalizationForm, Utf8ErrorReason } from \"@ethersproject/strings\";\n////////////////////////\n// Exports\nexport { AbiCoder, defaultAbiCoder, Fragment, ConstructorFragment, ErrorFragment, EventFragment, FunctionFragment, ParamType, FormatTypes, checkResultErrors, Logger, RLP, _fetchData, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, LogDescription, TransactionDescription, base58, base64, hexlify, isHexString, hexConcat, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, _TypedDataEncoder, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, computeHmac, keccak256, ripemd160, sha256, sha512, randomBytes, shuffled, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, accessListify, parseTransaction, serializeTransaction, TransactionTypes, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, verifyTypedData, getAccountPath, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, \n////////////////////////\n// Enums\nSupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Indexed };\n//# sourceMappingURL=utils.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nvar BN = _BN.BN;\nimport { hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null) && (BigNumber.isBigNumber(value) ||\n (typeof (value) === \"number\" && (value % 1) === 0) ||\n (typeof (value) === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n (typeof (value) === \"bigint\") ||\n isBytes(value));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\"\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return (this._hex[0] === \"-\");\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString()\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof (value) === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof (value) === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof (anyValue) === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof (hex) === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof (hex) === \"string\") {\n if (isHexString(hex) || (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof (value) !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return (new BN(\"-\" + hex.substring(3), 16));\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return (new BN(value, 16)).toString(36);\n}\n//# sourceMappingURL=bignumber.js.map","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export * from \"./consts\";\nexport * from \"./createNonce\";\nexport * from \"./parseVaa\";\nexport * from \"./array\";\n","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { GrpcWebImpl, PublicRPCServiceClientImpl, } from \"../proto/publicrpc/v1/publicrpc\";\nexport function getSignedVAA(host, emitterChain, emitterAddress, sequence, extraGrpcOpts) {\n if (extraGrpcOpts === void 0) { extraGrpcOpts = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var rpc, api;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n rpc = new GrpcWebImpl(host, extraGrpcOpts);\n api = new PublicRPCServiceClientImpl(rpc);\n return [4 /*yield*/, api.GetSignedVAA({\n messageId: {\n emitterChain: emitterChain,\n emitterAddress: emitterAddress,\n sequence: sequence,\n },\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { getSignedVAA } from \"..\";\nexport function getSignedVAAWithRetry(hosts, emitterChain, emitterAddress, sequence, extraGrpcOpts, retryTimeout, retryAttempts) {\n if (extraGrpcOpts === void 0) { extraGrpcOpts = {}; }\n if (retryTimeout === void 0) { retryTimeout = 1000; }\n return __awaiter(this, void 0, void 0, function () {\n var currentWormholeRpcHost, getNextRpcHost, result, attempts, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n currentWormholeRpcHost = -1;\n getNextRpcHost = function () { return ++currentWormholeRpcHost % hosts.length; };\n attempts = 0;\n _a.label = 1;\n case 1:\n if (!!result) return [3 /*break*/, 7];\n attempts++;\n return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, retryTimeout); })];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n _a.trys.push([3, 5, , 6]);\n return [4 /*yield*/, getSignedVAA(hosts[getNextRpcHost()], emitterChain, emitterAddress, sequence, extraGrpcOpts)];\n case 4:\n result = _a.sent();\n return [3 /*break*/, 6];\n case 5:\n e_1 = _a.sent();\n if (retryAttempts !== undefined && attempts > retryAttempts) {\n throw e_1;\n }\n return [3 /*break*/, 6];\n case 6: return [3 /*break*/, 1];\n case 7: return [2 /*return*/, result];\n }\n });\n });\n}\nexport default getSignedVAAWithRetry;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { importCoreWasm } from \"../solana/wasm\";\nimport { ethers } from \"ethers\";\nimport { uint8ArrayToHex } from \"..\";\nexport function getSignedVAAHash(signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var parse_vaa, parsedVAA, body;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importCoreWasm()];\n case 1:\n parse_vaa = (_a.sent()).parse_vaa;\n parsedVAA = parse_vaa(signedVAA);\n body = [\n ethers.utils.defaultAbiCoder.encode([\"uint32\"], [parsedVAA.timestamp]).substring(2 + (64 - 8)),\n ethers.utils.defaultAbiCoder.encode([\"uint32\"], [parsedVAA.nonce]).substring(2 + (64 - 8)),\n ethers.utils.defaultAbiCoder.encode([\"uint16\"], [parsedVAA.emitter_chain]).substring(2 + (64 - 4)),\n ethers.utils.defaultAbiCoder.encode([\"bytes32\"], [parsedVAA.emitter_address]).substring(2),\n ethers.utils.defaultAbiCoder.encode([\"uint64\"], [parsedVAA.sequence]).substring(2 + (64 - 16)),\n ethers.utils.defaultAbiCoder.encode([\"uint8\"], [parsedVAA.consistency_level]).substring(2 + (64 - 2)),\n uint8ArrayToHex(parsedVAA.payload),\n ];\n return [2 /*return*/, ethers.utils.solidityKeccak256([\"bytes\"], [ethers.utils.solidityKeccak256([\"bytes\"], [\"0x\" + body.join(\"\")])])];\n }\n });\n });\n}\n","import { Implementation__factory } from \"../ethers-contracts\";\nexport function parseSequenceFromLogEth(receipt, bridgeAddress) {\n // TODO: dangerous!(?)\n var bridgeLog = receipt.logs.filter(function (l) {\n return l.address === bridgeAddress;\n })[0];\n var sequence = Implementation__factory.createInterface().parseLog(bridgeLog).args.sequence;\n return sequence.toString();\n}\nexport function parseSequencesFromLogEth(receipt, bridgeAddress) {\n // TODO: dangerous!(?)\n var bridgeLogs = receipt.logs.filter(function (l) {\n return l.address === bridgeAddress;\n });\n return bridgeLogs.map(function (bridgeLog) {\n var sequence = Implementation__factory.createInterface().parseLog(bridgeLog).args.sequence;\n return sequence.toString();\n });\n}\nexport function parseSequenceFromLogTerra(info) {\n // Scan for the Sequence attribute in all the outputs of the transaction.\n // TODO: Make this not horrible.\n var sequence = \"\";\n var jsonLog = JSON.parse(info.raw_log);\n jsonLog.map(function (row) {\n row.events.map(function (event) {\n event.attributes.map(function (attribute) {\n if (attribute.key === \"message.sequence\") {\n sequence = attribute.value;\n }\n });\n });\n });\n console.log(\"Terra Sequence: \", sequence);\n return sequence.toString();\n}\nexport function parseSequencesFromLogTerra(info) {\n // Scan for the Sequence attribute in all the outputs of the transaction.\n // TODO: Make this not horrible.\n var sequences = [];\n var jsonLog = JSON.parse(info.raw_log);\n jsonLog.map(function (row) {\n row.events.map(function (event) {\n event.attributes.map(function (attribute) {\n if (attribute.key === \"message.sequence\") {\n sequences.push(attribute.value.toString());\n }\n });\n });\n });\n return sequences;\n}\nvar SOLANA_SEQ_LOG = \"Program log: Sequence: \";\nexport function parseSequenceFromLogSolana(info) {\n var _a, _b;\n // TODO: better parsing, safer\n var sequence = (_b = (_a = info.meta) === null || _a === void 0 ? void 0 : _a.logMessages) === null || _b === void 0 ? void 0 : _b.filter(function (msg) { return msg.startsWith(SOLANA_SEQ_LOG); })[0].replace(SOLANA_SEQ_LOG, \"\");\n if (!sequence) {\n throw new Error(\"sequence not found\");\n }\n return sequence.toString();\n}\nexport function parseSequencesFromLogSolana(info) {\n var _a, _b;\n // TODO: better parsing, safer\n return (_b = (_a = info.meta) === null || _a === void 0 ? void 0 : _a.logMessages) === null || _b === void 0 ? void 0 : _b.filter(function (msg) { return msg.startsWith(SOLANA_SEQ_LOG); }).map(function (msg) { return msg.replace(SOLANA_SEQ_LOG, \"\"); });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { Bridge__factory } from \"../ethers-contracts\";\nimport { getSignedVAAHash } from \"../bridge\";\nimport { importCoreWasm } from \"../solana/wasm\";\nimport { PublicKey } from \"@solana/web3.js\";\nimport axios from \"axios\";\nimport { redeemOnTerra } from \".\";\nexport function getIsTransferCompletedEth(tokenBridgeAddress, provider, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenBridge, signedVAAHash;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n tokenBridge = Bridge__factory.connect(tokenBridgeAddress, provider);\n return [4 /*yield*/, getSignedVAAHash(signedVAA)];\n case 1:\n signedVAAHash = _a.sent();\n return [4 /*yield*/, tokenBridge.isTransferCompleted(signedVAAHash)];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexport function getIsTransferCompletedTerra(tokenBridgeAddress, signedVAA, walletAddress, client, gasPriceUrl) {\n return __awaiter(this, void 0, void 0, function () {\n var msg, gasPrices, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, redeemOnTerra(tokenBridgeAddress, walletAddress, signedVAA)];\n case 1:\n msg = _a.sent();\n return [4 /*yield*/, axios.get(gasPriceUrl).then(function (result) { return result.data; })];\n case 2:\n gasPrices = _a.sent();\n _a.label = 3;\n case 3:\n _a.trys.push([3, 5, , 6]);\n return [4 /*yield*/, client.tx.estimateFee(walletAddress, [msg], {\n memo: \"already redeemed calculation\",\n feeDenoms: [\"uluna\"],\n gasPrices: gasPrices,\n })];\n case 4:\n _a.sent();\n return [3 /*break*/, 6];\n case 5:\n e_1 = _a.sent();\n // redeemed if the VAA was already executed\n return [2 /*return*/, e_1.response.data.error.includes(\"VaaAlreadyExecuted\")];\n case 6: return [2 /*return*/, false];\n }\n });\n });\n}\nexport function getIsTransferCompletedSolana(tokenBridgeAddress, signedVAA, connection) {\n return __awaiter(this, void 0, void 0, function () {\n var claim_address, claimAddress, claimInfo;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importCoreWasm()];\n case 1:\n claim_address = (_a.sent()).claim_address;\n return [4 /*yield*/, claim_address(tokenBridgeAddress, signedVAA)];\n case 2:\n claimAddress = _a.sent();\n return [4 /*yield*/, connection.getAccountInfo(new PublicKey(claimAddress), \"confirmed\")];\n case 3:\n claimInfo = _a.sent();\n return [2 /*return*/, !!claimInfo];\n }\n });\n });\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});","\nvar inherits;\nif (typeof Object.create === 'function'){\n inherits = function inherits(ctor, superCtor) {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n inherits = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\nexport default inherits;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport process from 'process';\nvar formatRegExp = /%[sdj%]/g;\nexport function format(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexport function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexport function debuglog(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = 0;\n debugs[set] = function() {\n var msg = format.apply(null, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nexport function inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n _extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexport function isArray(ar) {\n return Array.isArray(ar);\n}\n\nexport function isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexport function isNull(arg) {\n return arg === null;\n}\n\nexport function isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexport function isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexport function isString(arg) {\n return typeof arg === 'string';\n}\n\nexport function isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexport function isUndefined(arg) {\n return arg === void 0;\n}\n\nexport function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexport function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexport function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexport function isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexport function isBuffer(maybeBuf) {\n return Buffer.isBuffer(maybeBuf);\n}\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexport function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nimport inherits from './inherits';\nexport {inherits}\n\nexport function _extend(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport default {\n inherits: inherits,\n _extend: _extend,\n log: log,\n isBuffer: isBuffer,\n isPrimitive: isPrimitive,\n isFunction: isFunction,\n isError: isError,\n isDate: isDate,\n isObject: isObject,\n isRegExp: isRegExp,\n isUndefined: isUndefined,\n isSymbol: isSymbol,\n isString: isString,\n isNumber: isNumber,\n isNullOrUndefined: isNullOrUndefined,\n isNull: isNull,\n isBoolean: isBoolean,\n isArray: isArray,\n inspect: inspect,\n deprecate: deprecate,\n format: format,\n debuglog: debuglog\n}\n","\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport {isBuffer} from 'buffer';\nimport {isPrimitive, inherits, isError, isFunction, isRegExp, isDate, inspect as utilInspect} from 'util';\nvar pSlice = Array.prototype.slice;\nvar _functionsHaveNames;\nfunction functionsHaveNames() {\n if (typeof _functionsHaveNames !== 'undefined') {\n return _functionsHaveNames;\n }\n return _functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n }());\n}\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nfunction assert(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nexport default assert;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!isFunction(func)) {\n return;\n }\n if (functionsHaveNames()) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = AssertionError;\nexport function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}\n\n// assert.AssertionError instanceof Error\ninherits(AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames() || !isFunction(something)) {\n return utilInspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nexport function fail(actual, expected, message, operator, stackStartFunction) {\n throw new AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nexport function ok(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nassert.ok = ok;\nexport {ok as assert};\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\nassert.equal = equal;\nexport function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', equal);\n}\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\nassert.notEqual = notEqual;\nexport function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', notEqual);\n }\n}\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\nassert.deepEqual = deepEqual;\nexport function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', deepEqual);\n }\n}\nassert.deepStrictEqual = deepStrictEqual;\nexport function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);\n }\n}\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\nassert.notDeepEqual = notDeepEqual;\nexport function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', notDeepEqual);\n }\n}\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nexport function notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\nassert.strictEqual = strictEqual;\nexport function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', strictEqual);\n }\n}\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\nassert.notStrictEqual = notStrictEqual;\nexport function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', notStrictEqual);\n }\n}\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\nassert.throws = throws;\nexport function throws(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n}\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = doesNotThrow;\nexport function doesNotThrow(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n}\n\nassert.ifError = ifError;\nexport function ifError(err) {\n if (err) throw err;\n}\n","/* The MIT License (MIT)\n *\n * Copyright 2015-2018 Peter A. Bigot\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Support for translating between Buffer instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n */\n\n'use strict';\n\n/**\n * Base class for layout objects.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * Layout#encode|encode} or {@link Layout#decode|decode} functions.\n *\n * @param {Number} span - Initializer for {@link Layout#span|span}. The\n * parameter must be an integer; a negative value signifies that the\n * span is {@link Layout#getSpan|value-specific}.\n *\n * @param {string} [property] - Initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n */\nclass Layout {\n constructor(span, property) {\n if (!Number.isInteger(span)) {\n throw new TypeError('span must be an integer');\n }\n\n /** The span of the layout in bytes.\n *\n * Positive values are generally expected.\n *\n * Zero will only appear in {@link Constant}s and in {@link\n * Sequence}s where the {@link Sequence#count|count} is zero.\n *\n * A negative value indicates that the span is value-specific, and\n * must be obtained using {@link Layout#getSpan|getSpan}. */\n this.span = span;\n\n /** The property name used when this layout is represented in an\n * Object.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances. If left undefined the span of the unnamed layout will\n * be treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n\n /** Function to create an Object into which decoded properties will\n * be written.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances, which means:\n * * {@link Structure}\n * * {@link Union}\n * * {@link VariantLayout}\n * * {@link BitStructure}\n *\n * If left undefined the JavaScript representation of these layouts\n * will be Object instances.\n *\n * See {@link bindConstructorLayout}.\n */\n makeDestinationObject() {\n return {};\n }\n\n /**\n * Decode from a Buffer into an JavaScript value.\n *\n * @param {Buffer} b - the buffer from which encoded data is read.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {(Number|Array|Object)} - the value of the decoded data.\n *\n * @abstract\n */\n decode(b, offset) {\n throw new Error('Layout is abstract');\n }\n\n /**\n * Encode a JavaScript value into a Buffer.\n *\n * @param {(Number|Array|Object)} src - the value to be encoded into\n * the buffer. The type accepted depends on the (sub-)type of {@link\n * Layout}.\n *\n * @param {Buffer} b - the buffer into which encoded data will be\n * written.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {Number} - the number of bytes encoded, including the\n * space skipped for internal padding, but excluding data such as\n * {@link Sequence#count|lengths} when stored {@link\n * ExternalLayout|externally}. This is the adjustment to `offset`\n * producing the offset where data for the next layout would be\n * written.\n *\n * @abstract\n */\n encode(src, b, offset) {\n throw new Error('Layout is abstract');\n }\n\n /**\n * Calculate the span of a specific instance of a layout.\n *\n * @param {Buffer} b - the buffer that contains an encoded instance.\n *\n * @param {Number} [offset] - the offset at which the encoded instance\n * starts. If absent a zero offset is inferred.\n *\n * @return {Number} - the number of bytes covered by the layout\n * instance. If this method is not overridden in a subclass the\n * definition-time constant {@link Layout#span|span} will be\n * returned.\n *\n * @throws {RangeError} - if the length of the value cannot be\n * determined.\n */\n getSpan(b, offset) {\n if (0 > this.span) {\n throw new RangeError('indeterminate span');\n }\n return this.span;\n }\n\n /**\n * Replicate the layout using a new property.\n *\n * This function must be used to get a structurally-equivalent layout\n * with a different name since all {@link Layout} instances are\n * immutable.\n *\n * **NOTE** This is a shallow copy. All fields except {@link\n * Layout#property|property} are strictly equal to the origin layout.\n *\n * @param {String} property - the value for {@link\n * Layout#property|property} in the replica.\n *\n * @returns {Layout} - the copy with {@link Layout#property|property}\n * set to `property`.\n */\n replicate(property) {\n const rv = Object.create(this.constructor.prototype);\n Object.assign(rv, this);\n rv.property = property;\n return rv;\n }\n\n /**\n * Create an object from layout properties and an array of values.\n *\n * **NOTE** This function returns `undefined` if invoked on a layout\n * that does not return its value as an Object. Objects are\n * returned for things that are a {@link Structure}, which includes\n * {@link VariantLayout|variant layouts} if they are structures, and\n * excludes {@link Union}s. If you want this feature for a union\n * you must use {@link Union.getVariant|getVariant} to select the\n * desired layout.\n *\n * @param {Array} values - an array of values that correspond to the\n * default order for properties. As with {@link Layout#decode|decode}\n * layout elements that have no property name are skipped when\n * iterating over the array values. Only the top-level properties are\n * assigned; arguments are not assigned to properties of contained\n * layouts. Any unused values are ignored.\n *\n * @return {(Object|undefined)}\n */\n fromArray(values) {\n return undefined;\n }\n}\nexports.Layout = Layout;\n\n/* Provide text that carries a name (such as for a function that will\n * be throwing an error) annotated with the property of a given layout\n * (such as one for which the value was unacceptable).\n *\n * @ignore */\nfunction nameWithProperty(name, lo) {\n if (lo.property) {\n return name + '[' + lo.property + ']';\n }\n return name;\n}\nexports.nameWithProperty = nameWithProperty;\n\n/**\n * Augment a class so that instances can be encoded/decoded using a\n * given layout.\n *\n * Calling this function couples `Class` with `layout` in several ways:\n *\n * * `Class.layout_` becomes a static member property equal to `layout`;\n * * `layout.boundConstructor_` becomes a static member property equal\n * to `Class`;\n * * The {@link Layout#makeDestinationObject|makeDestinationObject()}\n * property of `layout` is set to a function that returns a `new\n * Class()`;\n * * `Class.decode(b, offset)` becomes a static member function that\n * delegates to {@link Layout#decode|layout.decode}. The\n * synthesized function may be captured and extended.\n * * `Class.prototype.encode(b, offset)` provides an instance member\n * function that delegates to {@link Layout#encode|layout.encode}\n * with `src` set to `this`. The synthesized function may be\n * captured and extended, but when the extension is invoked `this`\n * must be explicitly bound to the instance.\n *\n * @param {class} Class - a JavaScript class with a nullary\n * constructor.\n *\n * @param {Layout} layout - the {@link Layout} instance used to encode\n * instances of `Class`.\n */\nfunction bindConstructorLayout(Class, layout) {\n if ('function' !== typeof Class) {\n throw new TypeError('Class must be constructor');\n }\n if (Class.hasOwnProperty('layout_')) {\n throw new Error('Class is already bound to a layout');\n }\n if (!(layout && (layout instanceof Layout))) {\n throw new TypeError('layout must be a Layout');\n }\n if (layout.hasOwnProperty('boundConstructor_')) {\n throw new Error('layout is already bound to a constructor');\n }\n Class.layout_ = layout;\n layout.boundConstructor_ = Class;\n layout.makeDestinationObject = (() => new Class());\n Object.defineProperty(Class.prototype, 'encode', {\n value: function(b, offset) {\n return layout.encode(this, b, offset);\n },\n writable: true,\n });\n Object.defineProperty(Class, 'decode', {\n value: function(b, offset) {\n return layout.decode(b, offset);\n },\n writable: true,\n });\n}\nexports.bindConstructorLayout = bindConstructorLayout;\n\n/**\n * An object that behaves like a layout but does not consume space\n * within its containing layout.\n *\n * This is primarily used to obtain metadata about a member, such as a\n * {@link OffsetLayout} that can provide data about a {@link\n * Layout#getSpan|value-specific span}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support {@link\n * ExternalLayout#isCount|isCount} or other {@link Layout} functions.\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n * @augments {Layout}\n */\nclass ExternalLayout extends Layout {\n /**\n * Return `true` iff the external layout decodes to an unsigned\n * integer layout.\n *\n * In that case it can be used as the source of {@link\n * Sequence#count|Sequence counts}, {@link Blob#length|Blob lengths},\n * or as {@link UnionLayoutDiscriminator#layout|external union\n * discriminators}.\n *\n * @abstract\n */\n isCount() {\n throw new Error('ExternalLayout is abstract');\n }\n}\n\n/**\n * An {@link ExternalLayout} that determines its {@link\n * Layout#decode|value} based on offset into and length of the buffer\n * on which it is invoked.\n *\n * *Factory*: {@link module:Layout.greedy|greedy}\n *\n * @param {Number} [elementSpan] - initializer for {@link\n * GreedyCount#elementSpan|elementSpan}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {ExternalLayout}\n */\nclass GreedyCount extends ExternalLayout {\n constructor(elementSpan, property) {\n if (undefined === elementSpan) {\n elementSpan = 1;\n }\n if ((!Number.isInteger(elementSpan)) || (0 >= elementSpan)) {\n throw new TypeError('elementSpan must be a (positive) integer');\n }\n super(-1, property);\n\n /** The layout for individual elements of the sequence. The value\n * must be a positive integer. If not provided, the value will be\n * 1. */\n this.elementSpan = elementSpan;\n }\n\n /** @override */\n isCount() {\n return true;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const rem = b.length - offset;\n return Math.floor(rem / this.elementSpan);\n }\n\n /** @override */\n encode(src, b, offset) {\n return 0;\n }\n}\n\n/**\n * An {@link ExternalLayout} that supports accessing a {@link Layout}\n * at a fixed offset from the start of another Layout. The offset may\n * be before, within, or after the base layout.\n *\n * *Factory*: {@link module:Layout.offset|offset}\n *\n * @param {Layout} layout - initializer for {@link\n * OffsetLayout#layout|layout}, modulo `property`.\n *\n * @param {Number} [offset] - Initializes {@link\n * OffsetLayout#offset|offset}. Defaults to zero.\n *\n * @param {string} [property] - Optional new property name for a\n * {@link Layout#replicate| replica} of `layout` to be used as {@link\n * OffsetLayout#layout|layout}. If not provided the `layout` is used\n * unchanged.\n *\n * @augments {Layout}\n */\nclass OffsetLayout extends ExternalLayout {\n constructor(layout, offset, property) {\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n\n if (undefined === offset) {\n offset = 0;\n } else if (!Number.isInteger(offset)) {\n throw new TypeError('offset must be integer or undefined');\n }\n\n super(layout.span, property || layout.property);\n\n /** The subordinated layout. */\n this.layout = layout;\n\n /** The location of {@link OffsetLayout#layout} relative to the\n * start of another layout.\n *\n * The value may be positive or negative, but an error will thrown\n * if at the point of use it goes outside the span of the Buffer\n * being accessed. */\n this.offset = offset;\n }\n\n /** @override */\n isCount() {\n return ((this.layout instanceof UInt)\n || (this.layout instanceof UIntBE));\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.decode(b, offset + this.offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.encode(src, b, offset + this.offset);\n }\n}\n\n/**\n * Represent an unsigned integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.u8|u8}, {@link\n * module:Layout.u16|u16}, {@link module:Layout.u24|u24}, {@link\n * module:Layout.u32|u32}, {@link module:Layout.u40|u40}, {@link\n * module:Layout.u48|u48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UInt extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readUIntLE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeUIntLE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent an unsigned integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.u8be|u8be}, {@link\n * module:Layout.u16be|u16be}, {@link module:Layout.u24be|u24be},\n * {@link module:Layout.u32be|u32be}, {@link\n * module:Layout.u40be|u40be}, {@link module:Layout.u48be|u48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UIntBE extends Layout {\n constructor(span, property) {\n super( span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readUIntBE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeUIntBE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent a signed integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.s8|s8}, {@link\n * module:Layout.s16|s16}, {@link module:Layout.s24|s24}, {@link\n * module:Layout.s32|s32}, {@link module:Layout.s40|s40}, {@link\n * module:Layout.s48|s48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Int extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readIntLE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeIntLE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent a signed integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.s8be|s8be}, {@link\n * module:Layout.s16be|s16be}, {@link module:Layout.s24be|s24be},\n * {@link module:Layout.s32be|s32be}, {@link\n * module:Layout.s40be|s40be}, {@link module:Layout.s48be|s48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass IntBE extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readIntBE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeIntBE(src, offset, this.span);\n return this.span;\n }\n}\n\nconst V2E32 = Math.pow(2, 32);\n\n/* True modulus high and low 32-bit words, where low word is always\n * non-negative. */\nfunction divmodInt64(src) {\n const hi32 = Math.floor(src / V2E32);\n const lo32 = src - (hi32 * V2E32);\n return {hi32, lo32};\n}\n/* Reconstruct Number from quotient and non-negative remainder */\nfunction roundedInt64(hi32, lo32) {\n return hi32 * V2E32 + lo32;\n}\n\n/**\n * Represent an unsigned 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64|nu64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearUInt64 extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const lo32 = b.readUInt32LE(offset);\n const hi32 = b.readUInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32LE(split.lo32, offset);\n b.writeUInt32LE(split.hi32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent an unsigned 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64be|nu64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearUInt64BE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const hi32 = b.readUInt32BE(offset);\n const lo32 = b.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32BE(split.hi32, offset);\n b.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a signed 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64|ns64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearInt64 extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const lo32 = b.readUInt32LE(offset);\n const hi32 = b.readInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32LE(split.lo32, offset);\n b.writeInt32LE(split.hi32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a signed 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64be|ns64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearInt64BE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const hi32 = b.readInt32BE(offset);\n const lo32 = b.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeInt32BE(split.hi32, offset);\n b.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a 32-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f32|f32}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Float extends Layout {\n constructor(property) {\n super(4, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readFloatLE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeFloatLE(src, offset);\n return 4;\n }\n}\n\n/**\n * Represent a 32-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f32be|f32be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass FloatBE extends Layout {\n constructor(property) {\n super(4, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readFloatBE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeFloatBE(src, offset);\n return 4;\n }\n}\n\n/**\n * Represent a 64-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f64|f64}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Double extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readDoubleLE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeDoubleLE(src, offset);\n return 8;\n }\n}\n\n/**\n * Represent a 64-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f64be|f64be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass DoubleBE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readDoubleBE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeDoubleBE(src, offset);\n return 8;\n }\n}\n\n/**\n * Represent a contiguous sequence of a specific layout as an Array.\n *\n * *Factory*: {@link module:Layout.seq|seq}\n *\n * @param {Layout} elementLayout - initializer for {@link\n * Sequence#elementLayout|elementLayout}.\n *\n * @param {(Number|ExternalLayout)} count - initializer for {@link\n * Sequence#count|count}. The parameter must be either a positive\n * integer or an instance of {@link ExternalLayout}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Sequence extends Layout {\n constructor(elementLayout, count, property) {\n if (!(elementLayout instanceof Layout)) {\n throw new TypeError('elementLayout must be a Layout');\n }\n if (!(((count instanceof ExternalLayout) && count.isCount())\n || (Number.isInteger(count) && (0 <= count)))) {\n throw new TypeError('count must be non-negative integer '\n + 'or an unsigned integer ExternalLayout');\n }\n let span = -1;\n if ((!(count instanceof ExternalLayout))\n && (0 < elementLayout.span)) {\n span = count * elementLayout.span;\n }\n\n super(span, property);\n\n /** The layout for individual elements of the sequence. */\n this.elementLayout = elementLayout;\n\n /** The number of elements in the sequence.\n *\n * This will be either a non-negative integer or an instance of\n * {@link ExternalLayout} for which {@link\n * ExternalLayout#isCount|isCount()} is `true`. */\n this.count = count;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let span = 0;\n let count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n if (0 < this.elementLayout.span) {\n span = count * this.elementLayout.span;\n } else {\n let idx = 0;\n while (idx < count) {\n span += this.elementLayout.getSpan(b, offset + span);\n ++idx;\n }\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const rv = [];\n let i = 0;\n let count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n while (i < count) {\n rv.push(this.elementLayout.decode(b, offset));\n offset += this.elementLayout.getSpan(b, offset);\n i += 1;\n }\n return rv;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Sequence}.\n *\n * **NOTE** If `src` is shorter than {@link Sequence#count|count} then\n * the unused space in the buffer is left unchanged. If `src` is\n * longer than {@link Sequence#count|count} the unneeded elements are\n * ignored.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const elo = this.elementLayout;\n const span = src.reduce((span, v) => {\n return span + elo.encode(v, b, offset + span);\n }, 0);\n if (this.count instanceof ExternalLayout) {\n this.count.encode(src.length, b, offset);\n }\n return span;\n }\n}\n\n/**\n * Represent a contiguous sequence of arbitrary layout elements as an\n * Object.\n *\n * *Factory*: {@link module:Layout.struct|struct}\n *\n * **NOTE** The {@link Layout#span|span} of the structure is variable\n * if any layout in {@link Structure#fields|fields} has a variable\n * span. When {@link Layout#encode|encoding} we must have a value for\n * all variable-length fields, or we wouldn't be able to figure out\n * how much space to use for storage. We can only identify the value\n * for a field when it has a {@link Layout#property|property}. As\n * such, although a structure may contain both unnamed fields and\n * variable-length fields, it cannot contain an unnamed\n * variable-length field.\n *\n * @param {Layout[]} fields - initializer for {@link\n * Structure#fields|fields}. An error is raised if this contains a\n * variable-length field for which a {@link Layout#property|property}\n * is not defined.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @param {Boolean} [decodePrefixes] - initializer for {@link\n * Structure#decodePrefixes|property}.\n *\n * @throws {Error} - if `fields` contains an unnamed variable-length\n * layout.\n *\n * @augments {Layout}\n */\nclass Structure extends Layout {\n constructor(fields, property, decodePrefixes) {\n if (!(Array.isArray(fields)\n && fields.reduce((acc, v) => acc && (v instanceof Layout), true))) {\n throw new TypeError('fields must be array of Layout instances');\n }\n if (('boolean' === typeof property)\n && (undefined === decodePrefixes)) {\n decodePrefixes = property;\n property = undefined;\n }\n\n /* Verify absence of unnamed variable-length fields. */\n for (const fd of fields) {\n if ((0 > fd.span)\n && (undefined === fd.property)) {\n throw new Error('fields cannot contain unnamed variable-length layout');\n }\n }\n\n let span = -1;\n try {\n span = fields.reduce((span, fd) => span + fd.getSpan(), 0);\n } catch (e) {\n }\n super(span, property);\n\n /** The sequence of {@link Layout} values that comprise the\n * structure.\n *\n * The individual elements need not be the same type, and may be\n * either scalar or aggregate layouts. If a member layout leaves\n * its {@link Layout#property|property} undefined the\n * corresponding region of the buffer associated with the element\n * will not be mutated.\n *\n * @type {Layout[]} */\n this.fields = fields;\n\n /** Control behavior of {@link Layout#decode|decode()} given short\n * buffers.\n *\n * In some situations a structure many be extended with additional\n * fields over time, with older installations providing only a\n * prefix of the full structure. If this property is `true`\n * decoding will accept those buffers and leave subsequent fields\n * undefined, as long as the buffer ends at a field boundary.\n * Defaults to `false`. */\n this.decodePrefixes = !!decodePrefixes;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let span = 0;\n try {\n span = this.fields.reduce((span, fd) => {\n const fsp = fd.getSpan(b, offset);\n offset += fsp;\n return span + fsp;\n }, 0);\n } catch (e) {\n throw new RangeError('indeterminate span');\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const dest = this.makeDestinationObject();\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(b, offset);\n }\n offset += fd.getSpan(b, offset);\n if (this.decodePrefixes\n && (b.length === offset)) {\n break;\n }\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Structure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the buffer is\n * left unmodified. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const firstOffset = offset;\n let lastOffset = 0;\n let lastWrote = 0;\n for (const fd of this.fields) {\n let span = fd.span;\n lastWrote = (0 < span) ? span : 0;\n if (undefined !== fd.property) {\n const fv = src[fd.property];\n if (undefined !== fv) {\n lastWrote = fd.encode(fv, b, offset);\n if (0 > span) {\n /* Read the as-encoded span, which is not necessarily the\n * same as what we wrote. */\n span = fd.getSpan(b, offset);\n }\n }\n }\n lastOffset = offset;\n offset += span;\n }\n /* Use (lastOffset + lastWrote) instead of offset because the last\n * item may have had a dynamic length and we don't want to include\n * the padding between it and the end of the space reserved for\n * it. */\n return (lastOffset + lastWrote) - firstOffset;\n }\n\n /** @override */\n fromArray(values) {\n const dest = this.makeDestinationObject();\n for (const fd of this.fields) {\n if ((undefined !== fd.property)\n && (0 < values.length)) {\n dest[fd.property] = values.shift();\n }\n }\n return dest;\n }\n\n /**\n * Get access to the layout of a given property.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Layout} - the layout associated with `property`, or\n * undefined if there is no such property.\n */\n layoutFor(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (const fd of this.fields) {\n if (fd.property === property) {\n return fd;\n }\n }\n }\n\n /**\n * Get the offset of a structure member.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Number} - the offset in bytes to the start of `property`\n * within the structure, or undefined if `property` is not a field\n * within the structure. If the property is a member but follows a\n * variable-length structure member a negative number will be\n * returned.\n */\n offsetOf(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n let offset = 0;\n for (const fd of this.fields) {\n if (fd.property === property) {\n return offset;\n }\n if (0 > fd.span) {\n offset = -1;\n } else if (0 <= offset) {\n offset += fd.span;\n }\n }\n }\n}\n\n/**\n * An object that can provide a {@link\n * Union#discriminator|discriminator} API for {@link Union}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * UnionDiscriminator#encode|encode} or {@link\n * UnionDiscriminator#decode|decode} functions.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}.\n *\n * @abstract\n */\nclass UnionDiscriminator {\n constructor(property) {\n /** The {@link Layout#property|property} to be used when the\n * discriminator is referenced in isolation (generally when {@link\n * Union#decode|Union decode} cannot delegate to a specific\n * variant). */\n this.property = property;\n }\n\n /** Analog to {@link Layout#decode|Layout decode} for union discriminators.\n *\n * The implementation of this method need not reference the buffer if\n * variant information is available through other means. */\n decode() {\n throw new Error('UnionDiscriminator is abstract');\n }\n\n /** Analog to {@link Layout#decode|Layout encode} for union discriminators.\n *\n * The implementation of this method need not store the value if\n * variant information is maintained through other means. */\n encode() {\n throw new Error('UnionDiscriminator is abstract');\n }\n}\n\n/**\n * An object that can provide a {@link\n * UnionDiscriminator|discriminator API} for {@link Union} using an\n * unsigned integral {@link Layout} instance located either inside or\n * outside the union.\n *\n * @param {ExternalLayout} layout - initializes {@link\n * UnionLayoutDiscriminator#layout|layout}. Must satisfy {@link\n * ExternalLayout#isCount|isCount()}.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}, superseding the property\n * from `layout`, but defaulting to `variant` if neither `property`\n * nor layout provide a property name.\n *\n * @augments {UnionDiscriminator}\n */\nclass UnionLayoutDiscriminator extends UnionDiscriminator {\n constructor(layout, property) {\n if (!((layout instanceof ExternalLayout)\n && layout.isCount())) {\n throw new TypeError('layout must be an unsigned integer ExternalLayout');\n }\n\n super(property || layout.property || 'variant');\n\n /** The {@link ExternalLayout} used to access the discriminator\n * value. */\n this.layout = layout;\n }\n\n /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n decode(b, offset) {\n return this.layout.decode(b, offset);\n }\n\n /** Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n encode(src, b, offset) {\n return this.layout.encode(src, b, offset);\n }\n}\n\n/**\n * Represent any number of span-compatible layouts.\n *\n * *Factory*: {@link module:Layout.union|union}\n *\n * If the union has a {@link Union#defaultLayout|default layout} that\n * layout must have a non-negative {@link Layout#span|span}. The span\n * of a fixed-span union includes its {@link\n * Union#discriminator|discriminator} if the variant is a {@link\n * Union#usesPrefixDiscriminator|prefix of the union}, plus the span\n * of its {@link Union#defaultLayout|default layout}.\n *\n * If the union does not have a default layout then the encoded span\n * of the union depends on the encoded span of its variant (which may\n * be fixed or variable).\n *\n * {@link VariantLayout#layout|Variant layout}s are added through\n * {@link Union#addVariant|addVariant}. If the union has a default\n * layout, the span of the {@link VariantLayout#layout|layout\n * contained by the variant} must not exceed the span of the {@link\n * Union#defaultLayout|default layout} (minus the span of a {@link\n * Union#usesPrefixDiscriminator|prefix disriminator}, if used). The\n * span of the variant will equal the span of the union itself.\n *\n * The variant for a buffer can only be identified from the {@link\n * Union#discriminator|discriminator} {@link\n * UnionDiscriminator#property|property} (in the case of the {@link\n * Union#defaultLayout|default layout}), or by using {@link\n * Union#getVariant|getVariant} and examining the resulting {@link\n * VariantLayout} instance.\n *\n * A variant compatible with a JavaScript object can be identified\n * using {@link Union#getSourceVariant|getSourceVariant}.\n *\n * @param {(UnionDiscriminator|ExternalLayout|Layout)} discr - How to\n * identify the layout used to interpret the union contents. The\n * parameter must be an instance of {@link UnionDiscriminator}, an\n * {@link ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}, or {@link UInt} (or {@link\n * UIntBE}). When a non-external layout element is passed the layout\n * appears at the start of the union. In all cases the (synthesized)\n * {@link UnionDiscriminator} instance is recorded as {@link\n * Union#discriminator|discriminator}.\n *\n * @param {(Layout|null)} defaultLayout - initializer for {@link\n * Union#defaultLayout|defaultLayout}. If absent defaults to `null`.\n * If `null` there is no default layout: the union has data-dependent\n * length and attempts to decode or encode unrecognized variants will\n * throw an exception. A {@link Layout} instance must have a\n * non-negative {@link Layout#span|span}, and if it lacks a {@link\n * Layout#property|property} the {@link\n * Union#defaultLayout|defaultLayout} will be a {@link\n * Layout#replicate|replica} with property `content`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Union extends Layout {\n constructor(discr, defaultLayout, property) {\n const upv = ((discr instanceof UInt)\n || (discr instanceof UIntBE));\n if (upv) {\n discr = new UnionLayoutDiscriminator(new OffsetLayout(discr));\n } else if ((discr instanceof ExternalLayout)\n && discr.isCount()) {\n discr = new UnionLayoutDiscriminator(discr);\n } else if (!(discr instanceof UnionDiscriminator)) {\n throw new TypeError('discr must be a UnionDiscriminator '\n + 'or an unsigned integer layout');\n }\n if (undefined === defaultLayout) {\n defaultLayout = null;\n }\n if (!((null === defaultLayout)\n || (defaultLayout instanceof Layout))) {\n throw new TypeError('defaultLayout must be null or a Layout');\n }\n if (null !== defaultLayout) {\n if (0 > defaultLayout.span) {\n throw new Error('defaultLayout must have constant span');\n }\n if (undefined === defaultLayout.property) {\n defaultLayout = defaultLayout.replicate('content');\n }\n }\n\n /* The union span can be estimated only if there's a default\n * layout. The union spans its default layout, plus any prefix\n * variant layout. By construction both layouts, if present, have\n * non-negative span. */\n let span = -1;\n if (defaultLayout) {\n span = defaultLayout.span;\n if ((0 <= span) && upv) {\n span += discr.layout.span;\n }\n }\n super(span, property);\n\n /** The interface for the discriminator value in isolation.\n *\n * This a {@link UnionDiscriminator} either passed to the\n * constructor or synthesized from the `discr` constructor\n * argument. {@link\n * Union#usesPrefixDiscriminator|usesPrefixDiscriminator} will be\n * `true` iff the `discr` parameter was a non-offset {@link\n * Layout} instance. */\n this.discriminator = discr;\n\n /** `true` if the {@link Union#discriminator|discriminator} is the\n * first field in the union.\n *\n * If `false` the discriminator is obtained from somewhere\n * else. */\n this.usesPrefixDiscriminator = upv;\n\n /** The layout for non-discriminator content when the value of the\n * discriminator is not recognized.\n *\n * This is the value passed to the constructor. It is\n * structurally equivalent to the second component of {@link\n * Union#layout|layout} but may have a different property\n * name. */\n this.defaultLayout = defaultLayout;\n\n /** A registry of allowed variants.\n *\n * The keys are unsigned integers which should be compatible with\n * {@link Union.discriminator|discriminator}. The property value\n * is the corresponding {@link VariantLayout} instances assigned\n * to this union by {@link Union#addVariant|addVariant}.\n *\n * **NOTE** The registry remains mutable so that variants can be\n * {@link Union#addVariant|added} at any time. Users should not\n * manipulate the content of this property. */\n this.registry = {};\n\n /* Private variable used when invoking getSourceVariant */\n let boundGetSourceVariant = this.defaultGetSourceVariant.bind(this);\n\n /** Function to infer the variant selected by a source object.\n *\n * Defaults to {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant} but may\n * be overridden using {@link\n * Union#configGetSourceVariant|configGetSourceVariant}.\n *\n * @param {Object} src - as with {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * @returns {(undefined|VariantLayout)} The default variant\n * (`undefined`) or first registered variant that uses a property\n * available in `src`. */\n this.getSourceVariant = function(src) {\n return boundGetSourceVariant(src);\n };\n\n /** Function to override the implementation of {@link\n * Union#getSourceVariant|getSourceVariant}.\n *\n * Use this if the desired variant cannot be identified using the\n * algorithm of {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * **NOTE** The provided function will be invoked bound to this\n * Union instance, providing local access to {@link\n * Union#registry|registry}.\n *\n * @param {Function} gsv - a function that follows the API of\n * {@link Union#defaultGetSourceVariant|defaultGetSourceVariant}. */\n this.configGetSourceVariant = function(gsv) {\n boundGetSourceVariant = gsv.bind(this);\n };\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n /* Default layouts always have non-negative span, so we don't have\n * one and we have to recognize the variant which will in turn\n * determine the span. */\n const vlo = this.getVariant(b, offset);\n if (!vlo) {\n throw new Error('unable to determine span for unrecognized variant');\n }\n return vlo.getSpan(b, offset);\n }\n\n /**\n * Method to infer a registered Union variant compatible with `src`.\n *\n * The first satisified rule in the following sequence defines the\n * return value:\n * * If `src` has properties matching the Union discriminator and\n * the default layout, `undefined` is returned regardless of the\n * value of the discriminator property (this ensures the default\n * layout will be used);\n * * If `src` has a property matching the Union discriminator, the\n * value of the discriminator identifies a registered variant, and\n * either (a) the variant has no layout, or (b) `src` has the\n * variant's property, then the variant is returned (because the\n * source satisfies the constraints of the variant it identifies);\n * * If `src` does not have a property matching the Union\n * discriminator, but does have a property matching a registered\n * variant, then the variant is returned (because the source\n * matches a variant without an explicit conflict);\n * * An error is thrown (because we either can't identify a variant,\n * or we were explicitly told the variant but can't satisfy it).\n *\n * @param {Object} src - an object presumed to be compatible with\n * the content of the Union.\n *\n * @return {(undefined|VariantLayout)} - as described above.\n *\n * @throws {Error} - if `src` cannot be associated with a default or\n * registered variant.\n */\n defaultGetSourceVariant(src) {\n if (src.hasOwnProperty(this.discriminator.property)) {\n if (this.defaultLayout\n && src.hasOwnProperty(this.defaultLayout.property)) {\n return undefined;\n }\n const vlo = this.registry[src[this.discriminator.property]];\n if (vlo\n && ((!vlo.layout)\n || src.hasOwnProperty(vlo.property))) {\n return vlo;\n }\n } else {\n for (const tag in this.registry) {\n const vlo = this.registry[tag];\n if (src.hasOwnProperty(vlo.property)) {\n return vlo;\n }\n }\n }\n throw new Error('unable to infer src variant');\n }\n\n /** Implement {@link Layout#decode|decode} for {@link Union}.\n *\n * If the variant is {@link Union#addVariant|registered} the return\n * value is an instance of that variant, with no explicit\n * discriminator. Otherwise the {@link Union#defaultLayout|default\n * layout} is used to decode the content. */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let dest;\n const dlo = this.discriminator;\n const discr = dlo.decode(b, offset);\n let clo = this.registry[discr];\n if (undefined === clo) {\n let contentOffset = 0;\n clo = this.defaultLayout;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dest = this.makeDestinationObject();\n dest[dlo.property] = discr;\n dest[clo.property] = this.defaultLayout.decode(b, offset + contentOffset);\n } else {\n dest = clo.decode(b, offset);\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Union}.\n *\n * This API assumes the `src` object is consistent with the union's\n * {@link Union#defaultLayout|default layout}. To encode variants\n * use the appropriate variant-specific {@link VariantLayout#encode}\n * method. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const vlo = this.getSourceVariant(src);\n if (undefined === vlo) {\n const dlo = this.discriminator;\n const clo = this.defaultLayout;\n let contentOffset = 0;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dlo.encode(src[dlo.property], b, offset);\n return contentOffset + clo.encode(src[clo.property], b,\n offset + contentOffset);\n }\n return vlo.encode(src, b, offset);\n }\n\n /** Register a new variant structure within a union. The newly\n * created variant is returned.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} layout - initializer for {@link\n * VariantLayout#layout|layout}.\n *\n * @param {String} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {VariantLayout} */\n addVariant(variant, layout, property) {\n const rv = new VariantLayout(this, variant, layout, property);\n this.registry[variant] = rv;\n return rv;\n }\n\n /**\n * Get the layout associated with a registered variant.\n *\n * If `vb` does not produce a registered variant the function returns\n * `undefined`.\n *\n * @param {(Number|Buffer)} vb - either the variant number, or a\n * buffer from which the discriminator is to be read.\n *\n * @param {Number} offset - offset into `vb` for the start of the\n * union. Used only when `vb` is an instance of {Buffer}.\n *\n * @return {({VariantLayout}|undefined)}\n */\n getVariant(vb, offset) {\n let variant = vb;\n if (Buffer.isBuffer(vb)) {\n if (undefined === offset) {\n offset = 0;\n }\n variant = this.discriminator.decode(vb, offset);\n }\n return this.registry[variant];\n }\n}\n\n/**\n * Represent a specific variant within a containing union.\n *\n * **NOTE** The {@link Layout#span|span} of the variant may include\n * the span of the {@link Union#discriminator|discriminator} used to\n * identify it, but values read and written using the variant strictly\n * conform to the content of {@link VariantLayout#layout|layout}.\n *\n * **NOTE** User code should not invoke this constructor directly. Use\n * the union {@link Union#addVariant|addVariant} helper method.\n *\n * @param {Union} union - initializer for {@link\n * VariantLayout#union|union}.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} [layout] - initializer for {@link\n * VariantLayout#layout|layout}. If absent the variant carries no\n * data.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}. Unlike many other layouts, variant\n * layouts normally include a property name so they can be identified\n * within their containing {@link Union}. The property identifier may\n * be absent only if `layout` is is absent.\n *\n * @augments {Layout}\n */\nclass VariantLayout extends Layout {\n constructor(union, variant, layout, property) {\n if (!(union instanceof Union)) {\n throw new TypeError('union must be a Union');\n }\n if ((!Number.isInteger(variant)) || (0 > variant)) {\n throw new TypeError('variant must be a (non-negative) integer');\n }\n if (('string' === typeof layout)\n && (undefined === property)) {\n property = layout;\n layout = null;\n }\n if (layout) {\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n if ((null !== union.defaultLayout)\n && (0 <= layout.span)\n && (layout.span > union.defaultLayout.span)) {\n throw new Error('variant span exceeds span of containing union');\n }\n if ('string' !== typeof property) {\n throw new TypeError('variant must have a String property');\n }\n }\n let span = union.span;\n if (0 > union.span) {\n span = layout ? layout.span : 0;\n if ((0 <= span) && union.usesPrefixDiscriminator) {\n span += union.discriminator.layout.span;\n }\n }\n super(span, property);\n\n /** The {@link Union} to which this variant belongs. */\n this.union = union;\n\n /** The unsigned integral value identifying this variant within\n * the {@link Union#discriminator|discriminator} of the containing\n * union. */\n this.variant = variant;\n\n /** The {@link Layout} to be used when reading/writing the\n * non-discriminator part of the {@link\n * VariantLayout#union|union}. If `null` the variant carries no\n * data. */\n this.layout = layout || null;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n /* Will be equal to the containing union span if that is not\n * variable. */\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n /* Span is defined solely by the variant (and prefix discriminator) */\n return contentOffset + this.layout.getSpan(b, offset + contentOffset);\n }\n\n /** @override */\n decode(b, offset) {\n const dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n if (this !== this.union.getVariant(b, offset)) {\n throw new Error('variant mismatch');\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n if (this.layout) {\n dest[this.property] = this.layout.decode(b, offset + contentOffset);\n } else if (this.property) {\n dest[this.property] = true;\n } else if (this.union.usesPrefixDiscriminator) {\n dest[this.union.discriminator.property] = this.variant;\n }\n return dest;\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n if (this.layout\n && (!src.hasOwnProperty(this.property))) {\n throw new TypeError('variant lacks property ' + this.property);\n }\n this.union.discriminator.encode(this.variant, b, offset);\n let span = contentOffset;\n if (this.layout) {\n this.layout.encode(src[this.property], b, offset + contentOffset);\n span += this.layout.getSpan(b, offset + contentOffset);\n if ((0 <= this.union.span)\n && (span > this.union.span)) {\n throw new Error('encoded variant overruns containing union');\n }\n }\n return span;\n }\n\n /** Delegate {@link Layout#fromArray|fromArray} to {@link\n * VariantLayout#layout|layout}. */\n fromArray(values) {\n if (this.layout) {\n return this.layout.fromArray(values);\n }\n }\n}\n\n/** JavaScript chose to define bitwise operations as operating on\n * signed 32-bit values in 2's complement form, meaning any integer\n * with bit 31 set is going to look negative. For right shifts that's\n * not a problem, because `>>>` is a logical shift, but for every\n * other bitwise operator we have to compensate for possible negative\n * results. */\nfunction fixBitwiseResult(v) {\n if (0 > v) {\n v += 0x100000000;\n }\n return v;\n}\n\n/**\n * Contain a sequence of bit fields as an unsigned integer.\n *\n * *Factory*: {@link module:Layout.bits|bits}\n *\n * This is a container element; within it there are {@link BitField}\n * instances that provide the extracted properties. The container\n * simply defines the aggregate representation and its bit ordering.\n * The representation is an object containing properties with numeric\n * or {@link Boolean} values.\n *\n * {@link BitField}s are added with the {@link\n * BitStructure#addField|addField} and {@link\n * BitStructure#addBoolean|addBoolean} methods.\n\n * @param {Layout} word - initializer for {@link\n * BitStructure#word|word}. The parameter must be an instance of\n * {@link UInt} (or {@link UIntBE}) that is no more than 4 bytes wide.\n *\n * @param {bool} [msb] - `true` if the bit numbering starts at the\n * most significant bit of the containing word; `false` (default) if\n * it starts at the least significant bit of the containing word. If\n * the parameter at this position is a string and `property` is\n * `undefined` the value of this argument will instead be used as the\n * value of `property`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass BitStructure extends Layout {\n constructor(word, msb, property) {\n if (!((word instanceof UInt)\n || (word instanceof UIntBE))) {\n throw new TypeError('word must be a UInt or UIntBE layout');\n }\n if (('string' === typeof msb)\n && (undefined === property)) {\n property = msb;\n msb = undefined;\n }\n if (4 < word.span) {\n throw new RangeError('word cannot exceed 32 bits');\n }\n super(word.span, property);\n\n /** The layout used for the packed value. {@link BitField}\n * instances are packed sequentially depending on {@link\n * BitStructure#msb|msb}. */\n this.word = word;\n\n /** Whether the bit sequences are packed starting at the most\n * significant bit growing down (`true`), or the least significant\n * bit growing up (`false`).\n *\n * **NOTE** Regardless of this value, the least significant bit of\n * any {@link BitField} value is the least significant bit of the\n * corresponding section of the packed value. */\n this.msb = !!msb;\n\n /** The sequence of {@link BitField} layouts that comprise the\n * packed structure.\n *\n * **NOTE** The array remains mutable to allow fields to be {@link\n * BitStructure#addField|added} after construction. Users should\n * not manipulate the content of this property.*/\n this.fields = [];\n\n /* Storage for the value. Capture a variable instead of using an\n * instance property because we don't want anything to change the\n * value without going through the mutator. */\n let value = 0;\n this._packedSetValue = function(v) {\n value = fixBitwiseResult(v);\n return this;\n };\n this._packedGetValue = function() {\n return value;\n };\n }\n\n /** @override */\n decode(b, offset) {\n const dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n const value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(value);\n }\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link BitStructure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the packed\n * value is left unmodified. Unused bits are also left unmodified. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n const fv = src[fd.property];\n if (undefined !== fv) {\n fd.encode(fv);\n }\n }\n }\n return this.word.encode(this._packedGetValue(), b, offset);\n }\n\n /** Register a new bitfield with a containing bit structure. The\n * resulting bitfield is returned.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {BitField} */\n addField(bits, property) {\n const bf = new BitField(this, bits, property);\n this.fields.push(bf);\n return bf;\n }\n\n /** As with {@link BitStructure#addField|addField} for single-bit\n * fields with `boolean` value representation.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {Boolean} */\n addBoolean(property) {\n // This is my Boolean, not the Javascript one.\n // eslint-disable-next-line no-new-wrappers\n const bf = new Boolean(this, property);\n this.fields.push(bf);\n return bf;\n }\n\n /**\n * Get access to the bit field for a given property.\n *\n * @param {String} property - the bit field of interest.\n *\n * @return {BitField} - the field associated with `property`, or\n * undefined if there is no such property.\n */\n fieldFor(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (const fd of this.fields) {\n if (fd.property === property) {\n return fd;\n }\n }\n }\n}\n\n/**\n * Represent a sequence of bits within a {@link BitStructure}.\n *\n * All bit field values are represented as unsigned integers.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addField|addField} helper\n * method.\n *\n * **NOTE** BitField instances are not instances of {@link Layout}\n * since {@link Layout#span|span} measures 8-bit units.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n */\nclass BitField {\n constructor(container, bits, property) {\n if (!(container instanceof BitStructure)) {\n throw new TypeError('container must be a BitStructure');\n }\n if ((!Number.isInteger(bits)) || (0 >= bits)) {\n throw new TypeError('bits must be positive integer');\n }\n const totalBits = 8 * container.span;\n const usedBits = container.fields.reduce((sum, fd) => sum + fd.bits, 0);\n if ((bits + usedBits) > totalBits) {\n throw new Error('bits too long for span remainder ('\n + (totalBits - usedBits) + ' of '\n + totalBits + ' remain)');\n }\n\n /** The {@link BitStructure} instance to which this bit field\n * belongs. */\n this.container = container;\n\n /** The span of this value in bits. */\n this.bits = bits;\n\n /** A mask of {@link BitField#bits|bits} bits isolating value bits\n * that fit within the field.\n *\n * That is, it masks a value that has not yet been shifted into\n * position within its containing packed integer. */\n this.valueMask = (1 << bits) - 1;\n if (32 === bits) { // shifted value out of range\n this.valueMask = 0xFFFFFFFF;\n }\n\n /** The offset of the value within the containing packed unsigned\n * integer. The least significant bit of the packed value is at\n * offset zero, regardless of bit ordering used. */\n this.start = usedBits;\n if (this.container.msb) {\n this.start = totalBits - usedBits - bits;\n }\n\n /** A mask of {@link BitField#bits|bits} isolating the field value\n * within the containing packed unsigned integer. */\n this.wordMask = fixBitwiseResult(this.valueMask << this.start);\n\n /** The property name used when this bitfield is represented in an\n * Object.\n *\n * Intended to be functionally equivalent to {@link\n * Layout#property}.\n *\n * If left undefined the corresponding span of bits will be\n * treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n\n /** Store a value into the corresponding subsequence of the containing\n * bit field. */\n decode() {\n const word = this.container._packedGetValue();\n const wordValue = fixBitwiseResult(word & this.wordMask);\n const value = wordValue >>> this.start;\n return value;\n }\n\n /** Store a value into the corresponding subsequence of the containing\n * bit field.\n *\n * **NOTE** This is not a specialization of {@link\n * Layout#encode|Layout.encode} and there is no return value. */\n encode(value) {\n if ((!Number.isInteger(value))\n || (value !== fixBitwiseResult(value & this.valueMask))) {\n throw new TypeError(nameWithProperty('BitField.encode', this)\n + ' value must be integer not exceeding ' + this.valueMask);\n }\n const word = this.container._packedGetValue();\n const wordValue = fixBitwiseResult(value << this.start);\n this.container._packedSetValue(fixBitwiseResult(word & ~this.wordMask)\n | wordValue);\n };\n}\n\n/**\n * Represent a single bit within a {@link BitStructure} as a\n * JavaScript boolean.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addBoolean|addBoolean} helper\n * method.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {BitField}\n */\n/* eslint-disable no-extend-native */\nclass Boolean extends BitField {\n constructor(container, property) {\n super(container, 1, property);\n }\n\n /** Override {@link BitField#decode|decode} for {@link Boolean|Boolean}.\n *\n * @returns {boolean} */\n decode(b, offset) {\n return !!BitField.prototype.decode.call(this, b, offset);\n }\n\n /** @override */\n encode(value) {\n if ('boolean' === typeof value) {\n // BitField requires integer values\n value = +value;\n }\n return BitField.prototype.encode.call(this, value);\n }\n}\n/* eslint-enable no-extend-native */\n\n/**\n * Contain a fixed-length block of arbitrary data, represented as a\n * Buffer.\n *\n * *Factory*: {@link module:Layout.blob|blob}\n *\n * @param {(Number|ExternalLayout)} length - initializes {@link\n * Blob#length|length}.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Blob extends Layout {\n constructor(length, property) {\n if (!(((length instanceof ExternalLayout) && length.isCount())\n || (Number.isInteger(length) && (0 <= length)))) {\n throw new TypeError('length must be positive integer '\n + 'or an unsigned integer ExternalLayout');\n }\n\n let span = -1;\n if (!(length instanceof ExternalLayout)) {\n span = length;\n }\n super(span, property);\n\n /** The number of bytes in the blob.\n *\n * This may be a non-negative integer, or an instance of {@link\n * ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}. */\n this.length = length;\n }\n\n /** @override */\n getSpan(b, offset) {\n let span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return b.slice(offset, offset + span);\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Blob}.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n encode(src, b, offset) {\n let span = this.length;\n if (this.length instanceof ExternalLayout) {\n span = src.length;\n }\n if (!(Buffer.isBuffer(src)\n && (span === src.length))) {\n throw new TypeError(nameWithProperty('Blob.encode', this)\n + ' requires (length ' + span + ') Buffer as src');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n b.write(src.toString('hex'), offset, span, 'hex');\n if (this.length instanceof ExternalLayout) {\n this.length.encode(span, b, offset);\n }\n return span;\n }\n}\n\n/**\n * Contain a `NUL`-terminated UTF8 string.\n *\n * *Factory*: {@link module:Layout.cstr|cstr}\n *\n * **NOTE** Any UTF8 string that incorporates a zero-valued byte will\n * not be correctly decoded by this layout.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass CString extends Layout {\n constructor(property) {\n super(-1, property);\n }\n\n /** @override */\n getSpan(b, offset) {\n if (!Buffer.isBuffer(b)) {\n throw new TypeError('b must be a Buffer');\n }\n if (undefined === offset) {\n offset = 0;\n }\n let idx = offset;\n while ((idx < b.length) && (0 !== b[idx])) {\n idx += 1;\n }\n return 1 + idx - offset;\n }\n\n /** @override */\n decode(b, offset, dest) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.getSpan(b, offset);\n return b.slice(offset, offset + span - 1).toString('utf-8');\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n const srcb = new Buffer(src, 'utf8');\n const span = srcb.length;\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n srcb.copy(b, offset);\n b[offset + span] = 0;\n return span + 1;\n }\n}\n\n/**\n * Contain a UTF8 string with implicit length.\n *\n * *Factory*: {@link module:Layout.utf8|utf8}\n *\n * **NOTE** Because the length is implicit in the size of the buffer\n * this layout should be used only in isolation, or in a situation\n * where the length can be expressed by operating on a slice of the\n * containing buffer.\n *\n * @param {Number} [maxSpan] - the maximum length allowed for encoded\n * string content. If not provided there is no bound on the allowed\n * content.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UTF8 extends Layout {\n constructor(maxSpan, property) {\n if (('string' === typeof maxSpan)\n && (undefined === property)) {\n property = maxSpan;\n maxSpan = undefined;\n }\n if (undefined === maxSpan) {\n maxSpan = -1;\n } else if (!Number.isInteger(maxSpan)) {\n throw new TypeError('maxSpan must be an integer');\n }\n\n super(-1, property);\n\n /** The maximum span of the layout in bytes.\n *\n * Positive values are generally expected. Zero is abnormal.\n * Attempts to encode or decode a value that exceeds this length\n * will throw a `RangeError`.\n *\n * A negative value indicates that there is no bound on the length\n * of the content. */\n this.maxSpan = maxSpan;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (!Buffer.isBuffer(b)) {\n throw new TypeError('b must be a Buffer');\n }\n if (undefined === offset) {\n offset = 0;\n }\n return b.length - offset;\n }\n\n /** @override */\n decode(b, offset, dest) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.getSpan(b, offset);\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n return b.slice(offset, offset + span).toString('utf-8');\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n const srcb = new Buffer(src, 'utf8');\n const span = srcb.length;\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n srcb.copy(b, offset);\n return span;\n }\n}\n\n/**\n * Contain a constant value.\n *\n * This layout may be used in cases where a JavaScript value can be\n * inferred without an expression in the binary encoding. An example\n * would be a {@link VariantLayout|variant layout} where the content\n * is implied by the union {@link Union#discriminator|discriminator}.\n *\n * @param {Object|Number|String} value - initializer for {@link\n * Constant#value|value}. If the value is an object (or array) and\n * the application intends the object to remain unchanged regardless\n * of what is done to values decoded by this layout, the value should\n * be frozen prior passing it to this constructor.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Constant extends Layout {\n constructor(value, property) {\n super(0, property);\n\n /** The value produced by this constant when the layout is {@link\n * Constant#decode|decoded}.\n *\n * Any JavaScript value including `null` and `undefined` is\n * permitted.\n *\n * **WARNING** If `value` passed in the constructor was not\n * frozen, it is possible for users of decoded values to change\n * the content of the value. */\n this.value = value;\n }\n\n /** @override */\n decode(b, offset, dest) {\n return this.value;\n }\n\n /** @override */\n encode(src, b, offset) {\n /* Constants take no space */\n return 0;\n }\n}\n\nexports.ExternalLayout = ExternalLayout;\nexports.GreedyCount = GreedyCount;\nexports.OffsetLayout = OffsetLayout;\nexports.UInt = UInt;\nexports.UIntBE = UIntBE;\nexports.Int = Int;\nexports.IntBE = IntBE;\nexports.Float = Float;\nexports.FloatBE = FloatBE;\nexports.Double = Double;\nexports.DoubleBE = DoubleBE;\nexports.Sequence = Sequence;\nexports.Structure = Structure;\nexports.UnionDiscriminator = UnionDiscriminator;\nexports.UnionLayoutDiscriminator = UnionLayoutDiscriminator;\nexports.Union = Union;\nexports.VariantLayout = VariantLayout;\nexports.BitStructure = BitStructure;\nexports.BitField = BitField;\nexports.Boolean = Boolean;\nexports.Blob = Blob;\nexports.CString = CString;\nexports.UTF8 = UTF8;\nexports.Constant = Constant;\n\n/** Factory for {@link GreedyCount}. */\nexports.greedy = ((elementSpan, property) => new GreedyCount(elementSpan, property));\n\n/** Factory for {@link OffsetLayout}. */\nexports.offset = ((layout, offset, property) => new OffsetLayout(layout, offset, property));\n\n/** Factory for {@link UInt|unsigned int layouts} spanning one\n * byte. */\nexports.u8 = (property => new UInt(1, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16 = (property => new UInt(2, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24 = (property => new UInt(3, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32 = (property => new UInt(4, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40 = (property => new UInt(5, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48 = (property => new UInt(6, property));\n\n/** Factory for {@link NearUInt64|little-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64 = (property => new NearUInt64(property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16be = (property => new UIntBE(2, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24be = (property => new UIntBE(3, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32be = (property => new UIntBE(4, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40be = (property => new UIntBE(5, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48be = (property => new UIntBE(6, property));\n\n/** Factory for {@link NearUInt64BE|big-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64be = (property => new NearUInt64BE(property));\n\n/** Factory for {@link Int|signed int layouts} spanning one\n * byte. */\nexports.s8 = (property => new Int(1, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning two bytes. */\nexports.s16 = (property => new Int(2, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning three bytes. */\nexports.s24 = (property => new Int(3, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning four bytes. */\nexports.s32 = (property => new Int(4, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning five bytes. */\nexports.s40 = (property => new Int(5, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning six bytes. */\nexports.s48 = (property => new Int(6, property));\n\n/** Factory for {@link NearInt64|little-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64 = (property => new NearInt64(property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning two bytes. */\nexports.s16be = (property => new IntBE(2, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning three bytes. */\nexports.s24be = (property => new IntBE(3, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning four bytes. */\nexports.s32be = (property => new IntBE(4, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning five bytes. */\nexports.s40be = (property => new IntBE(5, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning six bytes. */\nexports.s48be = (property => new IntBE(6, property));\n\n/** Factory for {@link NearInt64BE|big-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64be = (property => new NearInt64BE(property));\n\n/** Factory for {@link Float|little-endian 32-bit floating point} values. */\nexports.f32 = (property => new Float(property));\n\n/** Factory for {@link FloatBE|big-endian 32-bit floating point} values. */\nexports.f32be = (property => new FloatBE(property));\n\n/** Factory for {@link Double|little-endian 64-bit floating point} values. */\nexports.f64 = (property => new Double(property));\n\n/** Factory for {@link DoubleBE|big-endian 64-bit floating point} values. */\nexports.f64be = (property => new DoubleBE(property));\n\n/** Factory for {@link Structure} values. */\nexports.struct = ((fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes));\n\n/** Factory for {@link BitStructure} values. */\nexports.bits = ((word, msb, property) => new BitStructure(word, msb, property));\n\n/** Factory for {@link Sequence} values. */\nexports.seq = ((elementLayout, count, property) => new Sequence(elementLayout, count, property));\n\n/** Factory for {@link Union} values. */\nexports.union = ((discr, defaultLayout, property) => new Union(discr, defaultLayout, property));\n\n/** Factory for {@link UnionLayoutDiscriminator} values. */\nexports.unionLayoutDiscriminator = ((layout, property) => new UnionLayoutDiscriminator(layout, property));\n\n/** Factory for {@link Blob} values. */\nexports.blob = ((length, property) => new Blob(length, property));\n\n/** Factory for {@link CString} values. */\nexports.cstr = (property => new CString(property));\n\n/** Factory for {@link UTF8} values. */\nexports.utf8 = ((maxSpan, property) => new UTF8(maxSpan, property));\n\n/** Factory for {@link Constant} values. */\nexports.const = ((value, property) => new Constant(value, property));\n","// @flow\n\nimport * as BufferLayout from 'buffer-layout';\n\n/**\n * Layout for a public key\n */\nexport const publicKey = (property: string = 'publicKey'): Object => {\n return BufferLayout.blob(32, property);\n};\n\n/**\n * Layout for a 64bit unsigned value\n */\nexport const uint64 = (property: string = 'uint64'): Object => {\n return BufferLayout.blob(8, property);\n};\n","// @flow\n\nimport {sendAndConfirmTransaction as realSendAndConfirmTransaction} from '@solana/web3.js';\nimport type {\n Connection,\n Signer,\n Transaction,\n TransactionSignature,\n} from '@solana/web3.js';\n\nexport function sendAndConfirmTransaction(\n title: string,\n connection: Connection,\n transaction: Transaction,\n ...signers: Array\n): Promise {\n return realSendAndConfirmTransaction(connection, transaction, signers, {\n skipPreflight: false,\n });\n}\n","/**\n * @flow\n */\n\nimport {Buffer} from 'buffer';\nimport assert from 'assert';\nimport BN from 'bn.js';\nimport * as BufferLayout from 'buffer-layout';\nimport {\n Keypair,\n PublicKey,\n SystemProgram,\n Transaction,\n TransactionInstruction,\n SYSVAR_RENT_PUBKEY,\n} from '@solana/web3.js';\nimport type {\n Connection,\n Commitment,\n Signer,\n TransactionSignature,\n} from '@solana/web3.js';\n\nimport * as Layout from './layout';\nimport {sendAndConfirmTransaction} from './util/send-and-confirm-transaction';\n\nexport const TOKEN_PROGRAM_ID: PublicKey = new PublicKey(\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n);\n\nexport const ASSOCIATED_TOKEN_PROGRAM_ID: PublicKey = new PublicKey(\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n);\n\nconst FAILED_TO_FIND_ACCOUNT = 'Failed to find account';\nconst INVALID_ACCOUNT_OWNER = 'Invalid account owner';\n\n/**\n * Unfortunately, BufferLayout.encode uses an `instanceof` check for `Buffer`\n * which fails when using `publicKey.toBuffer()` directly because the bundled `Buffer`\n * class in `@solana/web3.js` is different from the bundled `Buffer` class in this package\n */\nfunction pubkeyToBuffer(publicKey: PublicKey): typeof Buffer {\n return Buffer.from(publicKey.toBuffer());\n}\n\n/**\n * 64-bit value\n */\nexport class u64 extends BN {\n /**\n * Convert to Buffer representation\n */\n toBuffer(): typeof Buffer {\n const a = super.toArray().reverse();\n const b = Buffer.from(a);\n if (b.length === 8) {\n return b;\n }\n assert(b.length < 8, 'u64 too large');\n\n const zeroPad = Buffer.alloc(8);\n b.copy(zeroPad);\n return zeroPad;\n }\n\n /**\n * Construct a u64 from Buffer representation\n */\n static fromBuffer(buffer: typeof Buffer): u64 {\n assert(buffer.length === 8, `Invalid buffer length: ${buffer.length}`);\n return new u64(\n [...buffer]\n .reverse()\n .map(i => `00${i.toString(16)}`.slice(-2))\n .join(''),\n 16,\n );\n }\n}\n\nfunction isAccount(accountOrPublicKey: any): boolean {\n return 'publicKey' in accountOrPublicKey;\n}\n\ntype AuthorityType =\n | 'MintTokens'\n | 'FreezeAccount'\n | 'AccountOwner'\n | 'CloseAccount';\n\nconst AuthorityTypeCodes = {\n MintTokens: 0,\n FreezeAccount: 1,\n AccountOwner: 2,\n CloseAccount: 3,\n};\n\n// The address of the special mint for wrapped native token.\nexport const NATIVE_MINT: PublicKey = new PublicKey(\n 'So11111111111111111111111111111111111111112',\n);\n\n/**\n * Information about the mint\n */\ntype MintInfo = {|\n /**\n * Optional authority used to mint new tokens. The mint authority may only be provided during\n * mint creation. If no mint authority is present then the mint has a fixed supply and no\n * further tokens may be minted.\n */\n mintAuthority: null | PublicKey,\n\n /**\n * Total supply of tokens\n */\n supply: u64,\n\n /**\n * Number of base 10 digits to the right of the decimal place\n */\n decimals: number,\n\n /**\n * Is this mint initialized\n */\n isInitialized: boolean,\n\n /**\n * Optional authority to freeze token accounts\n */\n freezeAuthority: null | PublicKey,\n|};\n\nexport const MintLayout: typeof BufferLayout.Structure = BufferLayout.struct([\n BufferLayout.u32('mintAuthorityOption'),\n Layout.publicKey('mintAuthority'),\n Layout.uint64('supply'),\n BufferLayout.u8('decimals'),\n BufferLayout.u8('isInitialized'),\n BufferLayout.u32('freezeAuthorityOption'),\n Layout.publicKey('freezeAuthority'),\n]);\n\n/**\n * Information about an account\n */\ntype AccountInfo = {|\n /**\n * The address of this account\n */\n address: PublicKey,\n\n /**\n * The mint associated with this account\n */\n mint: PublicKey,\n\n /**\n * Owner of this account\n */\n owner: PublicKey,\n\n /**\n * Amount of tokens this account holds\n */\n amount: u64,\n\n /**\n * The delegate for this account\n */\n delegate: null | PublicKey,\n\n /**\n * The amount of tokens the delegate authorized to the delegate\n */\n delegatedAmount: u64,\n\n /**\n * Is this account initialized\n */\n isInitialized: boolean,\n\n /**\n * Is this account frozen\n */\n isFrozen: boolean,\n\n /**\n * Is this a native token account\n */\n isNative: boolean,\n\n /**\n * If this account is a native token, it must be rent-exempt. This\n * value logs the rent-exempt reserve which must remain in the balance\n * until the account is closed.\n */\n rentExemptReserve: null | u64,\n\n /**\n * Optional authority to close the account\n */\n closeAuthority: null | PublicKey,\n|};\n\n/**\n * @private\n */\nexport const AccountLayout: typeof BufferLayout.Structure = BufferLayout.struct(\n [\n Layout.publicKey('mint'),\n Layout.publicKey('owner'),\n Layout.uint64('amount'),\n BufferLayout.u32('delegateOption'),\n Layout.publicKey('delegate'),\n BufferLayout.u8('state'),\n BufferLayout.u32('isNativeOption'),\n Layout.uint64('isNative'),\n Layout.uint64('delegatedAmount'),\n BufferLayout.u32('closeAuthorityOption'),\n Layout.publicKey('closeAuthority'),\n ],\n);\n\n/**\n * Information about an multisig\n */\ntype MultisigInfo = {|\n /**\n * The number of signers required\n */\n m: number,\n\n /**\n * Number of possible signers, corresponds to the\n * number of `signers` that are valid.\n */\n n: number,\n\n /**\n * Is this mint initialized\n */\n initialized: boolean,\n\n /**\n * The signers\n */\n signer1: PublicKey,\n signer2: PublicKey,\n signer3: PublicKey,\n signer4: PublicKey,\n signer5: PublicKey,\n signer6: PublicKey,\n signer7: PublicKey,\n signer8: PublicKey,\n signer9: PublicKey,\n signer10: PublicKey,\n signer11: PublicKey,\n|};\n\n/**\n * @private\n */\nconst MultisigLayout = BufferLayout.struct([\n BufferLayout.u8('m'),\n BufferLayout.u8('n'),\n BufferLayout.u8('is_initialized'),\n Layout.publicKey('signer1'),\n Layout.publicKey('signer2'),\n Layout.publicKey('signer3'),\n Layout.publicKey('signer4'),\n Layout.publicKey('signer5'),\n Layout.publicKey('signer6'),\n Layout.publicKey('signer7'),\n Layout.publicKey('signer8'),\n Layout.publicKey('signer9'),\n Layout.publicKey('signer10'),\n Layout.publicKey('signer11'),\n]);\n\n/**\n * An ERC20-like Token\n */\nexport class Token {\n /**\n * @private\n */\n connection: Connection;\n\n /**\n * The public key identifying this mint\n */\n publicKey: PublicKey;\n\n /**\n * Program Identifier for the Token program\n */\n programId: PublicKey;\n\n /**\n * Program Identifier for the Associated Token program\n */\n associatedProgramId: PublicKey;\n\n /**\n * Fee payer\n */\n payer: Signer;\n\n /**\n * Create a Token object attached to the specific mint\n *\n * @param connection The connection to use\n * @param token Public key of the mint\n * @param programId token programId\n * @param payer Payer of fees\n */\n constructor(\n connection: Connection,\n publicKey: PublicKey,\n programId: PublicKey,\n payer: Signer,\n ) {\n Object.assign(this, {\n connection,\n publicKey,\n programId,\n payer,\n // Hard code is ok; Overriding is needed only for tests\n associatedProgramId: ASSOCIATED_TOKEN_PROGRAM_ID,\n });\n }\n\n /**\n * Get the minimum balance for the mint to be rent exempt\n *\n * @return Number of lamports required\n */\n static async getMinBalanceRentForExemptMint(\n connection: Connection,\n ): Promise {\n return await connection.getMinimumBalanceForRentExemption(MintLayout.span);\n }\n\n /**\n * Get the minimum balance for the account to be rent exempt\n *\n * @return Number of lamports required\n */\n static async getMinBalanceRentForExemptAccount(\n connection: Connection,\n ): Promise {\n return await connection.getMinimumBalanceForRentExemption(\n AccountLayout.span,\n );\n }\n\n /**\n * Get the minimum balance for the multsig to be rent exempt\n *\n * @return Number of lamports required\n */\n static async getMinBalanceRentForExemptMultisig(\n connection: Connection,\n ): Promise {\n return await connection.getMinimumBalanceForRentExemption(\n MultisigLayout.span,\n );\n }\n\n /**\n * Create and initialize a token.\n *\n * @param connection The connection to use\n * @param payer Fee payer for transaction\n * @param mintAuthority Account or multisig that will control minting\n * @param freezeAuthority Optional account or multisig that can freeze token accounts\n * @param decimals Location of the decimal place\n * @param programId Optional token programId, uses the system programId by default\n * @return Token object for the newly minted token\n */\n static async createMint(\n connection: Connection,\n payer: Signer,\n mintAuthority: PublicKey,\n freezeAuthority: PublicKey | null,\n decimals: number,\n programId: PublicKey,\n ): Promise {\n const mintAccount = Keypair.generate();\n const token = new Token(\n connection,\n mintAccount.publicKey,\n programId,\n payer,\n );\n\n // Allocate memory for the account\n const balanceNeeded = await Token.getMinBalanceRentForExemptMint(\n connection,\n );\n\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: payer.publicKey,\n newAccountPubkey: mintAccount.publicKey,\n lamports: balanceNeeded,\n space: MintLayout.span,\n programId,\n }),\n );\n\n transaction.add(\n Token.createInitMintInstruction(\n programId,\n mintAccount.publicKey,\n decimals,\n mintAuthority,\n freezeAuthority,\n ),\n );\n\n // Send the two instructions\n await sendAndConfirmTransaction(\n 'createAccount and InitializeMint',\n connection,\n transaction,\n payer,\n mintAccount,\n );\n\n return token;\n }\n\n /**\n * Create and initialize a new account.\n *\n * This account may then be used as a `transfer()` or `approve()` destination\n *\n * @param owner User account that will own the new account\n * @return Public key of the new empty account\n */\n async createAccount(owner: PublicKey): Promise {\n // Allocate memory for the account\n const balanceNeeded = await Token.getMinBalanceRentForExemptAccount(\n this.connection,\n );\n\n const newAccount = Keypair.generate();\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: this.payer.publicKey,\n newAccountPubkey: newAccount.publicKey,\n lamports: balanceNeeded,\n space: AccountLayout.span,\n programId: this.programId,\n }),\n );\n\n const mintPublicKey = this.publicKey;\n transaction.add(\n Token.createInitAccountInstruction(\n this.programId,\n mintPublicKey,\n newAccount.publicKey,\n owner,\n ),\n );\n\n // Send the two instructions\n await sendAndConfirmTransaction(\n 'createAccount and InitializeAccount',\n this.connection,\n transaction,\n this.payer,\n newAccount,\n );\n\n return newAccount.publicKey;\n }\n\n /**\n * Create and initialize the associated account.\n *\n * This account may then be used as a `transfer()` or `approve()` destination\n *\n * @param owner User account that will own the new account\n * @return Public key of the new associated account\n */\n async createAssociatedTokenAccount(owner: PublicKey): Promise {\n const associatedAddress = await Token.getAssociatedTokenAddress(\n this.associatedProgramId,\n this.programId,\n this.publicKey,\n owner,\n );\n\n return this.createAssociatedTokenAccountInternal(owner, associatedAddress);\n }\n\n async createAssociatedTokenAccountInternal(\n owner: PublicKey,\n associatedAddress: PublicKey,\n ): Promise {\n await sendAndConfirmTransaction(\n 'CreateAssociatedTokenAccount',\n this.connection,\n new Transaction().add(\n Token.createAssociatedTokenAccountInstruction(\n this.associatedProgramId,\n this.programId,\n this.publicKey,\n associatedAddress,\n owner,\n this.payer.publicKey,\n ),\n ),\n this.payer,\n );\n\n return associatedAddress;\n }\n\n /**\n * Retrieve the associated account or create one if not found.\n *\n * This account may then be used as a `transfer()` or `approve()` destination\n *\n * @param owner User account that will own the new account\n * @return The new associated account\n */\n async getOrCreateAssociatedAccountInfo(\n owner: PublicKey,\n ): Promise {\n const associatedAddress = await Token.getAssociatedTokenAddress(\n this.associatedProgramId,\n this.programId,\n this.publicKey,\n owner,\n );\n\n // This is the optimum logic, considering TX fee, client-side computation,\n // RPC roundtrips and guaranteed idempotent.\n // Sadly we can't do this atomically;\n try {\n return await this.getAccountInfo(associatedAddress);\n } catch (err) {\n // INVALID_ACCOUNT_OWNER can be possible if the associatedAddress has\n // already been received some lamports (= became system accounts).\n // Assuming program derived addressing is safe, this is the only case\n // for the INVALID_ACCOUNT_OWNER in this code-path\n if (\n err.message === FAILED_TO_FIND_ACCOUNT ||\n err.message === INVALID_ACCOUNT_OWNER\n ) {\n // as this isn't atomic, it's possible others can create associated\n // accounts meanwhile\n try {\n await this.createAssociatedTokenAccountInternal(\n owner,\n associatedAddress,\n );\n } catch (err) {\n // ignore all errors; for now there is no API compatible way to\n // selectively ignore the expected instruction error if the\n // associated account is existing already.\n }\n\n // Now this should always succeed\n return await this.getAccountInfo(associatedAddress);\n } else {\n throw err;\n }\n }\n }\n\n /**\n * Create and initialize a new account on the special native token mint.\n *\n * In order to be wrapped, the account must have a balance of native tokens\n * when it is initialized with the token program.\n *\n * This function sends lamports to the new account before initializing it.\n *\n * @param connection A solana web3 connection\n * @param programId The token program ID\n * @param owner The owner of the new token account\n * @param payer The source of the lamports to initialize, and payer of the initialization fees.\n * @param amount The amount of lamports to wrap\n * @return {Promise} The new token account\n */\n static async createWrappedNativeAccount(\n connection: Connection,\n programId: PublicKey,\n owner: PublicKey,\n payer: Signer,\n amount: number,\n ): Promise {\n // Allocate memory for the account\n const balanceNeeded = await Token.getMinBalanceRentForExemptAccount(\n connection,\n );\n\n // Create a new account\n const newAccount = Keypair.generate();\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: payer.publicKey,\n newAccountPubkey: newAccount.publicKey,\n lamports: balanceNeeded,\n space: AccountLayout.span,\n programId,\n }),\n );\n\n // Send lamports to it (these will be wrapped into native tokens by the token program)\n transaction.add(\n SystemProgram.transfer({\n fromPubkey: payer.publicKey,\n toPubkey: newAccount.publicKey,\n lamports: amount,\n }),\n );\n\n // Assign the new account to the native token mint.\n // the account will be initialized with a balance equal to the native token balance.\n // (i.e. amount)\n transaction.add(\n Token.createInitAccountInstruction(\n programId,\n NATIVE_MINT,\n newAccount.publicKey,\n owner,\n ),\n );\n\n // Send the three instructions\n await sendAndConfirmTransaction(\n 'createAccount, transfer, and initializeAccount',\n connection,\n transaction,\n payer,\n newAccount,\n );\n\n return newAccount.publicKey;\n }\n\n /**\n * Create and initialize a new multisig.\n *\n * This account may then be used for multisignature verification\n *\n * @param m Number of required signatures\n * @param signers Full set of signers\n * @return Public key of the new multisig account\n */\n async createMultisig(\n m: number,\n signers: Array,\n ): Promise {\n const multisigAccount = Keypair.generate();\n\n // Allocate memory for the account\n const balanceNeeded = await Token.getMinBalanceRentForExemptMultisig(\n this.connection,\n );\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: this.payer.publicKey,\n newAccountPubkey: multisigAccount.publicKey,\n lamports: balanceNeeded,\n space: MultisigLayout.span,\n programId: this.programId,\n }),\n );\n\n // create the new account\n let keys = [\n {pubkey: multisigAccount.publicKey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ];\n signers.forEach(signer =>\n keys.push({pubkey: signer, isSigner: false, isWritable: false}),\n );\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n BufferLayout.u8('m'),\n ]);\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 2, // InitializeMultisig instruction\n m,\n },\n data,\n );\n transaction.add({\n keys,\n programId: this.programId,\n data,\n });\n\n // Send the two instructions\n await sendAndConfirmTransaction(\n 'createAccount and InitializeMultisig',\n this.connection,\n transaction,\n this.payer,\n multisigAccount,\n );\n\n return multisigAccount.publicKey;\n }\n\n /**\n * Retrieve mint information\n */\n async getMintInfo(): Promise {\n const info = await this.connection.getAccountInfo(this.publicKey);\n if (info === null) {\n throw new Error('Failed to find mint account');\n }\n if (!info.owner.equals(this.programId)) {\n throw new Error(`Invalid mint owner: ${JSON.stringify(info.owner)}`);\n }\n if (info.data.length != MintLayout.span) {\n throw new Error(`Invalid mint size`);\n }\n\n const data = Buffer.from(info.data);\n const mintInfo = MintLayout.decode(data);\n\n if (mintInfo.mintAuthorityOption === 0) {\n mintInfo.mintAuthority = null;\n } else {\n mintInfo.mintAuthority = new PublicKey(mintInfo.mintAuthority);\n }\n\n mintInfo.supply = u64.fromBuffer(mintInfo.supply);\n mintInfo.isInitialized = mintInfo.isInitialized != 0;\n\n if (mintInfo.freezeAuthorityOption === 0) {\n mintInfo.freezeAuthority = null;\n } else {\n mintInfo.freezeAuthority = new PublicKey(mintInfo.freezeAuthority);\n }\n return mintInfo;\n }\n\n /**\n * Retrieve account information\n *\n * @param account Public key of the account\n */\n async getAccountInfo(\n account: PublicKey,\n commitment?: Commitment,\n ): Promise {\n const info = await this.connection.getAccountInfo(account, commitment);\n if (info === null) {\n throw new Error(FAILED_TO_FIND_ACCOUNT);\n }\n if (!info.owner.equals(this.programId)) {\n throw new Error(INVALID_ACCOUNT_OWNER);\n }\n if (info.data.length != AccountLayout.span) {\n throw new Error(`Invalid account size`);\n }\n\n const data = Buffer.from(info.data);\n const accountInfo = AccountLayout.decode(data);\n accountInfo.address = account;\n accountInfo.mint = new PublicKey(accountInfo.mint);\n accountInfo.owner = new PublicKey(accountInfo.owner);\n accountInfo.amount = u64.fromBuffer(accountInfo.amount);\n\n if (accountInfo.delegateOption === 0) {\n accountInfo.delegate = null;\n accountInfo.delegatedAmount = new u64();\n } else {\n accountInfo.delegate = new PublicKey(accountInfo.delegate);\n accountInfo.delegatedAmount = u64.fromBuffer(accountInfo.delegatedAmount);\n }\n\n accountInfo.isInitialized = accountInfo.state !== 0;\n accountInfo.isFrozen = accountInfo.state === 2;\n\n if (accountInfo.isNativeOption === 1) {\n accountInfo.rentExemptReserve = u64.fromBuffer(accountInfo.isNative);\n accountInfo.isNative = true;\n } else {\n accountInfo.rentExemptReserve = null;\n accountInfo.isNative = false;\n }\n\n if (accountInfo.closeAuthorityOption === 0) {\n accountInfo.closeAuthority = null;\n } else {\n accountInfo.closeAuthority = new PublicKey(accountInfo.closeAuthority);\n }\n\n if (!accountInfo.mint.equals(this.publicKey)) {\n throw new Error(\n `Invalid account mint: ${JSON.stringify(\n accountInfo.mint,\n )} !== ${JSON.stringify(this.publicKey)}`,\n );\n }\n return accountInfo;\n }\n\n /**\n * Retrieve Multisig information\n *\n * @param multisig Public key of the account\n */\n async getMultisigInfo(multisig: PublicKey): Promise {\n const info = await this.connection.getAccountInfo(multisig);\n if (info === null) {\n throw new Error('Failed to find multisig');\n }\n if (!info.owner.equals(this.programId)) {\n throw new Error(`Invalid multisig owner`);\n }\n if (info.data.length != MultisigLayout.span) {\n throw new Error(`Invalid multisig size`);\n }\n\n const data = Buffer.from(info.data);\n const multisigInfo = MultisigLayout.decode(data);\n multisigInfo.signer1 = new PublicKey(multisigInfo.signer1);\n multisigInfo.signer2 = new PublicKey(multisigInfo.signer2);\n multisigInfo.signer3 = new PublicKey(multisigInfo.signer3);\n multisigInfo.signer4 = new PublicKey(multisigInfo.signer4);\n multisigInfo.signer5 = new PublicKey(multisigInfo.signer5);\n multisigInfo.signer6 = new PublicKey(multisigInfo.signer6);\n multisigInfo.signer7 = new PublicKey(multisigInfo.signer7);\n multisigInfo.signer8 = new PublicKey(multisigInfo.signer8);\n multisigInfo.signer9 = new PublicKey(multisigInfo.signer9);\n multisigInfo.signer10 = new PublicKey(multisigInfo.signer10);\n multisigInfo.signer11 = new PublicKey(multisigInfo.signer11);\n\n return multisigInfo;\n }\n\n /**\n * Transfer tokens to another account\n *\n * @param source Source account\n * @param destination Destination account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Number of tokens to transfer\n */\n async transfer(\n source: PublicKey,\n destination: PublicKey,\n owner: any,\n multiSigners: Array,\n amount: number | u64,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(owner)) {\n ownerPublicKey = owner.publicKey;\n signers = [owner];\n } else {\n ownerPublicKey = owner;\n signers = multiSigners;\n }\n return await sendAndConfirmTransaction(\n 'Transfer',\n this.connection,\n new Transaction().add(\n Token.createTransferInstruction(\n this.programId,\n source,\n destination,\n ownerPublicKey,\n multiSigners,\n amount,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Grant a third-party permission to transfer up the specified number of tokens from an account\n *\n * @param account Public key of the account\n * @param delegate Account authorized to perform a transfer tokens from the source account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Maximum number of tokens the delegate may transfer\n */\n async approve(\n account: PublicKey,\n delegate: PublicKey,\n owner: any,\n multiSigners: Array,\n amount: number | u64,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(owner)) {\n ownerPublicKey = owner.publicKey;\n signers = [owner];\n } else {\n ownerPublicKey = owner;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'Approve',\n this.connection,\n new Transaction().add(\n Token.createApproveInstruction(\n this.programId,\n account,\n delegate,\n ownerPublicKey,\n multiSigners,\n amount,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Remove approval for the transfer of any remaining tokens\n *\n * @param account Public key of the account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n */\n async revoke(\n account: PublicKey,\n owner: any,\n multiSigners: Array,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(owner)) {\n ownerPublicKey = owner.publicKey;\n signers = [owner];\n } else {\n ownerPublicKey = owner;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'Revoke',\n this.connection,\n new Transaction().add(\n Token.createRevokeInstruction(\n this.programId,\n account,\n ownerPublicKey,\n multiSigners,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Assign a new authority to the account\n *\n * @param account Public key of the account\n * @param newAuthority New authority of the account\n * @param authorityType Type of authority to set\n * @param currentAuthority Current authority of the account\n * @param multiSigners Signing accounts if `currentAuthority` is a multiSig\n */\n async setAuthority(\n account: PublicKey,\n newAuthority: PublicKey | null,\n authorityType: AuthorityType,\n currentAuthority: any,\n multiSigners: Array,\n ): Promise {\n let currentAuthorityPublicKey: PublicKey;\n let signers;\n if (isAccount(currentAuthority)) {\n currentAuthorityPublicKey = currentAuthority.publicKey;\n signers = [currentAuthority];\n } else {\n currentAuthorityPublicKey = currentAuthority;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'SetAuthority',\n this.connection,\n new Transaction().add(\n Token.createSetAuthorityInstruction(\n this.programId,\n account,\n newAuthority,\n authorityType,\n currentAuthorityPublicKey,\n multiSigners,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Mint new tokens\n *\n * @param dest Public key of the account to mint to\n * @param authority Minting authority\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount Amount to mint\n */\n async mintTo(\n dest: PublicKey,\n authority: any,\n multiSigners: Array,\n amount: number | u64,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(authority)) {\n ownerPublicKey = authority.publicKey;\n signers = [authority];\n } else {\n ownerPublicKey = authority;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'MintTo',\n this.connection,\n new Transaction().add(\n Token.createMintToInstruction(\n this.programId,\n this.publicKey,\n dest,\n ownerPublicKey,\n multiSigners,\n amount,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Burn tokens\n *\n * @param account Account to burn tokens from\n * @param owner Account owner\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Amount to burn\n */\n async burn(\n account: PublicKey,\n owner: any,\n multiSigners: Array,\n amount: number | u64,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(owner)) {\n ownerPublicKey = owner.publicKey;\n signers = [owner];\n } else {\n ownerPublicKey = owner;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'Burn',\n this.connection,\n new Transaction().add(\n Token.createBurnInstruction(\n this.programId,\n this.publicKey,\n account,\n ownerPublicKey,\n multiSigners,\n amount,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Close account\n *\n * @param account Account to close\n * @param dest Account to receive the remaining balance of the closed account\n * @param authority Authority which is allowed to close the account\n * @param multiSigners Signing accounts if `authority` is a multiSig\n */\n async closeAccount(\n account: PublicKey,\n dest: PublicKey,\n authority: any,\n multiSigners: Array,\n ): Promise {\n let authorityPublicKey;\n let signers;\n if (isAccount(authority)) {\n authorityPublicKey = authority.publicKey;\n signers = [authority];\n } else {\n authorityPublicKey = authority;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'CloseAccount',\n this.connection,\n new Transaction().add(\n Token.createCloseAccountInstruction(\n this.programId,\n account,\n dest,\n authorityPublicKey,\n multiSigners,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Freeze account\n *\n * @param account Account to freeze\n * @param authority The mint freeze authority\n * @param multiSigners Signing accounts if `authority` is a multiSig\n */\n async freezeAccount(\n account: PublicKey,\n authority: any,\n multiSigners: Array,\n ): Promise {\n let authorityPublicKey;\n let signers;\n if (isAccount(authority)) {\n authorityPublicKey = authority.publicKey;\n signers = [authority];\n } else {\n authorityPublicKey = authority;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'FreezeAccount',\n this.connection,\n new Transaction().add(\n Token.createFreezeAccountInstruction(\n this.programId,\n account,\n this.publicKey,\n authorityPublicKey,\n multiSigners,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Thaw account\n *\n * @param account Account to thaw\n * @param authority The mint freeze authority\n * @param multiSigners Signing accounts if `authority` is a multiSig\n */\n async thawAccount(\n account: PublicKey,\n authority: any,\n multiSigners: Array,\n ): Promise {\n let authorityPublicKey;\n let signers;\n if (isAccount(authority)) {\n authorityPublicKey = authority.publicKey;\n signers = [authority];\n } else {\n authorityPublicKey = authority;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'ThawAccount',\n this.connection,\n new Transaction().add(\n Token.createThawAccountInstruction(\n this.programId,\n account,\n this.publicKey,\n authorityPublicKey,\n multiSigners,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Transfer tokens to another account, asserting the token mint and decimals\n *\n * @param source Source account\n * @param destination Destination account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Number of tokens to transfer\n * @param decimals Number of decimals in transfer amount\n */\n async transferChecked(\n source: PublicKey,\n destination: PublicKey,\n owner: any,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(owner)) {\n ownerPublicKey = owner.publicKey;\n signers = [owner];\n } else {\n ownerPublicKey = owner;\n signers = multiSigners;\n }\n return await sendAndConfirmTransaction(\n 'TransferChecked',\n this.connection,\n new Transaction().add(\n Token.createTransferCheckedInstruction(\n this.programId,\n source,\n this.publicKey,\n destination,\n ownerPublicKey,\n multiSigners,\n amount,\n decimals,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Grant a third-party permission to transfer up the specified number of tokens from an account,\n * asserting the token mint and decimals\n *\n * @param account Public key of the account\n * @param delegate Account authorized to perform a transfer tokens from the source account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Maximum number of tokens the delegate may transfer\n * @param decimals Number of decimals in approve amount\n */\n async approveChecked(\n account: PublicKey,\n delegate: PublicKey,\n owner: any,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(owner)) {\n ownerPublicKey = owner.publicKey;\n signers = [owner];\n } else {\n ownerPublicKey = owner;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'ApproveChecked',\n this.connection,\n new Transaction().add(\n Token.createApproveCheckedInstruction(\n this.programId,\n account,\n this.publicKey,\n delegate,\n ownerPublicKey,\n multiSigners,\n amount,\n decimals,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Mint new tokens, asserting the token mint and decimals\n *\n * @param dest Public key of the account to mint to\n * @param authority Minting authority\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount Amount to mint\n * @param decimals Number of decimals in amount to mint\n */\n async mintToChecked(\n dest: PublicKey,\n authority: any,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(authority)) {\n ownerPublicKey = authority.publicKey;\n signers = [authority];\n } else {\n ownerPublicKey = authority;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'MintToChecked',\n this.connection,\n new Transaction().add(\n Token.createMintToCheckedInstruction(\n this.programId,\n this.publicKey,\n dest,\n ownerPublicKey,\n multiSigners,\n amount,\n decimals,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Burn tokens, asserting the token mint and decimals\n *\n * @param account Account to burn tokens from\n * @param owner Account owner\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Amount to burn\n * @param decimals Number of decimals in amount to burn\n */\n async burnChecked(\n account: PublicKey,\n owner: any,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): Promise {\n let ownerPublicKey;\n let signers;\n if (isAccount(owner)) {\n ownerPublicKey = owner.publicKey;\n signers = [owner];\n } else {\n ownerPublicKey = owner;\n signers = multiSigners;\n }\n await sendAndConfirmTransaction(\n 'BurnChecked',\n this.connection,\n new Transaction().add(\n Token.createBurnCheckedInstruction(\n this.programId,\n this.publicKey,\n account,\n ownerPublicKey,\n multiSigners,\n amount,\n decimals,\n ),\n ),\n this.payer,\n ...signers,\n );\n }\n\n /**\n * Sync amount in native SPL token account to underlying lamports\n *\n * @param nativeAccount Account to sync\n */\n async syncNative(nativeAccount: PublicKey): Promise {\n await sendAndConfirmTransaction(\n 'SyncNative',\n this.connection,\n new Transaction().add(\n Token.createSyncNativeInstruction(this.programId, nativeAccount),\n ),\n this.payer,\n );\n }\n\n /**\n * Construct an InitializeMint instruction\n *\n * @param programId SPL Token program account\n * @param mint Token mint account\n * @param decimals Number of decimals in token account amounts\n * @param mintAuthority Minting authority\n * @param freezeAuthority Optional authority that can freeze token accounts\n */\n static createInitMintInstruction(\n programId: PublicKey,\n mint: PublicKey,\n decimals: number,\n mintAuthority: PublicKey,\n freezeAuthority: PublicKey | null,\n ): TransactionInstruction {\n let keys = [\n {pubkey: mint, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ];\n const commandDataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n BufferLayout.u8('decimals'),\n Layout.publicKey('mintAuthority'),\n BufferLayout.u8('option'),\n Layout.publicKey('freezeAuthority'),\n ]);\n let data = Buffer.alloc(1024);\n {\n const encodeLength = commandDataLayout.encode(\n {\n instruction: 0, // InitializeMint instruction\n decimals,\n mintAuthority: pubkeyToBuffer(mintAuthority),\n option: freezeAuthority === null ? 0 : 1,\n freezeAuthority: pubkeyToBuffer(freezeAuthority || new PublicKey(0)),\n },\n data,\n );\n data = data.slice(0, encodeLength);\n }\n\n return new TransactionInstruction({\n keys,\n programId,\n data,\n });\n }\n\n /**\n * Construct an InitializeAccount instruction\n *\n * @param programId SPL Token program account\n * @param mint Token mint account\n * @param account New account\n * @param owner Owner of the new account\n */\n static createInitAccountInstruction(\n programId: PublicKey,\n mint: PublicKey,\n account: PublicKey,\n owner: PublicKey,\n ): TransactionInstruction {\n const keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: mint, isSigner: false, isWritable: false},\n {pubkey: owner, isSigner: false, isWritable: false},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ];\n const dataLayout = BufferLayout.struct([BufferLayout.u8('instruction')]);\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 1, // InitializeAccount instruction\n },\n data,\n );\n\n return new TransactionInstruction({\n keys,\n programId,\n data,\n });\n }\n\n /**\n * Construct a Transfer instruction\n *\n * @param programId SPL Token program account\n * @param source Source account\n * @param destination Destination account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount Number of tokens to transfer\n */\n static createTransferInstruction(\n programId: PublicKey,\n source: PublicKey,\n destination: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 3, // Transfer instruction\n amount: new u64(amount).toBuffer(),\n },\n data,\n );\n\n let keys = [\n {pubkey: source, isSigner: false, isWritable: true},\n {pubkey: destination, isSigner: false, isWritable: true},\n ];\n if (multiSigners.length === 0) {\n keys.push({\n pubkey: owner,\n isSigner: true,\n isWritable: false,\n });\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct an Approve instruction\n *\n * @param programId SPL Token program account\n * @param account Public key of the account\n * @param delegate Account authorized to perform a transfer of tokens from the source account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Maximum number of tokens the delegate may transfer\n */\n static createApproveInstruction(\n programId: PublicKey,\n account: PublicKey,\n delegate: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 4, // Approve instruction\n amount: new u64(amount).toBuffer(),\n },\n data,\n );\n\n let keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: delegate, isSigner: false, isWritable: false},\n ];\n if (multiSigners.length === 0) {\n keys.push({pubkey: owner, isSigner: true, isWritable: false});\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a Revoke instruction\n *\n * @param programId SPL Token program account\n * @param account Public key of the account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n */\n static createRevokeInstruction(\n programId: PublicKey,\n account: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([BufferLayout.u8('instruction')]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 5, // Approve instruction\n },\n data,\n );\n\n let keys = [{pubkey: account, isSigner: false, isWritable: true}];\n if (multiSigners.length === 0) {\n keys.push({pubkey: owner, isSigner: true, isWritable: false});\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a SetAuthority instruction\n *\n * @param programId SPL Token program account\n * @param account Public key of the account\n * @param newAuthority New authority of the account\n * @param authorityType Type of authority to set\n * @param currentAuthority Current authority of the specified type\n * @param multiSigners Signing accounts if `currentAuthority` is a multiSig\n */\n static createSetAuthorityInstruction(\n programId: PublicKey,\n account: PublicKey,\n newAuthority: PublicKey | null,\n authorityType: AuthorityType,\n currentAuthority: PublicKey,\n multiSigners: Array,\n ): TransactionInstruction {\n const commandDataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n BufferLayout.u8('authorityType'),\n BufferLayout.u8('option'),\n Layout.publicKey('newAuthority'),\n ]);\n\n let data = Buffer.alloc(1024);\n {\n const encodeLength = commandDataLayout.encode(\n {\n instruction: 6, // SetAuthority instruction\n authorityType: AuthorityTypeCodes[authorityType],\n option: newAuthority === null ? 0 : 1,\n newAuthority: pubkeyToBuffer(newAuthority || new PublicKey(0)),\n },\n data,\n );\n data = data.slice(0, encodeLength);\n }\n\n let keys = [{pubkey: account, isSigner: false, isWritable: true}];\n if (multiSigners.length === 0) {\n keys.push({pubkey: currentAuthority, isSigner: true, isWritable: false});\n } else {\n keys.push({pubkey: currentAuthority, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a MintTo instruction\n *\n * @param programId SPL Token program account\n * @param mint Public key of the mint\n * @param dest Public key of the account to mint to\n * @param authority The mint authority\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount Amount to mint\n */\n static createMintToInstruction(\n programId: PublicKey,\n mint: PublicKey,\n dest: PublicKey,\n authority: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 7, // MintTo instruction\n amount: new u64(amount).toBuffer(),\n },\n data,\n );\n\n let keys = [\n {pubkey: mint, isSigner: false, isWritable: true},\n {pubkey: dest, isSigner: false, isWritable: true},\n ];\n if (multiSigners.length === 0) {\n keys.push({\n pubkey: authority,\n isSigner: true,\n isWritable: false,\n });\n } else {\n keys.push({pubkey: authority, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a Burn instruction\n *\n * @param programId SPL Token program account\n * @param mint Mint for the account\n * @param account Account to burn tokens from\n * @param owner Owner of the account\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount amount to burn\n */\n static createBurnInstruction(\n programId: PublicKey,\n mint: PublicKey,\n account: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 8, // Burn instruction\n amount: new u64(amount).toBuffer(),\n },\n data,\n );\n\n let keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: mint, isSigner: false, isWritable: true},\n ];\n if (multiSigners.length === 0) {\n keys.push({\n pubkey: owner,\n isSigner: true,\n isWritable: false,\n });\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a Close instruction\n *\n * @param programId SPL Token program account\n * @param account Account to close\n * @param dest Account to receive the remaining balance of the closed account\n * @param authority Account Close authority\n * @param multiSigners Signing accounts if `owner` is a multiSig\n */\n static createCloseAccountInstruction(\n programId: PublicKey,\n account: PublicKey,\n dest: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([BufferLayout.u8('instruction')]);\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 9, // CloseAccount instruction\n },\n data,\n );\n\n let keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: dest, isSigner: false, isWritable: true},\n ];\n if (multiSigners.length === 0) {\n keys.push({pubkey: owner, isSigner: true, isWritable: false});\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a Freeze instruction\n *\n * @param programId SPL Token program account\n * @param account Account to freeze\n * @param mint Mint account\n * @param authority Mint freeze authority\n * @param multiSigners Signing accounts if `owner` is a multiSig\n */\n static createFreezeAccountInstruction(\n programId: PublicKey,\n account: PublicKey,\n mint: PublicKey,\n authority: PublicKey,\n multiSigners: Array,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([BufferLayout.u8('instruction')]);\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 10, // FreezeAccount instruction\n },\n data,\n );\n\n let keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: mint, isSigner: false, isWritable: false},\n ];\n if (multiSigners.length === 0) {\n keys.push({pubkey: authority, isSigner: true, isWritable: false});\n } else {\n keys.push({pubkey: authority, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a Thaw instruction\n *\n * @param programId SPL Token program account\n * @param account Account to thaw\n * @param mint Mint account\n * @param authority Mint freeze authority\n * @param multiSigners Signing accounts if `owner` is a multiSig\n */\n static createThawAccountInstruction(\n programId: PublicKey,\n account: PublicKey,\n mint: PublicKey,\n authority: PublicKey,\n multiSigners: Array,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([BufferLayout.u8('instruction')]);\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 11, // ThawAccount instruction\n },\n data,\n );\n\n let keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: mint, isSigner: false, isWritable: false},\n ];\n if (multiSigners.length === 0) {\n keys.push({pubkey: authority, isSigner: true, isWritable: false});\n } else {\n keys.push({pubkey: authority, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a TransferChecked instruction\n *\n * @param programId SPL Token program account\n * @param source Source account\n * @param mint Mint account\n * @param destination Destination account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount Number of tokens to transfer\n * @param decimals Number of decimals in transfer amount\n */\n static createTransferCheckedInstruction(\n programId: PublicKey,\n source: PublicKey,\n mint: PublicKey,\n destination: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n BufferLayout.u8('decimals'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 12, // TransferChecked instruction\n amount: new u64(amount).toBuffer(),\n decimals,\n },\n data,\n );\n\n let keys = [\n {pubkey: source, isSigner: false, isWritable: true},\n {pubkey: mint, isSigner: false, isWritable: false},\n {pubkey: destination, isSigner: false, isWritable: true},\n ];\n if (multiSigners.length === 0) {\n keys.push({\n pubkey: owner,\n isSigner: true,\n isWritable: false,\n });\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct an ApproveChecked instruction\n *\n * @param programId SPL Token program account\n * @param account Public key of the account\n * @param mint Mint account\n * @param delegate Account authorized to perform a transfer of tokens from the source account\n * @param owner Owner of the source account\n * @param multiSigners Signing accounts if `owner` is a multiSig\n * @param amount Maximum number of tokens the delegate may transfer\n * @param decimals Number of decimals in approve amount\n */\n static createApproveCheckedInstruction(\n programId: PublicKey,\n account: PublicKey,\n mint: PublicKey,\n delegate: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n BufferLayout.u8('decimals'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 13, // ApproveChecked instruction\n amount: new u64(amount).toBuffer(),\n decimals,\n },\n data,\n );\n\n let keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: mint, isSigner: false, isWritable: false},\n {pubkey: delegate, isSigner: false, isWritable: false},\n ];\n if (multiSigners.length === 0) {\n keys.push({pubkey: owner, isSigner: true, isWritable: false});\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a MintToChecked instruction\n *\n * @param programId SPL Token program account\n * @param mint Public key of the mint\n * @param dest Public key of the account to mint to\n * @param authority The mint authority\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount Amount to mint\n * @param decimals Number of decimals in amount to mint\n */\n static createMintToCheckedInstruction(\n programId: PublicKey,\n mint: PublicKey,\n dest: PublicKey,\n authority: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n BufferLayout.u8('decimals'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 14, // MintToChecked instruction\n amount: new u64(amount).toBuffer(),\n decimals,\n },\n data,\n );\n\n let keys = [\n {pubkey: mint, isSigner: false, isWritable: true},\n {pubkey: dest, isSigner: false, isWritable: true},\n ];\n if (multiSigners.length === 0) {\n keys.push({\n pubkey: authority,\n isSigner: true,\n isWritable: false,\n });\n } else {\n keys.push({pubkey: authority, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a BurnChecked instruction\n *\n * @param programId SPL Token program account\n * @param mint Mint for the account\n * @param account Account to burn tokens from\n * @param owner Owner of the account\n * @param multiSigners Signing accounts if `authority` is a multiSig\n * @param amount amount to burn\n */\n static createBurnCheckedInstruction(\n programId: PublicKey,\n mint: PublicKey,\n account: PublicKey,\n owner: PublicKey,\n multiSigners: Array,\n amount: number | u64,\n decimals: number,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8('instruction'),\n Layout.uint64('amount'),\n BufferLayout.u8('decimals'),\n ]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 15, // BurnChecked instruction\n amount: new u64(amount).toBuffer(),\n decimals,\n },\n data,\n );\n\n let keys = [\n {pubkey: account, isSigner: false, isWritable: true},\n {pubkey: mint, isSigner: false, isWritable: true},\n ];\n if (multiSigners.length === 0) {\n keys.push({\n pubkey: owner,\n isSigner: true,\n isWritable: false,\n });\n } else {\n keys.push({pubkey: owner, isSigner: false, isWritable: false});\n multiSigners.forEach(signer =>\n keys.push({\n pubkey: signer.publicKey,\n isSigner: true,\n isWritable: false,\n }),\n );\n }\n\n return new TransactionInstruction({\n keys,\n programId: programId,\n data,\n });\n }\n\n /**\n * Construct a SyncNative instruction\n *\n * @param programId SPL Token program account\n * @param nativeAccount Account to sync lamports from\n */\n static createSyncNativeInstruction(\n programId: PublicKey,\n nativeAccount: PublicKey,\n ): TransactionInstruction {\n const dataLayout = BufferLayout.struct([BufferLayout.u8('instruction')]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 17, // SyncNative instruction\n },\n data,\n );\n\n let keys = [{pubkey: nativeAccount, isSigner: false, isWritable: true}];\n return new TransactionInstruction({keys, programId: programId, data});\n }\n\n /**\n * Get the address for the associated token account\n *\n * @param associatedProgramId SPL Associated Token program account\n * @param programId SPL Token program account\n * @param mint Token mint account\n * @param owner Owner of the new account\n * @return Public key of the associated token account\n */\n static async getAssociatedTokenAddress(\n associatedProgramId: PublicKey,\n programId: PublicKey,\n mint: PublicKey,\n owner: PublicKey,\n allowOwnerOffCurve: boolean = false,\n ): Promise {\n if (!allowOwnerOffCurve && !PublicKey.isOnCurve(owner.toBuffer())) {\n throw new Error(`Owner cannot sign: ${owner.toString()}`);\n }\n return (\n await PublicKey.findProgramAddress(\n [owner.toBuffer(), programId.toBuffer(), mint.toBuffer()],\n associatedProgramId,\n )\n )[0];\n }\n\n /**\n * Construct the AssociatedTokenProgram instruction to create the associated\n * token account\n *\n * @param associatedProgramId SPL Associated Token program account\n * @param programId SPL Token program account\n * @param mint Token mint account\n * @param associatedAccount New associated account\n * @param owner Owner of the new account\n * @param payer Payer of fees\n */\n static createAssociatedTokenAccountInstruction(\n associatedProgramId: PublicKey,\n programId: PublicKey,\n mint: PublicKey,\n associatedAccount: PublicKey,\n owner: PublicKey,\n payer: PublicKey,\n ): TransactionInstruction {\n const data = Buffer.alloc(0);\n\n let keys = [\n {pubkey: payer, isSigner: true, isWritable: true},\n {pubkey: associatedAccount, isSigner: false, isWritable: true},\n {pubkey: owner, isSigner: false, isWritable: false},\n {pubkey: mint, isSigner: false, isWritable: false},\n {pubkey: SystemProgram.programId, isSigner: false, isWritable: false},\n {pubkey: programId, isSigner: false, isWritable: false},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ];\n\n return new TransactionInstruction({\n keys,\n programId: associatedProgramId,\n data,\n });\n }\n}\n","\"use strict\";\nimport { arrayify, concat, hexConcat, hexlify } from \"@ethersproject/bytes\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nexport class Coder {\n constructor(name, type, localName, dynamic) {\n // @TODO: defineReadOnly these\n this.name = name;\n this.type = type;\n this.localName = localName;\n this.dynamic = dynamic;\n }\n _throwError(message, value) {\n logger.throwArgumentError(message, this.localName, value);\n }\n}\nexport class Writer {\n constructor(wordSize) {\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n this._data = [];\n this._dataLength = 0;\n this._padding = new Uint8Array(wordSize);\n }\n get data() {\n return hexConcat(this._data);\n }\n get length() { return this._dataLength; }\n _writeData(data) {\n this._data.push(data);\n this._dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this._writeData(concat(writer._data));\n }\n // Arrayish items; padded on the right to wordSize\n writeBytes(value) {\n let bytes = arrayify(value);\n const paddingOffset = bytes.length % this.wordSize;\n if (paddingOffset) {\n bytes = concat([bytes, this._padding.slice(paddingOffset)]);\n }\n return this._writeData(bytes);\n }\n _getValue(value) {\n let bytes = arrayify(BigNumber.from(value));\n if (bytes.length > this.wordSize) {\n logger.throwError(\"value out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this.wordSize,\n offset: bytes.length\n });\n }\n if (bytes.length % this.wordSize) {\n bytes = concat([this._padding.slice(bytes.length % this.wordSize), bytes]);\n }\n return bytes;\n }\n // BigNumberish items; padded on the left to wordSize\n writeValue(value) {\n return this._writeData(this._getValue(value));\n }\n writeUpdatableValue() {\n const offset = this._data.length;\n this._data.push(this._padding);\n this._dataLength += this.wordSize;\n return (value) => {\n this._data[offset] = this._getValue(value);\n };\n }\n}\nexport class Reader {\n constructor(data, wordSize, coerceFunc, allowLoose) {\n defineReadOnly(this, \"_data\", arrayify(data));\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n defineReadOnly(this, \"_coerceFunc\", coerceFunc);\n defineReadOnly(this, \"allowLoose\", allowLoose);\n this._offset = 0;\n }\n get data() { return hexlify(this._data); }\n get consumed() { return this._offset; }\n // The default Coerce function\n static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }\n coerce(name, value) {\n if (this._coerceFunc) {\n return this._coerceFunc(name, value);\n }\n return Reader.coerce(name, value);\n }\n _peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / this.wordSize) * this.wordSize;\n if (this._offset + alignedLength > this._data.length) {\n if (this.allowLoose && loose && this._offset + length <= this._data.length) {\n alignedLength = length;\n }\n else {\n logger.throwError(\"data out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this._data.length,\n offset: this._offset + alignedLength\n });\n }\n }\n return this._data.slice(this._offset, this._offset + alignedLength);\n }\n subReader(offset) {\n return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc, this.allowLoose);\n }\n readBytes(length, loose) {\n let bytes = this._peekBytes(0, length, !!loose);\n this._offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n readValue() {\n return BigNumber.from(this.readBytes(this.wordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { PublicKey, SystemProgram } from \"@solana/web3.js\";\nimport { importCoreWasm } from \"./wasm\";\nexport function getBridgeFeeIx(connection, bridgeAddress, payerAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var bridge, feeAccount, bridgeStatePK, bridgeStateAccountInfo, bridgeState, transferIx;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importCoreWasm()];\n case 1:\n bridge = _a.sent();\n return [4 /*yield*/, bridge.fee_collector_address(bridgeAddress)];\n case 2:\n feeAccount = _a.sent();\n bridgeStatePK = new PublicKey(bridge.state_address(bridgeAddress));\n return [4 /*yield*/, connection.getAccountInfo(bridgeStatePK)];\n case 3:\n bridgeStateAccountInfo = _a.sent();\n if ((bridgeStateAccountInfo === null || bridgeStateAccountInfo === void 0 ? void 0 : bridgeStateAccountInfo.data) === undefined) {\n throw new Error(\"bridge state not found\");\n }\n bridgeState = bridge.parse_state(new Uint8Array(bridgeStateAccountInfo === null || bridgeStateAccountInfo === void 0 ? void 0 : bridgeStateAccountInfo.data));\n transferIx = SystemProgram.transfer({\n fromPubkey: new PublicKey(payerAddress),\n toPubkey: new PublicKey(feeAccount),\n lamports: bridgeState.config.fee,\n });\n return [2 /*return*/, transferIx];\n }\n });\n });\n}\n","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n///////////////////////////////\nexport var UnicodeNormalizationForm;\n(function (UnicodeNormalizationForm) {\n UnicodeNormalizationForm[\"current\"] = \"\";\n UnicodeNormalizationForm[\"NFC\"] = \"NFC\";\n UnicodeNormalizationForm[\"NFD\"] = \"NFD\";\n UnicodeNormalizationForm[\"NFKC\"] = \"NFKC\";\n UnicodeNormalizationForm[\"NFKD\"] = \"NFKD\";\n})(UnicodeNormalizationForm || (UnicodeNormalizationForm = {}));\n;\nexport var Utf8ErrorReason;\n(function (Utf8ErrorReason) {\n // A continuation byte was present where there was nothing to continue\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"UNEXPECTED_CONTINUE\"] = \"unexpected continuation byte\";\n // An invalid (non-continuation) byte to start a UTF-8 codepoint was found\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"BAD_PREFIX\"] = \"bad codepoint prefix\";\n // The string is too short to process the expected codepoint\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"OVERRUN\"] = \"string overrun\";\n // A missing continuation byte was expected but not found\n // - offset = the index the continuation byte was expected at\n Utf8ErrorReason[\"MISSING_CONTINUE\"] = \"missing continuation byte\";\n // The computed code point is outside the range for UTF-8\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; outside the UTF-8 range\n Utf8ErrorReason[\"OUT_OF_RANGE\"] = \"out of UTF-8 range\";\n // UTF-8 strings may not contain UTF-16 surrogate pairs\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; inside the UTF-16 surrogate range\n Utf8ErrorReason[\"UTF16_SURROGATE\"] = \"UTF-16 surrogate\";\n // The string is an overlong representation\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; already bounds checked\n Utf8ErrorReason[\"OVERLONG\"] = \"overlong representation\";\n})(Utf8ErrorReason || (Utf8ErrorReason = {}));\n;\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n return logger.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === Utf8ErrorReason.BAD_PREFIX || reason === Utf8ErrorReason.UNEXPECTED_CONTINUE) {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === Utf8ErrorReason.OVERRUN) {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === Utf8ErrorReason.OVERLONG) {\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n// Common error handing strategies\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n bytes = arrayify(bytes);\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(Utf8ErrorReason.UNEXPECTED_CONTINUE, i - 1, bytes, result);\n }\n else {\n i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(Utf8ErrorReason.OVERRUN, i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(Utf8ErrorReason.MISSING_CONTINUE, i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(Utf8ErrorReason.OUT_OF_RANGE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(Utf8ErrorReason.UTF16_SURROGATE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(Utf8ErrorReason.OVERLONG, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\nexport function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {\n if (form != UnicodeNormalizationForm.current) {\n logger.checkNormalize();\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n if (i >= str.length || (c2 & 0xfc00) !== 0xdc00) {\n throw new Error(\"invalid utf-8 string\");\n }\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return arrayify(result);\n}\n;\nfunction escapeChar(value) {\n const hex = (\"0000\" + value.toString(16));\n return \"\\\\u\" + hex.substring(hex.length - 4);\n}\nexport function _toEscapedUtf8String(bytes, onError) {\n return '\"' + getUtf8CodePoints(bytes, onError).map((codePoint) => {\n if (codePoint < 256) {\n switch (codePoint) {\n case 8: return \"\\\\b\";\n case 9: return \"\\\\t\";\n case 10: return \"\\\\n\";\n case 13: return \"\\\\r\";\n case 34: return \"\\\\\\\"\";\n case 92: return \"\\\\\\\\\";\n }\n if (codePoint >= 32 && codePoint < 127) {\n return String.fromCharCode(codePoint);\n }\n }\n if (codePoint <= 0xffff) {\n return escapeChar(codePoint);\n }\n codePoint -= 0x10000;\n return escapeChar(((codePoint >> 10) & 0x3ff) + 0xd800) + escapeChar((codePoint & 0x3ff) + 0xdc00);\n }).join(\"\") + '\"';\n}\nexport function _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\nexport function toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import getPrototypeOf from \"./getPrototypeOf.js\";\nexport default function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}","import superPropBase from \"./superPropBase.js\";\nexport default function _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get.apply(this, arguments);\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\nconst _constructorGuard = {};\nlet ModifiersBytes = { calldata: true, memory: true, storage: true };\nlet ModifiersNest = { calldata: true, memory: true };\nfunction checkModifier(type, name) {\n if (type === \"bytes\" || type === \"string\") {\n if (ModifiersBytes[name]) {\n return true;\n }\n }\n else if (type === \"address\") {\n if (name === \"payable\") {\n return true;\n }\n }\n else if (type.indexOf(\"[\") >= 0 || type === \"tuple\") {\n if (ModifiersNest[name]) {\n return true;\n }\n }\n if (ModifiersBytes[name] || name === \"payable\") {\n logger.throwArgumentError(\"invalid modifier\", \"name\", name);\n }\n return false;\n}\n// @TODO: Make sure that children of an indexed tuple are marked with a null indexed\nfunction parseParamType(param, allowIndexed) {\n let originalParam = param;\n function throwError(i) {\n logger.throwArgumentError(`unexpected character at position ${i}`, \"param\", param);\n }\n param = param.replace(/\\s/g, \" \");\n function newNode(parent) {\n let node = { type: \"\", name: \"\", parent: parent, state: { allowType: true } };\n if (allowIndexed) {\n node.indexed = false;\n }\n return node;\n }\n let parent = { type: \"\", name: \"\", state: { allowType: true } };\n let node = parent;\n for (let i = 0; i < param.length; i++) {\n let c = param[i];\n switch (c) {\n case \"(\":\n if (node.state.allowType && node.type === \"\") {\n node.type = \"tuple\";\n }\n else if (!node.state.allowParams) {\n throwError(i);\n }\n node.state.allowType = false;\n node.type = verifyType(node.type);\n node.components = [newNode(node)];\n node = node.components[0];\n break;\n case \")\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let child = node;\n node = node.parent;\n if (!node) {\n throwError(i);\n }\n delete child.parent;\n node.state.allowParams = false;\n node.state.allowName = true;\n node.state.allowArray = true;\n break;\n case \",\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let sibling = newNode(node.parent);\n //{ type: \"\", name: \"\", parent: node.parent, state: { allowType: true } };\n node.parent.components.push(sibling);\n delete node.parent;\n node = sibling;\n break;\n // Hit a space...\n case \" \":\n // If reading type, the type is done and may read a param or name\n if (node.state.allowType) {\n if (node.type !== \"\") {\n node.type = verifyType(node.type);\n delete node.state.allowType;\n node.state.allowName = true;\n node.state.allowParams = true;\n }\n }\n // If reading name, the name is done\n if (node.state.allowName) {\n if (node.name !== \"\") {\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n if (node.indexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n else {\n node.state.allowName = false;\n }\n }\n }\n break;\n case \"[\":\n if (!node.state.allowArray) {\n throwError(i);\n }\n node.type += c;\n node.state.allowArray = false;\n node.state.allowName = false;\n node.state.readArray = true;\n break;\n case \"]\":\n if (!node.state.readArray) {\n throwError(i);\n }\n node.type += c;\n node.state.readArray = false;\n node.state.allowArray = true;\n node.state.allowName = true;\n break;\n default:\n if (node.state.allowType) {\n node.type += c;\n node.state.allowParams = true;\n node.state.allowArray = true;\n }\n else if (node.state.allowName) {\n node.name += c;\n delete node.state.allowArray;\n }\n else if (node.state.readArray) {\n node.type += c;\n }\n else {\n throwError(i);\n }\n }\n }\n if (node.parent) {\n logger.throwArgumentError(\"unexpected eof\", \"param\", param);\n }\n delete parent.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(originalParam.length - 7);\n }\n if (node.indexed) {\n throwError(originalParam.length - 7);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n parent.type = verifyType(parent.type);\n return parent;\n}\nfunction populate(object, params) {\n for (let key in params) {\n defineReadOnly(object, key, params[key]);\n }\n}\nexport const FormatTypes = Object.freeze({\n // Bare formatting, as is needed for computing a sighash of an event or function\n sighash: \"sighash\",\n // Human-Readable with Minimal spacing and without names (compact human-readable)\n minimal: \"minimal\",\n // Human-Readable with nice spacing, including all names\n full: \"full\",\n // JSON-format a la Solidity\n json: \"json\"\n});\nconst paramTypeArray = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nexport class ParamType {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use fromString\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new ParamType()\"\n });\n }\n populate(this, params);\n let match = this.type.match(paramTypeArray);\n if (match) {\n populate(this, {\n arrayLength: parseInt(match[2] || \"-1\"),\n arrayChildren: ParamType.fromObject({\n type: match[1],\n components: this.components\n }),\n baseType: \"array\"\n });\n }\n else {\n populate(this, {\n arrayLength: null,\n arrayChildren: null,\n baseType: ((this.components != null) ? \"tuple\" : this.type)\n });\n }\n this._isParamType = true;\n Object.freeze(this);\n }\n // Format the parameter fragment\n // - sighash: \"(uint256,address)\"\n // - minimal: \"tuple(uint256,address) indexed\"\n // - full: \"tuple(uint256 foo, address bar) indexed baz\"\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n let result = {\n type: ((this.baseType === \"tuple\") ? \"tuple\" : this.type),\n name: (this.name || undefined)\n };\n if (typeof (this.indexed) === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.components) {\n result.components = this.components.map((comp) => JSON.parse(comp.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.baseType === \"array\") {\n result += this.arrayChildren.format(format);\n result += \"[\" + (this.arrayLength < 0 ? \"\" : String(this.arrayLength)) + \"]\";\n }\n else {\n if (this.baseType === \"tuple\") {\n if (format !== FormatTypes.sighash) {\n result += this.type;\n }\n result += \"(\" + this.components.map((comp) => comp.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== FormatTypes.sighash) {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === FormatTypes.full && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n static from(value, allowIndexed) {\n if (typeof (value) === \"string\") {\n return ParamType.fromString(value, allowIndexed);\n }\n return ParamType.fromObject(value);\n }\n static fromObject(value) {\n if (ParamType.isParamType(value)) {\n return value;\n }\n return new ParamType(_constructorGuard, {\n name: (value.name || null),\n type: verifyType(value.type),\n indexed: ((value.indexed == null) ? null : !!value.indexed),\n components: (value.components ? value.components.map(ParamType.fromObject) : null)\n });\n }\n static fromString(value, allowIndexed) {\n function ParamTypify(node) {\n return ParamType.fromObject({\n name: node.name,\n type: node.type,\n indexed: node.indexed,\n components: node.components\n });\n }\n return ParamTypify(parseParamType(value, !!allowIndexed));\n }\n static isParamType(value) {\n return !!(value != null && value._isParamType);\n }\n}\n;\nfunction parseParams(value, allowIndex) {\n return splitNesting(value).map((param) => ParamType.fromString(param, allowIndex));\n}\nexport class Fragment {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use a static from method\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new Fragment()\"\n });\n }\n populate(this, params);\n this._isFragment = true;\n Object.freeze(this);\n }\n static from(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n if (typeof (value) === \"string\") {\n return Fragment.fromString(value);\n }\n return Fragment.fromObject(value);\n }\n static fromObject(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n switch (value.type) {\n case \"function\":\n return FunctionFragment.fromObject(value);\n case \"event\":\n return EventFragment.fromObject(value);\n case \"constructor\":\n return ConstructorFragment.fromObject(value);\n case \"error\":\n return ErrorFragment.fromObject(value);\n case \"fallback\":\n case \"receive\":\n // @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?\n return null;\n }\n return logger.throwArgumentError(\"invalid fragment object\", \"value\", value);\n }\n static fromString(value) {\n // Make sure the \"returns\" is surrounded by a space and all whitespace is exactly one space\n value = value.replace(/\\s/g, \" \");\n value = value.replace(/\\(/g, \" (\").replace(/\\)/g, \") \").replace(/\\s+/g, \" \");\n value = value.trim();\n if (value.split(\" \")[0] === \"event\") {\n return EventFragment.fromString(value.substring(5).trim());\n }\n else if (value.split(\" \")[0] === \"function\") {\n return FunctionFragment.fromString(value.substring(8).trim());\n }\n else if (value.split(\"(\")[0].trim() === \"constructor\") {\n return ConstructorFragment.fromString(value.trim());\n }\n else if (value.split(\" \")[0] === \"error\") {\n return ErrorFragment.fromString(value.substring(5).trim());\n }\n return logger.throwArgumentError(\"unsupported fragment\", \"value\", value);\n }\n static isFragment(value) {\n return !!(value && value._isFragment);\n }\n}\nexport class EventFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"event \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.anonymous) {\n result += \"anonymous \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return EventFragment.fromString(value);\n }\n return EventFragment.fromObject(value);\n }\n static fromObject(value) {\n if (EventFragment.isEventFragment(value)) {\n return value;\n }\n if (value.type !== \"event\") {\n logger.throwArgumentError(\"invalid event object\", \"value\", value);\n }\n const params = {\n name: verifyIdentifier(value.name),\n anonymous: value.anonymous,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n type: \"event\"\n };\n return new EventFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let match = value.match(regexParen);\n if (!match) {\n logger.throwArgumentError(\"invalid event string\", \"value\", value);\n }\n let anonymous = false;\n match[3].split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"anonymous\":\n anonymous = true;\n break;\n case \"\":\n break;\n default:\n logger.warn(\"unknown modifier: \" + modifier);\n }\n });\n return EventFragment.fromObject({\n name: match[1].trim(),\n anonymous: anonymous,\n inputs: parseParams(match[2], true),\n type: \"event\"\n });\n }\n static isEventFragment(value) {\n return (value && value._isFragment && value.type === \"event\");\n }\n}\nfunction parseGas(value, params) {\n params.gas = null;\n let comps = value.split(\"@\");\n if (comps.length !== 1) {\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid human-readable ABI signature\", \"value\", value);\n }\n if (!comps[1].match(/^[0-9]+$/)) {\n logger.throwArgumentError(\"invalid human-readable ABI signature gas\", \"value\", value);\n }\n params.gas = BigNumber.from(comps[1]);\n return comps[0];\n }\n return value;\n}\nfunction parseModifiers(value, params) {\n params.constant = false;\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n value.split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"constant\":\n params.constant = true;\n break;\n case \"payable\":\n params.payable = true;\n params.stateMutability = \"payable\";\n break;\n case \"nonpayable\":\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n break;\n case \"pure\":\n params.constant = true;\n params.stateMutability = \"pure\";\n break;\n case \"view\":\n params.constant = true;\n params.stateMutability = \"view\";\n break;\n case \"external\":\n case \"public\":\n case \"\":\n break;\n default:\n console.log(\"unknown modifier: \" + modifier);\n }\n });\n}\nfunction verifyState(value) {\n let result = {\n constant: false,\n payable: true,\n stateMutability: \"payable\"\n };\n if (value.stateMutability != null) {\n result.stateMutability = value.stateMutability;\n // Set (and check things are consistent) the constant property\n result.constant = (result.stateMutability === \"view\" || result.stateMutability === \"pure\");\n if (value.constant != null) {\n if ((!!value.constant) !== result.constant) {\n logger.throwArgumentError(\"cannot have constant function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n // Set (and check things are consistent) the payable property\n result.payable = (result.stateMutability === \"payable\");\n if (value.payable != null) {\n if ((!!value.payable) !== result.payable) {\n logger.throwArgumentError(\"cannot have payable function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n }\n else if (value.payable != null) {\n result.payable = !!value.payable;\n // If payable we can assume non-constant; otherwise we can't assume\n if (value.constant == null && !result.payable && value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n result.constant = !!value.constant;\n if (result.constant) {\n result.stateMutability = \"view\";\n }\n else {\n result.stateMutability = (result.payable ? \"payable\" : \"nonpayable\");\n }\n if (result.payable && result.constant) {\n logger.throwArgumentError(\"cannot have constant payable function\", \"value\", value);\n }\n }\n else if (value.constant != null) {\n result.constant = !!value.constant;\n result.payable = !result.constant;\n result.stateMutability = (result.constant ? \"view\" : \"payable\");\n }\n else if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n return result;\n}\nexport class ConstructorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n if (format === FormatTypes.sighash) {\n logger.throwError(\"cannot format a constructor for sighash\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"format(sighash)\"\n });\n }\n let result = \"constructor(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (this.stateMutability && this.stateMutability !== \"nonpayable\") {\n result += this.stateMutability + \" \";\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ConstructorFragment.fromString(value);\n }\n return ConstructorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ConstructorFragment.isConstructorFragment(value)) {\n return value;\n }\n if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor object\", \"value\", value);\n }\n let state = verifyState(value);\n if (state.constant) {\n logger.throwArgumentError(\"constructor cannot be constant\", \"value\", value);\n }\n const params = {\n name: null,\n type: value.type,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new ConstructorFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"constructor\" };\n value = parseGas(value, params);\n let parens = value.match(regexParen);\n if (!parens || parens[1].trim() !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor string\", \"value\", value);\n }\n params.inputs = parseParams(parens[2].trim(), false);\n parseModifiers(parens[3].trim(), params);\n return ConstructorFragment.fromObject(params);\n }\n static isConstructorFragment(value) {\n return (value && value._isFragment && value.type === \"constructor\");\n }\n}\nexport class FunctionFragment extends ConstructorFragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n outputs: this.outputs.map((output) => JSON.parse(output.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"function \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.stateMutability) {\n if (this.stateMutability !== \"nonpayable\") {\n result += (this.stateMutability + \" \");\n }\n }\n else if (this.constant) {\n result += \"view \";\n }\n if (this.outputs && this.outputs.length) {\n result += \"returns (\" + this.outputs.map((output) => output.format(format)).join(\", \") + \") \";\n }\n if (this.gas != null) {\n result += \"@\" + this.gas.toString() + \" \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return FunctionFragment.fromString(value);\n }\n return FunctionFragment.fromObject(value);\n }\n static fromObject(value) {\n if (FunctionFragment.isFunctionFragment(value)) {\n return value;\n }\n if (value.type !== \"function\") {\n logger.throwArgumentError(\"invalid function object\", \"value\", value);\n }\n let state = verifyState(value);\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n constant: state.constant,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n outputs: (value.outputs ? value.outputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new FunctionFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"function\" };\n value = parseGas(value, params);\n let comps = value.split(\" returns \");\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid function string\", \"value\", value);\n }\n let parens = comps[0].match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid function signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n parseModifiers(parens[3].trim(), params);\n // We have outputs\n if (comps.length > 1) {\n let returns = comps[1].match(regexParen);\n if (returns[1].trim() != \"\" || returns[3].trim() != \"\") {\n logger.throwArgumentError(\"unexpected tokens\", \"value\", value);\n }\n params.outputs = parseParams(returns[2], false);\n }\n else {\n params.outputs = [];\n }\n return FunctionFragment.fromObject(params);\n }\n static isFunctionFragment(value) {\n return (value && value._isFragment && value.type === \"function\");\n }\n}\n//export class StructFragment extends Fragment {\n//}\nfunction checkForbidden(fragment) {\n const sig = fragment.format();\n if (sig === \"Error(string)\" || sig === \"Panic(uint256)\") {\n logger.throwArgumentError(`cannot specify user defined ${sig} error`, \"fragment\", fragment);\n }\n return fragment;\n}\nexport class ErrorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"error \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ErrorFragment.fromString(value);\n }\n return ErrorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ErrorFragment.isErrorFragment(value)) {\n return value;\n }\n if (value.type !== \"error\") {\n logger.throwArgumentError(\"invalid error object\", \"value\", value);\n }\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : [])\n };\n return checkForbidden(new ErrorFragment(_constructorGuard, params));\n }\n static fromString(value) {\n let params = { type: \"error\" };\n let parens = value.match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid error signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n return checkForbidden(ErrorFragment.fromObject(params));\n }\n static isErrorFragment(value) {\n return (value && value._isFragment && value.type === \"error\");\n }\n}\nfunction verifyType(type) {\n // These need to be transformed to their full description\n if (type.match(/^uint($|[^1-9])/)) {\n type = \"uint256\" + type.substring(4);\n }\n else if (type.match(/^int($|[^1-9])/)) {\n type = \"int256\" + type.substring(3);\n }\n // @TODO: more verification\n return type;\n}\n// See: https://github.com/ethereum/solidity/blob/1f8f1a3db93a548d0555e3e14cfc55a10e25b60e/docs/grammar/SolidityLexer.g4#L234\nconst regexIdentifier = new RegExp(\"^[a-zA-Z$_][a-zA-Z0-9$_]*$\");\nfunction verifyIdentifier(value) {\n if (!value || !value.match(regexIdentifier)) {\n logger.throwArgumentError(`invalid identifier \"${value}\"`, \"value\", value);\n }\n return value;\n}\nconst regexParen = new RegExp(\"^([^)(]*)\\\\((.*)\\\\)([^)(]*)$\");\nfunction splitNesting(value) {\n value = value.trim();\n let result = [];\n let accum = \"\";\n let depth = 0;\n for (let offset = 0; offset < value.length; offset++) {\n let c = value[offset];\n if (c === \",\" && depth === 0) {\n result.push(accum);\n accum = \"\";\n }\n else {\n accum += c;\n if (c === \"(\") {\n depth++;\n }\n else if (c === \")\") {\n depth--;\n if (depth === -1) {\n logger.throwArgumentError(\"unbalanced parenthesis\", \"value\", value);\n }\n }\n }\n }\n if (accum) {\n result.push(accum);\n }\n return result;\n}\n//# sourceMappingURL=fragments.js.map","import { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@material-ui/utils\";\n\n/* eslint-disable no-use-before-define */\n\n/**\n * Returns a number whose value is limited to the given range.\n *\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clamp(value) {\n var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(\"Material-UI: The value provided \".concat(value, \" is out of range [\").concat(min, \", \").concat(max, \"].\"));\n }\n }\n\n return Math.min(Math.max(min, value), max);\n}\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n *\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\n\n\nexport function hexToRgb(color) {\n color = color.substr(1);\n var re = new RegExp(\".{1,\".concat(color.length >= 6 ? 2 : 1, \"}\"), 'g');\n var colors = color.match(re);\n\n if (colors && colors[0].length === 1) {\n colors = colors.map(function (n) {\n return n + n;\n });\n }\n\n return colors ? \"rgb\".concat(colors.length === 4 ? 'a' : '', \"(\").concat(colors.map(function (n, index) {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', '), \")\") : '';\n}\n\nfunction intToHex(int) {\n var hex = int.toString(16);\n return hex.length === 1 ? \"0\".concat(hex) : hex;\n}\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n *\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\n\n\nexport function rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n\n var _decomposeColor = decomposeColor(color),\n values = _decomposeColor.values;\n\n return \"#\".concat(values.map(function (n) {\n return intToHex(n);\n }).join(''));\n}\n/**\n * Converts a color from hsl format to rgb format.\n *\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\n\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n var _color = color,\n values = _color.values;\n var h = values[0];\n var s = values[1] / 100;\n var l = values[2] / 100;\n var a = s * Math.min(l, 1 - l);\n\n var f = function f(n) {\n var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;\n return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n };\n\n var type = 'rgb';\n var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n\n return recomposeColor({\n type: type,\n values: rgb\n });\n}\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\n\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n\n var marker = color.indexOf('(');\n var type = color.substring(0, marker);\n\n if (['rgb', 'rgba', 'hsl', 'hsla'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? \"Material-UI: Unsupported `\".concat(color, \"` color.\\nWe support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla().\") : _formatMuiErrorMessage(3, color));\n }\n\n var values = color.substring(marker + 1, color.length - 1).split(',');\n values = values.map(function (value) {\n return parseFloat(value);\n });\n return {\n type: type,\n values: values\n };\n}\n/**\n * Converts a color object with type and values to a string.\n *\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\n\nexport function recomposeColor(color) {\n var type = color.type;\n var values = color.values;\n\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map(function (n, i) {\n return i < 3 ? parseInt(n, 10) : n;\n });\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = \"\".concat(values[1], \"%\");\n values[2] = \"\".concat(values[2], \"%\");\n }\n\n return \"\".concat(type, \"(\").concat(values.join(', '), \")\");\n}\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n *\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\n\nexport function getContrastRatio(foreground, background) {\n var lumA = getLuminance(foreground);\n var lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\n\nexport function getLuminance(color) {\n color = decomposeColor(color);\n var rgb = color.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(function (val) {\n val /= 255; // normalized\n\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n }); // Truncate at 3 digits\n\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function emphasize(color) {\n var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nvar warnedOnce = false;\n/**\n * Set the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} value - value to set the alpha channel to in the range 0 -1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n *\n * @deprecated\n * Use `import { alpha } from '@material-ui/core/styles'` instead.\n */\n\nexport function fade(color, value) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['Material-UI: The `fade` color utility was renamed to `alpha` to better describe its functionality.', '', \"You should use `import { alpha } from '@material-ui/core/styles'`\"].join('\\n'));\n }\n }\n\n return alpha(color, value);\n}\n/**\n * Set the absolute transparency of a color.\n * Any existing alpha value is overwritten.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} value - value to set the alpha channel to in the range 0-1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function alpha(color, value) {\n color = decomposeColor(color);\n value = clamp(value);\n\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n\n color.values[3] = value;\n return recomposeColor(color);\n}\n/**\n * Darkens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (var i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n\n return recomposeColor(color);\n}\n/**\n * Lightens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (var i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n }\n\n return recomposeColor(color);\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { arrayify } from \"@ethersproject/bytes\";\nexport function getUrl(href, options) {\n return __awaiter(this, void 0, void 0, function* () {\n if (options == null) {\n options = {};\n }\n const request = {\n method: (options.method || \"GET\"),\n headers: (options.headers || {}),\n body: (options.body || undefined),\n };\n if (options.skipFetchSetup !== true) {\n request.mode = \"cors\"; // no-cors, cors, *same-origin\n request.cache = \"no-cache\"; // *default, no-cache, reload, force-cache, only-if-cached\n request.credentials = \"same-origin\"; // include, *same-origin, omit\n request.redirect = \"follow\"; // manual, *follow, error\n request.referrer = \"client\"; // no-referrer, *client\n }\n ;\n const response = yield fetch(href, request);\n const body = yield response.arrayBuffer();\n const headers = {};\n if (response.headers.forEach) {\n response.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n }\n else {\n ((response.headers).keys)().forEach((key) => {\n headers[key.toLowerCase()] = response.headers.get(key);\n });\n }\n return {\n headers: headers,\n statusCode: response.status,\n statusMessage: response.statusText,\n body: arrayify(new Uint8Array(body)),\n };\n });\n}\n//# sourceMappingURL=geturl.js.map","var hash = exports;\n\nhash.utils = require('./hash/utils');\nhash.common = require('./hash/common');\nhash.sha = require('./hash/sha');\nhash.ripemd = require('./hash/ripemd');\nhash.hmac = require('./hash/hmac');\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DecProto = exports.IntProto = exports.DecCoin = exports.Coin = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"cosmos.base.v1beta1\";\nconst baseCoin = { denom: \"\", amount: \"\" };\nexports.Coin = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.denom !== \"\") {\n writer.uint32(10).string(message.denom);\n }\n if (message.amount !== \"\") {\n writer.uint32(18).string(message.amount);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCoin);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.denom = reader.string();\n break;\n case 2:\n message.amount = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCoin);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = String(object.denom);\n }\n else {\n message.denom = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = String(object.amount);\n }\n else {\n message.amount = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.denom !== undefined && (obj.denom = message.denom);\n message.amount !== undefined && (obj.amount = message.amount);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCoin);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = object.denom;\n }\n else {\n message.denom = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = object.amount;\n }\n else {\n message.amount = \"\";\n }\n return message;\n },\n};\nconst baseDecCoin = { denom: \"\", amount: \"\" };\nexports.DecCoin = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.denom !== \"\") {\n writer.uint32(10).string(message.denom);\n }\n if (message.amount !== \"\") {\n writer.uint32(18).string(message.amount);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDecCoin);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.denom = reader.string();\n break;\n case 2:\n message.amount = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDecCoin);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = String(object.denom);\n }\n else {\n message.denom = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = String(object.amount);\n }\n else {\n message.amount = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.denom !== undefined && (obj.denom = message.denom);\n message.amount !== undefined && (obj.amount = message.amount);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDecCoin);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = object.denom;\n }\n else {\n message.denom = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = object.amount;\n }\n else {\n message.amount = \"\";\n }\n return message;\n },\n};\nconst baseIntProto = { int: \"\" };\nexports.IntProto = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.int !== \"\") {\n writer.uint32(10).string(message.int);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseIntProto);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.int = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseIntProto);\n if (object.int !== undefined && object.int !== null) {\n message.int = String(object.int);\n }\n else {\n message.int = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.int !== undefined && (obj.int = message.int);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseIntProto);\n if (object.int !== undefined && object.int !== null) {\n message.int = object.int;\n }\n else {\n message.int = \"\";\n }\n return message;\n },\n};\nconst baseDecProto = { dec: \"\" };\nexports.DecProto = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.dec !== \"\") {\n writer.uint32(10).string(message.dec);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDecProto);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.dec = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDecProto);\n if (object.dec !== undefined && object.dec !== null) {\n message.dec = String(object.dec);\n }\n else {\n message.dec = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.dec !== undefined && (obj.dec = message.dec);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDecProto);\n if (object.dec !== undefined && object.dec !== null) {\n message.dec = object.dec;\n }\n else {\n message.dec = \"\";\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=coin.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Coins = void 0;\nvar Coin_1 = require(\"./Coin\");\nvar json_1 = require(\"../util/json\");\n/**\n * Analagous to `sdk.Coins` and `sdk.DecCoins` from Cosmos-SDK, and represents a collection\n * of [[Coin]] objects.\n *\n */\nvar Coins = /** @class */ (function (_super) {\n __extends(Coins, _super);\n /**\n * @param arg coins to input\n */\n function Coins(arg) {\n if (arg === void 0) { arg = {}; }\n var _this = _super.call(this) || this;\n if (arg instanceof Coins) {\n _this._coins = __assign({}, arg._coins);\n }\n else if (typeof arg === 'string') {\n _this._coins = Coins.fromString(arg)._coins;\n }\n else {\n _this._coins = {};\n var coins_2;\n if (!Array.isArray(arg)) {\n coins_2 = [];\n Object.keys(arg).forEach(function (denom) {\n return coins_2.push(new Coin_1.Coin(denom, arg[denom]));\n });\n }\n else {\n coins_2 = arg;\n }\n for (var _i = 0, coins_1 = coins_2; _i < coins_1.length; _i++) {\n var coin = coins_1[_i];\n var denom = coin.denom;\n var x = _this._coins[denom];\n if (x !== undefined) {\n _this._coins[denom] = x.add(coin);\n }\n else {\n _this._coins[denom] = coin;\n }\n }\n // convert all coins to Dec if one is Dec\n if (!_this.toArray().every(function (c) { return c.isIntCoin(); })) {\n for (var _a = 0, _b = Object.keys(_this._coins); _a < _b.length; _a++) {\n var denom = _b[_a];\n _this._coins[denom] = _this._coins[denom].toDecCoin();\n }\n }\n }\n return _this;\n }\n // implement iterator interface for interop\n Coins.prototype[Symbol.iterator] = function () {\n var index = -1;\n var data = this.toArray();\n return {\n next: function () { return ({\n value: data[++index],\n done: (index === data.length),\n }); },\n };\n };\n /**\n * Converts the Coins information to a comma-separated list.\n *\n * Eg: `15000ukrw,12000uluna`\n */\n Coins.prototype.toString = function () {\n return this.toArray()\n .map(function (c) { return c.toString(); })\n .join(',');\n };\n /**\n * Converts a comma-separated list of coins to a Coins object\n *\n * Eg. `1500ukrw,12302uluna`\n *\n * @param str comma-separated list of coins\n */\n Coins.fromString = function (str) {\n var coin_strings = str.split(/,\\s*/);\n var coins = coin_strings.map(function (s) { return Coin_1.Coin.fromString(s); });\n return new Coins(coins);\n };\n /**\n * Gets the list of denominations\n */\n Coins.prototype.denoms = function () {\n return this.map(function (c) { return c.denom; });\n };\n /**\n * Creates a new Coins object with all Decimal coins\n */\n Coins.prototype.toDecCoins = function () {\n return new Coins(this.map(function (c) { return c.toDecCoin(); }));\n };\n /**\n * Creates a new Coins object with all Integer coins\n */\n Coins.prototype.toIntCoins = function () {\n return new Coins(this.map(function (c) { return c.toIntCoin(); }));\n };\n /**\n * Creates a new Coins object with all Integer coins with ceiling the amount\n */\n Coins.prototype.toIntCeilCoins = function () {\n return new Coins(this.map(function (c) { return c.toIntCeilCoin(); }));\n };\n /**\n * Gets the Coin for denomination if it exists in the collection.\n * @param denom denomination to lookup\n */\n Coins.prototype.get = function (denom) {\n return this._coins[denom];\n };\n /**\n * Sets the Coin value for a denomination.\n * @param denom denomination to set\n * @param value value to set\n */\n Coins.prototype.set = function (denom, value) {\n var val;\n if (value instanceof Coin_1.Coin) {\n if (value.denom != denom) {\n throw new Error(\"Denoms must match when setting: \" + denom + \", \" + value.denom);\n }\n val = value;\n }\n else {\n val = new Coin_1.Coin(denom, value);\n }\n this._coins[denom] = val;\n };\n /**\n * Gets the individual elements of the collection.\n */\n Coins.prototype.toArray = function () {\n return Object.values(this._coins).sort(function (a, b) {\n return a.denom.localeCompare(b.denom);\n });\n };\n /**\n * Adds a value from the elements of the collection. Coins of a similar denomination\n * will be clobbered into one value containing their sum.\n * @param other\n */\n Coins.prototype.add = function (other) {\n if (other instanceof Coin_1.Coin) {\n return new Coins(__spreadArray([other], Object.values(this._coins), true));\n }\n else {\n return new Coins(__spreadArray(__spreadArray([], Object.values(other._coins), true), Object.values(this._coins), true));\n }\n };\n /**\n * Subtracts a value from the elements of the collection.\n * @param other\n */\n Coins.prototype.sub = function (other) {\n return this.add(other.mul(-1));\n };\n /**\n * Multiplies the elements of the collection by a value.\n * @param other\n */\n Coins.prototype.mul = function (other) {\n return new Coins(this.map(function (c) { return c.mul(other); }));\n };\n /**\n * Divides the elements of the collection by a value.\n * @param other\n */\n Coins.prototype.div = function (other) {\n return new Coins(this.map(function (c) { return c.div(other); }));\n };\n /**\n * Modulos the elements of the collection with a value.\n * @param other\n */\n Coins.prototype.mod = function (other) {\n return new Coins(this.map(function (c) { return c.mod(other); }));\n };\n /**\n * Map a value onto the elements of the Coin collection.\n * @param fn\n */\n Coins.prototype.map = function (fn) {\n return this.toArray().map(fn);\n };\n /**\n * Filters out the Coin objects that don't match the predicate\n * @param fn predicate\n */\n Coins.prototype.filter = function (fn) {\n return new Coins(this.toArray().filter(fn));\n };\n Coins.fromAmino = function (data) {\n return new Coins((data !== null && data !== void 0 ? data : []).map(Coin_1.Coin.fromAmino));\n };\n Coins.prototype.toAmino = function () {\n return this.toArray().map(function (c) { return c.toAmino(); });\n };\n Coins.fromData = function (data) {\n return new Coins((data !== null && data !== void 0 ? data : []).map(Coin_1.Coin.fromData));\n };\n Coins.prototype.toData = function () {\n return this.toArray().map(function (c) { return c.toData(); });\n };\n Coins.fromProto = function (data) {\n return new Coins((data !== null && data !== void 0 ? data : []).map(Coin_1.Coin.fromProto));\n };\n Coins.prototype.toProto = function () {\n return this.toArray().map(function (c) { return c.toProto(); });\n };\n return Coins;\n}(json_1.JSONSerializable));\nexports.Coins = Coins;\n//# sourceMappingURL=Coins.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseAPI = void 0;\nvar BaseAPI = /** @class */ (function () {\n function BaseAPI(c) {\n this.c = c;\n }\n return BaseAPI;\n}());\nexports.BaseAPI = BaseAPI;\n//# sourceMappingURL=BaseAPI.js.map","import { useTheme as useThemeWithoutDefault } from '@material-ui/styles';\nimport React from 'react';\nimport defaultTheme from './defaultTheme';\nexport default function useTheme() {\n var theme = useThemeWithoutDefault() || defaultTheme;\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n\n return theme;\n}","\"use strict\";\n/**\n * Returns a Promise that resolves to the value of window.ethereum if it is\n * set within the given timeout, or null.\n * The Promise will not reject, but an error will be thrown if invalid options\n * are provided.\n *\n * @param options - Options bag.\n * @param options.mustBeMetaMask - Whether to only look for MetaMask providers.\n * Default: false\n * @param options.silent - Whether to silence console errors. Does not affect\n * thrown errors. Default: false\n * @param options.timeout - Milliseconds to wait for 'ethereum#initialized' to\n * be dispatched. Default: 3000\n * @returns A Promise that resolves with the Provider if it is detected within\n * given timeout, otherwise null.\n */\nfunction detectEthereumProvider({ mustBeMetaMask = false, silent = false, timeout = 3000, } = {}) {\n _validateInputs();\n let handled = false;\n return new Promise((resolve) => {\n if (window.ethereum) {\n handleEthereum();\n }\n else {\n window.addEventListener('ethereum#initialized', handleEthereum, { once: true });\n setTimeout(() => {\n handleEthereum();\n }, timeout);\n }\n function handleEthereum() {\n if (handled) {\n return;\n }\n handled = true;\n window.removeEventListener('ethereum#initialized', handleEthereum);\n const { ethereum } = window;\n if (ethereum && (!mustBeMetaMask || ethereum.isMetaMask)) {\n resolve(ethereum);\n }\n else {\n const message = mustBeMetaMask && ethereum\n ? 'Non-MetaMask window.ethereum detected.'\n : 'Unable to detect window.ethereum.';\n !silent && console.error('@metamask/detect-provider:', message);\n resolve(null);\n }\n }\n });\n function _validateInputs() {\n if (typeof mustBeMetaMask !== 'boolean') {\n throw new Error(`@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.`);\n }\n if (typeof silent !== 'boolean') {\n throw new Error(`@metamask/detect-provider: Expected option 'silent' to be a boolean.`);\n }\n if (typeof timeout !== 'number') {\n throw new Error(`@metamask/detect-provider: Expected option 'timeout' to be a number.`);\n }\n }\n}\nmodule.exports = detectEthereumProvider;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQVlBOzs7Ozs7Ozs7Ozs7Ozs7R0FlRztBQUNILFNBQVMsc0JBQXNCLENBQUMsRUFDOUIsY0FBYyxHQUFHLEtBQUssRUFDdEIsTUFBTSxHQUFHLEtBQUssRUFDZCxPQUFPLEdBQUcsSUFBSSxHQUNmLEdBQUcsRUFBRTtJQUVKLGVBQWUsRUFBRSxDQUFDO0lBRWxCLElBQUksT0FBTyxHQUFHLEtBQUssQ0FBQztJQUVwQixPQUFPLElBQUksT0FBTyxDQUFDLENBQUMsT0FBTyxFQUFFLEVBQUU7UUFDN0IsSUFBSSxNQUFNLENBQUMsUUFBUSxFQUFFO1lBRW5CLGNBQWMsRUFBRSxDQUFDO1NBRWxCO2FBQU07WUFFTCxNQUFNLENBQUMsZ0JBQWdCLENBQ3JCLHNCQUFzQixFQUN0QixjQUFjLEVBQ2QsRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLENBQ2YsQ0FBQztZQUVGLFVBQVUsQ0FBQyxHQUFHLEVBQUU7Z0JBQ2QsY0FBYyxFQUFFLENBQUM7WUFDbkIsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxDQUFDO1NBQ2I7UUFFRCxTQUFTLGNBQWM7WUFFckIsSUFBSSxPQUFPLEVBQUU7Z0JBQ1gsT0FBTzthQUNSO1lBQ0QsT0FBTyxHQUFHLElBQUksQ0FBQztZQUVmLE1BQU0sQ0FBQyxtQkFBbUIsQ0FBQyxzQkFBc0IsRUFBRSxjQUFjLENBQUMsQ0FBQztZQUVuRSxNQUFNLEVBQUUsUUFBUSxFQUFFLEdBQUcsTUFBTSxDQUFDO1lBRTVCLElBQUksUUFBUSxJQUFJLENBQUMsQ0FBQyxjQUFjLElBQUksUUFBUSxDQUFDLFVBQVUsQ0FBQyxFQUFFO2dCQUN4RCxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7YUFDbkI7aUJBQU07Z0JBRUwsTUFBTSxPQUFPLEdBQUcsY0FBYyxJQUFJLFFBQVE7b0JBQ3hDLENBQUMsQ0FBQyx3Q0FBd0M7b0JBQzFDLENBQUMsQ0FBQyxtQ0FBbUMsQ0FBQztnQkFFeEMsQ0FBQyxNQUFNLElBQUksT0FBTyxDQUFDLEtBQUssQ0FBQyw0QkFBNEIsRUFBRSxPQUFPLENBQUMsQ0FBQztnQkFDaEUsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ2Y7UUFDSCxDQUFDO0lBQ0gsQ0FBQyxDQUFDLENBQUM7SUFFSCxTQUFTLGVBQWU7UUFDdEIsSUFBSSxPQUFPLGNBQWMsS0FBSyxTQUFTLEVBQUU7WUFDdkMsTUFBTSxJQUFJLEtBQUssQ0FBQyw4RUFBOEUsQ0FBQyxDQUFDO1NBQ2pHO1FBQ0QsSUFBSSxPQUFPLE1BQU0sS0FBSyxTQUFTLEVBQUU7WUFDL0IsTUFBTSxJQUFJLEtBQUssQ0FBQyxzRUFBc0UsQ0FBQyxDQUFDO1NBQ3pGO1FBQ0QsSUFBSSxPQUFPLE9BQU8sS0FBSyxRQUFRLEVBQUU7WUFDL0IsTUFBTSxJQUFJLEtBQUssQ0FBQyxzRUFBc0UsQ0FBQyxDQUFDO1NBQ3pGO0lBQ0gsQ0FBQztBQUNILENBQUM7QUFsRkQsaUJBQVMsc0JBQXNCLENBQUMifQ==","var basex = require('base-x')\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.int = exports.dec = exports.Int = exports.Dec = exports.Numeric = exports.DEC_PRECISION = void 0;\nvar decimal_js_1 = __importDefault(require(\"decimal.js\"));\nexports.DEC_PRECISION = 18;\nvar _Dec = decimal_js_1.default.clone();\n_Dec.prototype.toString = function () {\n return this.toFixed(exports.DEC_PRECISION);\n};\nvar Numeric;\n(function (Numeric) {\n function parse(value) {\n if (value instanceof Dec) {\n return value;\n }\n else if (typeof value === 'string') {\n if (value.includes('.')) {\n return new Dec(value);\n }\n else {\n return new Int(value);\n }\n }\n else {\n var _value = new decimal_js_1.default(value);\n if (_value.isInteger()) {\n return new Int(_value);\n }\n else {\n return new Dec(_value.toString());\n }\n }\n }\n Numeric.parse = parse;\n})(Numeric = exports.Numeric || (exports.Numeric = {}));\n/**\n * Represents decimal values serialized with 18 digits of precision. This implementation\n * is based on the `decimal.js` library, and returns Dec values for only [[Dec.add]],\n * [[Dec.sub]], [[Dec.mul]], [[Dec.div]], and [[Dec.mod]]. For other methods inherited\n * from `Decimal`, you will need to convert back to `Dec` to remain compatible for\n * submitting information that requires `Dec` format back to the blockchain.\n *\n * Example:\n *\n * ```ts\n * const dec = new Dec(1.5);\n *\n * const decimal = dec.sqrt();\n * const dec2 = new Dec(decimal);\n */\nvar Dec = /** @class */ (function (_super) {\n __extends(Dec, _super);\n function Dec(arg) {\n return _super.call(this, (arg !== null && arg !== void 0 ? arg : 0).toString()) || this;\n }\n Dec.withPrec = function (value, prec) {\n return new Dec(new Dec(value).div(Math.pow(10, prec)));\n };\n // type conversion\n Dec.prototype.toInt = function () {\n return new Int(this);\n };\n // arithmetic\n Dec.prototype.add = function (other) {\n var val = new Dec(Numeric.parse(other));\n return new Dec(_super.prototype.add.call(this, val));\n };\n Dec.prototype.sub = function (other) {\n var val = new Dec(Numeric.parse(other));\n return new Dec(_super.prototype.sub.call(this, val));\n };\n Dec.prototype.mul = function (other) {\n var val = new Dec(Numeric.parse(other));\n return new Dec(_super.prototype.mul.call(this, val));\n };\n Dec.prototype.div = function (other) {\n var val = new Dec(Numeric.parse(other));\n return new Dec(_super.prototype.div.call(this, val));\n };\n Dec.prototype.mod = function (other) {\n var val = new Dec(Numeric.parse(other));\n return new Dec(_super.prototype.mod.call(this, val));\n };\n return Dec;\n}(_Dec));\nexports.Dec = Dec;\nvar _Int = decimal_js_1.default.clone();\n/**\n * Represents Integer values. Used mainly to store integer values of [[Coin]] and [[Coins]].\n *\n * Note: Do not use to work with values greater than 9999999999999999999. This\n * implementation is based on the `decimal.js` library, and returns Int values for only\n * [[Int.add]], [[Int.sub]], [[Int.mul]], [[Int.div]], and [[Int.mod]]. For other\n * methods inherited from `Decimal`, you will need to convert back to `Int` to remain\n * compatible for submitting information that requires `Int` format back to the\n * blockchain.\n *\n * Example:\n *\n * ```ts\n * const int = new Int(1.5);\n *\n * const decimal = int.pow(3);\n * const int2 = new Int(decimal);\n */\nvar Int = /** @class */ (function (_super) {\n __extends(Int, _super);\n function Int(arg) {\n var _this = this;\n var _arg = new decimal_js_1.default((arg !== null && arg !== void 0 ? arg : 0).toString());\n _this = _super.call(this, _arg.divToInt(1)) || this;\n return _this;\n }\n Int.prototype.toString = function () {\n return this.toFixed();\n };\n // type conversion\n Int.prototype.toDec = function () {\n return new Dec(this);\n };\n // artihmetic\n Int.prototype.add = function (other) {\n var val = Numeric.parse(other);\n if (val instanceof Dec) {\n return new Dec(this).add(val);\n }\n else {\n return new Int(this.plus(val));\n }\n };\n Int.prototype.sub = function (other) {\n var val = Numeric.parse(other);\n if (val instanceof Dec) {\n return new Dec(this).sub(val);\n }\n else {\n return new Int(this.minus(val));\n }\n };\n Int.prototype.mul = function (other) {\n var val = Numeric.parse(other);\n if (val instanceof Dec) {\n return new Dec(this).mul(val);\n }\n else {\n return new Int(this.times(val));\n }\n };\n Int.prototype.div = function (other) {\n var val = Numeric.parse(other);\n if (val instanceof Dec) {\n return new Dec(this).div(val);\n }\n else {\n return new Int(_super.prototype.div.call(this, val));\n }\n };\n Int.prototype.mod = function (other) {\n var val = Numeric.parse(other);\n if (val instanceof Dec) {\n return new Dec(this).mod(val);\n }\n else {\n return new Int(_super.prototype.mod.call(this, val));\n }\n };\n return Int;\n}(_Int));\nexports.Int = Int;\n/**\n * Template tagged literal for creating new Dec objects out of literal string.\n * This does not support literal string interpolation with `${}`.\n *\n * Usage is:\n *\n * ```ts\n * import { dec } from \"@terra-money/terra.js\";\n *\n * const dec1 = dec`234.12312`;\n * const dec2 = new Dec(\"234.12312\");\n *\n * dec1.equals(dec2);\n * ```\n * @param strings\n */\nfunction dec(strings) {\n return new Dec(strings[0]);\n}\nexports.dec = dec;\n/**\n * Template tagged literal for creating new Int objects out of literal string.\n * This does not support literal string interpolation with `${}`.\n *\n * Usage is:\n *\n * ```ts\n * import { int } from \"@terra-money/terra.js\";\n *\n * const int1 = int`234`;\n * const int2 = new Int(\"234\");\n *\n * int1.equals(int2);\n * ```\n * @param strings\n */\nfunction int(strings) {\n return new Int(strings[0]);\n}\nexports.int = int;\n//# sourceMappingURL=numeric.js.map","export var reflow = function reflow(node) {\n return node.scrollTop;\n};\nexport function getTransitionProps(props, options) {\n var timeout = props.timeout,\n _props$style = props.style,\n style = _props$style === void 0 ? {} : _props$style;\n return {\n duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,\n delay: style.transitionDelay\n };\n}","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Block\"), exports);\n__exportStar(require(\"./Coin\"), exports);\n__exportStar(require(\"./Coins\"), exports);\n__exportStar(require(\"./Denom\"), exports);\n__exportStar(require(\"./Msg\"), exports);\n__exportStar(require(\"./numeric\"), exports);\n__exportStar(require(\"./PublicKey\"), exports);\n__exportStar(require(\"./Fee\"), exports);\n__exportStar(require(\"./SignDoc\"), exports);\n__exportStar(require(\"./Tx\"), exports);\n__exportStar(require(\"./TxInfo\"), exports);\n__exportStar(require(\"./ValidatorSet\"), exports);\n__exportStar(require(\"./Deposit\"), exports);\n__exportStar(require(\"./SignatureV2\"), exports);\n__exportStar(require(\"./MultiSignature\"), exports);\n// Auth\n__exportStar(require(\"./auth/Account\"), exports);\n__exportStar(require(\"./auth/BaseAccount\"), exports);\n__exportStar(require(\"./auth/LazyGradedVestingAccount\"), exports);\n// Bank\n__exportStar(require(\"./bank/msgs\"), exports);\n// Distribution\n__exportStar(require(\"./distribution/msgs\"), exports);\n__exportStar(require(\"./distribution/proposals\"), exports);\n// FeeGrant\n__exportStar(require(\"./feegrant/msgs\"), exports);\n__exportStar(require(\"./feegrant/allowances\"), exports);\n// Governance\n__exportStar(require(\"./gov/msgs\"), exports);\n__exportStar(require(\"./gov/proposals\"), exports);\n__exportStar(require(\"./gov/Proposal\"), exports);\n__exportStar(require(\"./gov/Vote\"), exports);\n// Market\n__exportStar(require(\"./market/msgs\"), exports);\n// MsgAuth\n__exportStar(require(\"./authz/msgs\"), exports);\n__exportStar(require(\"./authz/authorizations\"), exports);\n// Oracle\n__exportStar(require(\"./oracle/msgs\"), exports);\n__exportStar(require(\"./oracle/AggregateExchangeRatePrevote\"), exports);\n__exportStar(require(\"./oracle/AggregateExchangeRateVote\"), exports);\n// Parameters\n__exportStar(require(\"./params/proposals\"), exports);\n__exportStar(require(\"./params/ParamChange\"), exports);\n// Slashing\n__exportStar(require(\"./slashing/msgs\"), exports);\n// Staking\n__exportStar(require(\"./staking/msgs\"), exports);\n__exportStar(require(\"./staking/Delegation\"), exports);\n__exportStar(require(\"./staking/Redelegation\"), exports);\n__exportStar(require(\"./staking/UnbondingDelegation\"), exports);\n__exportStar(require(\"./staking/Validator\"), exports);\n// Treasury\n__exportStar(require(\"./treasury/PolicyConstraints\"), exports);\n// WASM\n__exportStar(require(\"./wasm/msgs\"), exports);\n// IBC\n__exportStar(require(\"./ibc/msgs/channel\"), exports);\n__exportStar(require(\"./ibc/msgs/client\"), exports);\n__exportStar(require(\"./ibc/msgs/connection\"), exports);\n// IBC-transfer\n__exportStar(require(\"./ibc-transfer/msgs\"), exports);\n// bech32 types\n__exportStar(require(\"./bech32\"), exports);\n//# sourceMappingURL=index.js.map","// TODO v5: consider to make it private\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","import * as React from 'react';\nvar useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n/**\n * https://github.com/facebook/react/issues/14099#issuecomment-440013892\n *\n * @param {function} fn\n */\n\nexport default function useEventCallback(fn) {\n var ref = React.useRef(fn);\n useEnhancedEffect(function () {\n ref.current = fn;\n });\n return React.useCallback(function () {\n return (0, ref.current).apply(void 0, arguments);\n }, []);\n}","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import JSBI from 'jsbi'\n\n// constants used internally but not expected to be used externally\nexport const NEGATIVE_ONE = JSBI.BigInt(-1)\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\n\n// used in liquidity amount math\nexport const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96))\nexport const Q192 = JSBI.exponentiate(Q96, JSBI.BigInt(2))\n","import { defaultAbiCoder } from '@ethersproject/abi'\nimport { getCreate2Address } from '@ethersproject/address'\nimport { keccak256 } from '@ethersproject/solidity'\nimport { Token } from '@uniswap/sdk-core'\nimport { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'\n\n/**\n * Computes a pool address\n * @param factoryAddress The Uniswap V3 factory address\n * @param tokenA The first token of the pair, irrespective of sort order\n * @param tokenB The second token of the pair, irrespective of sort order\n * @param fee The fee tier of the pool\n * @param initCodeHashManualOverride Override the init code hash used to compute the pool address if necessary\n * @returns The pool address\n */\nexport function computePoolAddress({\n factoryAddress,\n tokenA,\n tokenB,\n fee,\n initCodeHashManualOverride\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n fee: FeeAmount\n initCodeHashManualOverride?: string\n}): string {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(\n ['bytes'],\n [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]\n ),\n initCodeHashManualOverride ?? POOL_INIT_CODE_HASH\n )\n}\n","import JSBI from 'jsbi'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\n\nexport abstract class LiquidityMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static addDelta(x: JSBI, y: JSBI): JSBI {\n if (JSBI.lessThan(y, ZERO)) {\n return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE))\n } else {\n return JSBI.add(x, y)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { ONE, ZERO } from '../internalConstants'\n\nexport abstract class FullMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI {\n const product = JSBI.multiply(a, b)\n let result = JSBI.divide(product, denominator)\n if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE)\n return result\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO, Q96 } from '../internalConstants'\nimport { FullMath } from './fullMath'\n\nconst MaxUint160 = JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(160)), ONE)\n\nfunction multiplyIn256(x: JSBI, y: JSBI): JSBI {\n const product = JSBI.multiply(x, y)\n return JSBI.bitwiseAnd(product, MaxUint256)\n}\n\nfunction addIn256(x: JSBI, y: JSBI): JSBI {\n const sum = JSBI.add(x, y)\n return JSBI.bitwiseAnd(sum, MaxUint256)\n}\n\nexport abstract class SqrtPriceMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n const numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)\n\n return roundUp\n ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96)\n : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96)\n }\n\n public static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n return roundUp\n ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96)\n : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96)\n }\n\n public static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true)\n }\n\n public static getNextSqrtPriceFromOutput(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amountOut: JSBI,\n zeroForOne: boolean\n ): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false)\n }\n\n private static getNextSqrtPriceFromAmount0RoundingUp(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (JSBI.equal(amount, ZERO)) return sqrtPX96\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n\n if (add) {\n let product = multiplyIn256(amount, sqrtPX96)\n if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) {\n const denominator = addIn256(numerator1, product)\n if (JSBI.greaterThanOrEqual(denominator, numerator1)) {\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount))\n } else {\n let product = multiplyIn256(amount, sqrtPX96)\n\n invariant(JSBI.equal(JSBI.divide(product, amount), sqrtPX96))\n invariant(JSBI.greaterThan(numerator1, product))\n const denominator = JSBI.subtract(numerator1, product)\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n private static getNextSqrtPriceFromAmount1RoundingDown(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (add) {\n const quotient = JSBI.lessThanOrEqual(amount, MaxUint160)\n ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity)\n : JSBI.divide(JSBI.multiply(amount, Q96), liquidity)\n\n return JSBI.add(sqrtPX96, quotient)\n } else {\n const quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity)\n\n invariant(JSBI.greaterThan(sqrtPX96, quotient))\n return JSBI.subtract(sqrtPX96, quotient)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { FeeAmount } from '../constants'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\nimport { FullMath } from './fullMath'\nimport { SqrtPriceMath } from './sqrtPriceMath'\n\nconst MAX_FEE = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(6))\n\nexport abstract class SwapMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static computeSwapStep(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioTargetX96: JSBI,\n liquidity: JSBI,\n amountRemaining: JSBI,\n feePips: FeeAmount\n ): [JSBI, JSBI, JSBI, JSBI] {\n const returnValues: Partial<{\n sqrtRatioNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n }> = {}\n\n const zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96)\n const exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO)\n\n if (exactIn) {\n const amountRemainingLessFee = JSBI.divide(\n JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))),\n MAX_FEE\n )\n returnValues.amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true)\n if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn!)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n )\n }\n } else {\n returnValues.amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false)\n if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n JSBI.multiply(amountRemaining, NEGATIVE_ONE),\n zeroForOne\n )\n }\n }\n\n const max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96)\n\n if (zeroForOne) {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false)\n } else {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false)\n }\n\n if (!exactIn && JSBI.greaterThan(returnValues.amountOut!, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) {\n returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE)\n }\n\n if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn!)\n } else {\n returnValues.feeAmount = FullMath.mulDivRoundingUp(\n returnValues.amountIn!,\n JSBI.BigInt(feePips),\n JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))\n )\n }\n\n return [returnValues.sqrtRatioNextX96!, returnValues.amountIn!, returnValues.amountOut!, returnValues.feeAmount!]\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\n\nconst TWO = JSBI.BigInt(2)\nconst POWERS_OF_2 = [128, 64, 32, 16, 8, 4, 2, 1].map((pow: number): [number, JSBI] => [\n pow,\n JSBI.exponentiate(TWO, JSBI.BigInt(pow))\n])\n\nexport function mostSignificantBit(x: JSBI): number {\n invariant(JSBI.greaterThan(x, ZERO), 'ZERO')\n invariant(JSBI.lessThanOrEqual(x, MaxUint256), 'MAX')\n\n let msb: number = 0\n for (const [power, min] of POWERS_OF_2) {\n if (JSBI.greaterThanOrEqual(x, min)) {\n x = JSBI.signedRightShift(x, JSBI.BigInt(power))\n msb += power\n }\n }\n return msb\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { mostSignificantBit } from './mostSignificantBit'\n\nfunction mulShift(val: JSBI, mulBy: string): JSBI {\n return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128))\n}\n\nconst Q32 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(32))\n\nexport abstract class TickMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * The minimum tick that can be used on any pool.\n */\n public static MIN_TICK: number = -887272\n /**\n * The maximum tick that can be used on any pool.\n */\n public static MAX_TICK: number = -TickMath.MIN_TICK\n\n /**\n * The sqrt ratio corresponding to the minimum tick that could be used on any pool.\n */\n public static MIN_SQRT_RATIO: JSBI = JSBI.BigInt('4295128739')\n /**\n * The sqrt ratio corresponding to the maximum tick that could be used on any pool.\n */\n public static MAX_SQRT_RATIO: JSBI = JSBI.BigInt('1461446703485210103287273052203988822378723970342')\n\n /**\n * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick\n * @param tick the tick for which to compute the sqrt ratio\n */\n public static getSqrtRatioAtTick(tick: number): JSBI {\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick), 'TICK')\n const absTick: number = tick < 0 ? tick * -1 : tick\n\n let ratio: JSBI =\n (absTick & 0x1) != 0\n ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001')\n : JSBI.BigInt('0x100000000000000000000000000000000')\n if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a')\n if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc')\n if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0')\n if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644')\n if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0')\n if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861')\n if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053')\n if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4')\n if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54')\n if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3')\n if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9')\n if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825')\n if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5')\n if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7')\n if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6')\n if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9')\n if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604')\n if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98')\n if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2')\n\n if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio)\n\n // back to Q96\n return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO)\n ? JSBI.add(JSBI.divide(ratio, Q32), ONE)\n : JSBI.divide(ratio, Q32)\n }\n\n /**\n * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96\n * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96\n * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick\n */\n public static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number {\n invariant(\n JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) &&\n JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO),\n 'SQRT_RATIO'\n )\n\n const sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32))\n\n const msb = mostSignificantBit(sqrtRatioX128)\n\n let r: JSBI\n if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) {\n r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127))\n } else {\n r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb))\n }\n\n let log_2: JSBI = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64))\n\n for (let i = 0; i < 14; i++) {\n r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127))\n const f = JSBI.signedRightShift(r, JSBI.BigInt(128))\n log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i)))\n r = JSBI.signedRightShift(r, f)\n }\n\n const log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141'))\n\n const tickLow = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')),\n JSBI.BigInt(128)\n )\n )\n const tickHigh = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')),\n JSBI.BigInt(128)\n )\n )\n\n return tickLow === tickHigh\n ? tickLow\n : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96)\n ? tickHigh\n : tickLow\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\n\n/**\n * Provides information about ticks\n */\nexport interface TickDataProvider {\n /**\n * Return information corresponding to a specific tick\n * @param tick the tick to load\n */\n getTick(tick: number): Promise<{ liquidityNet: BigintIsh }>\n\n /**\n * Return the next tick that is initialized within a single word\n * @param tick The current tick\n * @param lte Whether the next tick should be lte the current tick\n * @param tickSpacing The tick spacing of the pool\n */\n nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>\n}\n\n/**\n * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you\n * do not need to load tick data for your use case.\n */\nexport class NoTickDataProvider implements TickDataProvider {\n private static ERROR_MESSAGE = 'No tick data provider was given'\n async getTick(_tick: number): Promise<{ liquidityNet: BigintIsh }> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n\n async nextInitializedTickWithinOneWord(\n _tick: number,\n _lte: boolean,\n _tickSpacing: number\n ): Promise<[number, boolean]> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Tick } from '../entities/tick'\nimport { ZERO } from '../internalConstants'\nimport { isSorted } from './isSorted'\n\nfunction tickComparator(a: Tick, b: Tick) {\n return a.index - b.index\n}\n\n/**\n * Utility methods for interacting with sorted lists of ticks\n */\nexport abstract class TickList {\n /**\n * Cannot be constructed\n */\n private constructor() {}\n\n public static validateList(ticks: Tick[], tickSpacing: number) {\n invariant(tickSpacing > 0, 'TICK_SPACING_NONZERO')\n // ensure ticks are spaced appropriately\n invariant(\n ticks.every(({ index }) => index % tickSpacing === 0),\n 'TICK_SPACING'\n )\n\n // ensure tick liquidity deltas sum to 0\n invariant(\n JSBI.equal(\n ticks.reduce((accumulator, { liquidityNet }) => JSBI.add(accumulator, liquidityNet), ZERO),\n ZERO\n ),\n 'ZERO_NET'\n )\n\n invariant(isSorted(ticks, tickComparator), 'SORTED')\n }\n\n public static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick < ticks[0].index\n }\n\n public static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick >= ticks[ticks.length - 1].index\n }\n\n public static getTick(ticks: readonly Tick[], index: number): Tick {\n const tick = ticks[this.binarySearch(ticks, index)]\n invariant(tick.index === index, 'NOT_CONTAINED')\n return tick\n }\n\n /**\n * Finds the largest tick in the list of ticks that is less than or equal to tick\n * @param ticks list of ticks\n * @param tick tick to find the largest tick that is less than or equal to tick\n * @private\n */\n private static binarySearch(ticks: readonly Tick[], tick: number): number {\n invariant(!this.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n\n let l = 0\n let r = ticks.length - 1\n let i\n while (true) {\n i = Math.floor((l + r) / 2)\n\n if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) {\n return i\n }\n\n if (ticks[i].index < tick) {\n l = i + 1\n } else {\n r = i - 1\n }\n }\n }\n\n public static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick {\n if (lte) {\n invariant(!TickList.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n if (TickList.isAtOrAboveLargest(ticks, tick)) {\n return ticks[ticks.length - 1]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index]\n } else {\n invariant(!this.isAtOrAboveLargest(ticks, tick), 'AT_OR_ABOVE_LARGEST')\n if (this.isBelowSmallest(ticks, tick)) {\n return ticks[0]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index + 1]\n }\n }\n\n public static nextInitializedTickWithinOneWord(\n ticks: readonly Tick[],\n tick: number,\n lte: boolean,\n tickSpacing: number\n ): [number, boolean] {\n const compressed = Math.floor(tick / tickSpacing) // matches rounding in the code\n\n if (lte) {\n const wordPos = compressed >> 8\n const minimum = (wordPos << 8) * tickSpacing\n\n if (TickList.isBelowSmallest(ticks, tick)) {\n return [minimum, false]\n }\n\n const index = TickList.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.max(minimum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n } else {\n const wordPos = (compressed + 1) >> 8\n const maximum = (((wordPos + 1) << 8) - 1) * tickSpacing\n\n if (this.isAtOrAboveLargest(ticks, tick)) {\n return [maximum, false]\n }\n\n const index = this.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.min(maximum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n }\n }\n}\n","/**\n * Determines if a tick list is sorted\n * @param list The tick list\n * @param comparator The comparator\n * @returns true if sorted\n */\nexport function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean {\n for (let i = 0; i < list.length - 1; i++) {\n if (comparator(list[i], list[i + 1]) > 0) {\n return false\n }\n }\n return true\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\n\n/**\n * Generated method parameters for executing a call.\n */\nexport interface MethodParameters {\n /**\n * The hex encoded calldata to perform the given operation\n */\n calldata: string\n /**\n * The amount of ether (wei) to send in hex.\n */\n value: string\n}\n\n/**\n * Converts a big int to a hex string\n * @param bigintIsh\n * @returns The hex encoded calldata\n */\nexport function toHex(bigintIsh: BigintIsh) {\n const bigInt = JSBI.BigInt(bigintIsh)\n let hex = bigInt.toString(16)\n if (hex.length % 2 !== 0) {\n hex = `0${hex}`\n }\n return `0x${hex}`\n}\n","import { pack } from '@ethersproject/solidity'\nimport { Currency, Token } from '@uniswap/sdk-core'\nimport { Pool } from '../entities/pool'\nimport { Route } from '../entities/route'\n\n/**\n * Converts a route to a hex encoded path\n * @param route the v3 path to convert to an encoded path\n * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps\n */\nexport function encodeRouteToPath(route: Route, exactOutput: boolean): string {\n const firstInputToken: Token = route.input.wrapped\n\n const { path, types } = route.pools.reduce(\n (\n { inputToken, path, types }: { inputToken: Token; path: (string | number)[]; types: string[] },\n pool: Pool,\n index\n ): { inputToken: Token; path: (string | number)[]; types: string[] } => {\n const outputToken: Token = pool.token0.equals(inputToken) ? pool.token1 : pool.token0\n if (index === 0) {\n return {\n inputToken: outputToken,\n types: ['address', 'uint24', 'address'],\n path: [inputToken.address, pool.fee, outputToken.address]\n }\n } else {\n return {\n inputToken: outputToken,\n types: [...types, 'uint24', 'address'],\n path: [...path, pool.fee, outputToken.address]\n }\n }\n },\n { inputToken: firstInputToken, path: [], types: [] }\n )\n\n return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path)\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, sqrt } from '@uniswap/sdk-core'\n\n/**\n * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0\n * @param amount1 The numerator amount i.e., the amount of token1\n * @param amount0 The denominator amount i.e., the amount of token0\n * @returns The sqrt ratio\n */\n\nexport function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI {\n const numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192))\n const denominator = JSBI.BigInt(amount0)\n const ratioX192 = JSBI.divide(numerator, denominator)\n return sqrt(ratioX192)\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q96 } from '../internalConstants'\n\n/**\n * Returns an imprecise maximum amount of liquidity received for a given amount of token 0.\n * This function is available to accommodate LiquidityAmounts#getLiquidityForAmount0 in the v3 periphery,\n * which could be more precise by at least 32 bits by dividing by Q64 instead of Q96 in the intermediate step,\n * and shifting the subtracted ratio left by 32 bits. This imprecise calculation will likely be replaced in a future\n * v3 router contract.\n * @param sqrtRatioAX96 The price at the lower boundary\n * @param sqrtRatioBX96 The price at the upper boundary\n * @param amount0 The token0 amount\n * @returns liquidity for amount0, imprecise\n */\nfunction maxLiquidityForAmount0Imprecise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n const intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96)\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Returns a precise maximum amount of liquidity received for a given amount of token 0 by dividing by Q64 instead of Q96 in the intermediate step,\n * and shifting the subtracted ratio left by 32 bits.\n * @param sqrtRatioAX96 The price at the lower boundary\n * @param sqrtRatioBX96 The price at the upper boundary\n * @param amount0 The token0 amount\n * @returns liquidity for amount0, precise\n */\nfunction maxLiquidityForAmount0Precise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96)\n const denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n\n return JSBI.divide(numerator, denominator)\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token1\n * @param sqrtRatioAX96 The price at the lower tick boundary\n * @param sqrtRatioBX96 The price at the upper tick boundary\n * @param amount1 The token1 amount\n * @returns liquidity for amount1\n */\nfunction maxLiquidityForAmount1(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount1: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param sqrtRatioCurrentX96 the current price\n * @param sqrtRatioAX96 price at lower boundary\n * @param sqrtRatioBX96 price at upper boundary\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\nexport function maxLiquidityForAmounts(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioAX96: JSBI,\n sqrtRatioBX96: JSBI,\n amount0: BigintIsh,\n amount1: BigintIsh,\n useFullPrecision: boolean\n): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise\n\n if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) {\n return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0)\n } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) {\n const liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0)\n const liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1)\n return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1\n } else {\n return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns the closest tick that is nearest a given tick and usable for the given tick spacing\n * @param tick the target tick\n * @param tickSpacing the spacing of the pool\n */\nexport function nearestUsableTick(tick: number, tickSpacing: number) {\n invariant(Number.isInteger(tick) && Number.isInteger(tickSpacing), 'INTEGERS')\n invariant(tickSpacing > 0, 'TICK_SPACING')\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, 'TICK_BOUND')\n const rounded = Math.round(tick / tickSpacing) * tickSpacing\n if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing\n else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing\n else return rounded\n}\n","import { Price, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q192 } from '../internalConstants'\nimport { encodeSqrtRatioX96 } from './encodeSqrtRatioX96'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns a price object corresponding to the input tick and the base/quote token\n * Inputs must be tokens because the address order is used to interpret the price represented by the tick\n * @param baseToken the base token of the price\n * @param quoteToken the quote token of the price\n * @param tick the tick for which to return the price\n */\nexport function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price {\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick)\n\n const ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96)\n\n return baseToken.sortsBefore(quoteToken)\n ? new Price(baseToken, quoteToken, Q192, ratioX192)\n : new Price(baseToken, quoteToken, ratioX192, Q192)\n}\n\n/**\n * Returns the first tick for which the given price is greater than or equal to the tick price\n * @param price for which to return the closest tick that represents a price less than or equal to the input price,\n * i.e. the price of the returned tick is less than or equal to the input price\n */\nexport function priceToClosestTick(price: Price): number {\n const sorted = price.baseCurrency.sortsBefore(price.quoteCurrency)\n\n const sqrtRatioX96 = sorted\n ? encodeSqrtRatioX96(price.numerator, price.denominator)\n : encodeSqrtRatioX96(price.denominator, price.numerator)\n\n let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96)\n const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1)\n if (sorted) {\n if (!price.lessThan(nextTickPrice)) {\n tick++\n }\n } else {\n if (!price.greaterThan(nextTickPrice)) {\n tick++\n }\n }\n return tick\n}\n","import JSBI from 'jsbi'\nimport { ZERO } from '../internalConstants'\n\ninterface FeeGrowthOutside {\n feeGrowthOutside0X128: JSBI\n feeGrowthOutside1X128: JSBI\n}\n\nconst Q256 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(256))\n\nexport function subIn256(x: JSBI, y: JSBI): JSBI {\n const difference = JSBI.subtract(x, y)\n\n if (JSBI.lessThan(difference, ZERO)) {\n return JSBI.add(Q256, difference)\n } else {\n return difference\n }\n}\n\nexport abstract class TickLibrary {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getFeeGrowthInside(\n feeGrowthOutsideLower: FeeGrowthOutside,\n feeGrowthOutsideUpper: FeeGrowthOutside,\n tickLower: number,\n tickUpper: number,\n tickCurrent: number,\n feeGrowthGlobal0X128: JSBI,\n feeGrowthGlobal1X128: JSBI\n ) {\n let feeGrowthBelow0X128: JSBI\n let feeGrowthBelow1X128: JSBI\n if (tickCurrent >= tickLower) {\n feeGrowthBelow0X128 = feeGrowthOutsideLower.feeGrowthOutside0X128\n feeGrowthBelow1X128 = feeGrowthOutsideLower.feeGrowthOutside1X128\n } else {\n feeGrowthBelow0X128 = subIn256(feeGrowthGlobal0X128, feeGrowthOutsideLower.feeGrowthOutside0X128)\n feeGrowthBelow1X128 = subIn256(feeGrowthGlobal1X128, feeGrowthOutsideLower.feeGrowthOutside1X128)\n }\n\n let feeGrowthAbove0X128: JSBI\n let feeGrowthAbove1X128: JSBI\n if (tickCurrent < tickUpper) {\n feeGrowthAbove0X128 = feeGrowthOutsideUpper.feeGrowthOutside0X128\n feeGrowthAbove1X128 = feeGrowthOutsideUpper.feeGrowthOutside1X128\n } else {\n feeGrowthAbove0X128 = subIn256(feeGrowthGlobal0X128, feeGrowthOutsideUpper.feeGrowthOutside0X128)\n feeGrowthAbove1X128 = subIn256(feeGrowthGlobal1X128, feeGrowthOutsideUpper.feeGrowthOutside1X128)\n }\n\n return [\n subIn256(subIn256(feeGrowthGlobal0X128, feeGrowthBelow0X128), feeGrowthAbove0X128),\n subIn256(subIn256(feeGrowthGlobal1X128, feeGrowthBelow1X128), feeGrowthAbove1X128)\n ]\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { BigintIsh } from '@uniswap/sdk-core'\nimport { TickMath } from '../utils'\n\nexport interface TickConstructorArgs {\n index: number\n liquidityGross: BigintIsh\n liquidityNet: BigintIsh\n}\n\nexport class Tick {\n public readonly index: number\n public readonly liquidityGross: JSBI\n public readonly liquidityNet: JSBI\n\n constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs) {\n invariant(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK, 'TICK')\n this.index = index\n this.liquidityGross = JSBI.BigInt(liquidityGross)\n this.liquidityNet = JSBI.BigInt(liquidityNet)\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport { TickList } from '../utils/tickList'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { TickDataProvider } from './tickDataProvider'\n\n/**\n * A data provider for ticks that is backed by an in-memory array of ticks.\n */\nexport class TickListDataProvider implements TickDataProvider {\n private ticks: readonly Tick[]\n\n constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number) {\n const ticksMapped: Tick[] = ticks.map(t => (t instanceof Tick ? t : new Tick(t)))\n TickList.validateList(ticksMapped, tickSpacing)\n this.ticks = ticksMapped\n }\n\n async getTick(tick: number): Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }> {\n return TickList.getTick(this.ticks, tick)\n }\n\n async nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]> {\n return TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)\n }\n}\n","import { BigintIsh, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { FACTORY_ADDRESS, FeeAmount, TICK_SPACINGS } from '../constants'\nimport { NEGATIVE_ONE, ONE, Q192, ZERO } from '../internalConstants'\nimport { computePoolAddress } from '../utils/computePoolAddress'\nimport { LiquidityMath } from '../utils/liquidityMath'\nimport { SwapMath } from '../utils/swapMath'\nimport { TickMath } from '../utils/tickMath'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { NoTickDataProvider, TickDataProvider } from './tickDataProvider'\nimport { TickListDataProvider } from './tickListDataProvider'\n\ninterface StepComputations {\n sqrtPriceStartX96: JSBI\n tickNext: number\n initialized: boolean\n sqrtPriceNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n}\n\n/**\n * By default, pools will not allow operations that require ticks.\n */\nconst NO_TICK_DATA_PROVIDER_DEFAULT = new NoTickDataProvider()\n\n/**\n * Represents a V3 pool\n */\nexport class Pool {\n public readonly token0: Token\n public readonly token1: Token\n public readonly fee: FeeAmount\n public readonly sqrtRatioX96: JSBI\n public readonly liquidity: JSBI\n public readonly tickCurrent: number\n public readonly tickDataProvider: TickDataProvider\n\n private _token0Price?: Price\n private _token1Price?: Price\n\n public static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount, initCodeHashManualOverride?: string): string {\n return computePoolAddress({ factoryAddress: FACTORY_ADDRESS, fee, tokenA, tokenB, initCodeHashManualOverride })\n }\n\n /**\n * Construct a pool\n * @param tokenA One of the tokens in the pool\n * @param tokenB The other token in the pool\n * @param fee The fee in hundredths of a bips of the input amount of every swap that is collected by the pool\n * @param sqrtRatioX96 The sqrt of the current ratio of amounts of token1 to token0\n * @param liquidity The current value of in range liquidity\n * @param tickCurrent The current tick of the pool\n * @param ticks The current state of the pool ticks or a data provider that can return tick data\n */\n public constructor(\n tokenA: Token,\n tokenB: Token,\n fee: FeeAmount,\n sqrtRatioX96: BigintIsh,\n liquidity: BigintIsh,\n tickCurrent: number,\n ticks: TickDataProvider | (Tick | TickConstructorArgs)[] = NO_TICK_DATA_PROVIDER_DEFAULT\n ) {\n invariant(Number.isInteger(fee) && fee < 1_000_000, 'FEE')\n\n const tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent)\n const nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1)\n invariant(\n JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) &&\n JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96),\n 'PRICE_BOUNDS'\n )\n // always create a copy of the list since we want the pool's tick list to be immutable\n ;[this.token0, this.token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n this.fee = fee\n this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96)\n this.liquidity = JSBI.BigInt(liquidity)\n this.tickCurrent = tickCurrent\n this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token The token to check\n * @returns True if token is either token0 or token\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0\n */\n public get token0Price(): Price {\n return (\n this._token0Price ??\n (this._token0Price = new Price(\n this.token0,\n this.token1,\n Q192,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)\n ))\n )\n }\n\n /**\n * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1\n */\n public get token1Price(): Price {\n return (\n this._token1Price ??\n (this._token1Price = new Price(\n this.token1,\n this.token0,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96),\n Q192\n ))\n )\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pool.\n * @param token The token to return price of\n * @returns The price of the given token, in terms of the other.\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pool.\n */\n public get chainId(): number {\n return this.token0.chainId\n }\n\n /**\n * Given an input amount of a token, return the computed output amount, and a pool with state updated after the trade\n * @param inputAmount The input amount for which to quote the output amount\n * @param sqrtPriceLimitX96 The Q64.96 sqrt price limit\n * @returns The output amount and the pool with updated state\n */\n public async getOutputAmount(\n inputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n\n const zeroForOne = inputAmount.currency.equals(this.token0)\n\n const { amountCalculated: outputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n inputAmount.quotient,\n sqrtPriceLimitX96\n )\n const outputToken = zeroForOne ? this.token1 : this.token0\n return [\n CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade\n * @param outputAmount the output amount for which to quote the input amount\n * @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap\n * @returns The input amount and the pool with updated state\n */\n public async getInputAmount(\n outputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency), 'TOKEN')\n\n const zeroForOne = outputAmount.currency.equals(this.token1)\n\n const { amountCalculated: inputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE),\n sqrtPriceLimitX96\n )\n const inputToken = zeroForOne ? this.token0 : this.token1\n return [\n CurrencyAmount.fromRawAmount(inputToken, inputAmount),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Executes a swap\n * @param zeroForOne Whether the amount in is token0 or token1\n * @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n * @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap\n * @returns amountCalculated\n * @returns sqrtRatioX96\n * @returns liquidity\n * @returns tickCurrent\n */\n private async swap(\n zeroForOne: boolean,\n amountSpecified: JSBI,\n sqrtPriceLimitX96?: JSBI\n ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> {\n if (!sqrtPriceLimitX96)\n sqrtPriceLimitX96 = zeroForOne\n ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE)\n : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE)\n\n if (zeroForOne) {\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO), 'RATIO_MIN')\n invariant(JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n } else {\n invariant(JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO), 'RATIO_MAX')\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n }\n\n const exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO)\n\n // keep track of swap state\n\n const state = {\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: ZERO,\n sqrtPriceX96: this.sqrtRatioX96,\n tick: this.tickCurrent,\n liquidity: this.liquidity\n }\n\n // start swap while loop\n while (JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n let step: Partial = {}\n step.sqrtPriceStartX96 = state.sqrtPriceX96\n\n // because each iteration of the while loop rounds, we can't optimize this code (relative to the smart contract)\n // by simply traversing to the next available tick, we instead need to exactly replicate\n // tickBitmap.nextInitializedTickWithinOneWord\n ;[step.tickNext, step.initialized] = await this.tickDataProvider.nextInitializedTickWithinOneWord(\n state.tick,\n zeroForOne,\n this.tickSpacing\n )\n\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK\n }\n\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext)\n ;[state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount] = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne\n ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)\n : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96))\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n this.fee\n )\n\n if (exactInput) {\n state.amountSpecifiedRemaining = JSBI.subtract(\n state.amountSpecifiedRemaining,\n JSBI.add(step.amountIn, step.feeAmount)\n )\n state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut)\n } else {\n state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut)\n state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount))\n }\n\n // TODO\n if (JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n let liquidityNet = JSBI.BigInt((await this.tickDataProvider.getTick(step.tickNext)).liquidityNet)\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE)\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet)\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96)\n }\n }\n\n return {\n amountCalculated: state.amountCalculated,\n sqrtRatioX96: state.sqrtPriceX96,\n liquidity: state.liquidity,\n tickCurrent: state.tick\n }\n }\n\n public get tickSpacing(): number {\n return TICK_SPACINGS[this.fee]\n }\n}\n","import { BigintIsh, MaxUint256, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { maxLiquidityForAmounts } from '../utils/maxLiquidityForAmounts'\nimport { tickToPrice } from '../utils/priceTickConversions'\nimport { SqrtPriceMath } from '../utils/sqrtPriceMath'\nimport { TickMath } from '../utils/tickMath'\nimport { encodeSqrtRatioX96 } from '../utils/encodeSqrtRatioX96'\nimport { Pool } from './pool'\n\ninterface PositionConstructorArgs {\n pool: Pool\n tickLower: number\n tickUpper: number\n liquidity: BigintIsh\n}\n\n/**\n * Represents a position on a Uniswap V3 Pool\n */\nexport class Position {\n public readonly pool: Pool\n public readonly tickLower: number\n public readonly tickUpper: number\n public readonly liquidity: JSBI\n\n // cached resuts for the getters\n private _token0Amount: CurrencyAmount | null = null\n private _token1Amount: CurrencyAmount | null = null\n private _mintAmounts: Readonly<{ amount0: JSBI; amount1: JSBI }> | null = null\n\n /**\n * Constructs a position for a given pool with the given liquidity\n * @param pool For which pool the liquidity is assigned\n * @param liquidity The amount of liquidity that is in the position\n * @param tickLower The lower tick of the position\n * @param tickUpper The upper tick of the position\n */\n public constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs) {\n invariant(tickLower < tickUpper, 'TICK_ORDER')\n invariant(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0, 'TICK_LOWER')\n invariant(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0, 'TICK_UPPER')\n\n this.pool = pool\n this.tickLower = tickLower\n this.tickUpper = tickUpper\n this.liquidity = JSBI.BigInt(liquidity)\n }\n\n /**\n * Returns the price of token0 at the lower tick\n */\n public get token0PriceLower(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower)\n }\n\n /**\n * Returns the price of token0 at the upper tick\n */\n public get token0PriceUpper(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper)\n }\n\n /**\n * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price\n */\n public get amount0(): CurrencyAmount {\n if (this._token0Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else {\n this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO)\n }\n }\n return this._token0Amount\n }\n\n /**\n * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price\n */\n public get amount1(): CurrencyAmount {\n if (this._token1Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO)\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n false\n )\n )\n } else {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n }\n }\n return this._token1Amount\n }\n\n /**\n * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage\n * @param slippageTolerance The amount by which the price can 'slip' before the transaction will revert\n * @returns The sqrt ratios after slippage\n */\n private ratiosAfterSlippage(slippageTolerance: Percent): { sqrtRatioX96Lower: JSBI; sqrtRatioX96Upper: JSBI } {\n const priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance))\n const priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1))\n let sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator)\n if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) {\n sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1))\n }\n let sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator)\n if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) {\n sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1))\n }\n return {\n sqrtRatioX96Lower,\n sqrtRatioX96Upper\n }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position\n * with the given slippage tolerance\n * @param slippageTolerance Tolerance of unfavorable slippage from the current price\n * @returns The amounts, with slippage\n */\n public mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage)\n const positionThatWillBeCreated = Position.fromAmounts({\n pool: this.pool,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper,\n ...this.mintAmounts, // the mint amounts are what will be passed as calldata\n useFullPrecision: false\n })\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const { amount0 } = new Position({\n pool: poolUpper,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n // ...and the lower for amount1\n const { amount1 } = new Position({\n pool: poolLower,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n\n return { amount0, amount1 }\n }\n\n /**\n * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the\n * position with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n * @returns The amounts, with slippage\n */\n public burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const amount0 = new Position({\n pool: poolUpper,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount0\n // ...and the lower for amount1\n const amount1 = new Position({\n pool: poolLower,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount1\n\n return { amount0: amount0.quotient, amount1: amount1.quotient }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at\n * the current price for the pool\n */\n public get mintAmounts(): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n if (this._mintAmounts === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: ZERO\n }\n } else if (this.pool.tickCurrent < this.tickUpper) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n true\n )\n }\n } else {\n return {\n amount0: ZERO,\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n )\n }\n }\n }\n return this._mintAmounts\n }\n\n /**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param pool The pool for which the position should be created\n * @param tickLower The lower tick of the position\n * @param tickUpper The upper tick of the position\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision If false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n * @returns The amount of liquidity for the position\n */\n public static fromAmounts({\n pool,\n tickLower,\n tickUpper,\n amount0,\n amount1,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n amount1: BigintIsh\n useFullPrecision: boolean\n }) {\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower)\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper)\n return new Position({\n pool,\n tickLower,\n tickUpper,\n liquidity: maxLiquidityForAmounts(\n pool.sqrtRatioX96,\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0,\n amount1,\n useFullPrecision\n )\n })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1\n * @param pool The pool for which the position is created\n * @param tickLower The lower tick\n * @param tickUpper The upper tick\n * @param amount0 The desired amount of token0\n * @param useFullPrecision If true, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n * @returns The position\n */\n public static fromAmount0({\n pool,\n tickLower,\n tickUpper,\n amount0,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n useFullPrecision: boolean\n }) {\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0, amount1: MaxUint256, useFullPrecision })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0\n * @param pool The pool for which the position is created\n * @param tickLower The lower tick\n * @param tickUpper The upper tick\n * @param amount1 The desired amount of token1\n * @returns The position\n */\n public static fromAmount1({\n pool,\n tickLower,\n tickUpper,\n amount1\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount1: BigintIsh\n }) {\n // this function always uses full precision,\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0: MaxUint256, amount1, useFullPrecision: true })\n }\n}\n","import invariant from 'tiny-invariant'\nimport { Currency, Price, Token } from '@uniswap/sdk-core'\n\nimport { Pair } from './pair'\n\nexport class Route {\n public readonly pairs: Pair[]\n public readonly path: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n public constructor(pairs: Pair[], input: TInput, output: TOutput) {\n invariant(pairs.length > 0, 'PAIRS')\n const chainId: number = pairs[0].chainId\n invariant(\n pairs.every(pair => pair.chainId === chainId),\n 'CHAIN_IDS'\n )\n\n const wrappedInput = input.wrapped\n invariant(pairs[0].involvesToken(wrappedInput), 'INPUT')\n invariant(typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(output.wrapped), 'OUTPUT')\n\n const path: Token[] = [wrappedInput]\n for (const [i, pair] of pairs.entries()) {\n const currentInput = path[i]\n invariant(currentInput.equals(pair.token0) || currentInput.equals(pair.token1), 'PATH')\n const output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0\n path.push(output)\n }\n\n this.pairs = pairs\n this.path = path\n this.input = input\n this.output = output\n }\n\n private _midPrice: Price | null = null\n\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n const prices: Price[] = []\n for (const [i, pair] of this.pairs.entries()) {\n prices.push(\n this.path[i].equals(pair.token0)\n ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient)\n : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)\n )\n }\n const reduced = prices.slice(1).reduce((accumulator, currentValue) => accumulator.multiply(currentValue), prices[0])\n return (this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator))\n }\n\n public get chainId(): number {\n return this.pairs[0].chainId\n }\n}\n","import {\n computePriceImpact,\n Token,\n Currency,\n CurrencyAmount,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n TradeType\n} from '@uniswap/sdk-core'\nimport { ONE, ZERO } from '../constants'\nimport invariant from 'tiny-invariant'\n\nimport { Pair } from './pair'\nimport { Route } from './route'\n\n// minimal interface so the input output comparator may be shared across types\ninterface InputOutput {\n readonly inputAmount: CurrencyAmount\n readonly outputAmount: CurrencyAmount\n}\n\n// comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts\n// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first\nexport function inputOutputComparator(\n a: InputOutput,\n b: InputOutput\n): number {\n // must have same input and output token for comparison\n invariant(a.inputAmount.currency.equals(b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(a.outputAmount.currency.equals(b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n return 0\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n const ioComp = inputOutputComparator(a, b)\n if (ioComp !== 0) {\n return ioComp\n }\n\n // consider lowest slippage next, since these are less likely to fail\n if (a.priceImpact.lessThan(b.priceImpact)) {\n return -1\n } else if (a.priceImpact.greaterThan(b.priceImpact)) {\n return 1\n }\n\n // finally consider the number of hops since each hop costs gas\n return a.route.path.length - b.route.path.length\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pairs.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public readonly executionPrice: Price\n /**\n * The percent difference between the mid price before the trade and the trade execution price.\n */\n public readonly priceImpact: Percent\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Trade {\n return new Trade(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Trade {\n return new Trade(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n public constructor(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ) {\n this.route = route\n this.tradeType = tradeType\n\n const tokenAmounts: CurrencyAmount[] = new Array(route.path.length)\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(amount.currency.equals(route.input), 'INPUT')\n tokenAmounts[0] = amount.wrapped\n for (let i = 0; i < route.path.length - 1; i++) {\n const pair = route.pairs[i]\n const [outputAmount] = pair.getOutputAmount(tokenAmounts[i])\n tokenAmounts[i + 1] = outputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n this.outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n tokenAmounts[tokenAmounts.length - 1].numerator,\n tokenAmounts[tokenAmounts.length - 1].denominator\n )\n } else {\n invariant(amount.currency.equals(route.output), 'OUTPUT')\n tokenAmounts[tokenAmounts.length - 1] = amount.wrapped\n for (let i = route.path.length - 1; i > 0; i--) {\n const pair = route.pairs[i - 1]\n const [inputAmount] = pair.getInputAmount(tokenAmounts[i])\n tokenAmounts[i - 1] = inputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(\n route.input,\n tokenAmounts[0].numerator,\n tokenAmounts[0].denominator\n )\n this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n this.executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n )\n this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount)\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactIn(\n pairs: Pair[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPairs.length > 0, 'INVALID_RECURSION')\n\n const amountIn = nextAmountIn.wrapped\n const tokenOut = currencyOut.wrapped\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!pair.token0.equals(amountIn.currency) && !pair.token1.equals(amountIn.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = pair.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (amountOut.currency.equals(tokenOut)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([...currentPairs, pair], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n Trade.bestTradeExactIn(\n pairsExcludingThisPair,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPairs, pair],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactOut(\n pairs: Pair[],\n currencyIn: TInput,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPairs.length > 0, 'INVALID_RECURSION')\n\n const amountOut = nextAmountOut.wrapped\n const tokenIn = currencyIn.wrapped\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!pair.token0.equals(amountOut.currency) && !pair.token1.equals(amountOut.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = pair.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pair\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (amountIn.currency.equals(tokenIn)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([pair, ...currentPairs], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n Trade.bestTradeExactOut(\n pairsExcludingThisPair,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pair, ...currentPairs],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json'\n\nexport abstract class Multicall {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static encodeMulticall(calldatas: string | string[]): string {\n if (!Array.isArray(calldatas)) {\n calldatas = [calldatas]\n }\n\n return calldatas.length === 1 ? calldatas[0] : Multicall.INTERFACE.encodeFunctionData('multicall', [calldatas])\n }\n}\n","import { BigintIsh, Token } from '@uniswap/sdk-core'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'\nimport { toHex } from './utils'\n\nexport interface StandardPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n amount: BigintIsh\n deadline: BigintIsh\n}\n\nexport interface AllowedPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n nonce: BigintIsh\n expiry: BigintIsh\n}\n\nexport type PermitOptions = StandardPermitArguments | AllowedPermitArguments\n\nfunction isAllowedPermit(permitOptions: PermitOptions): permitOptions is AllowedPermitArguments {\n return 'nonce' in permitOptions\n}\n\nexport abstract class SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static encodePermit(token: Token, options: PermitOptions) {\n return isAllowedPermit(options)\n ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [\n token.address,\n toHex(options.nonce),\n toHex(options.expiry),\n options.v,\n options.r,\n options.s\n ])\n : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [\n token.address,\n toHex(options.amount),\n toHex(options.deadline),\n options.v,\n options.r,\n options.s\n ])\n }\n}\n","import JSBI from 'jsbi'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/IPeripheryPaymentsWithFee.sol/IPeripheryPaymentsWithFee.json'\nimport { Percent, Token, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { toHex } from './utils/calldata'\n\nexport interface FeeOptions {\n /**\n * The percent of the output that will be taken as a fee.\n */\n fee: Percent\n\n /**\n * The recipient of the fee.\n */\n recipient: string\n}\n\nexport abstract class Payments {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n private static encodeFeeBips(fee: Percent): string {\n return toHex(fee.multiply(10_000).quotient)\n }\n\n public static encodeUnwrapWETH9(amountMinimum: JSBI, recipient: string, feeOptions?: FeeOptions): string {\n recipient = validateAndParseAddress(recipient)\n\n if (!!feeOptions) {\n const feeBips = this.encodeFeeBips(feeOptions.fee)\n const feeRecipient: string = validateAndParseAddress(feeOptions.recipient)\n\n return Payments.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [\n toHex(amountMinimum),\n recipient,\n feeBips,\n feeRecipient\n ])\n } else {\n return Payments.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(amountMinimum), recipient])\n }\n }\n\n public static encodeSweepToken(\n token: Token,\n amountMinimum: JSBI,\n recipient: string,\n feeOptions?: FeeOptions\n ): string {\n recipient = validateAndParseAddress(recipient)\n\n if (!!feeOptions) {\n const feeBips = this.encodeFeeBips(feeOptions.fee)\n const feeRecipient: string = validateAndParseAddress(feeOptions.recipient)\n\n return Payments.INTERFACE.encodeFunctionData('sweepTokenWithFee', [\n token.address,\n toHex(amountMinimum),\n recipient,\n feeBips,\n feeRecipient\n ])\n } else {\n return Payments.INTERFACE.encodeFunctionData('sweepToken', [token.address, toHex(amountMinimum), recipient])\n }\n }\n\n public static encodeRefundETH(): string {\n return Payments.INTERFACE.encodeFunctionData('refundETH')\n }\n}\n","import {\n BigintIsh,\n Percent,\n Token,\n CurrencyAmount,\n validateAndParseAddress,\n Currency,\n NativeCurrency\n} from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Position } from './entities/position'\nimport { ONE, ZERO } from './internalConstants'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { ADDRESS_ZERO } from './constants'\nimport { Pool } from './entities'\nimport { Multicall } from './multicall'\nimport { Payments } from './payments'\n\nconst MaxUint128 = toHex(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(128)), JSBI.BigInt(1)))\n\nexport interface MintSpecificOptions {\n /**\n * The account that should receive the minted NFT.\n */\n recipient: string\n\n /**\n * Creates pool if not initialized before mint.\n */\n createPool?: boolean\n}\n\nexport interface IncreaseSpecificOptions {\n /**\n * Indicates the ID of the position to increase liquidity for.\n */\n tokenId: BigintIsh\n}\n\n/**\n * Options for producing the calldata to add liquidity.\n */\nexport interface CommonAddLiquidityOptions {\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false\n */\n useNative?: NativeCurrency\n\n /**\n * The optional permit parameters for spending token0\n */\n token0Permit?: PermitOptions\n\n /**\n * The optional permit parameters for spending token1\n */\n token1Permit?: PermitOptions\n}\n\nexport type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions\nexport type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions\n\nexport type AddLiquidityOptions = MintOptions | IncreaseOptions\n\nexport interface SafeTransferOptions {\n /**\n * The account sending the NFT.\n */\n sender: string\n\n /**\n * The account that should receive the NFT.\n */\n recipient: string\n\n /**\n * The id of the token being sent.\n */\n tokenId: BigintIsh\n /**\n * The optional parameter that passes data to the `onERC721Received` call for the staker\n */\n data?: string\n}\n\n// type guard\nfunction isMint(options: AddLiquidityOptions): options is MintOptions {\n return Object.keys(options).some(k => k === 'recipient')\n}\n\nexport interface CollectOptions {\n /**\n * Indicates the ID of the position to collect for.\n */\n tokenId: BigintIsh\n\n /**\n * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed0: CurrencyAmount\n\n /**\n * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed1: CurrencyAmount\n\n /**\n * The account that should receive the tokens.\n */\n recipient: string\n}\n\nexport interface NFTPermitOptions {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n deadline: BigintIsh\n spender: string\n}\n\n/**\n * Options for producing the calldata to exit a position.\n */\nexport interface RemoveLiquidityOptions {\n /**\n * The ID of the token to exit\n */\n tokenId: BigintIsh\n\n /**\n * The percentage of position liquidity to exit.\n */\n liquidityPercentage: Percent\n\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether the NFT should be burned if the entire position is being exited, by default false.\n */\n burnToken?: boolean\n\n /**\n * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT\n */\n permit?: NFTPermitOptions\n\n /**\n * Parameters to be passed on to collect\n */\n collectOptions: Omit\n}\n\nexport abstract class NonfungiblePositionManager {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n private static encodeCreate(pool: Pool): string {\n return NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [\n pool.token0.address,\n pool.token1.address,\n pool.fee,\n toHex(pool.sqrtRatioX96)\n ])\n }\n\n public static createCallParameters(pool: Pool): MethodParameters {\n return {\n calldata: this.encodeCreate(pool),\n value: toHex(0)\n }\n }\n\n public static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters {\n invariant(JSBI.greaterThan(position.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n const calldatas: string[] = []\n\n // get amounts\n const { amount0: amount0Desired, amount1: amount1Desired } = position.mintAmounts\n\n // adjust for slippage\n const minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance)\n const amount0Min = toHex(minimumAmounts.amount0)\n const amount1Min = toHex(minimumAmounts.amount1)\n\n const deadline = toHex(options.deadline)\n\n // create pool if needed\n if (isMint(options) && options.createPool) {\n calldatas.push(this.encodeCreate(position.pool))\n }\n\n // permits if necessary\n if (options.token0Permit) {\n calldatas.push(SelfPermit.encodePermit(position.pool.token0, options.token0Permit))\n }\n if (options.token1Permit) {\n calldatas.push(SelfPermit.encodePermit(position.pool.token1, options.token1Permit))\n }\n\n // mint\n if (isMint(options)) {\n const recipient: string = validateAndParseAddress(options.recipient)\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [\n {\n token0: position.pool.token0.address,\n token1: position.pool.token1.address,\n fee: position.pool.fee,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper,\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n recipient,\n deadline\n }\n ])\n )\n } else {\n // increase\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [\n {\n tokenId: toHex(options.tokenId),\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n deadline\n }\n ])\n )\n }\n\n let value: string = toHex(0)\n\n if (options.useNative) {\n const wrapped = options.useNative.wrapped\n invariant(position.pool.token0.equals(wrapped) || position.pool.token1.equals(wrapped), 'NO_WETH')\n\n const wrappedValue = position.pool.token0.equals(wrapped) ? amount0Desired : amount1Desired\n\n // we only need to refund if we're actually sending ETH\n if (JSBI.greaterThan(wrappedValue, ZERO)) {\n calldatas.push(Payments.encodeRefundETH())\n }\n\n value = toHex(wrappedValue)\n }\n\n return {\n calldata: Multicall.encodeMulticall(calldatas),\n value\n }\n }\n\n private static encodeCollect(options: CollectOptions): string[] {\n const calldatas: string[] = []\n\n const tokenId = toHex(options.tokenId)\n\n const involvesETH =\n options.expectedCurrencyOwed0.currency.isNative || options.expectedCurrencyOwed1.currency.isNative\n\n const recipient = validateAndParseAddress(options.recipient)\n\n // collect\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [\n {\n tokenId,\n recipient: involvesETH ? ADDRESS_ZERO : recipient,\n amount0Max: MaxUint128,\n amount1Max: MaxUint128\n }\n ])\n )\n\n if (involvesETH) {\n const ethAmount = options.expectedCurrencyOwed0.currency.isNative\n ? options.expectedCurrencyOwed0.quotient\n : options.expectedCurrencyOwed1.quotient\n const token = options.expectedCurrencyOwed0.currency.isNative\n ? (options.expectedCurrencyOwed1.currency as Token)\n : (options.expectedCurrencyOwed0.currency as Token)\n const tokenAmount = options.expectedCurrencyOwed0.currency.isNative\n ? options.expectedCurrencyOwed1.quotient\n : options.expectedCurrencyOwed0.quotient\n\n calldatas.push(Payments.encodeUnwrapWETH9(ethAmount, recipient))\n calldatas.push(Payments.encodeSweepToken(token, tokenAmount, recipient))\n }\n\n return calldatas\n }\n\n public static collectCallParameters(options: CollectOptions): MethodParameters {\n const calldatas: string[] = NonfungiblePositionManager.encodeCollect(options)\n\n return {\n calldata: Multicall.encodeMulticall(calldatas),\n value: toHex(0)\n }\n }\n\n /**\n * Produces the calldata for completely or partially exiting a position\n * @param position The position to exit\n * @param options Additional information necessary for generating the calldata\n * @returns The call parameters\n */\n public static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters {\n const calldatas: string[] = []\n\n const deadline = toHex(options.deadline)\n const tokenId = toHex(options.tokenId)\n\n // construct a partial position with a percentage of liquidity\n const partialPosition = new Position({\n pool: position.pool,\n liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper\n })\n invariant(JSBI.greaterThan(partialPosition.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n // slippage-adjusted underlying amounts\n const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(\n options.slippageTolerance\n )\n\n if (options.permit) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [\n validateAndParseAddress(options.permit.spender),\n tokenId,\n toHex(options.permit.deadline),\n options.permit.v,\n options.permit.r,\n options.permit.s\n ])\n )\n }\n\n // remove liquidity\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [\n {\n tokenId,\n liquidity: toHex(partialPosition.liquidity),\n amount0Min: toHex(amount0Min),\n amount1Min: toHex(amount1Min),\n deadline\n }\n ])\n )\n\n const { expectedCurrencyOwed0, expectedCurrencyOwed1, ...rest } = options.collectOptions\n calldatas.push(\n ...NonfungiblePositionManager.encodeCollect({\n tokenId: toHex(options.tokenId),\n // add the underlying value to the expected currency already owed\n expectedCurrencyOwed0: expectedCurrencyOwed0.add(\n CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency, amount0Min)\n ),\n expectedCurrencyOwed1: expectedCurrencyOwed1.add(\n CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency, amount1Min)\n ),\n ...rest\n })\n )\n\n if (options.liquidityPercentage.equalTo(ONE)) {\n if (options.burnToken) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId]))\n }\n } else {\n invariant(options.burnToken !== true, 'CANNOT_BURN')\n }\n\n return {\n calldata: Multicall.encodeMulticall(calldatas),\n value: toHex(0)\n }\n }\n\n public static safeTransferFromParameters(options: SafeTransferOptions): MethodParameters {\n const recipient = validateAndParseAddress(options.recipient)\n const sender = validateAndParseAddress(options.sender)\n\n let calldata: string\n if (options.data) {\n calldata = NonfungiblePositionManager.INTERFACE.encodeFunctionData(\n 'safeTransferFrom(address,address,uint256,bytes)',\n [sender, recipient, toHex(options.tokenId), options.data]\n )\n } else {\n calldata = NonfungiblePositionManager.INTERFACE.encodeFunctionData('safeTransferFrom(address,address,uint256)', [\n sender,\n recipient,\n toHex(options.tokenId)\n ])\n }\n return {\n calldata: calldata,\n value: toHex(0)\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/lens/Quoter.sol/Quoter.json'\nimport { Route } from './entities'\nimport invariant from 'tiny-invariant'\n\n/**\n * Optional arguments to send to the quoter.\n */\nexport interface QuoteOptions {\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n}\n\n/**\n * Represents the Uniswap V3 QuoterV1 contract with a method for returning the formatted\n * calldata needed to call the quoter contract.\n */\nexport abstract class SwapQuoter {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Produces the on-chain method name of the appropriate function within QuoterV2,\n * and the relevant hex encoded parameters.\n * @template TInput The input token, either Ether or an ERC-20\n * @template TOutput The output token, either Ether or an ERC-20\n * @param route The swap route, a list of pools through which a swap can occur\n * @param amount The amount of the quote, either an amount in, or an amount out\n * @param tradeType The trade type, either exact input or exact output\n * @returns The formatted calldata\n */\n public static quoteCallParameters(\n route: Route,\n amount: CurrencyAmount,\n tradeType: TradeType,\n options: QuoteOptions = {}\n ): MethodParameters {\n const singleHop = route.pools.length === 1\n const quoteAmount: string = toHex(amount.quotient)\n let calldata: string\n\n if (singleHop) {\n if (tradeType === TradeType.EXACT_INPUT) {\n calldata = SwapQuoter.INTERFACE.encodeFunctionData(`quoteExactInputSingle`, [\n route.tokenPath[0].address,\n route.tokenPath[1].address,\n route.pools[0].fee,\n quoteAmount,\n toHex(options?.sqrtPriceLimitX96 ?? 0)\n ])\n } else {\n calldata = SwapQuoter.INTERFACE.encodeFunctionData(`quoteExactOutputSingle`, [\n route.tokenPath[0].address,\n route.tokenPath[1].address,\n route.pools[0].fee,\n quoteAmount,\n toHex(options?.sqrtPriceLimitX96 ?? 0)\n ])\n }\n } else {\n invariant(options?.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n const path: string = encodeRouteToPath(route, tradeType === TradeType.EXACT_OUTPUT)\n\n if (tradeType === TradeType.EXACT_INPUT) {\n calldata = SwapQuoter.INTERFACE.encodeFunctionData('quoteExactInput', [path, quoteAmount])\n } else {\n calldata = SwapQuoter.INTERFACE.encodeFunctionData('quoteExactOutput', [path, quoteAmount])\n }\n }\n return {\n calldata,\n value: toHex(0)\n }\n }\n}\n","import { BigintIsh, Token, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { defaultAbiCoder, Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-staker/artifacts/contracts/UniswapV3Staker.sol/UniswapV3Staker.json'\nimport { Pool } from './entities'\nimport { Multicall } from './multicall'\n\nexport type FullWithdrawOptions = ClaimOptions & WithdrawOptions\n/**\n * Represents a unique staking program.\n */\nexport interface IncentiveKey {\n /**\n * The token rewarded for participating in the staking program.\n */\n rewardToken: Token\n /**\n * The pool that the staked positions must provide in.\n */\n pool: Pool\n /**\n * The time when the incentive program begins.\n */\n startTime: BigintIsh\n /**\n * The time that the incentive program ends.\n */\n endTime: BigintIsh\n /**\n * The address which receives any remaining reward tokens at `endTime`.\n */\n refundee: string\n}\n\n/**\n * Options to specify when claiming rewards.\n */\nexport interface ClaimOptions {\n /**\n * The id of the NFT\n */\n tokenId: BigintIsh\n\n /**\n * Address to send rewards to.\n */\n recipient: string\n\n /**\n * The amount of `rewardToken` to claim. 0 claims all.\n */\n amount?: BigintIsh\n}\n/**\n * Options to specify when withdrawing a position.\n */\nexport interface WithdrawOptions {\n /**\n * Set when withdrawing. The position will be sent to `owner` on withdraw.\n */\n owner: string\n\n /**\n * Set when withdrawing. `data` is passed to `safeTransferFrom` when transferring the position from contract back to owner.\n */\n data?: string\n}\n\nexport abstract class Staker {\n public static INTERFACE: Interface = new Interface(abi)\n\n protected constructor() {}\n private static INCENTIVE_KEY_ABI =\n 'tuple(address rewardToken, address pool, uint256 startTime, uint256 endTime, address refundee)'\n\n /**\n * To claim rewards, must unstake and then claim.\n * @param incentiveKey The unique identifier of a staking program.\n * @param options Options for producing the calldata to claim. Can't claim unless you unstake.\n * @returns The calldatas for 'unstakeToken' and 'claimReward'.\n */\n private static encodeClaim(incentiveKey: IncentiveKey, options: ClaimOptions): string[] {\n const calldatas: string[] = []\n calldatas.push(\n Staker.INTERFACE.encodeFunctionData('unstakeToken', [\n this._encodeIncentiveKey(incentiveKey),\n toHex(options.tokenId)\n ])\n )\n const recipient: string = validateAndParseAddress(options.recipient)\n const amount = options.amount ?? 0\n calldatas.push(\n Staker.INTERFACE.encodeFunctionData('claimReward', [incentiveKey.rewardToken.address, recipient, toHex(amount)])\n )\n return calldatas\n }\n\n /**\n *\n * Note: A `tokenId` can be staked in many programs but to claim rewards and continue the program you must unstake, claim, and then restake.\n * @param incentiveKeys An IncentiveKey or array of IncentiveKeys that `tokenId` is staked in.\n * Input an array of IncentiveKeys to claim rewards for each program.\n * @param options ClaimOptions to specify tokenId, recipient, and amount wanting to collect.\n * Note that you can only specify one amount and one recipient across the various programs if you are collecting from multiple programs at once.\n * @returns\n */\n public static collectRewards(incentiveKeys: IncentiveKey | IncentiveKey[], options: ClaimOptions): MethodParameters {\n incentiveKeys = Array.isArray(incentiveKeys) ? incentiveKeys : [incentiveKeys]\n let calldatas: string[] = []\n\n for (let i = 0; i < incentiveKeys.length; i++) {\n // the unique program tokenId is staked in\n const incentiveKey = incentiveKeys[i]\n // unstakes and claims for the unique program\n calldatas = calldatas.concat(this.encodeClaim(incentiveKey, options))\n // re-stakes the position for the unique program\n calldatas.push(\n Staker.INTERFACE.encodeFunctionData('stakeToken', [\n this._encodeIncentiveKey(incentiveKey),\n toHex(options.tokenId)\n ])\n )\n }\n return {\n calldata: Multicall.encodeMulticall(calldatas),\n value: toHex(0)\n }\n }\n\n /**\n *\n * @param incentiveKeys A list of incentiveKeys to unstake from. Should include all incentiveKeys (unique staking programs) that `options.tokenId` is staked in.\n * @param withdrawOptions Options for producing claim calldata and withdraw calldata. Can't withdraw without unstaking all programs for `tokenId`.\n * @returns Calldata for unstaking, claiming, and withdrawing.\n */\n public static withdrawToken(\n incentiveKeys: IncentiveKey | IncentiveKey[],\n withdrawOptions: FullWithdrawOptions\n ): MethodParameters {\n let calldatas: string[] = []\n\n incentiveKeys = Array.isArray(incentiveKeys) ? incentiveKeys : [incentiveKeys]\n\n const claimOptions = {\n tokenId: withdrawOptions.tokenId,\n recipient: withdrawOptions.recipient,\n amount: withdrawOptions.amount\n }\n\n for (let i = 0; i < incentiveKeys.length; i++) {\n const incentiveKey = incentiveKeys[i]\n calldatas = calldatas.concat(this.encodeClaim(incentiveKey, claimOptions))\n }\n const owner = validateAndParseAddress(withdrawOptions.owner)\n calldatas.push(\n Staker.INTERFACE.encodeFunctionData('withdrawToken', [\n toHex(withdrawOptions.tokenId),\n owner,\n withdrawOptions.data ? withdrawOptions.data : toHex(0)\n ])\n )\n return {\n calldata: Multicall.encodeMulticall(calldatas),\n value: toHex(0)\n }\n }\n\n /**\n *\n * @param incentiveKeys A single IncentiveKey or array of IncentiveKeys to be encoded and used in the data parameter in `safeTransferFrom`\n * @returns An IncentiveKey as a string\n */\n public static encodeDeposit(incentiveKeys: IncentiveKey | IncentiveKey[]): string {\n incentiveKeys = Array.isArray(incentiveKeys) ? incentiveKeys : [incentiveKeys]\n let data: string\n\n if (incentiveKeys.length > 1) {\n const keys = []\n for (let i = 0; i < incentiveKeys.length; i++) {\n const incentiveKey = incentiveKeys[i]\n keys.push(this._encodeIncentiveKey(incentiveKey))\n }\n data = defaultAbiCoder.encode([`${Staker.INCENTIVE_KEY_ABI}[]`], [keys])\n } else {\n data = defaultAbiCoder.encode([Staker.INCENTIVE_KEY_ABI], [this._encodeIncentiveKey(incentiveKeys[0])])\n }\n return data\n }\n /**\n *\n * @param incentiveKey An `IncentiveKey` which represents a unique staking program.\n * @returns An encoded IncentiveKey to be read by ethers\n */\n private static _encodeIncentiveKey(incentiveKey: IncentiveKey): {} {\n const { token0, token1, fee } = incentiveKey.pool\n const refundee = validateAndParseAddress(incentiveKey.refundee)\n return {\n rewardToken: incentiveKey.rewardToken.address,\n pool: Pool.getAddress(token0, token1, fee),\n startTime: toHex(incentiveKey.startTime),\n endTime: toHex(incentiveKey.endTime),\n refundee\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, CurrencyAmount, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { Trade } from './entities/trade'\nimport { ADDRESS_ZERO } from './constants'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'\nimport { Multicall } from './multicall'\nimport { FeeOptions, Payments } from './payments'\n\n/**\n * Options for producing the arguments to send calls to the router.\n */\nexport interface SwapOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n slippageTolerance: Percent\n\n /**\n * The account that should receive the output.\n */\n recipient: string\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * The optional permit parameters for spending the input.\n */\n inputTokenPermit?: PermitOptions\n\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n\n /**\n * Optional information for taking a fee on output.\n */\n fee?: FeeOptions\n}\n\n/**\n * Represents the Uniswap V3 SwapRouter, and has static methods for helping execute trades.\n */\nexport abstract class SwapRouter {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trades: Trade | Trade[],\n options: SwapOptions\n ): MethodParameters {\n if (!Array.isArray(trades)) {\n trades = [trades]\n }\n\n const sampleTrade = trades[0]\n const tokenIn = sampleTrade.inputAmount.currency.wrapped\n const tokenOut = sampleTrade.outputAmount.currency.wrapped\n\n // All trades should have the same starting and ending token.\n invariant(\n trades.every(trade => trade.inputAmount.currency.wrapped.equals(tokenIn)),\n 'TOKEN_IN_DIFF'\n )\n invariant(\n trades.every(trade => trade.outputAmount.currency.wrapped.equals(tokenOut)),\n 'TOKEN_OUT_DIFF'\n )\n\n const calldatas: string[] = []\n\n const ZERO_IN: CurrencyAmount = CurrencyAmount.fromRawAmount(trades[0].inputAmount.currency, 0)\n const ZERO_OUT: CurrencyAmount = CurrencyAmount.fromRawAmount(trades[0].outputAmount.currency, 0)\n\n const totalAmountOut: CurrencyAmount = trades.reduce(\n (sum, trade) => sum.add(trade.minimumAmountOut(options.slippageTolerance)),\n ZERO_OUT\n )\n\n // flag for whether a refund needs to happen\n const mustRefund = sampleTrade.inputAmount.currency.isNative && sampleTrade.tradeType === TradeType.EXACT_OUTPUT\n const inputIsNative = sampleTrade.inputAmount.currency.isNative\n // flags for whether funds should be send first to the router\n const outputIsNative = sampleTrade.outputAmount.currency.isNative\n const routerMustCustody = outputIsNative || !!options.fee\n\n const totalValue: CurrencyAmount = inputIsNative\n ? trades.reduce((sum, trade) => sum.add(trade.maximumAmountIn(options.slippageTolerance)), ZERO_IN)\n : ZERO_IN\n\n // encode permit if necessary\n if (options.inputTokenPermit) {\n invariant(sampleTrade.inputAmount.currency.isToken, 'NON_TOKEN_PERMIT')\n calldatas.push(SelfPermit.encodePermit(sampleTrade.inputAmount.currency, options.inputTokenPermit))\n }\n\n const recipient: string = validateAndParseAddress(options.recipient)\n const deadline = toHex(options.deadline)\n\n for (const trade of trades) {\n for (const { route, inputAmount, outputAmount } of trade.swaps) {\n const amountIn: string = toHex(trade.maximumAmountIn(options.slippageTolerance, inputAmount).quotient)\n const amountOut: string = toHex(trade.minimumAmountOut(options.slippageTolerance, outputAmount).quotient)\n\n // flag for whether the trade is single hop or not\n const singleHop = route.pools.length === 1\n\n if (singleHop) {\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputSingleParams = {\n tokenIn: route.tokenPath[0].address,\n tokenOut: route.tokenPath[1].address,\n fee: route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams]))\n } else {\n const exactOutputSingleParams = {\n tokenIn: route.tokenPath[0].address,\n tokenOut: route.tokenPath[1].address,\n fee: route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams]))\n }\n } else {\n invariant(options.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n\n const path: string = encodeRouteToPath(route, trade.tradeType === TradeType.EXACT_OUTPUT)\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams]))\n } else {\n const exactOutputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams]))\n }\n }\n }\n }\n\n // unwrap\n if (routerMustCustody) {\n if (!!options.fee) {\n if (outputIsNative) {\n calldatas.push(Payments.encodeUnwrapWETH9(totalAmountOut.quotient, recipient, options.fee))\n } else {\n calldatas.push(\n Payments.encodeSweepToken(\n sampleTrade.outputAmount.currency.wrapped,\n totalAmountOut.quotient,\n recipient,\n options.fee\n )\n )\n }\n } else {\n calldatas.push(Payments.encodeUnwrapWETH9(totalAmountOut.quotient, recipient))\n }\n }\n\n // refund\n if (mustRefund) {\n calldatas.push(Payments.encodeRefundETH())\n }\n\n return {\n calldata: Multicall.encodeMulticall(calldatas),\n value: toHex(totalValue.quotient)\n }\n }\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Coin = void 0;\nvar json_1 = require(\"../util/json\");\nvar numeric_1 = require(\"./numeric\");\nvar coin_1 = require(\"@terra-money/terra.proto/cosmos/base/v1beta1/coin\");\n/**\n * Captures `sdk.Coin` and `sdk.DecCoin` from Cosmos SDK. A composite value that combines\n * a denomination with an amount value. Coins are immutable once created, and operations\n * that return Coin will return a new Coin. See [[Coins]] for a collection of Coin objects.\n */\nvar Coin = /** @class */ (function (_super) {\n __extends(Coin, _super);\n /**\n * Creates a new coin. Depending on the type of amount, it will be converted to an\n * integer coin or decimal coin.\n *\n * @param denom denomination\n * @param amount coin's amount\n */\n function Coin(denom, amount) {\n var _this = _super.call(this) || this;\n _this.denom = denom;\n _this.amount = numeric_1.Numeric.parse(amount);\n return _this;\n }\n /**\n * Checks whether the Coin is an Integer coin.\n */\n Coin.prototype.isIntCoin = function () {\n // TODO: convert into typeguard\n return this.amount instanceof numeric_1.Int;\n };\n /**\n * Checks whether the Coin is a Decimal coin.\n */\n Coin.prototype.isDecCoin = function () {\n return this.amount instanceof numeric_1.Dec;\n };\n /**\n * Turns the Coin into an Integer coin.\n */\n Coin.prototype.toIntCoin = function () {\n return new Coin(this.denom, new numeric_1.Int(this.amount));\n };\n /**\n * Turns the Coin into an Integer coin with ceiling the amount.\n */\n Coin.prototype.toIntCeilCoin = function () {\n return new Coin(this.denom, new numeric_1.Int(this.amount.ceil()));\n };\n /**\n * Turns the Coin into a Decimal coin.\n */\n Coin.prototype.toDecCoin = function () {\n return new Coin(this.denom, new numeric_1.Dec(this.amount));\n };\n /**\n * Outputs ``.\n *\n * Eg: `Coin('uluna', 1500) -> 1500uluna`\n */\n Coin.prototype.toString = function () {\n var amount = this.amount.toFixed();\n if (this.isDecCoin() && amount.indexOf('.') === -1) {\n return amount + \".0\" + this.denom;\n }\n return \"\" + amount + this.denom;\n };\n Coin.fromString = function (str) {\n var m = str.match(/^(-?[0-9]+(\\.[0-9]+)?)([0-9a-zA-Z/]+)$/);\n if (m === null) {\n throw new Error(\"failed to parse to Coin: \" + str);\n }\n var amount = m[1];\n var denom = m[3];\n return new Coin(denom, amount);\n };\n /**\n * Creates a new Coin adding to the current value.\n *\n * @param other\n */\n Coin.prototype.add = function (other) {\n var otherAmount;\n if (other instanceof Coin) {\n if (other.denom !== this.denom) {\n throw new Coin.ArithmeticError(\"cannot add two Coins of different denoms: \" + this.denom + \" and \" + other.denom);\n }\n otherAmount = other.amount;\n }\n else {\n otherAmount = other;\n }\n otherAmount = numeric_1.Numeric.parse(otherAmount);\n return new Coin(this.denom, this.amount.add(otherAmount));\n };\n /**\n * Creates a new Coin subtracting from the current value.\n * @param other\n */\n Coin.prototype.sub = function (other) {\n var otherAmount;\n if (other instanceof Coin) {\n if (other.denom !== this.denom) {\n throw new Coin.ArithmeticError(\"cannot subtract two Coins of different denoms: \" + this.denom + \" and \" + other.denom);\n }\n otherAmount = other.amount;\n }\n else {\n otherAmount = other;\n }\n otherAmount = numeric_1.Numeric.parse(otherAmount);\n return new Coin(this.denom, this.amount.sub(otherAmount));\n };\n /**\n * Multiplies the current value with an amount.\n * @param other\n */\n Coin.prototype.mul = function (other) {\n var otherAmount = numeric_1.Numeric.parse(other);\n return new Coin(this.denom, this.amount.mul(otherAmount));\n };\n /**\n * Divides the current value with an amount.\n * @param other\n */\n Coin.prototype.div = function (other) {\n var otherAmount = numeric_1.Numeric.parse(other);\n return new Coin(this.denom, this.amount.div(otherAmount));\n };\n /**\n * Modulo the current value with an amount.\n * @param other\n */\n Coin.prototype.mod = function (other) {\n var otherAmount = numeric_1.Numeric.parse(other);\n return new Coin(this.denom, this.amount.mod(otherAmount));\n };\n Coin.fromAmino = function (data) {\n var denom = data.denom, amount = data.amount;\n return new Coin(denom, amount);\n };\n Coin.prototype.toAmino = function () {\n var _a = this, denom = _a.denom, amount = _a.amount;\n return {\n denom: denom,\n amount: amount.toString(),\n };\n };\n Coin.fromData = function (data) {\n var denom = data.denom, amount = data.amount;\n return new Coin(denom, amount);\n };\n Coin.prototype.toData = function () {\n var _a = this, denom = _a.denom, amount = _a.amount;\n return {\n denom: denom,\n amount: amount.toString(),\n };\n };\n Coin.fromProto = function (proto) {\n return new Coin(proto.denom, numeric_1.Numeric.parse(proto.amount));\n };\n Coin.prototype.toProto = function () {\n return coin_1.Coin.fromPartial({\n denom: this.denom,\n amount: this.amount.toString(),\n });\n };\n return Coin;\n}(json_1.JSONSerializable));\nexports.Coin = Coin;\n(function (Coin) {\n var ArithmeticError = /** @class */ (function () {\n function ArithmeticError(message) {\n this.message = message;\n }\n return ArithmeticError;\n }());\n Coin.ArithmeticError = ArithmeticError;\n})(Coin = exports.Coin || (exports.Coin = {}));\nexports.Coin = Coin;\n//# sourceMappingURL=Coin.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Height = void 0;\nvar client_1 = require(\"@terra-money/terra.proto/ibc/core/client/v1/client\");\nvar Long = __importStar(require(\"long\"));\nvar json_1 = require(\"../../../../util/json\");\n/**\n * Height is a monotonically increasing data type\n * that can be compared against another Height for the purposes of updating and\n * freezing clients\n *\n * Normally the RevisionHeight is incremented at each height while keeping\n * RevisionNumber the same. However some consensus algorithms may choose to\n * reset the height in certain conditions e.g. hard forks, state-machine\n * breaking changes In these cases, the RevisionNumber is incremented so that\n * height continues to be monitonically increasing even as the RevisionHeight\n * gets reset\n */\nvar Height = /** @class */ (function (_super) {\n __extends(Height, _super);\n /**\n * @param revision_number the revision that the client is currently on\n * @param revision_height the height within the given revision\n */\n function Height(revision_number, revision_height) {\n var _this = _super.call(this) || this;\n _this.revision_number = revision_number;\n _this.revision_height = revision_height;\n return _this;\n }\n Height.fromAmino = function (data) {\n var revision_number = data.revision_number, revision_height = data.revision_height;\n return new Height(parseInt(revision_number), parseInt(revision_height));\n };\n Height.prototype.toAmino = function () {\n var _a = this, revision_number = _a.revision_number, revision_height = _a.revision_height;\n var res = {\n revision_number: revision_number.toFixed(),\n revision_height: revision_height.toFixed(),\n };\n return res;\n };\n Height.fromData = function (data) {\n var revision_number = data.revision_number, revision_height = data.revision_height;\n return new Height(Number.parseInt(revision_number), Number.parseInt(revision_height));\n };\n Height.prototype.toData = function () {\n var _a = this, revision_number = _a.revision_number, revision_height = _a.revision_height;\n var res = {\n revision_number: revision_number.toFixed(),\n revision_height: revision_height.toFixed(),\n };\n return res;\n };\n Height.fromProto = function (proto) {\n return new Height(proto.revisionNumber.toNumber(), proto.revisionHeight.toNumber());\n };\n Height.prototype.toProto = function () {\n var _a = this, revision_number = _a.revision_number, revision_height = _a.revision_height;\n return client_1.Height.fromPartial({\n revisionNumber: Long.fromNumber(revision_number),\n revisionHeight: Long.fromNumber(revision_height),\n });\n };\n return Height;\n}(json_1.JSONSerializable));\nexports.Height = Height;\n//# sourceMappingURL=Height.js.map","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nexport var easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n}; // Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\n\nexport var duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\n\nfunction formatMs(milliseconds) {\n return \"\".concat(Math.round(milliseconds), \"ms\");\n}\n/**\n * @param {string|Array} props\n * @param {object} param\n * @param {string} param.prop\n * @param {number} param.duration\n * @param {string} param.easing\n * @param {number} param.delay\n */\n\n\nexport default {\n easing: easing,\n duration: duration,\n create: function create() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all'];\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _options$duration = options.duration,\n durationOption = _options$duration === void 0 ? duration.standard : _options$duration,\n _options$easing = options.easing,\n easingOption = _options$easing === void 0 ? easing.easeInOut : _options$easing,\n _options$delay = options.delay,\n delay = _options$delay === void 0 ? 0 : _options$delay,\n other = _objectWithoutProperties(options, [\"duration\", \"easing\", \"delay\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n var isString = function isString(value) {\n return typeof value === 'string';\n };\n\n var isNumber = function isNumber(value) {\n return !isNaN(parseFloat(value));\n };\n\n if (!isString(props) && !Array.isArray(props)) {\n console.error('Material-UI: Argument \"props\" must be a string or Array.');\n }\n\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(\"Material-UI: Argument \\\"duration\\\" must be a number or a string but found \".concat(durationOption, \".\"));\n }\n\n if (!isString(easingOption)) {\n console.error('Material-UI: Argument \"easing\" must be a string.');\n }\n\n if (!isNumber(delay) && !isString(delay)) {\n console.error('Material-UI: Argument \"delay\" must be a number or a string.');\n }\n\n if (Object.keys(other).length !== 0) {\n console.error(\"Material-UI: Unrecognized argument(s) [\".concat(Object.keys(other).join(','), \"].\"));\n }\n }\n\n return (Array.isArray(props) ? props : [props]).map(function (animatedProp) {\n return \"\".concat(animatedProp, \" \").concat(typeof durationOption === 'string' ? durationOption : formatMs(durationOption), \" \").concat(easingOption, \" \").concat(typeof delay === 'string' ? delay : formatMs(delay));\n }).join(',');\n },\n getAutoHeightDuration: function getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n\n var constant = height / 36; // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n\n return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);\n }\n};","export var CHAIN_ID_SOLANA = 1;\nexport var CHAIN_ID_ETH = 2;\nexport var CHAIN_ID_TERRA = 3;\nexport var CHAIN_ID_BSC = 4;\nexport var CHAIN_ID_POLYGON = 5;\nexport var CHAIN_ID_AVAX = 6;\nexport var CHAIN_ID_OASIS = 7;\nexport var CHAIN_ID_ALGORAND = 8;\nexport var CHAIN_ID_ETHEREUM_ROPSTEN = 10001;\nexport var WSOL_ADDRESS = \"So11111111111111111111111111111111111111112\";\nexport var WSOL_DECIMALS = 9;\nexport var MAX_VAA_DECIMALS = 8;\n","(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n var i, r = new Float64Array(16);\n if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n return r;\n};\n\n// Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _0 = new Uint8Array(16);\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n gf1 = gf([1]),\n _121665 = gf([0xdb41, 1]),\n D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction ts64(x, i, h, l) {\n x[i] = (h >> 24) & 0xff;\n x[i+1] = (h >> 16) & 0xff;\n x[i+2] = (h >> 8) & 0xff;\n x[i+3] = h & 0xff;\n x[i+4] = (l >> 24) & 0xff;\n x[i+5] = (l >> 16) & 0xff;\n x[i+6] = (l >> 8) & 0xff;\n x[i+7] = l & 0xff;\n}\n\nfunction vn(x, xi, y, yi, n) {\n var i,d = 0;\n for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_16(x, xi, y, yi) {\n return vn(x,xi,y,yi,16);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n return vn(x,xi,y,yi,32);\n}\n\nfunction core_salsa20(o, p, k, c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n x0 = x0 + j0 | 0;\n x1 = x1 + j1 | 0;\n x2 = x2 + j2 | 0;\n x3 = x3 + j3 | 0;\n x4 = x4 + j4 | 0;\n x5 = x5 + j5 | 0;\n x6 = x6 + j6 | 0;\n x7 = x7 + j7 | 0;\n x8 = x8 + j8 | 0;\n x9 = x9 + j9 | 0;\n x10 = x10 + j10 | 0;\n x11 = x11 + j11 | 0;\n x12 = x12 + j12 | 0;\n x13 = x13 + j13 | 0;\n x14 = x14 + j14 | 0;\n x15 = x15 + j15 | 0;\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x1 >>> 0 & 0xff;\n o[ 5] = x1 >>> 8 & 0xff;\n o[ 6] = x1 >>> 16 & 0xff;\n o[ 7] = x1 >>> 24 & 0xff;\n\n o[ 8] = x2 >>> 0 & 0xff;\n o[ 9] = x2 >>> 8 & 0xff;\n o[10] = x2 >>> 16 & 0xff;\n o[11] = x2 >>> 24 & 0xff;\n\n o[12] = x3 >>> 0 & 0xff;\n o[13] = x3 >>> 8 & 0xff;\n o[14] = x3 >>> 16 & 0xff;\n o[15] = x3 >>> 24 & 0xff;\n\n o[16] = x4 >>> 0 & 0xff;\n o[17] = x4 >>> 8 & 0xff;\n o[18] = x4 >>> 16 & 0xff;\n o[19] = x4 >>> 24 & 0xff;\n\n o[20] = x5 >>> 0 & 0xff;\n o[21] = x5 >>> 8 & 0xff;\n o[22] = x5 >>> 16 & 0xff;\n o[23] = x5 >>> 24 & 0xff;\n\n o[24] = x6 >>> 0 & 0xff;\n o[25] = x6 >>> 8 & 0xff;\n o[26] = x6 >>> 16 & 0xff;\n o[27] = x6 >>> 24 & 0xff;\n\n o[28] = x7 >>> 0 & 0xff;\n o[29] = x7 >>> 8 & 0xff;\n o[30] = x7 >>> 16 & 0xff;\n o[31] = x7 >>> 24 & 0xff;\n\n o[32] = x8 >>> 0 & 0xff;\n o[33] = x8 >>> 8 & 0xff;\n o[34] = x8 >>> 16 & 0xff;\n o[35] = x8 >>> 24 & 0xff;\n\n o[36] = x9 >>> 0 & 0xff;\n o[37] = x9 >>> 8 & 0xff;\n o[38] = x9 >>> 16 & 0xff;\n o[39] = x9 >>> 24 & 0xff;\n\n o[40] = x10 >>> 0 & 0xff;\n o[41] = x10 >>> 8 & 0xff;\n o[42] = x10 >>> 16 & 0xff;\n o[43] = x10 >>> 24 & 0xff;\n\n o[44] = x11 >>> 0 & 0xff;\n o[45] = x11 >>> 8 & 0xff;\n o[46] = x11 >>> 16 & 0xff;\n o[47] = x11 >>> 24 & 0xff;\n\n o[48] = x12 >>> 0 & 0xff;\n o[49] = x12 >>> 8 & 0xff;\n o[50] = x12 >>> 16 & 0xff;\n o[51] = x12 >>> 24 & 0xff;\n\n o[52] = x13 >>> 0 & 0xff;\n o[53] = x13 >>> 8 & 0xff;\n o[54] = x13 >>> 16 & 0xff;\n o[55] = x13 >>> 24 & 0xff;\n\n o[56] = x14 >>> 0 & 0xff;\n o[57] = x14 >>> 8 & 0xff;\n o[58] = x14 >>> 16 & 0xff;\n o[59] = x14 >>> 24 & 0xff;\n\n o[60] = x15 >>> 0 & 0xff;\n o[61] = x15 >>> 8 & 0xff;\n o[62] = x15 >>> 16 & 0xff;\n o[63] = x15 >>> 24 & 0xff;\n}\n\nfunction core_hsalsa20(o,p,k,c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x5 >>> 0 & 0xff;\n o[ 5] = x5 >>> 8 & 0xff;\n o[ 6] = x5 >>> 16 & 0xff;\n o[ 7] = x5 >>> 24 & 0xff;\n\n o[ 8] = x10 >>> 0 & 0xff;\n o[ 9] = x10 >>> 8 & 0xff;\n o[10] = x10 >>> 16 & 0xff;\n o[11] = x10 >>> 24 & 0xff;\n\n o[12] = x15 >>> 0 & 0xff;\n o[13] = x15 >>> 8 & 0xff;\n o[14] = x15 >>> 16 & 0xff;\n o[15] = x15 >>> 24 & 0xff;\n\n o[16] = x6 >>> 0 & 0xff;\n o[17] = x6 >>> 8 & 0xff;\n o[18] = x6 >>> 16 & 0xff;\n o[19] = x6 >>> 24 & 0xff;\n\n o[20] = x7 >>> 0 & 0xff;\n o[21] = x7 >>> 8 & 0xff;\n o[22] = x7 >>> 16 & 0xff;\n o[23] = x7 >>> 24 & 0xff;\n\n o[24] = x8 >>> 0 & 0xff;\n o[25] = x8 >>> 8 & 0xff;\n o[26] = x8 >>> 16 & 0xff;\n o[27] = x8 >>> 24 & 0xff;\n\n o[28] = x9 >>> 0 & 0xff;\n o[29] = x9 >>> 8 & 0xff;\n o[30] = x9 >>> 16 & 0xff;\n o[31] = x9 >>> 24 & 0xff;\n}\n\nfunction crypto_core_salsa20(out,inp,k,c) {\n core_salsa20(out,inp,k,c);\n}\n\nfunction crypto_core_hsalsa20(out,inp,k,c) {\n core_hsalsa20(out,inp,k,c);\n}\n\nvar sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);\n // \"expand 32-byte k\"\n\nfunction crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n mpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n }\n return 0;\n}\n\nfunction crypto_stream_salsa20(c,cpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = x[i];\n }\n return 0;\n}\n\nfunction crypto_stream(c,cpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20(c,cpos,d,sn,s);\n}\n\nfunction crypto_stream_xor(c,cpos,m,mpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);\n}\n\n/*\n* Port of Andrew Moon's Poly1305-donna-16. Public domain.\n* https://github.com/floodyberry/poly1305-donna\n*/\n\nvar poly1305 = function(key) {\n this.buffer = new Uint8Array(16);\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.leftover = 0;\n this.fin = 0;\n\n var t0, t1, t2, t3, t4, t5, t6, t7;\n\n t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;\n t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;\n t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;\n this.r[5] = ((t4 >>> 1)) & 0x1ffe;\n t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;\n t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n this.r[9] = ((t7 >>> 5)) & 0x007f;\n\n this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;\n this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;\n this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;\n this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;\n this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;\n this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;\n this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;\n this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;\n};\n\npoly1305.prototype.blocks = function(m, mpos, bytes) {\n var hibit = this.fin ? 0 : (1 << 11);\n var t0, t1, t2, t3, t4, t5, t6, t7, c;\n var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;\n\n var h0 = this.h[0],\n h1 = this.h[1],\n h2 = this.h[2],\n h3 = this.h[3],\n h4 = this.h[4],\n h5 = this.h[5],\n h6 = this.h[6],\n h7 = this.h[7],\n h8 = this.h[8],\n h9 = this.h[9];\n\n var r0 = this.r[0],\n r1 = this.r[1],\n r2 = this.r[2],\n r3 = this.r[3],\n r4 = this.r[4],\n r5 = this.r[5],\n r6 = this.r[6],\n r7 = this.r[7],\n r8 = this.r[8],\n r9 = this.r[9];\n\n while (bytes >= 16) {\n t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;\n t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;\n t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;\n h5 += ((t4 >>> 1)) & 0x1fff;\n t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;\n t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n h9 += ((t7 >>> 5)) | hibit;\n\n c = 0;\n\n d0 = c;\n d0 += h0 * r0;\n d0 += h1 * (5 * r9);\n d0 += h2 * (5 * r8);\n d0 += h3 * (5 * r7);\n d0 += h4 * (5 * r6);\n c = (d0 >>> 13); d0 &= 0x1fff;\n d0 += h5 * (5 * r5);\n d0 += h6 * (5 * r4);\n d0 += h7 * (5 * r3);\n d0 += h8 * (5 * r2);\n d0 += h9 * (5 * r1);\n c += (d0 >>> 13); d0 &= 0x1fff;\n\n d1 = c;\n d1 += h0 * r1;\n d1 += h1 * r0;\n d1 += h2 * (5 * r9);\n d1 += h3 * (5 * r8);\n d1 += h4 * (5 * r7);\n c = (d1 >>> 13); d1 &= 0x1fff;\n d1 += h5 * (5 * r6);\n d1 += h6 * (5 * r5);\n d1 += h7 * (5 * r4);\n d1 += h8 * (5 * r3);\n d1 += h9 * (5 * r2);\n c += (d1 >>> 13); d1 &= 0x1fff;\n\n d2 = c;\n d2 += h0 * r2;\n d2 += h1 * r1;\n d2 += h2 * r0;\n d2 += h3 * (5 * r9);\n d2 += h4 * (5 * r8);\n c = (d2 >>> 13); d2 &= 0x1fff;\n d2 += h5 * (5 * r7);\n d2 += h6 * (5 * r6);\n d2 += h7 * (5 * r5);\n d2 += h8 * (5 * r4);\n d2 += h9 * (5 * r3);\n c += (d2 >>> 13); d2 &= 0x1fff;\n\n d3 = c;\n d3 += h0 * r3;\n d3 += h1 * r2;\n d3 += h2 * r1;\n d3 += h3 * r0;\n d3 += h4 * (5 * r9);\n c = (d3 >>> 13); d3 &= 0x1fff;\n d3 += h5 * (5 * r8);\n d3 += h6 * (5 * r7);\n d3 += h7 * (5 * r6);\n d3 += h8 * (5 * r5);\n d3 += h9 * (5 * r4);\n c += (d3 >>> 13); d3 &= 0x1fff;\n\n d4 = c;\n d4 += h0 * r4;\n d4 += h1 * r3;\n d4 += h2 * r2;\n d4 += h3 * r1;\n d4 += h4 * r0;\n c = (d4 >>> 13); d4 &= 0x1fff;\n d4 += h5 * (5 * r9);\n d4 += h6 * (5 * r8);\n d4 += h7 * (5 * r7);\n d4 += h8 * (5 * r6);\n d4 += h9 * (5 * r5);\n c += (d4 >>> 13); d4 &= 0x1fff;\n\n d5 = c;\n d5 += h0 * r5;\n d5 += h1 * r4;\n d5 += h2 * r3;\n d5 += h3 * r2;\n d5 += h4 * r1;\n c = (d5 >>> 13); d5 &= 0x1fff;\n d5 += h5 * r0;\n d5 += h6 * (5 * r9);\n d5 += h7 * (5 * r8);\n d5 += h8 * (5 * r7);\n d5 += h9 * (5 * r6);\n c += (d5 >>> 13); d5 &= 0x1fff;\n\n d6 = c;\n d6 += h0 * r6;\n d6 += h1 * r5;\n d6 += h2 * r4;\n d6 += h3 * r3;\n d6 += h4 * r2;\n c = (d6 >>> 13); d6 &= 0x1fff;\n d6 += h5 * r1;\n d6 += h6 * r0;\n d6 += h7 * (5 * r9);\n d6 += h8 * (5 * r8);\n d6 += h9 * (5 * r7);\n c += (d6 >>> 13); d6 &= 0x1fff;\n\n d7 = c;\n d7 += h0 * r7;\n d7 += h1 * r6;\n d7 += h2 * r5;\n d7 += h3 * r4;\n d7 += h4 * r3;\n c = (d7 >>> 13); d7 &= 0x1fff;\n d7 += h5 * r2;\n d7 += h6 * r1;\n d7 += h7 * r0;\n d7 += h8 * (5 * r9);\n d7 += h9 * (5 * r8);\n c += (d7 >>> 13); d7 &= 0x1fff;\n\n d8 = c;\n d8 += h0 * r8;\n d8 += h1 * r7;\n d8 += h2 * r6;\n d8 += h3 * r5;\n d8 += h4 * r4;\n c = (d8 >>> 13); d8 &= 0x1fff;\n d8 += h5 * r3;\n d8 += h6 * r2;\n d8 += h7 * r1;\n d8 += h8 * r0;\n d8 += h9 * (5 * r9);\n c += (d8 >>> 13); d8 &= 0x1fff;\n\n d9 = c;\n d9 += h0 * r9;\n d9 += h1 * r8;\n d9 += h2 * r7;\n d9 += h3 * r6;\n d9 += h4 * r5;\n c = (d9 >>> 13); d9 &= 0x1fff;\n d9 += h5 * r4;\n d9 += h6 * r3;\n d9 += h7 * r2;\n d9 += h8 * r1;\n d9 += h9 * r0;\n c += (d9 >>> 13); d9 &= 0x1fff;\n\n c = (((c << 2) + c)) | 0;\n c = (c + d0) | 0;\n d0 = c & 0x1fff;\n c = (c >>> 13);\n d1 += c;\n\n h0 = d0;\n h1 = d1;\n h2 = d2;\n h3 = d3;\n h4 = d4;\n h5 = d5;\n h6 = d6;\n h7 = d7;\n h8 = d8;\n h9 = d9;\n\n mpos += 16;\n bytes -= 16;\n }\n this.h[0] = h0;\n this.h[1] = h1;\n this.h[2] = h2;\n this.h[3] = h3;\n this.h[4] = h4;\n this.h[5] = h5;\n this.h[6] = h6;\n this.h[7] = h7;\n this.h[8] = h8;\n this.h[9] = h9;\n};\n\npoly1305.prototype.finish = function(mac, macpos) {\n var g = new Uint16Array(10);\n var c, mask, f, i;\n\n if (this.leftover) {\n i = this.leftover;\n this.buffer[i++] = 1;\n for (; i < 16; i++) this.buffer[i] = 0;\n this.fin = 1;\n this.blocks(this.buffer, 0, 16);\n }\n\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n for (i = 2; i < 10; i++) {\n this.h[i] += c;\n c = this.h[i] >>> 13;\n this.h[i] &= 0x1fff;\n }\n this.h[0] += (c * 5);\n c = this.h[0] >>> 13;\n this.h[0] &= 0x1fff;\n this.h[1] += c;\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n this.h[2] += c;\n\n g[0] = this.h[0] + 5;\n c = g[0] >>> 13;\n g[0] &= 0x1fff;\n for (i = 1; i < 10; i++) {\n g[i] = this.h[i] + c;\n c = g[i] >>> 13;\n g[i] &= 0x1fff;\n }\n g[9] -= (1 << 13);\n\n mask = (c ^ 1) - 1;\n for (i = 0; i < 10; i++) g[i] &= mask;\n mask = ~mask;\n for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];\n\n this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;\n this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;\n this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;\n this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;\n this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;\n this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;\n this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;\n this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;\n\n f = this.h[0] + this.pad[0];\n this.h[0] = f & 0xffff;\n for (i = 1; i < 8; i++) {\n f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;\n this.h[i] = f & 0xffff;\n }\n\n mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;\n mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;\n mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;\n mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;\n mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;\n mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;\n mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;\n mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;\n mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;\n mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;\n mac[macpos+10] = (this.h[5] >>> 0) & 0xff;\n mac[macpos+11] = (this.h[5] >>> 8) & 0xff;\n mac[macpos+12] = (this.h[6] >>> 0) & 0xff;\n mac[macpos+13] = (this.h[6] >>> 8) & 0xff;\n mac[macpos+14] = (this.h[7] >>> 0) & 0xff;\n mac[macpos+15] = (this.h[7] >>> 8) & 0xff;\n};\n\npoly1305.prototype.update = function(m, mpos, bytes) {\n var i, want;\n\n if (this.leftover) {\n want = (16 - this.leftover);\n if (want > bytes)\n want = bytes;\n for (i = 0; i < want; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n bytes -= want;\n mpos += want;\n this.leftover += want;\n if (this.leftover < 16)\n return;\n this.blocks(this.buffer, 0, 16);\n this.leftover = 0;\n }\n\n if (bytes >= 16) {\n want = bytes - (bytes % 16);\n this.blocks(m, mpos, want);\n mpos += want;\n bytes -= want;\n }\n\n if (bytes) {\n for (i = 0; i < bytes; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n this.leftover += bytes;\n }\n};\n\nfunction crypto_onetimeauth(out, outpos, m, mpos, n, k) {\n var s = new poly1305(k);\n s.update(m, mpos, n);\n s.finish(out, outpos);\n return 0;\n}\n\nfunction crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {\n var x = new Uint8Array(16);\n crypto_onetimeauth(x,0,m,mpos,n,k);\n return crypto_verify_16(h,hpos,x,0);\n}\n\nfunction crypto_secretbox(c,m,d,n,k) {\n var i;\n if (d < 32) return -1;\n crypto_stream_xor(c,0,m,0,d,n,k);\n crypto_onetimeauth(c, 16, c, 32, d - 32, c);\n for (i = 0; i < 16; i++) c[i] = 0;\n return 0;\n}\n\nfunction crypto_secretbox_open(m,c,d,n,k) {\n var i;\n var x = new Uint8Array(32);\n if (d < 32) return -1;\n crypto_stream(x,0,32,n,k);\n if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;\n crypto_stream_xor(m,0,c,0,d,n,k);\n for (i = 0; i < 32; i++) m[i] = 0;\n return 0;\n}\n\nfunction set25519(r, a) {\n var i;\n for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n var i, v, c = 1;\n for (i = 0; i < 16; i++) {\n v = o[i] + c + 65535;\n c = Math.floor(v / 65536);\n o[i] = v - c * 65536;\n }\n o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n var t, c = ~(b-1);\n for (var i = 0; i < 16; i++) {\n t = c & (p[i] ^ q[i]);\n p[i] ^= t;\n q[i] ^= t;\n }\n}\n\nfunction pack25519(o, n) {\n var i, j, b;\n var m = gf(), t = gf();\n for (i = 0; i < 16; i++) t[i] = n[i];\n car25519(t);\n car25519(t);\n car25519(t);\n for (j = 0; j < 2; j++) {\n m[0] = t[0] - 0xffed;\n for (i = 1; i < 15; i++) {\n m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n m[i-1] &= 0xffff;\n }\n m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n b = (m[15]>>16) & 1;\n m[14] &= 0xffff;\n sel25519(t, m, 1-b);\n }\n for (i = 0; i < 16; i++) {\n o[2*i] = t[i] & 0xff;\n o[2*i+1] = t[i]>>8;\n }\n}\n\nfunction neq25519(a, b) {\n var c = new Uint8Array(32), d = new Uint8Array(32);\n pack25519(c, a);\n pack25519(d, b);\n return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n var d = new Uint8Array(32);\n pack25519(d, a);\n return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n var i;\n for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n var v, c,\n t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11],\n b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n\n v = a[0];\n t0 += v * b0;\n t1 += v * b1;\n t2 += v * b2;\n t3 += v * b3;\n t4 += v * b4;\n t5 += v * b5;\n t6 += v * b6;\n t7 += v * b7;\n t8 += v * b8;\n t9 += v * b9;\n t10 += v * b10;\n t11 += v * b11;\n t12 += v * b12;\n t13 += v * b13;\n t14 += v * b14;\n t15 += v * b15;\n v = a[1];\n t1 += v * b0;\n t2 += v * b1;\n t3 += v * b2;\n t4 += v * b3;\n t5 += v * b4;\n t6 += v * b5;\n t7 += v * b6;\n t8 += v * b7;\n t9 += v * b8;\n t10 += v * b9;\n t11 += v * b10;\n t12 += v * b11;\n t13 += v * b12;\n t14 += v * b13;\n t15 += v * b14;\n t16 += v * b15;\n v = a[2];\n t2 += v * b0;\n t3 += v * b1;\n t4 += v * b2;\n t5 += v * b3;\n t6 += v * b4;\n t7 += v * b5;\n t8 += v * b6;\n t9 += v * b7;\n t10 += v * b8;\n t11 += v * b9;\n t12 += v * b10;\n t13 += v * b11;\n t14 += v * b12;\n t15 += v * b13;\n t16 += v * b14;\n t17 += v * b15;\n v = a[3];\n t3 += v * b0;\n t4 += v * b1;\n t5 += v * b2;\n t6 += v * b3;\n t7 += v * b4;\n t8 += v * b5;\n t9 += v * b6;\n t10 += v * b7;\n t11 += v * b8;\n t12 += v * b9;\n t13 += v * b10;\n t14 += v * b11;\n t15 += v * b12;\n t16 += v * b13;\n t17 += v * b14;\n t18 += v * b15;\n v = a[4];\n t4 += v * b0;\n t5 += v * b1;\n t6 += v * b2;\n t7 += v * b3;\n t8 += v * b4;\n t9 += v * b5;\n t10 += v * b6;\n t11 += v * b7;\n t12 += v * b8;\n t13 += v * b9;\n t14 += v * b10;\n t15 += v * b11;\n t16 += v * b12;\n t17 += v * b13;\n t18 += v * b14;\n t19 += v * b15;\n v = a[5];\n t5 += v * b0;\n t6 += v * b1;\n t7 += v * b2;\n t8 += v * b3;\n t9 += v * b4;\n t10 += v * b5;\n t11 += v * b6;\n t12 += v * b7;\n t13 += v * b8;\n t14 += v * b9;\n t15 += v * b10;\n t16 += v * b11;\n t17 += v * b12;\n t18 += v * b13;\n t19 += v * b14;\n t20 += v * b15;\n v = a[6];\n t6 += v * b0;\n t7 += v * b1;\n t8 += v * b2;\n t9 += v * b3;\n t10 += v * b4;\n t11 += v * b5;\n t12 += v * b6;\n t13 += v * b7;\n t14 += v * b8;\n t15 += v * b9;\n t16 += v * b10;\n t17 += v * b11;\n t18 += v * b12;\n t19 += v * b13;\n t20 += v * b14;\n t21 += v * b15;\n v = a[7];\n t7 += v * b0;\n t8 += v * b1;\n t9 += v * b2;\n t10 += v * b3;\n t11 += v * b4;\n t12 += v * b5;\n t13 += v * b6;\n t14 += v * b7;\n t15 += v * b8;\n t16 += v * b9;\n t17 += v * b10;\n t18 += v * b11;\n t19 += v * b12;\n t20 += v * b13;\n t21 += v * b14;\n t22 += v * b15;\n v = a[8];\n t8 += v * b0;\n t9 += v * b1;\n t10 += v * b2;\n t11 += v * b3;\n t12 += v * b4;\n t13 += v * b5;\n t14 += v * b6;\n t15 += v * b7;\n t16 += v * b8;\n t17 += v * b9;\n t18 += v * b10;\n t19 += v * b11;\n t20 += v * b12;\n t21 += v * b13;\n t22 += v * b14;\n t23 += v * b15;\n v = a[9];\n t9 += v * b0;\n t10 += v * b1;\n t11 += v * b2;\n t12 += v * b3;\n t13 += v * b4;\n t14 += v * b5;\n t15 += v * b6;\n t16 += v * b7;\n t17 += v * b8;\n t18 += v * b9;\n t19 += v * b10;\n t20 += v * b11;\n t21 += v * b12;\n t22 += v * b13;\n t23 += v * b14;\n t24 += v * b15;\n v = a[10];\n t10 += v * b0;\n t11 += v * b1;\n t12 += v * b2;\n t13 += v * b3;\n t14 += v * b4;\n t15 += v * b5;\n t16 += v * b6;\n t17 += v * b7;\n t18 += v * b8;\n t19 += v * b9;\n t20 += v * b10;\n t21 += v * b11;\n t22 += v * b12;\n t23 += v * b13;\n t24 += v * b14;\n t25 += v * b15;\n v = a[11];\n t11 += v * b0;\n t12 += v * b1;\n t13 += v * b2;\n t14 += v * b3;\n t15 += v * b4;\n t16 += v * b5;\n t17 += v * b6;\n t18 += v * b7;\n t19 += v * b8;\n t20 += v * b9;\n t21 += v * b10;\n t22 += v * b11;\n t23 += v * b12;\n t24 += v * b13;\n t25 += v * b14;\n t26 += v * b15;\n v = a[12];\n t12 += v * b0;\n t13 += v * b1;\n t14 += v * b2;\n t15 += v * b3;\n t16 += v * b4;\n t17 += v * b5;\n t18 += v * b6;\n t19 += v * b7;\n t20 += v * b8;\n t21 += v * b9;\n t22 += v * b10;\n t23 += v * b11;\n t24 += v * b12;\n t25 += v * b13;\n t26 += v * b14;\n t27 += v * b15;\n v = a[13];\n t13 += v * b0;\n t14 += v * b1;\n t15 += v * b2;\n t16 += v * b3;\n t17 += v * b4;\n t18 += v * b5;\n t19 += v * b6;\n t20 += v * b7;\n t21 += v * b8;\n t22 += v * b9;\n t23 += v * b10;\n t24 += v * b11;\n t25 += v * b12;\n t26 += v * b13;\n t27 += v * b14;\n t28 += v * b15;\n v = a[14];\n t14 += v * b0;\n t15 += v * b1;\n t16 += v * b2;\n t17 += v * b3;\n t18 += v * b4;\n t19 += v * b5;\n t20 += v * b6;\n t21 += v * b7;\n t22 += v * b8;\n t23 += v * b9;\n t24 += v * b10;\n t25 += v * b11;\n t26 += v * b12;\n t27 += v * b13;\n t28 += v * b14;\n t29 += v * b15;\n v = a[15];\n t15 += v * b0;\n t16 += v * b1;\n t17 += v * b2;\n t18 += v * b3;\n t19 += v * b4;\n t20 += v * b5;\n t21 += v * b6;\n t22 += v * b7;\n t23 += v * b8;\n t24 += v * b9;\n t25 += v * b10;\n t26 += v * b11;\n t27 += v * b12;\n t28 += v * b13;\n t29 += v * b14;\n t30 += v * b15;\n\n t0 += 38 * t16;\n t1 += 38 * t17;\n t2 += 38 * t18;\n t3 += 38 * t19;\n t4 += 38 * t20;\n t5 += 38 * t21;\n t6 += 38 * t22;\n t7 += 38 * t23;\n t8 += 38 * t24;\n t9 += 38 * t25;\n t10 += 38 * t26;\n t11 += 38 * t27;\n t12 += 38 * t28;\n t13 += 38 * t29;\n t14 += 38 * t30;\n // t15 left as is\n\n // first car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n // second car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n o[ 0] = t0;\n o[ 1] = t1;\n o[ 2] = t2;\n o[ 3] = t3;\n o[ 4] = t4;\n o[ 5] = t5;\n o[ 6] = t6;\n o[ 7] = t7;\n o[ 8] = t8;\n o[ 9] = t9;\n o[10] = t10;\n o[11] = t11;\n o[12] = t12;\n o[13] = t13;\n o[14] = t14;\n o[15] = t15;\n}\n\nfunction S(o, a) {\n M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 253; a >= 0; a--) {\n S(c, c);\n if(a !== 2 && a !== 4) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 250; a >= 0; a--) {\n S(c, c);\n if(a !== 1) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n var z = new Uint8Array(32);\n var x = new Float64Array(80), r, i;\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf();\n for (i = 0; i < 31; i++) z[i] = n[i];\n z[31]=(n[31]&127)|64;\n z[0]&=248;\n unpack25519(x,p);\n for (i = 0; i < 16; i++) {\n b[i]=x[i];\n d[i]=a[i]=c[i]=0;\n }\n a[0]=d[0]=1;\n for (i=254; i>=0; --i) {\n r=(z[i>>>3]>>>(i&7))&1;\n sel25519(a,b,r);\n sel25519(c,d,r);\n A(e,a,c);\n Z(a,a,c);\n A(c,b,d);\n Z(b,b,d);\n S(d,e);\n S(f,a);\n M(a,c,a);\n M(c,b,e);\n A(e,a,c);\n Z(a,a,c);\n S(b,a);\n Z(c,d,f);\n M(a,c,_121665);\n A(a,a,d);\n M(c,c,a);\n M(a,d,f);\n M(d,b,x);\n S(b,e);\n sel25519(a,b,r);\n sel25519(c,d,r);\n }\n for (i = 0; i < 16; i++) {\n x[i+16]=a[i];\n x[i+32]=c[i];\n x[i+48]=b[i];\n x[i+64]=d[i];\n }\n var x32 = x.subarray(32);\n var x16 = x.subarray(16);\n inv25519(x32,x32);\n M(x16,x16,x32);\n pack25519(q,x16);\n return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n randombytes(x, 32);\n return crypto_scalarmult_base(y, x);\n}\n\nfunction crypto_box_beforenm(k, y, x) {\n var s = new Uint8Array(32);\n crypto_scalarmult(s, x, y);\n return crypto_core_hsalsa20(k, _0, s, sigma);\n}\n\nvar crypto_box_afternm = crypto_secretbox;\nvar crypto_box_open_afternm = crypto_secretbox_open;\n\nfunction crypto_box(c, m, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_afternm(c, m, d, n, k);\n}\n\nfunction crypto_box_open(m, c, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_open_afternm(m, c, d, n, k);\n}\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction crypto_hashblocks_hl(hh, hl, m, n) {\n var wh = new Int32Array(16), wl = new Int32Array(16),\n bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,\n bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,\n th, tl, i, j, h, l, a, b, c, d;\n\n var ah0 = hh[0],\n ah1 = hh[1],\n ah2 = hh[2],\n ah3 = hh[3],\n ah4 = hh[4],\n ah5 = hh[5],\n ah6 = hh[6],\n ah7 = hh[7],\n\n al0 = hl[0],\n al1 = hl[1],\n al2 = hl[2],\n al3 = hl[3],\n al4 = hl[4],\n al5 = hl[5],\n al6 = hl[6],\n al7 = hl[7];\n\n var pos = 0;\n while (n >= 128) {\n for (i = 0; i < 16; i++) {\n j = 8 * i + pos;\n wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];\n wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];\n }\n for (i = 0; i < 80; i++) {\n bh0 = ah0;\n bh1 = ah1;\n bh2 = ah2;\n bh3 = ah3;\n bh4 = ah4;\n bh5 = ah5;\n bh6 = ah6;\n bh7 = ah7;\n\n bl0 = al0;\n bl1 = al1;\n bl2 = al2;\n bl3 = al3;\n bl4 = al4;\n bl5 = al5;\n bl6 = al6;\n bl7 = al7;\n\n // add\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma1\n h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));\n l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Ch\n h = (ah4 & ah5) ^ (~ah4 & ah6);\n l = (al4 & al5) ^ (~al4 & al6);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // K\n h = K[i*2];\n l = K[i*2+1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // w\n h = wh[i%16];\n l = wl[i%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n th = c & 0xffff | d << 16;\n tl = a & 0xffff | b << 16;\n\n // add\n h = th;\n l = tl;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma0\n h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));\n l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Maj\n h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh7 = (c & 0xffff) | (d << 16);\n bl7 = (a & 0xffff) | (b << 16);\n\n // add\n h = bh3;\n l = bl3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = th;\n l = tl;\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh3 = (c & 0xffff) | (d << 16);\n bl3 = (a & 0xffff) | (b << 16);\n\n ah1 = bh0;\n ah2 = bh1;\n ah3 = bh2;\n ah4 = bh3;\n ah5 = bh4;\n ah6 = bh5;\n ah7 = bh6;\n ah0 = bh7;\n\n al1 = bl0;\n al2 = bl1;\n al3 = bl2;\n al4 = bl3;\n al5 = bl4;\n al6 = bl5;\n al7 = bl6;\n al0 = bl7;\n\n if (i%16 === 15) {\n for (j = 0; j < 16; j++) {\n // add\n h = wh[j];\n l = wl[j];\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = wh[(j+9)%16];\n l = wl[(j+9)%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma0\n th = wh[(j+1)%16];\n tl = wl[(j+1)%16];\n h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);\n l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma1\n th = wh[(j+14)%16];\n tl = wl[(j+14)%16];\n h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);\n l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n wh[j] = (c & 0xffff) | (d << 16);\n wl[j] = (a & 0xffff) | (b << 16);\n }\n }\n }\n\n // add\n h = ah0;\n l = al0;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[0];\n l = hl[0];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[0] = ah0 = (c & 0xffff) | (d << 16);\n hl[0] = al0 = (a & 0xffff) | (b << 16);\n\n h = ah1;\n l = al1;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[1];\n l = hl[1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[1] = ah1 = (c & 0xffff) | (d << 16);\n hl[1] = al1 = (a & 0xffff) | (b << 16);\n\n h = ah2;\n l = al2;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[2];\n l = hl[2];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[2] = ah2 = (c & 0xffff) | (d << 16);\n hl[2] = al2 = (a & 0xffff) | (b << 16);\n\n h = ah3;\n l = al3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[3];\n l = hl[3];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[3] = ah3 = (c & 0xffff) | (d << 16);\n hl[3] = al3 = (a & 0xffff) | (b << 16);\n\n h = ah4;\n l = al4;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[4];\n l = hl[4];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[4] = ah4 = (c & 0xffff) | (d << 16);\n hl[4] = al4 = (a & 0xffff) | (b << 16);\n\n h = ah5;\n l = al5;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[5];\n l = hl[5];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[5] = ah5 = (c & 0xffff) | (d << 16);\n hl[5] = al5 = (a & 0xffff) | (b << 16);\n\n h = ah6;\n l = al6;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[6];\n l = hl[6];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[6] = ah6 = (c & 0xffff) | (d << 16);\n hl[6] = al6 = (a & 0xffff) | (b << 16);\n\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[7];\n l = hl[7];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[7] = ah7 = (c & 0xffff) | (d << 16);\n hl[7] = al7 = (a & 0xffff) | (b << 16);\n\n pos += 128;\n n -= 128;\n }\n\n return n;\n}\n\nfunction crypto_hash(out, m, n) {\n var hh = new Int32Array(8),\n hl = new Int32Array(8),\n x = new Uint8Array(256),\n i, b = n;\n\n hh[0] = 0x6a09e667;\n hh[1] = 0xbb67ae85;\n hh[2] = 0x3c6ef372;\n hh[3] = 0xa54ff53a;\n hh[4] = 0x510e527f;\n hh[5] = 0x9b05688c;\n hh[6] = 0x1f83d9ab;\n hh[7] = 0x5be0cd19;\n\n hl[0] = 0xf3bcc908;\n hl[1] = 0x84caa73b;\n hl[2] = 0xfe94f82b;\n hl[3] = 0x5f1d36f1;\n hl[4] = 0xade682d1;\n hl[5] = 0x2b3e6c1f;\n hl[6] = 0xfb41bd6b;\n hl[7] = 0x137e2179;\n\n crypto_hashblocks_hl(hh, hl, m, n);\n n %= 128;\n\n for (i = 0; i < n; i++) x[i] = m[b-n+i];\n x[n] = 128;\n\n n = 256-128*(n<112?1:0);\n x[n-9] = 0;\n ts64(x, n-8, (b / 0x20000000) | 0, b << 3);\n crypto_hashblocks_hl(hh, hl, x, n);\n\n for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);\n\n return 0;\n}\n\nfunction add(p, q) {\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf(),\n g = gf(), h = gf(), t = gf();\n\n Z(a, p[1], p[0]);\n Z(t, q[1], q[0]);\n M(a, a, t);\n A(b, p[0], p[1]);\n A(t, q[0], q[1]);\n M(b, b, t);\n M(c, p[3], q[3]);\n M(c, c, D2);\n M(d, p[2], q[2]);\n A(d, d, d);\n Z(e, b, a);\n Z(f, d, c);\n A(g, d, c);\n A(h, b, a);\n\n M(p[0], e, f);\n M(p[1], h, g);\n M(p[2], g, f);\n M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n var i;\n for (i = 0; i < 4; i++) {\n sel25519(p[i], q[i], b);\n }\n}\n\nfunction pack(r, p) {\n var tx = gf(), ty = gf(), zi = gf();\n inv25519(zi, p[2]);\n M(tx, p[0], zi);\n M(ty, p[1], zi);\n pack25519(r, ty);\n r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n var b, i;\n set25519(p[0], gf0);\n set25519(p[1], gf1);\n set25519(p[2], gf1);\n set25519(p[3], gf0);\n for (i = 255; i >= 0; --i) {\n b = (s[(i/8)|0] >> (i&7)) & 1;\n cswap(p, q, b);\n add(q, p);\n add(p, p);\n cswap(p, q, b);\n }\n}\n\nfunction scalarbase(p, s) {\n var q = [gf(), gf(), gf(), gf()];\n set25519(q[0], X);\n set25519(q[1], Y);\n set25519(q[2], gf1);\n M(q[3], X, Y);\n scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n var d = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()];\n var i;\n\n if (!seeded) randombytes(sk, 32);\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n scalarbase(p, d);\n pack(pk, p);\n\n for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n var carry, i, j, k;\n for (i = 63; i >= 32; --i) {\n carry = 0;\n for (j = i - 32, k = i - 12; j < k; ++j) {\n x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n carry = Math.floor((x[j] + 128) / 256);\n x[j] -= carry * 256;\n }\n x[j] += carry;\n x[i] = 0;\n }\n carry = 0;\n for (j = 0; j < 32; j++) {\n x[j] += carry - (x[31] >> 4) * L[j];\n carry = x[j] >> 8;\n x[j] &= 255;\n }\n for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n for (i = 0; i < 32; i++) {\n x[i+1] += x[i] >> 8;\n r[i] = x[i] & 255;\n }\n}\n\nfunction reduce(r) {\n var x = new Float64Array(64), i;\n for (i = 0; i < 64; i++) x[i] = r[i];\n for (i = 0; i < 64; i++) r[i] = 0;\n modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);\n var i, j, x = new Float64Array(64);\n var p = [gf(), gf(), gf(), gf()];\n\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n var smlen = n + 64;\n for (i = 0; i < n; i++) sm[64 + i] = m[i];\n for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n crypto_hash(r, sm.subarray(32), n+32);\n reduce(r);\n scalarbase(p, r);\n pack(sm, p);\n\n for (i = 32; i < 64; i++) sm[i] = sk[i];\n crypto_hash(h, sm, n + 64);\n reduce(h);\n\n for (i = 0; i < 64; i++) x[i] = 0;\n for (i = 0; i < 32; i++) x[i] = r[i];\n for (i = 0; i < 32; i++) {\n for (j = 0; j < 32; j++) {\n x[i+j] += h[i] * d[j];\n }\n }\n\n modL(sm.subarray(32), x);\n return smlen;\n}\n\nfunction unpackneg(r, p) {\n var t = gf(), chk = gf(), num = gf(),\n den = gf(), den2 = gf(), den4 = gf(),\n den6 = gf();\n\n set25519(r[2], gf1);\n unpack25519(r[1], p);\n S(num, r[1]);\n M(den, num, D);\n Z(num, num, r[2]);\n A(den, r[2], den);\n\n S(den2, den);\n S(den4, den2);\n M(den6, den4, den2);\n M(t, den6, num);\n M(t, t, den);\n\n pow2523(t, t);\n M(t, t, num);\n M(t, t, den);\n M(t, t, den);\n M(r[0], t, den);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) M(r[0], r[0], I);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) return -1;\n\n if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n M(r[3], r[0], r[1]);\n return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n var i;\n var t = new Uint8Array(32), h = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()],\n q = [gf(), gf(), gf(), gf()];\n\n if (n < 64) return -1;\n\n if (unpackneg(q, pk)) return -1;\n\n for (i = 0; i < n; i++) m[i] = sm[i];\n for (i = 0; i < 32; i++) m[i+32] = pk[i];\n crypto_hash(h, m, n);\n reduce(h);\n scalarmult(p, q, h);\n\n scalarbase(q, sm.subarray(32));\n add(p, q);\n pack(t, p);\n\n n -= 64;\n if (crypto_verify_32(sm, 0, t, 0)) {\n for (i = 0; i < n; i++) m[i] = 0;\n return -1;\n }\n\n for (i = 0; i < n; i++) m[i] = sm[i + 64];\n return n;\n}\n\nvar crypto_secretbox_KEYBYTES = 32,\n crypto_secretbox_NONCEBYTES = 24,\n crypto_secretbox_ZEROBYTES = 32,\n crypto_secretbox_BOXZEROBYTES = 16,\n crypto_scalarmult_BYTES = 32,\n crypto_scalarmult_SCALARBYTES = 32,\n crypto_box_PUBLICKEYBYTES = 32,\n crypto_box_SECRETKEYBYTES = 32,\n crypto_box_BEFORENMBYTES = 32,\n crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,\n crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,\n crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,\n crypto_sign_BYTES = 64,\n crypto_sign_PUBLICKEYBYTES = 32,\n crypto_sign_SECRETKEYBYTES = 64,\n crypto_sign_SEEDBYTES = 32,\n crypto_hash_BYTES = 64;\n\nnacl.lowlevel = {\n crypto_core_hsalsa20: crypto_core_hsalsa20,\n crypto_stream_xor: crypto_stream_xor,\n crypto_stream: crypto_stream,\n crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,\n crypto_stream_salsa20: crypto_stream_salsa20,\n crypto_onetimeauth: crypto_onetimeauth,\n crypto_onetimeauth_verify: crypto_onetimeauth_verify,\n crypto_verify_16: crypto_verify_16,\n crypto_verify_32: crypto_verify_32,\n crypto_secretbox: crypto_secretbox,\n crypto_secretbox_open: crypto_secretbox_open,\n crypto_scalarmult: crypto_scalarmult,\n crypto_scalarmult_base: crypto_scalarmult_base,\n crypto_box_beforenm: crypto_box_beforenm,\n crypto_box_afternm: crypto_box_afternm,\n crypto_box: crypto_box,\n crypto_box_open: crypto_box_open,\n crypto_box_keypair: crypto_box_keypair,\n crypto_hash: crypto_hash,\n crypto_sign: crypto_sign,\n crypto_sign_keypair: crypto_sign_keypair,\n crypto_sign_open: crypto_sign_open,\n\n crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,\n crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,\n crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,\n crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,\n crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,\n crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,\n crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,\n crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,\n crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,\n crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,\n crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,\n crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,\n crypto_sign_BYTES: crypto_sign_BYTES,\n crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,\n crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,\n crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,\n crypto_hash_BYTES: crypto_hash_BYTES,\n\n gf: gf,\n D: D,\n L: L,\n pack25519: pack25519,\n unpack25519: unpack25519,\n M: M,\n A: A,\n S: S,\n Z: Z,\n pow2523: pow2523,\n add: add,\n set25519: set25519,\n modL: modL,\n scalarmult: scalarmult,\n scalarbase: scalarbase,\n};\n\n/* High-level API */\n\nfunction checkLengths(k, n) {\n if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');\n if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');\n}\n\nfunction checkBoxLengths(pk, sk) {\n if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');\n if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');\n}\n\nfunction checkArrayTypes() {\n for (var i = 0; i < arguments.length; i++) {\n if (!(arguments[i] instanceof Uint8Array))\n throw new TypeError('unexpected type, use Uint8Array');\n }\n}\n\nfunction cleanup(arr) {\n for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\nnacl.randomBytes = function(n) {\n var b = new Uint8Array(n);\n randombytes(b, n);\n return b;\n};\n\nnacl.secretbox = function(msg, nonce, key) {\n checkArrayTypes(msg, nonce, key);\n checkLengths(key, nonce);\n var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);\n var c = new Uint8Array(m.length);\n for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];\n crypto_secretbox(c, m, m.length, nonce, key);\n return c.subarray(crypto_secretbox_BOXZEROBYTES);\n};\n\nnacl.secretbox.open = function(box, nonce, key) {\n checkArrayTypes(box, nonce, key);\n checkLengths(key, nonce);\n var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);\n var m = new Uint8Array(c.length);\n for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];\n if (c.length < 32) return null;\n if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return null;\n return m.subarray(crypto_secretbox_ZEROBYTES);\n};\n\nnacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;\nnacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\nnacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\n\nnacl.scalarMult = function(n, p) {\n checkArrayTypes(n, p);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult(q, n, p);\n return q;\n};\n\nnacl.scalarMult.base = function(n) {\n checkArrayTypes(n);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult_base(q, n);\n return q;\n};\n\nnacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\nnacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;\n\nnacl.box = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox(msg, nonce, k);\n};\n\nnacl.box.before = function(publicKey, secretKey) {\n checkArrayTypes(publicKey, secretKey);\n checkBoxLengths(publicKey, secretKey);\n var k = new Uint8Array(crypto_box_BEFORENMBYTES);\n crypto_box_beforenm(k, publicKey, secretKey);\n return k;\n};\n\nnacl.box.after = nacl.secretbox;\n\nnacl.box.open = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox.open(msg, nonce, k);\n};\n\nnacl.box.open.after = nacl.secretbox.open;\n\nnacl.box.keyPair = function() {\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n crypto_box_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n crypto_scalarmult_base(pk, secretKey);\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;\nnacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;\nnacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;\nnacl.box.nonceLength = crypto_box_NONCEBYTES;\nnacl.box.overheadLength = nacl.secretbox.overheadLength;\n\nnacl.sign = function(msg, secretKey) {\n checkArrayTypes(msg, secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n crypto_sign(signedMsg, msg, msg.length, secretKey);\n return signedMsg;\n};\n\nnacl.sign.open = function(signedMsg, publicKey) {\n checkArrayTypes(signedMsg, publicKey);\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var tmp = new Uint8Array(signedMsg.length);\n var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);\n if (mlen < 0) return null;\n var m = new Uint8Array(mlen);\n for (var i = 0; i < m.length; i++) m[i] = tmp[i];\n return m;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n var signedMsg = nacl.sign(msg, secretKey);\n var sig = new Uint8Array(crypto_sign_BYTES);\n for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n checkArrayTypes(msg, sig, publicKey);\n if (sig.length !== crypto_sign_BYTES)\n throw new Error('bad signature size');\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n var i;\n for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n crypto_sign_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n checkArrayTypes(seed);\n if (seed.length !== crypto_sign_SEEDBYTES)\n throw new Error('bad seed size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n for (var i = 0; i < 32; i++) sk[i] = seed[i];\n crypto_sign_keypair(pk, sk, true);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;\nnacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;\nnacl.sign.seedLength = crypto_sign_SEEDBYTES;\nnacl.sign.signatureLength = crypto_sign_BYTES;\n\nnacl.hash = function(msg) {\n checkArrayTypes(msg);\n var h = new Uint8Array(crypto_hash_BYTES);\n crypto_hash(h, msg, msg.length);\n return h;\n};\n\nnacl.hash.hashLength = crypto_hash_BYTES;\n\nnacl.verify = function(x, y) {\n checkArrayTypes(x, y);\n // Zero length arguments are considered not equal.\n if (x.length === 0 || y.length === 0) return false;\n if (x.length !== y.length) return false;\n return (vn(x, 0, y, 0, x.length) === 0) ? true : false;\n};\n\nnacl.setPRNG = function(fn) {\n randombytes = fn;\n};\n\n(function() {\n // Initialize PRNG if environment provides CSPRNG.\n // If not, methods calling randombytes will throw.\n var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n if (crypto && crypto.getRandomValues) {\n // Browsers.\n var QUOTA = 65536;\n nacl.setPRNG(function(x, n) {\n var i, v = new Uint8Array(n);\n for (i = 0; i < n; i += QUOTA) {\n crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n }\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n } else if (typeof require !== 'undefined') {\n // Node.js.\n crypto = require('crypto');\n if (crypto && crypto.randomBytes) {\n nacl.setPRNG(function(x, n) {\n var i, v = crypto.randomBytes(n);\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n }\n }\n})();\n\n})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n","'use strict';\n\nvar utils = exports;\nvar BN = require('bn.js');\nvar minAssert = require('minimalistic-assert');\nvar minUtils = require('minimalistic-crypto-utils');\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n\n var ws = 1 << (w + 1);\n var k = num.clone();\n\n for (var i = 0; i < naf.length; i++) {\n var z;\n var mod = k.andln(ws - 1);\n if (k.isOdd()) {\n if (mod > (ws >> 1) - 1)\n z = (ws >> 1) - mod;\n else\n z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n\n naf[i] = z;\n k.iushrn(1);\n }\n\n return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n var jsf = [\n [],\n [],\n ];\n\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n var m8;\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n // First phase\n var m14 = (k1.andln(3) + d1) & 3;\n var m24 = (k2.andln(3) + d2) & 3;\n if (m14 === 3)\n m14 = -1;\n if (m24 === 3)\n m24 = -1;\n var u1;\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n m8 = (k1.andln(7) + d1) & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n jsf[0].push(u1);\n\n var u2;\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n m8 = (k2.andln(7) + d2) & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n jsf[1].push(u2);\n\n // Second phase\n if (2 * d1 === u1 + 1)\n d1 = 1 - d1;\n if (2 * d2 === u2 + 1)\n d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] :\n this[key] = computer.call(this);\n };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n\n","import { zeroPad } from \"@ethersproject/bytes\";\nimport { bech32 } from \"bech32\";\nexport function canonicalAddress(humanAddress) {\n return new Uint8Array(bech32.fromWords(bech32.decode(humanAddress).words));\n}\nexport function humanAddress(canonicalAddress) {\n return bech32.encode(\"terra\", bech32.toWords(canonicalAddress));\n}\n// from https://github.com/terra-money/station/blob/dca7de43958ce075c6e46605622203b9859b0e14/src/lib/utils/is.ts#L12\nexport var isNativeTerra = function (string) {\n if (string === void 0) { string = \"\"; }\n return string.startsWith(\"u\") && string.length === 4;\n};\n// from https://github.com/terra-money/station/blob/dca7de43958ce075c6e46605622203b9859b0e14/src/lib/utils/is.ts#L20\nexport var isNativeDenom = function (string) {\n if (string === void 0) { string = \"\"; }\n return isNativeTerra(string) || string === \"uluna\";\n};\nexport function buildNativeId(denom) {\n var bytes = [];\n for (var i = 0; i < denom.length; i++) {\n bytes.push(denom.charCodeAt(i));\n }\n var padded = zeroPad(new Uint8Array(bytes), 32);\n padded[0] = 1;\n return padded;\n}\n","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexDataSlice, hexlify, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { id } from \"@ethersproject/hash\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { defineReadOnly, Description, getStatic } from \"@ethersproject/properties\";\nimport { defaultAbiCoder } from \"./abi-coder\";\nimport { checkResultErrors } from \"./coders/abstract-coder\";\nimport { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, ParamType } from \"./fragments\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport { checkResultErrors };\nexport class LogDescription extends Description {\n}\nexport class TransactionDescription extends Description {\n}\nexport class ErrorDescription extends Description {\n}\nexport class Indexed extends Description {\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n}\nconst BuiltinErrors = {\n \"0x08c379a0\": { signature: \"Error(string)\", name: \"Error\", inputs: [\"string\"], reason: true },\n \"0x4e487b71\": { signature: \"Panic(uint256)\", name: \"Panic\", inputs: [\"uint256\"] }\n};\nfunction wrapAccessError(property, error) {\n const wrap = new Error(`deferred error during ABI decoding triggered accessing ${property}`);\n wrap.error = error;\n return wrap;\n}\n/*\nfunction checkNames(fragment: Fragment, type: \"input\" | \"output\", params: Array): void {\n params.reduce((accum, param) => {\n if (param.name) {\n if (accum[param.name]) {\n logger.throwArgumentError(`duplicate ${ type } parameter ${ JSON.stringify(param.name) } in ${ fragment.format(\"full\") }`, \"fragment\", fragment);\n }\n accum[param.name] = true;\n }\n return accum;\n }, <{ [ name: string ]: boolean }>{ });\n}\n*/\nexport class Interface {\n constructor(fragments) {\n logger.checkNew(new.target, Interface);\n let abi = [];\n if (typeof (fragments) === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n defineReadOnly(this, \"fragments\", abi.map((fragment) => {\n return Fragment.from(fragment);\n }).filter((fragment) => (fragment != null)));\n defineReadOnly(this, \"_abiCoder\", getStatic(new.target, \"getAbiCoder\")());\n defineReadOnly(this, \"functions\", {});\n defineReadOnly(this, \"errors\", {});\n defineReadOnly(this, \"events\", {});\n defineReadOnly(this, \"structs\", {});\n // Add all fragments by their signature\n this.fragments.forEach((fragment) => {\n let bucket = null;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n logger.warn(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineReadOnly(this, \"deploy\", fragment);\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.events;\n break;\n case \"error\":\n bucket = this.errors;\n break;\n default:\n return;\n }\n let signature = fragment.format();\n if (bucket[signature]) {\n logger.warn(\"duplicate definition - \" + signature);\n return;\n }\n bucket[signature] = fragment;\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineReadOnly(this, \"deploy\", ConstructorFragment.from({\n payable: false,\n type: \"constructor\"\n }));\n }\n defineReadOnly(this, \"_isInterface\", true);\n }\n format(format) {\n if (!format) {\n format = FormatTypes.full;\n }\n if (format === FormatTypes.sighash) {\n logger.throwArgumentError(\"interface does not support formatting sighash\", \"format\", format);\n }\n const abi = this.fragments.map((fragment) => fragment.format(format));\n // We need to re-bundle the JSON fragments a bit\n if (format === FormatTypes.json) {\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n return abi;\n }\n // Sub-classes can override these to handle other blockchains\n static getAbiCoder() {\n return defaultAbiCoder;\n }\n static getAddress(address) {\n return getAddress(address);\n }\n static getSighash(fragment) {\n return hexDataSlice(id(fragment.format()), 0, 4);\n }\n static getEventTopic(eventFragment) {\n return id(eventFragment.format());\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getFunction(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n return this.functions[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n getEvent(nameOrSignatureOrTopic) {\n if (isHexString(nameOrSignatureOrTopic)) {\n const topichash = nameOrSignatureOrTopic.toLowerCase();\n for (const name in this.events) {\n if (topichash === this.getEventTopic(name)) {\n return this.events[name];\n }\n }\n logger.throwArgumentError(\"no matching event\", \"topichash\", topichash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrTopic.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrTopic.trim();\n const matching = Object.keys(this.events).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching event\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching events\", \"name\", name);\n }\n return this.events[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching event\", \"signature\", nameOrSignatureOrTopic);\n }\n return result;\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getError(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n const getSighash = getStatic(this.constructor, \"getSighash\");\n for (const name in this.errors) {\n const error = this.errors[name];\n if (nameOrSignatureOrSighash === getSighash(error)) {\n return this.errors[name];\n }\n }\n logger.throwArgumentError(\"no matching error\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.errors).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching error\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching errors\", \"name\", name);\n }\n return this.errors[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching error\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Get the sighash (the bytes4 selector) used by Solidity to identify a function\n getSighash(fragment) {\n if (typeof (fragment) === \"string\") {\n try {\n fragment = this.getFunction(fragment);\n }\n catch (error) {\n try {\n fragment = this.getError(fragment);\n }\n catch (_) {\n throw error;\n }\n }\n }\n return getStatic(this.constructor, \"getSighash\")(fragment);\n }\n // Get the topic (the bytes32 hash) used by Solidity to identify an event\n getEventTopic(eventFragment) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n return getStatic(this.constructor, \"getEventTopic\")(eventFragment);\n }\n _decodeParams(params, data) {\n return this._abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this._abiCoder.encode(params, values);\n }\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n decodeErrorResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {\n logger.throwArgumentError(`data signature does not match error ${fragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(fragment.inputs, bytes.slice(4));\n }\n encodeErrorResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n return hexlify(concat([\n this.getSighash(fragment),\n this._encodeParams(fragment.inputs, values || [])\n ]));\n }\n // Decode the data for a function call (e.g. tx.data)\n decodeFunctionData(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {\n logger.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(functionFragment.inputs, bytes.slice(4));\n }\n // Encode the data for a function call (e.g. tx.data)\n encodeFunctionData(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(concat([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [])\n ]));\n }\n // Decode the result from a function call (e.g. from eth_call)\n decodeFunctionResult(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n let bytes = arrayify(data);\n let reason = null;\n let errorArgs = null;\n let errorName = null;\n let errorSignature = null;\n switch (bytes.length % this._abiCoder._getWordSize()) {\n case 0:\n try {\n return this._abiCoder.decode(functionFragment.outputs, bytes);\n }\n catch (error) { }\n break;\n case 4: {\n const selector = hexlify(bytes.slice(0, 4));\n const builtin = BuiltinErrors[selector];\n if (builtin) {\n errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));\n errorName = builtin.name;\n errorSignature = builtin.signature;\n if (builtin.reason) {\n reason = errorArgs[0];\n }\n }\n else {\n try {\n const error = this.getError(selector);\n errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4));\n errorName = error.name;\n errorSignature = error.format();\n }\n catch (error) {\n console.log(error);\n }\n }\n break;\n }\n }\n return logger.throwError(\"call revert exception\", Logger.errors.CALL_EXCEPTION, {\n method: functionFragment.format(),\n errorArgs, errorName, errorSignature, reason\n });\n }\n // Encode the result for a function call (e.g. for eth_call)\n encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));\n }\n // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n encodeFilterTopics(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (values.length > eventFragment.inputs.length) {\n logger.throwError(\"too many arguments for \" + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {\n argument: \"values\",\n value: values\n });\n }\n let topics = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return keccak256(hexlify(value));\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this._abiCoder.encode([\"address\"], [value]);\n }\n return hexZeroPad(hexlify(value), 32);\n };\n values.forEach((value, index) => {\n let param = eventFragment.inputs[index];\n if (!param.indexed) {\n if (value != null) {\n logger.throwArgumentError(\"cannot filter non-indexed parameters; must be null\", (\"contract.\" + param.name), value);\n }\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n if (values.length !== eventFragment.inputs.length) {\n logger.throwArgumentError(\"event arguments/values mismatch\", \"values\", values);\n }\n eventFragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(keccak256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this._abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this._abiCoder.encode(dataTypes, dataValues),\n topics: topics\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(eventFragment, data, topics) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (topics != null && !eventFragment.anonymous) {\n let topicHash = this.getEventTopic(eventFragment);\n if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {\n logger.throwError(\"fragment/topic mismatch\", Logger.errors.INVALID_ARGUMENT, { argument: \"topics[0]\", expected: topicHash, value: topics[0] });\n }\n topics = topics.slice(1);\n }\n let indexed = [];\n let nonIndexed = [];\n let dynamic = [];\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" || param.type === \"bytes\" || param.baseType === \"tuple\" || param.baseType === \"array\") {\n indexed.push(ParamType.fromObject({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n let resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, concat(topics)) : null;\n let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);\n let result = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (resultIndexed == null) {\n result[index] = new Indexed({ _isIndexed: true, hash: null });\n }\n else if (dynamic[index]) {\n result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] });\n }\n else {\n try {\n result[index] = resultIndexed[indexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n }\n else {\n try {\n result[index] = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n // Add the keyword argument if named and safe\n if (param.name && result[param.name] == null) {\n const value = result[index];\n // Make error named values throw on access\n if (value instanceof Error) {\n Object.defineProperty(result, param.name, {\n enumerable: true,\n get: () => { throw wrapAccessError(`property ${JSON.stringify(param.name)}`, value); }\n });\n }\n else {\n result[param.name] = value;\n }\n }\n });\n // Make all error indexed values throw on access\n for (let i = 0; i < result.length; i++) {\n const value = result[i];\n if (value instanceof Error) {\n Object.defineProperty(result, i, {\n enumerable: true,\n get: () => { throw wrapAccessError(`index ${i}`, value); }\n });\n }\n }\n return Object.freeze(result);\n }\n // Given a transaction, find the matching function fragment (if any) and\n // determine all its properties and call parameters\n parseTransaction(tx) {\n let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new TransactionDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + tx.data.substring(10)),\n functionFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n value: BigNumber.from(tx.value || \"0\"),\n });\n }\n // @TODO\n //parseCallResult(data: BytesLike): ??\n // Given an event log, find the matching event fragment (if any) and\n // determine all its properties and values\n parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }\n parseError(data) {\n const hexData = hexlify(data);\n let fragment = this.getError(hexData.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new ErrorDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + hexData.substring(10)),\n errorFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n });\n }\n /*\n static from(value: Array | string | Interface) {\n if (Interface.isInterface(value)) {\n return value;\n }\n if (typeof(value) === \"string\") {\n return new Interface(JSON.parse(value));\n }\n return new Interface(value);\n }\n */\n static isInterface(value) {\n return !!(value && value._isInterface);\n }\n}\n//# sourceMappingURL=interface.js.map","\"use strict\";\n\n(function(root) {\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && ArrayBuffer.isView(arg) && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16];\n var Si =[0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = value >> 8;\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (typeof exports !== 'undefined') {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define(aesjs);\n\n // Web Browsers\n } else {\n\n // If there was an existing library at \"aesjs\" make sure it's still available\n if (root.aesjs) {\n aesjs._aesjs = root.aesjs;\n }\n\n root.aesjs = aesjs;\n }\n\n\n})(this);\n","'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.bech32m = exports.bech32 = void 0;\nconst ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';\nconst ALPHABET_MAP = {};\nfor (let z = 0; z < ALPHABET.length; z++) {\n const x = ALPHABET.charAt(z);\n ALPHABET_MAP[x] = z;\n}\nfunction polymodStep(pre) {\n const b = pre >> 25;\n return (((pre & 0x1ffffff) << 5) ^\n (-((b >> 0) & 1) & 0x3b6a57b2) ^\n (-((b >> 1) & 1) & 0x26508e6d) ^\n (-((b >> 2) & 1) & 0x1ea119fa) ^\n (-((b >> 3) & 1) & 0x3d4233dd) ^\n (-((b >> 4) & 1) & 0x2a1462b3));\n}\nfunction prefixChk(prefix) {\n let chk = 1;\n for (let i = 0; i < prefix.length; ++i) {\n const c = prefix.charCodeAt(i);\n if (c < 33 || c > 126)\n return 'Invalid prefix (' + prefix + ')';\n chk = polymodStep(chk) ^ (c >> 5);\n }\n chk = polymodStep(chk);\n for (let i = 0; i < prefix.length; ++i) {\n const v = prefix.charCodeAt(i);\n chk = polymodStep(chk) ^ (v & 0x1f);\n }\n return chk;\n}\nfunction convert(data, inBits, outBits, pad) {\n let value = 0;\n let bits = 0;\n const maxV = (1 << outBits) - 1;\n const result = [];\n for (let i = 0; i < data.length; ++i) {\n value = (value << inBits) | data[i];\n bits += inBits;\n while (bits >= outBits) {\n bits -= outBits;\n result.push((value >> bits) & maxV);\n }\n }\n if (pad) {\n if (bits > 0) {\n result.push((value << (outBits - bits)) & maxV);\n }\n }\n else {\n if (bits >= inBits)\n return 'Excess padding';\n if ((value << (outBits - bits)) & maxV)\n return 'Non-zero padding';\n }\n return result;\n}\nfunction toWords(bytes) {\n return convert(bytes, 8, 5, true);\n}\nfunction fromWordsUnsafe(words) {\n const res = convert(words, 5, 8, false);\n if (Array.isArray(res))\n return res;\n}\nfunction fromWords(words) {\n const res = convert(words, 5, 8, false);\n if (Array.isArray(res))\n return res;\n throw new Error(res);\n}\nfunction getLibraryFromEncoding(encoding) {\n let ENCODING_CONST;\n if (encoding === 'bech32') {\n ENCODING_CONST = 1;\n }\n else {\n ENCODING_CONST = 0x2bc830a3;\n }\n function encode(prefix, words, LIMIT) {\n LIMIT = LIMIT || 90;\n if (prefix.length + 7 + words.length > LIMIT)\n throw new TypeError('Exceeds length limit');\n prefix = prefix.toLowerCase();\n // determine chk mod\n let chk = prefixChk(prefix);\n if (typeof chk === 'string')\n throw new Error(chk);\n let result = prefix + '1';\n for (let i = 0; i < words.length; ++i) {\n const x = words[i];\n if (x >> 5 !== 0)\n throw new Error('Non 5-bit word');\n chk = polymodStep(chk) ^ x;\n result += ALPHABET.charAt(x);\n }\n for (let i = 0; i < 6; ++i) {\n chk = polymodStep(chk);\n }\n chk ^= ENCODING_CONST;\n for (let i = 0; i < 6; ++i) {\n const v = (chk >> ((5 - i) * 5)) & 0x1f;\n result += ALPHABET.charAt(v);\n }\n return result;\n }\n function __decode(str, LIMIT) {\n LIMIT = LIMIT || 90;\n if (str.length < 8)\n return str + ' too short';\n if (str.length > LIMIT)\n return 'Exceeds length limit';\n // don't allow mixed case\n const lowered = str.toLowerCase();\n const uppered = str.toUpperCase();\n if (str !== lowered && str !== uppered)\n return 'Mixed-case string ' + str;\n str = lowered;\n const split = str.lastIndexOf('1');\n if (split === -1)\n return 'No separator character for ' + str;\n if (split === 0)\n return 'Missing prefix for ' + str;\n const prefix = str.slice(0, split);\n const wordChars = str.slice(split + 1);\n if (wordChars.length < 6)\n return 'Data too short';\n let chk = prefixChk(prefix);\n if (typeof chk === 'string')\n return chk;\n const words = [];\n for (let i = 0; i < wordChars.length; ++i) {\n const c = wordChars.charAt(i);\n const v = ALPHABET_MAP[c];\n if (v === undefined)\n return 'Unknown character ' + c;\n chk = polymodStep(chk) ^ v;\n // not in the checksum?\n if (i + 6 >= wordChars.length)\n continue;\n words.push(v);\n }\n if (chk !== ENCODING_CONST)\n return 'Invalid checksum for ' + str;\n return { prefix, words };\n }\n function decodeUnsafe(str, LIMIT) {\n const res = __decode(str, LIMIT);\n if (typeof res === 'object')\n return res;\n }\n function decode(str, LIMIT) {\n const res = __decode(str, LIMIT);\n if (typeof res === 'object')\n return res;\n throw new Error(res);\n }\n return {\n decodeUnsafe,\n decode,\n encode,\n toWords,\n fromWordsUnsafe,\n fromWords,\n };\n}\nexports.bech32 = getLibraryFromEncoding('bech32');\nexports.bech32m = getLibraryFromEncoding('bech32m');\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n return false;\n }\n if (i < 0 || i + 1 >= msg.length) {\n return false;\n }\n return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n // Inspired by stringToUtf8ByteArray() in closure-library by Google\n // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n // Apache License 2.0\n // https://github.com/google/closure-library/blob/master/LICENSE\n var p = 0;\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n if (c < 128) {\n res[p++] = c;\n } else if (c < 2048) {\n res[p++] = (c >> 6) | 192;\n res[p++] = (c & 63) | 128;\n } else if (isSurrogatePair(msg, i)) {\n c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n res[p++] = (c >> 18) | 240;\n res[p++] = ((c >> 12) & 63) | 128;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n } else {\n res[p++] = (c >> 12) | 224;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n }\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgAcknowledgementResponse = exports.MsgAcknowledgement = exports.MsgTimeoutOnCloseResponse = exports.MsgTimeoutOnClose = exports.MsgTimeoutResponse = exports.MsgTimeout = exports.MsgRecvPacketResponse = exports.MsgRecvPacket = exports.MsgChannelCloseConfirmResponse = exports.MsgChannelCloseConfirm = exports.MsgChannelCloseInitResponse = exports.MsgChannelCloseInit = exports.MsgChannelOpenConfirmResponse = exports.MsgChannelOpenConfirm = exports.MsgChannelOpenAckResponse = exports.MsgChannelOpenAck = exports.MsgChannelOpenTryResponse = exports.MsgChannelOpenTry = exports.MsgChannelOpenInitResponse = exports.MsgChannelOpenInit = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst channel_1 = require(\"../../../../ibc/core/channel/v1/channel\");\nconst client_1 = require(\"../../../../ibc/core/client/v1/client\");\nexports.protobufPackage = \"ibc.core.channel.v1\";\nconst baseMsgChannelOpenInit = { portId: \"\", signer: \"\" };\nexports.MsgChannelOpenInit = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.channel !== undefined) {\n channel_1.Channel.encode(message.channel, writer.uint32(18).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(26).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenInit);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.channel = channel_1.Channel.decode(reader, reader.uint32());\n break;\n case 3:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgChannelOpenInit);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channel !== undefined && object.channel !== null) {\n message.channel = channel_1.Channel.fromJSON(object.channel);\n }\n else {\n message.channel = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.channel !== undefined &&\n (obj.channel = message.channel ? channel_1.Channel.toJSON(message.channel) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgChannelOpenInit);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channel !== undefined && object.channel !== null) {\n message.channel = channel_1.Channel.fromPartial(object.channel);\n }\n else {\n message.channel = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgChannelOpenInitResponse = {};\nexports.MsgChannelOpenInitResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenInitResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgChannelOpenInitResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgChannelOpenInitResponse);\n return message;\n },\n};\nconst baseMsgChannelOpenTry = {\n portId: \"\",\n previousChannelId: \"\",\n counterpartyVersion: \"\",\n signer: \"\",\n};\nexports.MsgChannelOpenTry = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.previousChannelId !== \"\") {\n writer.uint32(18).string(message.previousChannelId);\n }\n if (message.channel !== undefined) {\n channel_1.Channel.encode(message.channel, writer.uint32(26).fork()).ldelim();\n }\n if (message.counterpartyVersion !== \"\") {\n writer.uint32(34).string(message.counterpartyVersion);\n }\n if (message.proofInit.length !== 0) {\n writer.uint32(42).bytes(message.proofInit);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(58).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenTry);\n message.proofInit = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.previousChannelId = reader.string();\n break;\n case 3:\n message.channel = channel_1.Channel.decode(reader, reader.uint32());\n break;\n case 4:\n message.counterpartyVersion = reader.string();\n break;\n case 5:\n message.proofInit = reader.bytes();\n break;\n case 6:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 7:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgChannelOpenTry);\n message.proofInit = new Uint8Array();\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.previousChannelId !== undefined && object.previousChannelId !== null) {\n message.previousChannelId = String(object.previousChannelId);\n }\n else {\n message.previousChannelId = \"\";\n }\n if (object.channel !== undefined && object.channel !== null) {\n message.channel = channel_1.Channel.fromJSON(object.channel);\n }\n else {\n message.channel = undefined;\n }\n if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) {\n message.counterpartyVersion = String(object.counterpartyVersion);\n }\n else {\n message.counterpartyVersion = \"\";\n }\n if (object.proofInit !== undefined && object.proofInit !== null) {\n message.proofInit = bytesFromBase64(object.proofInit);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.previousChannelId !== undefined && (obj.previousChannelId = message.previousChannelId);\n message.channel !== undefined &&\n (obj.channel = message.channel ? channel_1.Channel.toJSON(message.channel) : undefined);\n message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion);\n message.proofInit !== undefined &&\n (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgChannelOpenTry);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.previousChannelId !== undefined && object.previousChannelId !== null) {\n message.previousChannelId = object.previousChannelId;\n }\n else {\n message.previousChannelId = \"\";\n }\n if (object.channel !== undefined && object.channel !== null) {\n message.channel = channel_1.Channel.fromPartial(object.channel);\n }\n else {\n message.channel = undefined;\n }\n if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) {\n message.counterpartyVersion = object.counterpartyVersion;\n }\n else {\n message.counterpartyVersion = \"\";\n }\n if (object.proofInit !== undefined && object.proofInit !== null) {\n message.proofInit = object.proofInit;\n }\n else {\n message.proofInit = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgChannelOpenTryResponse = {};\nexports.MsgChannelOpenTryResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenTryResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgChannelOpenTryResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgChannelOpenTryResponse);\n return message;\n },\n};\nconst baseMsgChannelOpenAck = {\n portId: \"\",\n channelId: \"\",\n counterpartyChannelId: \"\",\n counterpartyVersion: \"\",\n signer: \"\",\n};\nexports.MsgChannelOpenAck = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(18).string(message.channelId);\n }\n if (message.counterpartyChannelId !== \"\") {\n writer.uint32(26).string(message.counterpartyChannelId);\n }\n if (message.counterpartyVersion !== \"\") {\n writer.uint32(34).string(message.counterpartyVersion);\n }\n if (message.proofTry.length !== 0) {\n writer.uint32(42).bytes(message.proofTry);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(58).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenAck);\n message.proofTry = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.channelId = reader.string();\n break;\n case 3:\n message.counterpartyChannelId = reader.string();\n break;\n case 4:\n message.counterpartyVersion = reader.string();\n break;\n case 5:\n message.proofTry = reader.bytes();\n break;\n case 6:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 7:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgChannelOpenAck);\n message.proofTry = new Uint8Array();\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = String(object.channelId);\n }\n else {\n message.channelId = \"\";\n }\n if (object.counterpartyChannelId !== undefined && object.counterpartyChannelId !== null) {\n message.counterpartyChannelId = String(object.counterpartyChannelId);\n }\n else {\n message.counterpartyChannelId = \"\";\n }\n if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) {\n message.counterpartyVersion = String(object.counterpartyVersion);\n }\n else {\n message.counterpartyVersion = \"\";\n }\n if (object.proofTry !== undefined && object.proofTry !== null) {\n message.proofTry = bytesFromBase64(object.proofTry);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.channelId !== undefined && (obj.channelId = message.channelId);\n message.counterpartyChannelId !== undefined &&\n (obj.counterpartyChannelId = message.counterpartyChannelId);\n message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion);\n message.proofTry !== undefined &&\n (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgChannelOpenAck);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = object.channelId;\n }\n else {\n message.channelId = \"\";\n }\n if (object.counterpartyChannelId !== undefined && object.counterpartyChannelId !== null) {\n message.counterpartyChannelId = object.counterpartyChannelId;\n }\n else {\n message.counterpartyChannelId = \"\";\n }\n if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) {\n message.counterpartyVersion = object.counterpartyVersion;\n }\n else {\n message.counterpartyVersion = \"\";\n }\n if (object.proofTry !== undefined && object.proofTry !== null) {\n message.proofTry = object.proofTry;\n }\n else {\n message.proofTry = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgChannelOpenAckResponse = {};\nexports.MsgChannelOpenAckResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenAckResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgChannelOpenAckResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgChannelOpenAckResponse);\n return message;\n },\n};\nconst baseMsgChannelOpenConfirm = { portId: \"\", channelId: \"\", signer: \"\" };\nexports.MsgChannelOpenConfirm = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(18).string(message.channelId);\n }\n if (message.proofAck.length !== 0) {\n writer.uint32(26).bytes(message.proofAck);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(42).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenConfirm);\n message.proofAck = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.channelId = reader.string();\n break;\n case 3:\n message.proofAck = reader.bytes();\n break;\n case 4:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 5:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgChannelOpenConfirm);\n message.proofAck = new Uint8Array();\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = String(object.channelId);\n }\n else {\n message.channelId = \"\";\n }\n if (object.proofAck !== undefined && object.proofAck !== null) {\n message.proofAck = bytesFromBase64(object.proofAck);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.channelId !== undefined && (obj.channelId = message.channelId);\n message.proofAck !== undefined &&\n (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgChannelOpenConfirm);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = object.channelId;\n }\n else {\n message.channelId = \"\";\n }\n if (object.proofAck !== undefined && object.proofAck !== null) {\n message.proofAck = object.proofAck;\n }\n else {\n message.proofAck = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgChannelOpenConfirmResponse = {};\nexports.MsgChannelOpenConfirmResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelOpenConfirmResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgChannelOpenConfirmResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgChannelOpenConfirmResponse);\n return message;\n },\n};\nconst baseMsgChannelCloseInit = { portId: \"\", channelId: \"\", signer: \"\" };\nexports.MsgChannelCloseInit = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(18).string(message.channelId);\n }\n if (message.signer !== \"\") {\n writer.uint32(26).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelCloseInit);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.channelId = reader.string();\n break;\n case 3:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgChannelCloseInit);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = String(object.channelId);\n }\n else {\n message.channelId = \"\";\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.channelId !== undefined && (obj.channelId = message.channelId);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgChannelCloseInit);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = object.channelId;\n }\n else {\n message.channelId = \"\";\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgChannelCloseInitResponse = {};\nexports.MsgChannelCloseInitResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelCloseInitResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgChannelCloseInitResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgChannelCloseInitResponse);\n return message;\n },\n};\nconst baseMsgChannelCloseConfirm = { portId: \"\", channelId: \"\", signer: \"\" };\nexports.MsgChannelCloseConfirm = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(18).string(message.channelId);\n }\n if (message.proofInit.length !== 0) {\n writer.uint32(26).bytes(message.proofInit);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(42).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelCloseConfirm);\n message.proofInit = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.channelId = reader.string();\n break;\n case 3:\n message.proofInit = reader.bytes();\n break;\n case 4:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 5:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgChannelCloseConfirm);\n message.proofInit = new Uint8Array();\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = String(object.channelId);\n }\n else {\n message.channelId = \"\";\n }\n if (object.proofInit !== undefined && object.proofInit !== null) {\n message.proofInit = bytesFromBase64(object.proofInit);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.channelId !== undefined && (obj.channelId = message.channelId);\n message.proofInit !== undefined &&\n (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgChannelCloseConfirm);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = object.channelId;\n }\n else {\n message.channelId = \"\";\n }\n if (object.proofInit !== undefined && object.proofInit !== null) {\n message.proofInit = object.proofInit;\n }\n else {\n message.proofInit = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgChannelCloseConfirmResponse = {};\nexports.MsgChannelCloseConfirmResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgChannelCloseConfirmResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgChannelCloseConfirmResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgChannelCloseConfirmResponse);\n return message;\n },\n};\nconst baseMsgRecvPacket = { signer: \"\" };\nexports.MsgRecvPacket = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.packet !== undefined) {\n channel_1.Packet.encode(message.packet, writer.uint32(10).fork()).ldelim();\n }\n if (message.proofCommitment.length !== 0) {\n writer.uint32(18).bytes(message.proofCommitment);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(34).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgRecvPacket);\n message.proofCommitment = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.packet = channel_1.Packet.decode(reader, reader.uint32());\n break;\n case 2:\n message.proofCommitment = reader.bytes();\n break;\n case 3:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 4:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgRecvPacket);\n message.proofCommitment = new Uint8Array();\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromJSON(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.proofCommitment !== undefined && object.proofCommitment !== null) {\n message.proofCommitment = bytesFromBase64(object.proofCommitment);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.packet !== undefined && (obj.packet = message.packet ? channel_1.Packet.toJSON(message.packet) : undefined);\n message.proofCommitment !== undefined &&\n (obj.proofCommitment = base64FromBytes(message.proofCommitment !== undefined ? message.proofCommitment : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgRecvPacket);\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromPartial(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.proofCommitment !== undefined && object.proofCommitment !== null) {\n message.proofCommitment = object.proofCommitment;\n }\n else {\n message.proofCommitment = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgRecvPacketResponse = {};\nexports.MsgRecvPacketResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgRecvPacketResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgRecvPacketResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgRecvPacketResponse);\n return message;\n },\n};\nconst baseMsgTimeout = { nextSequenceRecv: long_1.default.UZERO, signer: \"\" };\nexports.MsgTimeout = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.packet !== undefined) {\n channel_1.Packet.encode(message.packet, writer.uint32(10).fork()).ldelim();\n }\n if (message.proofUnreceived.length !== 0) {\n writer.uint32(18).bytes(message.proofUnreceived);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();\n }\n if (!message.nextSequenceRecv.isZero()) {\n writer.uint32(32).uint64(message.nextSequenceRecv);\n }\n if (message.signer !== \"\") {\n writer.uint32(42).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgTimeout);\n message.proofUnreceived = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.packet = channel_1.Packet.decode(reader, reader.uint32());\n break;\n case 2:\n message.proofUnreceived = reader.bytes();\n break;\n case 3:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 4:\n message.nextSequenceRecv = reader.uint64();\n break;\n case 5:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgTimeout);\n message.proofUnreceived = new Uint8Array();\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromJSON(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) {\n message.proofUnreceived = bytesFromBase64(object.proofUnreceived);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) {\n message.nextSequenceRecv = long_1.default.fromString(object.nextSequenceRecv);\n }\n else {\n message.nextSequenceRecv = long_1.default.UZERO;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.packet !== undefined && (obj.packet = message.packet ? channel_1.Packet.toJSON(message.packet) : undefined);\n message.proofUnreceived !== undefined &&\n (obj.proofUnreceived = base64FromBytes(message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.nextSequenceRecv !== undefined &&\n (obj.nextSequenceRecv = (message.nextSequenceRecv || long_1.default.UZERO).toString());\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgTimeout);\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromPartial(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) {\n message.proofUnreceived = object.proofUnreceived;\n }\n else {\n message.proofUnreceived = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) {\n message.nextSequenceRecv = object.nextSequenceRecv;\n }\n else {\n message.nextSequenceRecv = long_1.default.UZERO;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgTimeoutResponse = {};\nexports.MsgTimeoutResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgTimeoutResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgTimeoutResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgTimeoutResponse);\n return message;\n },\n};\nconst baseMsgTimeoutOnClose = { nextSequenceRecv: long_1.default.UZERO, signer: \"\" };\nexports.MsgTimeoutOnClose = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.packet !== undefined) {\n channel_1.Packet.encode(message.packet, writer.uint32(10).fork()).ldelim();\n }\n if (message.proofUnreceived.length !== 0) {\n writer.uint32(18).bytes(message.proofUnreceived);\n }\n if (message.proofClose.length !== 0) {\n writer.uint32(26).bytes(message.proofClose);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim();\n }\n if (!message.nextSequenceRecv.isZero()) {\n writer.uint32(40).uint64(message.nextSequenceRecv);\n }\n if (message.signer !== \"\") {\n writer.uint32(50).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgTimeoutOnClose);\n message.proofUnreceived = new Uint8Array();\n message.proofClose = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.packet = channel_1.Packet.decode(reader, reader.uint32());\n break;\n case 2:\n message.proofUnreceived = reader.bytes();\n break;\n case 3:\n message.proofClose = reader.bytes();\n break;\n case 4:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 5:\n message.nextSequenceRecv = reader.uint64();\n break;\n case 6:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgTimeoutOnClose);\n message.proofUnreceived = new Uint8Array();\n message.proofClose = new Uint8Array();\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromJSON(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) {\n message.proofUnreceived = bytesFromBase64(object.proofUnreceived);\n }\n if (object.proofClose !== undefined && object.proofClose !== null) {\n message.proofClose = bytesFromBase64(object.proofClose);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) {\n message.nextSequenceRecv = long_1.default.fromString(object.nextSequenceRecv);\n }\n else {\n message.nextSequenceRecv = long_1.default.UZERO;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.packet !== undefined && (obj.packet = message.packet ? channel_1.Packet.toJSON(message.packet) : undefined);\n message.proofUnreceived !== undefined &&\n (obj.proofUnreceived = base64FromBytes(message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array()));\n message.proofClose !== undefined &&\n (obj.proofClose = base64FromBytes(message.proofClose !== undefined ? message.proofClose : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.nextSequenceRecv !== undefined &&\n (obj.nextSequenceRecv = (message.nextSequenceRecv || long_1.default.UZERO).toString());\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgTimeoutOnClose);\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromPartial(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) {\n message.proofUnreceived = object.proofUnreceived;\n }\n else {\n message.proofUnreceived = new Uint8Array();\n }\n if (object.proofClose !== undefined && object.proofClose !== null) {\n message.proofClose = object.proofClose;\n }\n else {\n message.proofClose = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) {\n message.nextSequenceRecv = object.nextSequenceRecv;\n }\n else {\n message.nextSequenceRecv = long_1.default.UZERO;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgTimeoutOnCloseResponse = {};\nexports.MsgTimeoutOnCloseResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgTimeoutOnCloseResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgTimeoutOnCloseResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgTimeoutOnCloseResponse);\n return message;\n },\n};\nconst baseMsgAcknowledgement = { signer: \"\" };\nexports.MsgAcknowledgement = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.packet !== undefined) {\n channel_1.Packet.encode(message.packet, writer.uint32(10).fork()).ldelim();\n }\n if (message.acknowledgement.length !== 0) {\n writer.uint32(18).bytes(message.acknowledgement);\n }\n if (message.proofAcked.length !== 0) {\n writer.uint32(26).bytes(message.proofAcked);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(42).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgAcknowledgement);\n message.acknowledgement = new Uint8Array();\n message.proofAcked = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.packet = channel_1.Packet.decode(reader, reader.uint32());\n break;\n case 2:\n message.acknowledgement = reader.bytes();\n break;\n case 3:\n message.proofAcked = reader.bytes();\n break;\n case 4:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 5:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgAcknowledgement);\n message.acknowledgement = new Uint8Array();\n message.proofAcked = new Uint8Array();\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromJSON(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.acknowledgement !== undefined && object.acknowledgement !== null) {\n message.acknowledgement = bytesFromBase64(object.acknowledgement);\n }\n if (object.proofAcked !== undefined && object.proofAcked !== null) {\n message.proofAcked = bytesFromBase64(object.proofAcked);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.packet !== undefined && (obj.packet = message.packet ? channel_1.Packet.toJSON(message.packet) : undefined);\n message.acknowledgement !== undefined &&\n (obj.acknowledgement = base64FromBytes(message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array()));\n message.proofAcked !== undefined &&\n (obj.proofAcked = base64FromBytes(message.proofAcked !== undefined ? message.proofAcked : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgAcknowledgement);\n if (object.packet !== undefined && object.packet !== null) {\n message.packet = channel_1.Packet.fromPartial(object.packet);\n }\n else {\n message.packet = undefined;\n }\n if (object.acknowledgement !== undefined && object.acknowledgement !== null) {\n message.acknowledgement = object.acknowledgement;\n }\n else {\n message.acknowledgement = new Uint8Array();\n }\n if (object.proofAcked !== undefined && object.proofAcked !== null) {\n message.proofAcked = object.proofAcked;\n }\n else {\n message.proofAcked = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgAcknowledgementResponse = {};\nexports.MsgAcknowledgementResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgAcknowledgementResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgAcknowledgementResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgAcknowledgementResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.ChannelOpenInit = this.ChannelOpenInit.bind(this);\n this.ChannelOpenTry = this.ChannelOpenTry.bind(this);\n this.ChannelOpenAck = this.ChannelOpenAck.bind(this);\n this.ChannelOpenConfirm = this.ChannelOpenConfirm.bind(this);\n this.ChannelCloseInit = this.ChannelCloseInit.bind(this);\n this.ChannelCloseConfirm = this.ChannelCloseConfirm.bind(this);\n this.RecvPacket = this.RecvPacket.bind(this);\n this.Timeout = this.Timeout.bind(this);\n this.TimeoutOnClose = this.TimeoutOnClose.bind(this);\n this.Acknowledgement = this.Acknowledgement.bind(this);\n }\n ChannelOpenInit(request) {\n const data = exports.MsgChannelOpenInit.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"ChannelOpenInit\", data);\n return promise.then((data) => exports.MsgChannelOpenInitResponse.decode(new minimal_1.default.Reader(data)));\n }\n ChannelOpenTry(request) {\n const data = exports.MsgChannelOpenTry.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"ChannelOpenTry\", data);\n return promise.then((data) => exports.MsgChannelOpenTryResponse.decode(new minimal_1.default.Reader(data)));\n }\n ChannelOpenAck(request) {\n const data = exports.MsgChannelOpenAck.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"ChannelOpenAck\", data);\n return promise.then((data) => exports.MsgChannelOpenAckResponse.decode(new minimal_1.default.Reader(data)));\n }\n ChannelOpenConfirm(request) {\n const data = exports.MsgChannelOpenConfirm.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"ChannelOpenConfirm\", data);\n return promise.then((data) => exports.MsgChannelOpenConfirmResponse.decode(new minimal_1.default.Reader(data)));\n }\n ChannelCloseInit(request) {\n const data = exports.MsgChannelCloseInit.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"ChannelCloseInit\", data);\n return promise.then((data) => exports.MsgChannelCloseInitResponse.decode(new minimal_1.default.Reader(data)));\n }\n ChannelCloseConfirm(request) {\n const data = exports.MsgChannelCloseConfirm.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"ChannelCloseConfirm\", data);\n return promise.then((data) => exports.MsgChannelCloseConfirmResponse.decode(new minimal_1.default.Reader(data)));\n }\n RecvPacket(request) {\n const data = exports.MsgRecvPacket.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"RecvPacket\", data);\n return promise.then((data) => exports.MsgRecvPacketResponse.decode(new minimal_1.default.Reader(data)));\n }\n Timeout(request) {\n const data = exports.MsgTimeout.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"Timeout\", data);\n return promise.then((data) => exports.MsgTimeoutResponse.decode(new minimal_1.default.Reader(data)));\n }\n TimeoutOnClose(request) {\n const data = exports.MsgTimeoutOnClose.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"TimeoutOnClose\", data);\n return promise.then((data) => exports.MsgTimeoutOnCloseResponse.decode(new minimal_1.default.Reader(data)));\n }\n Acknowledgement(request) {\n const data = exports.MsgAcknowledgement.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.channel.v1.Msg\", \"Acknowledgement\", data);\n return promise.then((data) => exports.MsgAcknowledgementResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return function () {\n return null;\n };\n }\n\n return function (props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<>';\n var propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined') {\n return new Error(\"The \".concat(location, \" `\").concat(propFullNameSafe, \"` of \") + \"`\".concat(componentNameSafe, \"` is deprecated. \").concat(reason));\n }\n\n return null;\n };\n}","/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.2';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasatob = typeof atob === 'function';\nconst _hasbtoa = typeof btoa === 'function';\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it, fn = (x) => x) => new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = _hasbtoa ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = _hasatob ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a), c => c.charCodeAt(0));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins,\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","/**\n * Safe chained function\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n *\n * @param {function} functions to chain\n * @returns {function|null}\n */\nexport default function createChainedFunction() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n return funcs.reduce(function (acc, func) {\n if (func == null) {\n return acc;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof func !== 'function') {\n console.error('Material-UI: Invalid Argument Type, must only provide functions, undefined, or null.');\n }\n }\n\n return function chainedFunction() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, function () {});\n}","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nvar ListContext = React.createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ListContext.displayName = 'ListContext';\n}\n\nexport default ListContext;","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nvar FormControlContext = React.createContext();\n\nif (process.env.NODE_ENV !== 'production') {\n FormControlContext.displayName = 'FormControlContext';\n}\n\nexport function useFormControl() {\n return React.useContext(FormControlContext);\n}\nexport default FormControlContext;","import { BigNumber } from \"@ethersproject/bignumber\";\nconst NegativeOne = ( /*#__PURE__*/BigNumber.from(-1));\nconst Zero = ( /*#__PURE__*/BigNumber.from(0));\nconst One = ( /*#__PURE__*/BigNumber.from(1));\nconst Two = ( /*#__PURE__*/BigNumber.from(2));\nconst WeiPerEther = ( /*#__PURE__*/BigNumber.from(\"1000000000000000000\"));\nconst MaxUint256 = ( /*#__PURE__*/BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nconst MinInt256 = ( /*#__PURE__*/BigNumber.from(\"-0x8000000000000000000000000000000000000000000000000000000000000000\"));\nconst MaxInt256 = ( /*#__PURE__*/BigNumber.from(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nexport { NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256, MinInt256, MaxInt256, };\n//# sourceMappingURL=bignumbers.js.map","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // 'A' - 'F'\n if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n // '0' - '9'\n } else {\n return (c - 48) & 0xf;\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this.strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is BN v4 instance\n r.strip();\n } else {\n // r is BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nexport function id(text) {\n return keccak256(toUtf8Bytes(text));\n}\n//# sourceMappingURL=id.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timestamp = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"google.protobuf\";\nconst baseTimestamp = { seconds: long_1.default.ZERO, nanos: 0 };\nexports.Timestamp = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.seconds.isZero()) {\n writer.uint32(8).int64(message.seconds);\n }\n if (message.nanos !== 0) {\n writer.uint32(16).int32(message.nanos);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTimestamp);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.seconds = reader.int64();\n break;\n case 2:\n message.nanos = reader.int32();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTimestamp);\n if (object.seconds !== undefined && object.seconds !== null) {\n message.seconds = long_1.default.fromString(object.seconds);\n }\n else {\n message.seconds = long_1.default.ZERO;\n }\n if (object.nanos !== undefined && object.nanos !== null) {\n message.nanos = Number(object.nanos);\n }\n else {\n message.nanos = 0;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.seconds !== undefined && (obj.seconds = (message.seconds || long_1.default.ZERO).toString());\n message.nanos !== undefined && (obj.nanos = message.nanos);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTimestamp);\n if (object.seconds !== undefined && object.seconds !== null) {\n message.seconds = object.seconds;\n }\n else {\n message.seconds = long_1.default.ZERO;\n }\n if (object.nanos !== undefined && object.nanos !== null) {\n message.nanos = object.nanos;\n }\n else {\n message.nanos = 0;\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=timestamp.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValConsPublicKey = exports.LegacyAminoMultisigPublicKey = exports.SimplePublicKey = exports.PublicKey = void 0;\nvar json_1 = require(\"../util/json\");\nvar hash_1 = require(\"../util/hash\");\nvar keys_1 = require(\"@terra-money/terra.proto/cosmos/crypto/multisig/keys\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar keys_2 = require(\"@terra-money/terra.proto/cosmos/crypto/secp256k1/keys\");\nvar keys_3 = require(\"@terra-money/terra.proto/cosmos/crypto/ed25519/keys\");\nvar bech32_1 = require(\"bech32\");\n// As discussed in https://github.com/binance-chain/javascript-sdk/issues/163\n// Prefixes listed here: https://github.com/tendermint/tendermint/blob/d419fffe18531317c28c29a292ad7d253f6cafdf/docs/spec/blockchain/encoding.md#public-key-cryptography\n// Last bytes is varint-encoded length prefix\nvar pubkeyAminoPrefixSecp256k1 = Buffer.from('eb5ae987' + '21' /* fixed length */, 'hex');\nvar pubkeyAminoPrefixEd25519 = Buffer.from('1624de64' + '20' /* fixed length */, 'hex');\n/** See https://github.com/tendermint/tendermint/commit/38b401657e4ad7a7eeb3c30a3cbf512037df3740 */\nvar pubkeyAminoPrefixMultisigThreshold = Buffer.from('22c1f7e2' /* variable length not included */, 'hex');\nvar encodeUvarint = function (value) {\n var checked = Number.parseInt(value.toString());\n if (checked > 127) {\n 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.');\n }\n return [checked];\n};\nvar PublicKey;\n(function (PublicKey) {\n function fromAmino(data) {\n switch (data.type) {\n case 'tendermint/PubKeySecp256k1':\n return SimplePublicKey.fromAmino(data);\n case 'tendermint/PubKeyMultisigThreshold':\n return LegacyAminoMultisigPublicKey.fromAmino(data);\n case 'tendermint/PubKeyEd25519':\n return ValConsPublicKey.fromAmino(data);\n }\n }\n PublicKey.fromAmino = fromAmino;\n function fromData(data) {\n switch (data['@type']) {\n case '/cosmos.crypto.secp256k1.PubKey':\n return SimplePublicKey.fromData(data);\n case '/cosmos.crypto.multisig.LegacyAminoPubKey':\n return LegacyAminoMultisigPublicKey.fromData(data);\n case '/cosmos.crypto.ed25519.PubKey':\n return ValConsPublicKey.fromData(data);\n }\n }\n PublicKey.fromData = fromData;\n function fromProto(pubkeyAny) {\n var typeUrl = pubkeyAny.typeUrl;\n if (typeUrl === '/cosmos.crypto.secp256k1.PubKey') {\n return SimplePublicKey.unpackAny(pubkeyAny);\n }\n else if (typeUrl === '/cosmos.crypto.multisig.LegacyAminoPubKey') {\n return LegacyAminoMultisigPublicKey.unpackAny(pubkeyAny);\n }\n else if (typeUrl === '/cosmos.crypto.ed25519.PubKey') {\n return ValConsPublicKey.unpackAny(pubkeyAny);\n }\n throw new Error(\"Pubkey type \" + typeUrl + \" not recognized\");\n }\n PublicKey.fromProto = fromProto;\n})(PublicKey = exports.PublicKey || (exports.PublicKey = {}));\nvar SimplePublicKey = /** @class */ (function (_super) {\n __extends(SimplePublicKey, _super);\n function SimplePublicKey(key) {\n var _this = _super.call(this) || this;\n _this.key = key;\n return _this;\n }\n SimplePublicKey.fromAmino = function (data) {\n return new SimplePublicKey(data.value);\n };\n SimplePublicKey.prototype.toAmino = function () {\n return {\n type: 'tendermint/PubKeySecp256k1',\n value: this.key,\n };\n };\n SimplePublicKey.fromData = function (data) {\n return new SimplePublicKey(data.key);\n };\n SimplePublicKey.prototype.toData = function () {\n return {\n '@type': '/cosmos.crypto.secp256k1.PubKey',\n key: this.key,\n };\n };\n SimplePublicKey.fromProto = function (pubkeyProto) {\n return new SimplePublicKey(Buffer.from(pubkeyProto.key).toString('base64'));\n };\n SimplePublicKey.prototype.toProto = function () {\n return keys_2.PubKey.fromPartial({\n key: Buffer.from(this.key, 'base64'),\n });\n };\n SimplePublicKey.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.crypto.secp256k1.PubKey',\n value: keys_2.PubKey.encode(this.toProto()).finish(),\n });\n };\n SimplePublicKey.unpackAny = function (pubkeyAny) {\n return SimplePublicKey.fromProto(keys_2.PubKey.decode(pubkeyAny.value));\n };\n SimplePublicKey.prototype.encodeAminoPubkey = function () {\n return Buffer.concat([\n pubkeyAminoPrefixSecp256k1,\n Buffer.from(this.key, 'base64'),\n ]);\n };\n SimplePublicKey.prototype.rawAddress = function () {\n var pubkeyData = Buffer.from(this.key, 'base64');\n return (0, hash_1.ripemd160)((0, hash_1.sha256)(pubkeyData));\n };\n SimplePublicKey.prototype.address = function () {\n return bech32_1.bech32.encode('terra', bech32_1.bech32.toWords(this.rawAddress()));\n };\n SimplePublicKey.prototype.pubkeyAddress = function () {\n return bech32_1.bech32.encode('terrapub', bech32_1.bech32.toWords(this.encodeAminoPubkey()));\n };\n return SimplePublicKey;\n}(json_1.JSONSerializable));\nexports.SimplePublicKey = SimplePublicKey;\nvar LegacyAminoMultisigPublicKey = /** @class */ (function (_super) {\n __extends(LegacyAminoMultisigPublicKey, _super);\n function LegacyAminoMultisigPublicKey(threshold, pubkeys) {\n var _this = _super.call(this) || this;\n _this.threshold = threshold;\n _this.pubkeys = pubkeys;\n return _this;\n }\n LegacyAminoMultisigPublicKey.prototype.encodeAminoPubkey = function () {\n var out = Array.from(pubkeyAminoPrefixMultisigThreshold);\n out.push(0x08);\n out.push.apply(out, encodeUvarint(this.threshold));\n for (var _i = 0, _a = this.pubkeys.map(function (p) { return p.encodeAminoPubkey(); }); _i < _a.length; _i++) {\n var pubkeyData = _a[_i];\n out.push(0x12);\n out.push.apply(out, encodeUvarint(pubkeyData.length));\n out.push.apply(out, Array.from(pubkeyData));\n }\n return new Uint8Array(out);\n };\n LegacyAminoMultisigPublicKey.prototype.rawAddress = function () {\n var pubkeyData = this.encodeAminoPubkey();\n return (0, hash_1.sha256)(pubkeyData).slice(0, 20);\n };\n LegacyAminoMultisigPublicKey.prototype.address = function () {\n return bech32_1.bech32.encode('terra', bech32_1.bech32.toWords(this.rawAddress()));\n };\n LegacyAminoMultisigPublicKey.prototype.pubkeyAddress = function () {\n return bech32_1.bech32.encode('terrapub', bech32_1.bech32.toWords(this.encodeAminoPubkey()));\n };\n LegacyAminoMultisigPublicKey.fromAmino = function (data) {\n return new LegacyAminoMultisigPublicKey(Number.parseInt(data.value.threshold), data.value.pubkeys.map(function (p) { return SimplePublicKey.fromAmino(p); }));\n };\n LegacyAminoMultisigPublicKey.prototype.toAmino = function () {\n return {\n type: 'tendermint/PubKeyMultisigThreshold',\n value: {\n threshold: this.threshold.toFixed(),\n pubkeys: this.pubkeys.map(function (p) { return p.toAmino(); }),\n },\n };\n };\n LegacyAminoMultisigPublicKey.fromData = function (data) {\n return new LegacyAminoMultisigPublicKey(Number.parseInt(data.threshold), data.public_keys.map(function (v) { return SimplePublicKey.fromData(v); }));\n };\n LegacyAminoMultisigPublicKey.prototype.toData = function () {\n return {\n '@type': '/cosmos.crypto.multisig.LegacyAminoPubKey',\n threshold: this.threshold.toFixed(),\n public_keys: this.pubkeys.map(function (p) { return p.toData(); }),\n };\n };\n LegacyAminoMultisigPublicKey.fromProto = function (pubkeyProto) {\n return new LegacyAminoMultisigPublicKey(pubkeyProto.threshold, pubkeyProto.publicKeys.map(function (v) { return SimplePublicKey.unpackAny(v); }));\n };\n LegacyAminoMultisigPublicKey.prototype.toProto = function () {\n return keys_1.LegacyAminoPubKey.fromPartial({\n threshold: this.threshold,\n publicKeys: this.pubkeys.map(function (v) { return v.packAny(); }),\n });\n };\n LegacyAminoMultisigPublicKey.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.crypto.multisig.LegacyAminoPubKey',\n value: keys_1.LegacyAminoPubKey.encode(this.toProto()).finish(),\n });\n };\n LegacyAminoMultisigPublicKey.unpackAny = function (pubkeyAny) {\n return LegacyAminoMultisigPublicKey.fromProto(keys_1.LegacyAminoPubKey.decode(pubkeyAny.value));\n };\n return LegacyAminoMultisigPublicKey;\n}(json_1.JSONSerializable));\nexports.LegacyAminoMultisigPublicKey = LegacyAminoMultisigPublicKey;\nvar ValConsPublicKey = /** @class */ (function (_super) {\n __extends(ValConsPublicKey, _super);\n function ValConsPublicKey(key) {\n var _this = _super.call(this) || this;\n _this.key = key;\n return _this;\n }\n ValConsPublicKey.fromAmino = function (data) {\n return new ValConsPublicKey(data.value);\n };\n ValConsPublicKey.prototype.toAmino = function () {\n return {\n type: 'tendermint/PubKeyEd25519',\n value: this.key,\n };\n };\n ValConsPublicKey.fromData = function (data) {\n return new ValConsPublicKey(data.key);\n };\n ValConsPublicKey.prototype.toData = function () {\n return {\n '@type': '/cosmos.crypto.ed25519.PubKey',\n key: this.key,\n };\n };\n ValConsPublicKey.fromProto = function (pubkeyProto) {\n return new ValConsPublicKey(Buffer.from(pubkeyProto.key).toString('base64'));\n };\n ValConsPublicKey.prototype.toProto = function () {\n return keys_2.PubKey.fromPartial({\n key: Buffer.from(this.key, 'base64'),\n });\n };\n ValConsPublicKey.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.crypto.ed25519.PubKey',\n value: keys_3.PubKey.encode(this.toProto()).finish(),\n });\n };\n ValConsPublicKey.unpackAny = function (pubkeyAny) {\n return ValConsPublicKey.fromProto(keys_3.PubKey.decode(pubkeyAny.value));\n };\n ValConsPublicKey.prototype.encodeAminoPubkey = function () {\n return Buffer.concat([\n pubkeyAminoPrefixEd25519,\n Buffer.from(this.key, 'base64'),\n ]);\n };\n ValConsPublicKey.prototype.rawAddress = function () {\n var pubkeyData = Buffer.from(this.key, 'base64');\n return (0, hash_1.sha256)(pubkeyData).slice(0, 20);\n };\n ValConsPublicKey.prototype.address = function () {\n return bech32_1.bech32.encode('terravalcons', bech32_1.bech32.toWords(this.rawAddress()));\n };\n ValConsPublicKey.prototype.pubkeyAddress = function () {\n return bech32_1.bech32.encode('terravalconspub', bech32_1.bech32.toWords(this.encodeAminoPubkey()));\n };\n return ValConsPublicKey;\n}(json_1.JSONSerializable));\nexports.ValConsPublicKey = ValConsPublicKey;\n//# sourceMappingURL=PublicKey.js.map","export default function requirePropFactory(componentNameInError) {\n if (process.env.NODE_ENV === 'production') {\n return function () {\n return null;\n };\n }\n\n var requireProp = function requireProp(requiredProp) {\n return function (props, propName, componentName, location, propFullName) {\n var propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(\"The prop `\".concat(propFullNameSafe, \"` of \") + \"`\".concat(componentNameInError, \"` must be used on `\").concat(requiredProp, \"`.\"));\n }\n\n return null;\n };\n };\n\n return requireProp;\n}","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n\n var propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined') {\n return new Error(\"The prop `\".concat(propFullNameSafe, \"` is not supported. Please remove it.\"));\n }\n\n return null;\n}","\"use strict\";\nimport { BaseContract, Contract, ContractFactory } from \"@ethersproject/contracts\";\nimport { BigNumber, FixedNumber } from \"@ethersproject/bignumber\";\nimport { Signer, VoidSigner } from \"@ethersproject/abstract-signer\";\nimport { Wallet } from \"@ethersproject/wallet\";\nimport * as constants from \"@ethersproject/constants\";\nimport * as providers from \"@ethersproject/providers\";\nimport { getDefaultProvider } from \"@ethersproject/providers\";\nimport { Wordlist, wordlists } from \"@ethersproject/wordlists\";\nimport * as utils from \"./utils\";\nimport { ErrorCode as errors, Logger } from \"@ethersproject/logger\";\n////////////////////////\n// Compile-Time Constants\n// This is generated by \"npm run dist\"\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n////////////////////////\n// Exports\nexport { Signer, Wallet, VoidSigner, getDefaultProvider, providers, BaseContract, Contract, ContractFactory, BigNumber, FixedNumber, constants, errors, logger, utils, wordlists, \n////////////////////////\n// Compile-Time Constants\nversion, Wordlist };\n//# sourceMappingURL=ethers.js.map","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}","// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nvar hadKeyboardEvent = true;\nvar hadFocusVisibleRecently = false;\nvar hadFocusVisibleRecentlyTimeout = null;\nvar inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @return {boolean}\n */\n\nfunction focusTriggersKeyboardModality(node) {\n var type = node.type,\n tagName = node.tagName;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n\n if (node.isContentEditable) {\n return true;\n }\n\n return false;\n}\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\n\n\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n\n hadKeyboardEvent = true;\n}\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\n\n\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\n\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\n\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nfunction isFocusVisible(event) {\n var target = event.target;\n\n try {\n return target.matches(':focus-visible');\n } catch (error) {} // browsers not implementing :focus-visible will throw a SyntaxError\n // we use our own heuristic for those browsers\n // rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n // no need for validFocusTarget check. the user does that by attaching it to\n // focusable events only\n\n\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\n/**\n * Should be called if a blur event is fired on a focus-visible element\n */\n\n\nfunction handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}\n\nexport default function useIsFocusVisible() {\n var ref = React.useCallback(function (instance) {\n var node = ReactDOM.findDOMNode(instance);\n\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(isFocusVisible);\n }\n\n return {\n isFocusVisible: isFocusVisible,\n onBlurVisible: handleBlurVisible,\n ref: ref\n };\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nexport function isCrowdsaleWallet(json) {\n let data = null;\n try {\n data = JSON.parse(json);\n }\n catch (error) {\n return false;\n }\n return (data.encseed && data.ethaddr);\n}\nexport function isKeystoreWallet(json) {\n let data = null;\n try {\n data = JSON.parse(json);\n }\n catch (error) {\n return false;\n }\n if (!data.version || parseInt(data.version) !== data.version || parseInt(data.version) !== 3) {\n return false;\n }\n // @TODO: Put more checks to make sure it has kdf, iv and all that good stuff\n return true;\n}\n//export function isJsonWallet(json: string): boolean {\n// return (isSecretStorageWallet(json) || isCrowdsaleWallet(json));\n//}\nexport function getJsonWalletAddress(json) {\n if (isCrowdsaleWallet(json)) {\n try {\n return getAddress(JSON.parse(json).ethaddr);\n }\n catch (error) {\n return null;\n }\n }\n if (isKeystoreWallet(json)) {\n try {\n return getAddress(JSON.parse(json).address);\n }\n catch (error) {\n return null;\n }\n }\n return null;\n}\n//# sourceMappingURL=inspect.js.map","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;\n}","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { hexZeroPad } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, value) {\n try {\n value = getAddress(value);\n }\n catch (error) {\n this._throwError(error.message, value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(hexZeroPad(reader.readValue().toHexString(), 20));\n }\n}\n//# sourceMappingURL=address.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\n// Clones the functionality of an existing Coder, but without a localName\nexport class AnonymousCoder extends Coder {\n constructor(coder) {\n super(coder.name, coder.type, undefined, coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nimport { Coder, Writer } from \"./abstract-coder\";\nimport { AnonymousCoder } from \"./anonymous\";\nexport function pack(writer, coders, values) {\n let arrayValues = null;\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof (values) === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n if (!name) {\n logger.throwError(\"cannot encode object for signature with missing names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n if (unique[name]) {\n logger.throwError(\"cannot encode object for signature with duplicate names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n unique[name] = true;\n return values[name];\n });\n }\n else {\n logger.throwArgumentError(\"invalid tuple value\", \"tuple\", values);\n }\n if (coders.length !== arrayValues.length) {\n logger.throwArgumentError(\"types/value length mismatch\", \"tuple\", values);\n }\n let staticWriter = new Writer(writer.wordSize);\n let dynamicWriter = new Writer(writer.wordSize);\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => { func(staticWriter.length); });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\nexport function unpack(reader, coders) {\n let values = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readValue();\n let offsetReader = baseReader.subReader(offset.toNumber());\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value != undefined) {\n values.push(value);\n }\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add any named parameters (i.e. tuples)\n coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n const value = values[index];\n if (value instanceof Error) {\n Object.defineProperty(values, name, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n else {\n values[name] = value;\n }\n });\n for (let i = 0; i < values.length; i++) {\n const value = values[i];\n if (value instanceof Error) {\n Object.defineProperty(values, i, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n }\n return Object.freeze(values);\n}\nexport class ArrayCoder extends Coder {\n constructor(coder, length, localName) {\n const type = (coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\");\n const dynamic = (length === -1 || coder.dynamic);\n super(\"array\", type, localName, dynamic);\n this.coder = coder;\n this.length = length;\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, value) {\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n logger.checkArgumentCount(value.length, count, \"coder array\" + (this.localName ? (\" \" + this.localName) : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readValue().toNumber();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n if (count * 32 > reader._data.length) {\n logger.throwError(\"insufficient data length\", Logger.errors.BUFFER_OVERRUN, {\n length: reader._data.length,\n count: count\n });\n }\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return reader.coerce(this.name, unpack(reader, coders));\n }\n}\n//# sourceMappingURL=array.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, value) {\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return reader.coerce(this.type, !reader.readValue().isZero());\n }\n}\n//# sourceMappingURL=boolean.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = arrayify(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readValue().toNumber(), true);\n }\n}\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(super.decode(reader)));\n }\n}\n//# sourceMappingURL=bytes.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\n// @TODO: Merge this with bytes\nexport class FixedBytesCoder extends Coder {\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n this.size = size;\n }\n defaultValue() {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n }\n encode(writer, value) {\n let data = arrayify(value);\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(reader.readBytes(this.size)));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes([]);\n }\n decode(reader) {\n reader.readBytes(0);\n return reader.coerce(this.name, null);\n }\n}\n//# sourceMappingURL=null.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { MaxUint256, NegativeOne, One, Zero } from \"@ethersproject/constants\";\nimport { Coder } from \"./abstract-coder\";\nexport class NumberCoder extends Coder {\n constructor(size, signed, localName) {\n const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n super(name, name, localName, false);\n this.size = size;\n this.signed = signed;\n }\n defaultValue() {\n return 0;\n }\n encode(writer, value) {\n let v = BigNumber.from(value);\n // Check bounds are safe for encoding\n let maxUintValue = MaxUint256.mask(writer.wordSize * 8);\n if (this.signed) {\n let bounds = maxUintValue.mask(this.size * 8 - 1);\n if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n }\n else if (v.lt(Zero) || v.gt(maxUintValue.mask(this.size * 8))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n v = v.toTwos(this.size * 8).mask(this.size * 8);\n if (this.signed) {\n v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);\n }\n return writer.writeValue(v);\n }\n decode(reader) {\n let value = reader.readValue().mask(this.size * 8);\n if (this.signed) {\n value = value.fromTwos(this.size * 8);\n }\n return reader.coerce(this.name, value);\n }\n}\n//# sourceMappingURL=number.js.map","\"use strict\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { DynamicBytesCoder } from \"./bytes\";\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, value) {\n return super.encode(writer, toUtf8Bytes(value));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nimport { pack, unpack } from \"./array\";\nexport class TupleCoder extends Coder {\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = (\"tuple(\" + types.join(\",\") + \")\");\n super(\"tuple\", type, localName, dynamic);\n this.coders = coders;\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, value) {\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return reader.coerce(this.name, unpack(reader, this.coders));\n }\n}\n//# sourceMappingURL=tuple.js.map","\"use strict\";\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { Reader, Writer } from \"./coders/abstract-coder\";\nimport { AddressCoder } from \"./coders/address\";\nimport { ArrayCoder } from \"./coders/array\";\nimport { BooleanCoder } from \"./coders/boolean\";\nimport { BytesCoder } from \"./coders/bytes\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes\";\nimport { NullCoder } from \"./coders/null\";\nimport { NumberCoder } from \"./coders/number\";\nimport { StringCoder } from \"./coders/string\";\nimport { TupleCoder } from \"./coders/tuple\";\nimport { ParamType } from \"./fragments\";\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nexport class AbiCoder {\n constructor(coerceFunc) {\n logger.checkNew(new.target, AbiCoder);\n defineReadOnly(this, \"coerceFunc\", coerceFunc || null);\n }\n _getCoder(param) {\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"array\":\n return new ArrayCoder(this._getCoder(param.arrayChildren), param.arrayLength, param.name);\n case \"tuple\":\n return new TupleCoder((param.components || []).map((component) => {\n return this._getCoder(component);\n }), param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n if (size === 0 || size > 256 || (size % 8) !== 0) {\n logger.throwArgumentError(\"invalid \" + match[1] + \" bit length\", \"param\", param);\n }\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n if (size === 0 || size > 32) {\n logger.throwArgumentError(\"invalid bytes length\", \"param\", param);\n }\n return new FixedBytesCoder(size, param.name);\n }\n return logger.throwArgumentError(\"invalid type\", \"type\", param.type);\n }\n _getWordSize() { return 32; }\n _getReader(data, allowLoose) {\n return new Reader(data, this._getWordSize(), this.coerceFunc, allowLoose);\n }\n _getWriter() {\n return new Writer(this._getWordSize());\n }\n getDefaultValue(types) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n encode(types, values) {\n if (types.length !== values.length) {\n logger.throwError(\"types/values length mismatch\", Logger.errors.INVALID_ARGUMENT, {\n count: { types: types.length, values: values.length },\n value: { types: types, values: values }\n });\n }\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = this._getWriter();\n coder.encode(writer, values);\n return writer.data;\n }\n decode(types, data, loose) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(this._getReader(arrayify(data), loose));\n }\n}\nexport const defaultAbiCoder = new AbiCoder();\n//# sourceMappingURL=abi-coder.js.map","import { BigintIsh, Price, sqrt, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { pack, keccak256 } from '@ethersproject/solidity'\nimport { getCreate2Address } from '@ethersproject/address'\n\nimport { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY, FIVE, _997, _1000, ONE, ZERO } from '../constants'\nimport { InsufficientReservesError, InsufficientInputAmountError } from '../errors'\n\nexport const computePairAddress = ({\n factoryAddress,\n tokenA,\n tokenB\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n}): string => {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]),\n INIT_CODE_HASH\n )\n}\nexport class Pair {\n public readonly liquidityToken: Token\n private readonly tokenAmounts: [CurrencyAmount, CurrencyAmount]\n\n public static getAddress(tokenA: Token, tokenB: Token): string {\n return computePairAddress({ factoryAddress: FACTORY_ADDRESS, tokenA, tokenB })\n }\n\n public constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount) {\n const tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [currencyAmountA, tokenAmountB]\n : [tokenAmountB, currencyAmountA]\n this.liquidityToken = new Token(\n tokenAmounts[0].currency.chainId,\n Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency),\n 18,\n 'UNI-V2',\n 'Uniswap V2'\n )\n this.tokenAmounts = tokenAmounts as [CurrencyAmount, CurrencyAmount]\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0\n */\n public get token0Price(): Price {\n const result = this.tokenAmounts[1].divide(this.tokenAmounts[0])\n return new Price(this.token0, this.token1, result.denominator, result.numerator)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1\n */\n public get token1Price(): Price {\n const result = this.tokenAmounts[0].divide(this.tokenAmounts[1])\n return new Price(this.token1, this.token0, result.denominator, result.numerator)\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pair.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pair.\n */\n public get chainId(): number {\n return this.token0.chainId\n }\n\n public get token0(): Token {\n return this.tokenAmounts[0].currency\n }\n\n public get token1(): Token {\n return this.tokenAmounts[1].currency\n }\n\n public get reserve0(): CurrencyAmount {\n return this.tokenAmounts[0]\n }\n\n public get reserve1(): CurrencyAmount {\n return this.tokenAmounts[1]\n }\n\n public reserveOf(token: Token): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.reserve0 : this.reserve1\n }\n\n public getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) {\n throw new InsufficientReservesError()\n }\n const inputReserve = this.reserveOf(inputAmount.currency)\n const outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997)\n const numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient)\n const denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee)\n const outputAmount = CurrencyAmount.fromRawAmount(\n inputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.divide(numerator, denominator)\n )\n if (JSBI.equal(outputAmount.quotient, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(outputAmount.currency), 'TOKEN')\n if (\n JSBI.equal(this.reserve0.quotient, ZERO) ||\n JSBI.equal(this.reserve1.quotient, ZERO) ||\n JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)\n ) {\n throw new InsufficientReservesError()\n }\n\n const outputReserve = this.reserveOf(outputAmount.currency)\n const inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000)\n const denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997)\n const inputAmount = CurrencyAmount.fromRawAmount(\n outputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.add(JSBI.divide(numerator, denominator), ONE)\n )\n return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getLiquidityMinted(\n totalSupply: CurrencyAmount,\n tokenAmountA: CurrencyAmount,\n tokenAmountB: CurrencyAmount\n ): CurrencyAmount {\n invariant(totalSupply.currency.equals(this.liquidityToken), 'LIQUIDITY')\n const tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [tokenAmountA, tokenAmountB]\n : [tokenAmountB, tokenAmountA]\n invariant(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1), 'TOKEN')\n\n let liquidity: JSBI\n if (JSBI.equal(totalSupply.quotient, ZERO)) {\n liquidity = JSBI.subtract(\n sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)),\n MINIMUM_LIQUIDITY\n )\n } else {\n const amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient)\n const amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient)\n liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1\n }\n if (!JSBI.greaterThan(liquidity, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity)\n }\n\n public getLiquidityValue(\n token: Token,\n totalSupply: CurrencyAmount,\n liquidity: CurrencyAmount,\n feeOn: boolean = false,\n kLast?: BigintIsh\n ): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n invariant(totalSupply.currency.equals(this.liquidityToken), 'TOTAL_SUPPLY')\n invariant(liquidity.currency.equals(this.liquidityToken), 'LIQUIDITY')\n invariant(JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient), 'LIQUIDITY')\n\n let totalSupplyAdjusted: CurrencyAmount\n if (!feeOn) {\n totalSupplyAdjusted = totalSupply\n } else {\n invariant(!!kLast, 'K_LAST')\n const kLastParsed = JSBI.BigInt(kLast)\n if (!JSBI.equal(kLastParsed, ZERO)) {\n const rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient))\n const rootKLast = sqrt(kLastParsed)\n if (JSBI.greaterThan(rootK, rootKLast)) {\n const numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast))\n const denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast)\n const feeLiquidity = JSBI.divide(numerator, denominator)\n totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity))\n } else {\n totalSupplyAdjusted = totalSupply\n }\n } else {\n totalSupplyAdjusted = totalSupply\n }\n }\n\n return CurrencyAmount.fromRawAmount(\n token,\n JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)\n )\n }\n}\n","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TallyParams = exports.VotingParams = exports.DepositParams = exports.Vote = exports.TallyResult = exports.Proposal = exports.Deposit = exports.TextProposal = exports.WeightedVoteOption = exports.proposalStatusToJSON = exports.proposalStatusFromJSON = exports.ProposalStatus = exports.voteOptionToJSON = exports.voteOptionFromJSON = exports.VoteOption = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst duration_1 = require(\"../../../google/protobuf/duration\");\nconst timestamp_1 = require(\"../../../google/protobuf/timestamp\");\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"cosmos.gov.v1beta1\";\n/** VoteOption enumerates the valid vote options for a given governance proposal. */\nvar VoteOption;\n(function (VoteOption) {\n /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */\n VoteOption[VoteOption[\"VOTE_OPTION_UNSPECIFIED\"] = 0] = \"VOTE_OPTION_UNSPECIFIED\";\n /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */\n VoteOption[VoteOption[\"VOTE_OPTION_YES\"] = 1] = \"VOTE_OPTION_YES\";\n /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */\n VoteOption[VoteOption[\"VOTE_OPTION_ABSTAIN\"] = 2] = \"VOTE_OPTION_ABSTAIN\";\n /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */\n VoteOption[VoteOption[\"VOTE_OPTION_NO\"] = 3] = \"VOTE_OPTION_NO\";\n /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */\n VoteOption[VoteOption[\"VOTE_OPTION_NO_WITH_VETO\"] = 4] = \"VOTE_OPTION_NO_WITH_VETO\";\n VoteOption[VoteOption[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(VoteOption = exports.VoteOption || (exports.VoteOption = {}));\nfunction voteOptionFromJSON(object) {\n switch (object) {\n case 0:\n case \"VOTE_OPTION_UNSPECIFIED\":\n return VoteOption.VOTE_OPTION_UNSPECIFIED;\n case 1:\n case \"VOTE_OPTION_YES\":\n return VoteOption.VOTE_OPTION_YES;\n case 2:\n case \"VOTE_OPTION_ABSTAIN\":\n return VoteOption.VOTE_OPTION_ABSTAIN;\n case 3:\n case \"VOTE_OPTION_NO\":\n return VoteOption.VOTE_OPTION_NO;\n case 4:\n case \"VOTE_OPTION_NO_WITH_VETO\":\n return VoteOption.VOTE_OPTION_NO_WITH_VETO;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return VoteOption.UNRECOGNIZED;\n }\n}\nexports.voteOptionFromJSON = voteOptionFromJSON;\nfunction voteOptionToJSON(object) {\n switch (object) {\n case VoteOption.VOTE_OPTION_UNSPECIFIED:\n return \"VOTE_OPTION_UNSPECIFIED\";\n case VoteOption.VOTE_OPTION_YES:\n return \"VOTE_OPTION_YES\";\n case VoteOption.VOTE_OPTION_ABSTAIN:\n return \"VOTE_OPTION_ABSTAIN\";\n case VoteOption.VOTE_OPTION_NO:\n return \"VOTE_OPTION_NO\";\n case VoteOption.VOTE_OPTION_NO_WITH_VETO:\n return \"VOTE_OPTION_NO_WITH_VETO\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.voteOptionToJSON = voteOptionToJSON;\n/** ProposalStatus enumerates the valid statuses of a proposal. */\nvar ProposalStatus;\n(function (ProposalStatus) {\n /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */\n ProposalStatus[ProposalStatus[\"PROPOSAL_STATUS_UNSPECIFIED\"] = 0] = \"PROPOSAL_STATUS_UNSPECIFIED\";\n /**\n * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit\n * period.\n */\n ProposalStatus[ProposalStatus[\"PROPOSAL_STATUS_DEPOSIT_PERIOD\"] = 1] = \"PROPOSAL_STATUS_DEPOSIT_PERIOD\";\n /**\n * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting\n * period.\n */\n ProposalStatus[ProposalStatus[\"PROPOSAL_STATUS_VOTING_PERIOD\"] = 2] = \"PROPOSAL_STATUS_VOTING_PERIOD\";\n /**\n * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has\n * passed.\n */\n ProposalStatus[ProposalStatus[\"PROPOSAL_STATUS_PASSED\"] = 3] = \"PROPOSAL_STATUS_PASSED\";\n /**\n * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has\n * been rejected.\n */\n ProposalStatus[ProposalStatus[\"PROPOSAL_STATUS_REJECTED\"] = 4] = \"PROPOSAL_STATUS_REJECTED\";\n /**\n * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has\n * failed.\n */\n ProposalStatus[ProposalStatus[\"PROPOSAL_STATUS_FAILED\"] = 5] = \"PROPOSAL_STATUS_FAILED\";\n ProposalStatus[ProposalStatus[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(ProposalStatus = exports.ProposalStatus || (exports.ProposalStatus = {}));\nfunction proposalStatusFromJSON(object) {\n switch (object) {\n case 0:\n case \"PROPOSAL_STATUS_UNSPECIFIED\":\n return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED;\n case 1:\n case \"PROPOSAL_STATUS_DEPOSIT_PERIOD\":\n return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD;\n case 2:\n case \"PROPOSAL_STATUS_VOTING_PERIOD\":\n return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD;\n case 3:\n case \"PROPOSAL_STATUS_PASSED\":\n return ProposalStatus.PROPOSAL_STATUS_PASSED;\n case 4:\n case \"PROPOSAL_STATUS_REJECTED\":\n return ProposalStatus.PROPOSAL_STATUS_REJECTED;\n case 5:\n case \"PROPOSAL_STATUS_FAILED\":\n return ProposalStatus.PROPOSAL_STATUS_FAILED;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return ProposalStatus.UNRECOGNIZED;\n }\n}\nexports.proposalStatusFromJSON = proposalStatusFromJSON;\nfunction proposalStatusToJSON(object) {\n switch (object) {\n case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED:\n return \"PROPOSAL_STATUS_UNSPECIFIED\";\n case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD:\n return \"PROPOSAL_STATUS_DEPOSIT_PERIOD\";\n case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD:\n return \"PROPOSAL_STATUS_VOTING_PERIOD\";\n case ProposalStatus.PROPOSAL_STATUS_PASSED:\n return \"PROPOSAL_STATUS_PASSED\";\n case ProposalStatus.PROPOSAL_STATUS_REJECTED:\n return \"PROPOSAL_STATUS_REJECTED\";\n case ProposalStatus.PROPOSAL_STATUS_FAILED:\n return \"PROPOSAL_STATUS_FAILED\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.proposalStatusToJSON = proposalStatusToJSON;\nconst baseWeightedVoteOption = { option: 0, weight: \"\" };\nexports.WeightedVoteOption = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.option !== 0) {\n writer.uint32(8).int32(message.option);\n }\n if (message.weight !== \"\") {\n writer.uint32(18).string(message.weight);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseWeightedVoteOption);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.option = reader.int32();\n break;\n case 2:\n message.weight = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseWeightedVoteOption);\n if (object.option !== undefined && object.option !== null) {\n message.option = voteOptionFromJSON(object.option);\n }\n else {\n message.option = 0;\n }\n if (object.weight !== undefined && object.weight !== null) {\n message.weight = String(object.weight);\n }\n else {\n message.weight = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.option !== undefined && (obj.option = voteOptionToJSON(message.option));\n message.weight !== undefined && (obj.weight = message.weight);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseWeightedVoteOption);\n if (object.option !== undefined && object.option !== null) {\n message.option = object.option;\n }\n else {\n message.option = 0;\n }\n if (object.weight !== undefined && object.weight !== null) {\n message.weight = object.weight;\n }\n else {\n message.weight = \"\";\n }\n return message;\n },\n};\nconst baseTextProposal = { title: \"\", description: \"\" };\nexports.TextProposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.title !== \"\") {\n writer.uint32(10).string(message.title);\n }\n if (message.description !== \"\") {\n writer.uint32(18).string(message.description);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTextProposal);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.title = reader.string();\n break;\n case 2:\n message.description = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTextProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = String(object.title);\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = String(object.description);\n }\n else {\n message.description = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.title !== undefined && (obj.title = message.title);\n message.description !== undefined && (obj.description = message.description);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTextProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = object.title;\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = object.description;\n }\n else {\n message.description = \"\";\n }\n return message;\n },\n};\nconst baseDeposit = { proposalId: long_1.default.UZERO, depositor: \"\" };\nexports.Deposit = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.proposalId.isZero()) {\n writer.uint32(8).uint64(message.proposalId);\n }\n if (message.depositor !== \"\") {\n writer.uint32(18).string(message.depositor);\n }\n for (const v of message.amount) {\n coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDeposit);\n message.amount = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proposalId = reader.uint64();\n break;\n case 2:\n message.depositor = reader.string();\n break;\n case 3:\n message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDeposit);\n message.amount = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = long_1.default.fromString(object.proposalId);\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.depositor !== undefined && object.depositor !== null) {\n message.depositor = String(object.depositor);\n }\n else {\n message.depositor = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.proposalId !== undefined && (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());\n message.depositor !== undefined && (obj.depositor = message.depositor);\n if (message.amount) {\n obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.amount = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDeposit);\n message.amount = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = object.proposalId;\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.depositor !== undefined && object.depositor !== null) {\n message.depositor = object.depositor;\n }\n else {\n message.depositor = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseProposal = { proposalId: long_1.default.UZERO, status: 0 };\nexports.Proposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.proposalId.isZero()) {\n writer.uint32(8).uint64(message.proposalId);\n }\n if (message.content !== undefined) {\n any_1.Any.encode(message.content, writer.uint32(18).fork()).ldelim();\n }\n if (message.status !== 0) {\n writer.uint32(24).int32(message.status);\n }\n if (message.finalTallyResult !== undefined) {\n exports.TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim();\n }\n if (message.submitTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim();\n }\n if (message.depositEndTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim();\n }\n for (const v of message.totalDeposit) {\n coin_1.Coin.encode(v, writer.uint32(58).fork()).ldelim();\n }\n if (message.votingStartTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim();\n }\n if (message.votingEndTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseProposal);\n message.totalDeposit = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proposalId = reader.uint64();\n break;\n case 2:\n message.content = any_1.Any.decode(reader, reader.uint32());\n break;\n case 3:\n message.status = reader.int32();\n break;\n case 4:\n message.finalTallyResult = exports.TallyResult.decode(reader, reader.uint32());\n break;\n case 5:\n message.submitTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 6:\n message.depositEndTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 7:\n message.totalDeposit.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 8:\n message.votingStartTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 9:\n message.votingEndTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseProposal);\n message.totalDeposit = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = long_1.default.fromString(object.proposalId);\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.content !== undefined && object.content !== null) {\n message.content = any_1.Any.fromJSON(object.content);\n }\n else {\n message.content = undefined;\n }\n if (object.status !== undefined && object.status !== null) {\n message.status = proposalStatusFromJSON(object.status);\n }\n else {\n message.status = 0;\n }\n if (object.finalTallyResult !== undefined && object.finalTallyResult !== null) {\n message.finalTallyResult = exports.TallyResult.fromJSON(object.finalTallyResult);\n }\n else {\n message.finalTallyResult = undefined;\n }\n if (object.submitTime !== undefined && object.submitTime !== null) {\n message.submitTime = fromJsonTimestamp(object.submitTime);\n }\n else {\n message.submitTime = undefined;\n }\n if (object.depositEndTime !== undefined && object.depositEndTime !== null) {\n message.depositEndTime = fromJsonTimestamp(object.depositEndTime);\n }\n else {\n message.depositEndTime = undefined;\n }\n if (object.totalDeposit !== undefined && object.totalDeposit !== null) {\n for (const e of object.totalDeposit) {\n message.totalDeposit.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.votingStartTime !== undefined && object.votingStartTime !== null) {\n message.votingStartTime = fromJsonTimestamp(object.votingStartTime);\n }\n else {\n message.votingStartTime = undefined;\n }\n if (object.votingEndTime !== undefined && object.votingEndTime !== null) {\n message.votingEndTime = fromJsonTimestamp(object.votingEndTime);\n }\n else {\n message.votingEndTime = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.proposalId !== undefined && (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());\n message.content !== undefined &&\n (obj.content = message.content ? any_1.Any.toJSON(message.content) : undefined);\n message.status !== undefined && (obj.status = proposalStatusToJSON(message.status));\n message.finalTallyResult !== undefined &&\n (obj.finalTallyResult = message.finalTallyResult\n ? exports.TallyResult.toJSON(message.finalTallyResult)\n : undefined);\n message.submitTime !== undefined && (obj.submitTime = message.submitTime.toISOString());\n message.depositEndTime !== undefined && (obj.depositEndTime = message.depositEndTime.toISOString());\n if (message.totalDeposit) {\n obj.totalDeposit = message.totalDeposit.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.totalDeposit = [];\n }\n message.votingStartTime !== undefined && (obj.votingStartTime = message.votingStartTime.toISOString());\n message.votingEndTime !== undefined && (obj.votingEndTime = message.votingEndTime.toISOString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseProposal);\n message.totalDeposit = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = object.proposalId;\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.content !== undefined && object.content !== null) {\n message.content = any_1.Any.fromPartial(object.content);\n }\n else {\n message.content = undefined;\n }\n if (object.status !== undefined && object.status !== null) {\n message.status = object.status;\n }\n else {\n message.status = 0;\n }\n if (object.finalTallyResult !== undefined && object.finalTallyResult !== null) {\n message.finalTallyResult = exports.TallyResult.fromPartial(object.finalTallyResult);\n }\n else {\n message.finalTallyResult = undefined;\n }\n if (object.submitTime !== undefined && object.submitTime !== null) {\n message.submitTime = object.submitTime;\n }\n else {\n message.submitTime = undefined;\n }\n if (object.depositEndTime !== undefined && object.depositEndTime !== null) {\n message.depositEndTime = object.depositEndTime;\n }\n else {\n message.depositEndTime = undefined;\n }\n if (object.totalDeposit !== undefined && object.totalDeposit !== null) {\n for (const e of object.totalDeposit) {\n message.totalDeposit.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.votingStartTime !== undefined && object.votingStartTime !== null) {\n message.votingStartTime = object.votingStartTime;\n }\n else {\n message.votingStartTime = undefined;\n }\n if (object.votingEndTime !== undefined && object.votingEndTime !== null) {\n message.votingEndTime = object.votingEndTime;\n }\n else {\n message.votingEndTime = undefined;\n }\n return message;\n },\n};\nconst baseTallyResult = { yes: \"\", abstain: \"\", no: \"\", noWithVeto: \"\" };\nexports.TallyResult = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.yes !== \"\") {\n writer.uint32(10).string(message.yes);\n }\n if (message.abstain !== \"\") {\n writer.uint32(18).string(message.abstain);\n }\n if (message.no !== \"\") {\n writer.uint32(26).string(message.no);\n }\n if (message.noWithVeto !== \"\") {\n writer.uint32(34).string(message.noWithVeto);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTallyResult);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.yes = reader.string();\n break;\n case 2:\n message.abstain = reader.string();\n break;\n case 3:\n message.no = reader.string();\n break;\n case 4:\n message.noWithVeto = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTallyResult);\n if (object.yes !== undefined && object.yes !== null) {\n message.yes = String(object.yes);\n }\n else {\n message.yes = \"\";\n }\n if (object.abstain !== undefined && object.abstain !== null) {\n message.abstain = String(object.abstain);\n }\n else {\n message.abstain = \"\";\n }\n if (object.no !== undefined && object.no !== null) {\n message.no = String(object.no);\n }\n else {\n message.no = \"\";\n }\n if (object.noWithVeto !== undefined && object.noWithVeto !== null) {\n message.noWithVeto = String(object.noWithVeto);\n }\n else {\n message.noWithVeto = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.yes !== undefined && (obj.yes = message.yes);\n message.abstain !== undefined && (obj.abstain = message.abstain);\n message.no !== undefined && (obj.no = message.no);\n message.noWithVeto !== undefined && (obj.noWithVeto = message.noWithVeto);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTallyResult);\n if (object.yes !== undefined && object.yes !== null) {\n message.yes = object.yes;\n }\n else {\n message.yes = \"\";\n }\n if (object.abstain !== undefined && object.abstain !== null) {\n message.abstain = object.abstain;\n }\n else {\n message.abstain = \"\";\n }\n if (object.no !== undefined && object.no !== null) {\n message.no = object.no;\n }\n else {\n message.no = \"\";\n }\n if (object.noWithVeto !== undefined && object.noWithVeto !== null) {\n message.noWithVeto = object.noWithVeto;\n }\n else {\n message.noWithVeto = \"\";\n }\n return message;\n },\n};\nconst baseVote = { proposalId: long_1.default.UZERO, voter: \"\", option: 0 };\nexports.Vote = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.proposalId.isZero()) {\n writer.uint32(8).uint64(message.proposalId);\n }\n if (message.voter !== \"\") {\n writer.uint32(18).string(message.voter);\n }\n if (message.option !== 0) {\n writer.uint32(24).int32(message.option);\n }\n for (const v of message.options) {\n exports.WeightedVoteOption.encode(v, writer.uint32(34).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseVote);\n message.options = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proposalId = reader.uint64();\n break;\n case 2:\n message.voter = reader.string();\n break;\n case 3:\n message.option = reader.int32();\n break;\n case 4:\n message.options.push(exports.WeightedVoteOption.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseVote);\n message.options = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = long_1.default.fromString(object.proposalId);\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = String(object.voter);\n }\n else {\n message.voter = \"\";\n }\n if (object.option !== undefined && object.option !== null) {\n message.option = voteOptionFromJSON(object.option);\n }\n else {\n message.option = 0;\n }\n if (object.options !== undefined && object.options !== null) {\n for (const e of object.options) {\n message.options.push(exports.WeightedVoteOption.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.proposalId !== undefined && (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());\n message.voter !== undefined && (obj.voter = message.voter);\n message.option !== undefined && (obj.option = voteOptionToJSON(message.option));\n if (message.options) {\n obj.options = message.options.map((e) => (e ? exports.WeightedVoteOption.toJSON(e) : undefined));\n }\n else {\n obj.options = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseVote);\n message.options = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = object.proposalId;\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = object.voter;\n }\n else {\n message.voter = \"\";\n }\n if (object.option !== undefined && object.option !== null) {\n message.option = object.option;\n }\n else {\n message.option = 0;\n }\n if (object.options !== undefined && object.options !== null) {\n for (const e of object.options) {\n message.options.push(exports.WeightedVoteOption.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseDepositParams = {};\nexports.DepositParams = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.minDeposit) {\n coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (message.maxDepositPeriod !== undefined) {\n duration_1.Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDepositParams);\n message.minDeposit = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.minDeposit.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 2:\n message.maxDepositPeriod = duration_1.Duration.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDepositParams);\n message.minDeposit = [];\n if (object.minDeposit !== undefined && object.minDeposit !== null) {\n for (const e of object.minDeposit) {\n message.minDeposit.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) {\n message.maxDepositPeriod = duration_1.Duration.fromJSON(object.maxDepositPeriod);\n }\n else {\n message.maxDepositPeriod = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.minDeposit) {\n obj.minDeposit = message.minDeposit.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.minDeposit = [];\n }\n message.maxDepositPeriod !== undefined &&\n (obj.maxDepositPeriod = message.maxDepositPeriod\n ? duration_1.Duration.toJSON(message.maxDepositPeriod)\n : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDepositParams);\n message.minDeposit = [];\n if (object.minDeposit !== undefined && object.minDeposit !== null) {\n for (const e of object.minDeposit) {\n message.minDeposit.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) {\n message.maxDepositPeriod = duration_1.Duration.fromPartial(object.maxDepositPeriod);\n }\n else {\n message.maxDepositPeriod = undefined;\n }\n return message;\n },\n};\nconst baseVotingParams = {};\nexports.VotingParams = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.votingPeriod !== undefined) {\n duration_1.Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseVotingParams);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.votingPeriod = duration_1.Duration.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseVotingParams);\n if (object.votingPeriod !== undefined && object.votingPeriod !== null) {\n message.votingPeriod = duration_1.Duration.fromJSON(object.votingPeriod);\n }\n else {\n message.votingPeriod = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.votingPeriod !== undefined &&\n (obj.votingPeriod = message.votingPeriod ? duration_1.Duration.toJSON(message.votingPeriod) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseVotingParams);\n if (object.votingPeriod !== undefined && object.votingPeriod !== null) {\n message.votingPeriod = duration_1.Duration.fromPartial(object.votingPeriod);\n }\n else {\n message.votingPeriod = undefined;\n }\n return message;\n },\n};\nconst baseTallyParams = {};\nexports.TallyParams = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.quorum.length !== 0) {\n writer.uint32(10).bytes(message.quorum);\n }\n if (message.threshold.length !== 0) {\n writer.uint32(18).bytes(message.threshold);\n }\n if (message.vetoThreshold.length !== 0) {\n writer.uint32(26).bytes(message.vetoThreshold);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTallyParams);\n message.quorum = new Uint8Array();\n message.threshold = new Uint8Array();\n message.vetoThreshold = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.quorum = reader.bytes();\n break;\n case 2:\n message.threshold = reader.bytes();\n break;\n case 3:\n message.vetoThreshold = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTallyParams);\n message.quorum = new Uint8Array();\n message.threshold = new Uint8Array();\n message.vetoThreshold = new Uint8Array();\n if (object.quorum !== undefined && object.quorum !== null) {\n message.quorum = bytesFromBase64(object.quorum);\n }\n if (object.threshold !== undefined && object.threshold !== null) {\n message.threshold = bytesFromBase64(object.threshold);\n }\n if (object.vetoThreshold !== undefined && object.vetoThreshold !== null) {\n message.vetoThreshold = bytesFromBase64(object.vetoThreshold);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.quorum !== undefined &&\n (obj.quorum = base64FromBytes(message.quorum !== undefined ? message.quorum : new Uint8Array()));\n message.threshold !== undefined &&\n (obj.threshold = base64FromBytes(message.threshold !== undefined ? message.threshold : new Uint8Array()));\n message.vetoThreshold !== undefined &&\n (obj.vetoThreshold = base64FromBytes(message.vetoThreshold !== undefined ? message.vetoThreshold : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTallyParams);\n if (object.quorum !== undefined && object.quorum !== null) {\n message.quorum = object.quorum;\n }\n else {\n message.quorum = new Uint8Array();\n }\n if (object.threshold !== undefined && object.threshold !== null) {\n message.threshold = object.threshold;\n }\n else {\n message.threshold = new Uint8Array();\n }\n if (object.vetoThreshold !== undefined && object.vetoThreshold !== null) {\n message.vetoThreshold = object.vetoThreshold;\n }\n else {\n message.vetoThreshold = new Uint8Array();\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nfunction toTimestamp(date) {\n const seconds = numberToLong(date.getTime() / 1000);\n const nanos = (date.getTime() % 1000) * 1000000;\n return { seconds, nanos };\n}\nfunction fromTimestamp(t) {\n let millis = t.seconds.toNumber() * 1000;\n millis += t.nanos / 1000000;\n return new Date(millis);\n}\nfunction fromJsonTimestamp(o) {\n if (o instanceof Date) {\n return o;\n }\n else if (typeof o === \"string\") {\n return new Date(o);\n }\n else {\n return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));\n }\n}\nfunction numberToLong(number) {\n return long_1.default.fromNumber(number);\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=gov.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgClearContractAdminResponse = exports.MsgClearContractAdmin = exports.MsgUpdateContractAdminResponse = exports.MsgUpdateContractAdmin = exports.MsgMigrateContractResponse = exports.MsgMigrateContract = exports.MsgExecuteContractResponse = exports.MsgExecuteContract = exports.MsgInstantiateContractResponse = exports.MsgInstantiateContract = exports.MsgMigrateCodeResponse = exports.MsgMigrateCode = exports.MsgStoreCodeResponse = exports.MsgStoreCode = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"terra.wasm.v1beta1\";\nconst baseMsgStoreCode = { sender: \"\" };\nexports.MsgStoreCode = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.sender !== \"\") {\n writer.uint32(10).string(message.sender);\n }\n if (message.wasmByteCode.length !== 0) {\n writer.uint32(18).bytes(message.wasmByteCode);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgStoreCode);\n message.wasmByteCode = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.sender = reader.string();\n break;\n case 2:\n message.wasmByteCode = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgStoreCode);\n message.wasmByteCode = new Uint8Array();\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = String(object.sender);\n }\n else {\n message.sender = \"\";\n }\n if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) {\n message.wasmByteCode = bytesFromBase64(object.wasmByteCode);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.sender !== undefined && (obj.sender = message.sender);\n message.wasmByteCode !== undefined &&\n (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgStoreCode);\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = object.sender;\n }\n else {\n message.sender = \"\";\n }\n if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) {\n message.wasmByteCode = object.wasmByteCode;\n }\n else {\n message.wasmByteCode = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMsgStoreCodeResponse = { codeId: long_1.default.UZERO };\nexports.MsgStoreCodeResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.codeId.isZero()) {\n writer.uint32(8).uint64(message.codeId);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgStoreCodeResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.codeId = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgStoreCodeResponse);\n if (object.codeId !== undefined && object.codeId !== null) {\n message.codeId = long_1.default.fromString(object.codeId);\n }\n else {\n message.codeId = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.codeId !== undefined && (obj.codeId = (message.codeId || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgStoreCodeResponse);\n if (object.codeId !== undefined && object.codeId !== null) {\n message.codeId = object.codeId;\n }\n else {\n message.codeId = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseMsgMigrateCode = { codeId: long_1.default.UZERO, sender: \"\" };\nexports.MsgMigrateCode = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.codeId.isZero()) {\n writer.uint32(8).uint64(message.codeId);\n }\n if (message.sender !== \"\") {\n writer.uint32(18).string(message.sender);\n }\n if (message.wasmByteCode.length !== 0) {\n writer.uint32(26).bytes(message.wasmByteCode);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgMigrateCode);\n message.wasmByteCode = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.codeId = reader.uint64();\n break;\n case 2:\n message.sender = reader.string();\n break;\n case 3:\n message.wasmByteCode = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgMigrateCode);\n message.wasmByteCode = new Uint8Array();\n if (object.codeId !== undefined && object.codeId !== null) {\n message.codeId = long_1.default.fromString(object.codeId);\n }\n else {\n message.codeId = long_1.default.UZERO;\n }\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = String(object.sender);\n }\n else {\n message.sender = \"\";\n }\n if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) {\n message.wasmByteCode = bytesFromBase64(object.wasmByteCode);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.codeId !== undefined && (obj.codeId = (message.codeId || long_1.default.UZERO).toString());\n message.sender !== undefined && (obj.sender = message.sender);\n message.wasmByteCode !== undefined &&\n (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgMigrateCode);\n if (object.codeId !== undefined && object.codeId !== null) {\n message.codeId = object.codeId;\n }\n else {\n message.codeId = long_1.default.UZERO;\n }\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = object.sender;\n }\n else {\n message.sender = \"\";\n }\n if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) {\n message.wasmByteCode = object.wasmByteCode;\n }\n else {\n message.wasmByteCode = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMsgMigrateCodeResponse = {};\nexports.MsgMigrateCodeResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgMigrateCodeResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgMigrateCodeResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgMigrateCodeResponse);\n return message;\n },\n};\nconst baseMsgInstantiateContract = { sender: \"\", admin: \"\", codeId: long_1.default.UZERO };\nexports.MsgInstantiateContract = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.sender !== \"\") {\n writer.uint32(10).string(message.sender);\n }\n if (message.admin !== \"\") {\n writer.uint32(18).string(message.admin);\n }\n if (!message.codeId.isZero()) {\n writer.uint32(24).uint64(message.codeId);\n }\n if (message.initMsg.length !== 0) {\n writer.uint32(34).bytes(message.initMsg);\n }\n for (const v of message.initCoins) {\n coin_1.Coin.encode(v, writer.uint32(42).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgInstantiateContract);\n message.initCoins = [];\n message.initMsg = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.sender = reader.string();\n break;\n case 2:\n message.admin = reader.string();\n break;\n case 3:\n message.codeId = reader.uint64();\n break;\n case 4:\n message.initMsg = reader.bytes();\n break;\n case 5:\n message.initCoins.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgInstantiateContract);\n message.initCoins = [];\n message.initMsg = new Uint8Array();\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = String(object.sender);\n }\n else {\n message.sender = \"\";\n }\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = String(object.admin);\n }\n else {\n message.admin = \"\";\n }\n if (object.codeId !== undefined && object.codeId !== null) {\n message.codeId = long_1.default.fromString(object.codeId);\n }\n else {\n message.codeId = long_1.default.UZERO;\n }\n if (object.initMsg !== undefined && object.initMsg !== null) {\n message.initMsg = bytesFromBase64(object.initMsg);\n }\n if (object.initCoins !== undefined && object.initCoins !== null) {\n for (const e of object.initCoins) {\n message.initCoins.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.sender !== undefined && (obj.sender = message.sender);\n message.admin !== undefined && (obj.admin = message.admin);\n message.codeId !== undefined && (obj.codeId = (message.codeId || long_1.default.UZERO).toString());\n message.initMsg !== undefined &&\n (obj.initMsg = base64FromBytes(message.initMsg !== undefined ? message.initMsg : new Uint8Array()));\n if (message.initCoins) {\n obj.initCoins = message.initCoins.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.initCoins = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgInstantiateContract);\n message.initCoins = [];\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = object.sender;\n }\n else {\n message.sender = \"\";\n }\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = object.admin;\n }\n else {\n message.admin = \"\";\n }\n if (object.codeId !== undefined && object.codeId !== null) {\n message.codeId = object.codeId;\n }\n else {\n message.codeId = long_1.default.UZERO;\n }\n if (object.initMsg !== undefined && object.initMsg !== null) {\n message.initMsg = object.initMsg;\n }\n else {\n message.initMsg = new Uint8Array();\n }\n if (object.initCoins !== undefined && object.initCoins !== null) {\n for (const e of object.initCoins) {\n message.initCoins.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseMsgInstantiateContractResponse = { contractAddress: \"\" };\nexports.MsgInstantiateContractResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.contractAddress !== \"\") {\n writer.uint32(10).string(message.contractAddress);\n }\n if (message.data.length !== 0) {\n writer.uint32(18).bytes(message.data);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgInstantiateContractResponse);\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.contractAddress = reader.string();\n break;\n case 2:\n message.data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgInstantiateContractResponse);\n message.data = new Uint8Array();\n if (object.contractAddress !== undefined && object.contractAddress !== null) {\n message.contractAddress = String(object.contractAddress);\n }\n else {\n message.contractAddress = \"\";\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgInstantiateContractResponse);\n if (object.contractAddress !== undefined && object.contractAddress !== null) {\n message.contractAddress = object.contractAddress;\n }\n else {\n message.contractAddress = \"\";\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMsgExecuteContract = { sender: \"\", contract: \"\" };\nexports.MsgExecuteContract = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.sender !== \"\") {\n writer.uint32(10).string(message.sender);\n }\n if (message.contract !== \"\") {\n writer.uint32(18).string(message.contract);\n }\n if (message.executeMsg.length !== 0) {\n writer.uint32(26).bytes(message.executeMsg);\n }\n for (const v of message.coins) {\n coin_1.Coin.encode(v, writer.uint32(42).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgExecuteContract);\n message.coins = [];\n message.executeMsg = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.sender = reader.string();\n break;\n case 2:\n message.contract = reader.string();\n break;\n case 3:\n message.executeMsg = reader.bytes();\n break;\n case 5:\n message.coins.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgExecuteContract);\n message.coins = [];\n message.executeMsg = new Uint8Array();\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = String(object.sender);\n }\n else {\n message.sender = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = String(object.contract);\n }\n else {\n message.contract = \"\";\n }\n if (object.executeMsg !== undefined && object.executeMsg !== null) {\n message.executeMsg = bytesFromBase64(object.executeMsg);\n }\n if (object.coins !== undefined && object.coins !== null) {\n for (const e of object.coins) {\n message.coins.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.sender !== undefined && (obj.sender = message.sender);\n message.contract !== undefined && (obj.contract = message.contract);\n message.executeMsg !== undefined &&\n (obj.executeMsg = base64FromBytes(message.executeMsg !== undefined ? message.executeMsg : new Uint8Array()));\n if (message.coins) {\n obj.coins = message.coins.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.coins = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgExecuteContract);\n message.coins = [];\n if (object.sender !== undefined && object.sender !== null) {\n message.sender = object.sender;\n }\n else {\n message.sender = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = object.contract;\n }\n else {\n message.contract = \"\";\n }\n if (object.executeMsg !== undefined && object.executeMsg !== null) {\n message.executeMsg = object.executeMsg;\n }\n else {\n message.executeMsg = new Uint8Array();\n }\n if (object.coins !== undefined && object.coins !== null) {\n for (const e of object.coins) {\n message.coins.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseMsgExecuteContractResponse = {};\nexports.MsgExecuteContractResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.data.length !== 0) {\n writer.uint32(10).bytes(message.data);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgExecuteContractResponse);\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgExecuteContractResponse);\n message.data = new Uint8Array();\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgExecuteContractResponse);\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMsgMigrateContract = { admin: \"\", contract: \"\", newCodeId: long_1.default.UZERO };\nexports.MsgMigrateContract = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.admin !== \"\") {\n writer.uint32(10).string(message.admin);\n }\n if (message.contract !== \"\") {\n writer.uint32(18).string(message.contract);\n }\n if (!message.newCodeId.isZero()) {\n writer.uint32(24).uint64(message.newCodeId);\n }\n if (message.migrateMsg.length !== 0) {\n writer.uint32(34).bytes(message.migrateMsg);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgMigrateContract);\n message.migrateMsg = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.admin = reader.string();\n break;\n case 2:\n message.contract = reader.string();\n break;\n case 3:\n message.newCodeId = reader.uint64();\n break;\n case 4:\n message.migrateMsg = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgMigrateContract);\n message.migrateMsg = new Uint8Array();\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = String(object.admin);\n }\n else {\n message.admin = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = String(object.contract);\n }\n else {\n message.contract = \"\";\n }\n if (object.newCodeId !== undefined && object.newCodeId !== null) {\n message.newCodeId = long_1.default.fromString(object.newCodeId);\n }\n else {\n message.newCodeId = long_1.default.UZERO;\n }\n if (object.migrateMsg !== undefined && object.migrateMsg !== null) {\n message.migrateMsg = bytesFromBase64(object.migrateMsg);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.admin !== undefined && (obj.admin = message.admin);\n message.contract !== undefined && (obj.contract = message.contract);\n message.newCodeId !== undefined && (obj.newCodeId = (message.newCodeId || long_1.default.UZERO).toString());\n message.migrateMsg !== undefined &&\n (obj.migrateMsg = base64FromBytes(message.migrateMsg !== undefined ? message.migrateMsg : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgMigrateContract);\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = object.admin;\n }\n else {\n message.admin = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = object.contract;\n }\n else {\n message.contract = \"\";\n }\n if (object.newCodeId !== undefined && object.newCodeId !== null) {\n message.newCodeId = object.newCodeId;\n }\n else {\n message.newCodeId = long_1.default.UZERO;\n }\n if (object.migrateMsg !== undefined && object.migrateMsg !== null) {\n message.migrateMsg = object.migrateMsg;\n }\n else {\n message.migrateMsg = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMsgMigrateContractResponse = {};\nexports.MsgMigrateContractResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.data.length !== 0) {\n writer.uint32(10).bytes(message.data);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgMigrateContractResponse);\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgMigrateContractResponse);\n message.data = new Uint8Array();\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgMigrateContractResponse);\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMsgUpdateContractAdmin = { admin: \"\", newAdmin: \"\", contract: \"\" };\nexports.MsgUpdateContractAdmin = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.admin !== \"\") {\n writer.uint32(10).string(message.admin);\n }\n if (message.newAdmin !== \"\") {\n writer.uint32(18).string(message.newAdmin);\n }\n if (message.contract !== \"\") {\n writer.uint32(26).string(message.contract);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUpdateContractAdmin);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.admin = reader.string();\n break;\n case 2:\n message.newAdmin = reader.string();\n break;\n case 3:\n message.contract = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgUpdateContractAdmin);\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = String(object.admin);\n }\n else {\n message.admin = \"\";\n }\n if (object.newAdmin !== undefined && object.newAdmin !== null) {\n message.newAdmin = String(object.newAdmin);\n }\n else {\n message.newAdmin = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = String(object.contract);\n }\n else {\n message.contract = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.admin !== undefined && (obj.admin = message.admin);\n message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin);\n message.contract !== undefined && (obj.contract = message.contract);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgUpdateContractAdmin);\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = object.admin;\n }\n else {\n message.admin = \"\";\n }\n if (object.newAdmin !== undefined && object.newAdmin !== null) {\n message.newAdmin = object.newAdmin;\n }\n else {\n message.newAdmin = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = object.contract;\n }\n else {\n message.contract = \"\";\n }\n return message;\n },\n};\nconst baseMsgUpdateContractAdminResponse = {};\nexports.MsgUpdateContractAdminResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUpdateContractAdminResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgUpdateContractAdminResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgUpdateContractAdminResponse);\n return message;\n },\n};\nconst baseMsgClearContractAdmin = { admin: \"\", contract: \"\" };\nexports.MsgClearContractAdmin = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.admin !== \"\") {\n writer.uint32(10).string(message.admin);\n }\n if (message.contract !== \"\") {\n writer.uint32(18).string(message.contract);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgClearContractAdmin);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.admin = reader.string();\n break;\n case 2:\n message.contract = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgClearContractAdmin);\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = String(object.admin);\n }\n else {\n message.admin = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = String(object.contract);\n }\n else {\n message.contract = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.admin !== undefined && (obj.admin = message.admin);\n message.contract !== undefined && (obj.contract = message.contract);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgClearContractAdmin);\n if (object.admin !== undefined && object.admin !== null) {\n message.admin = object.admin;\n }\n else {\n message.admin = \"\";\n }\n if (object.contract !== undefined && object.contract !== null) {\n message.contract = object.contract;\n }\n else {\n message.contract = \"\";\n }\n return message;\n },\n};\nconst baseMsgClearContractAdminResponse = {};\nexports.MsgClearContractAdminResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgClearContractAdminResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgClearContractAdminResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgClearContractAdminResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.StoreCode = this.StoreCode.bind(this);\n this.MigrateCode = this.MigrateCode.bind(this);\n this.InstantiateContract = this.InstantiateContract.bind(this);\n this.ExecuteContract = this.ExecuteContract.bind(this);\n this.MigrateContract = this.MigrateContract.bind(this);\n this.UpdateContractAdmin = this.UpdateContractAdmin.bind(this);\n this.ClearContractAdmin = this.ClearContractAdmin.bind(this);\n }\n StoreCode(request) {\n const data = exports.MsgStoreCode.encode(request).finish();\n const promise = this.rpc.request(\"terra.wasm.v1beta1.Msg\", \"StoreCode\", data);\n return promise.then((data) => exports.MsgStoreCodeResponse.decode(new minimal_1.default.Reader(data)));\n }\n MigrateCode(request) {\n const data = exports.MsgMigrateCode.encode(request).finish();\n const promise = this.rpc.request(\"terra.wasm.v1beta1.Msg\", \"MigrateCode\", data);\n return promise.then((data) => exports.MsgMigrateCodeResponse.decode(new minimal_1.default.Reader(data)));\n }\n InstantiateContract(request) {\n const data = exports.MsgInstantiateContract.encode(request).finish();\n const promise = this.rpc.request(\"terra.wasm.v1beta1.Msg\", \"InstantiateContract\", data);\n return promise.then((data) => exports.MsgInstantiateContractResponse.decode(new minimal_1.default.Reader(data)));\n }\n ExecuteContract(request) {\n const data = exports.MsgExecuteContract.encode(request).finish();\n const promise = this.rpc.request(\"terra.wasm.v1beta1.Msg\", \"ExecuteContract\", data);\n return promise.then((data) => exports.MsgExecuteContractResponse.decode(new minimal_1.default.Reader(data)));\n }\n MigrateContract(request) {\n const data = exports.MsgMigrateContract.encode(request).finish();\n const promise = this.rpc.request(\"terra.wasm.v1beta1.Msg\", \"MigrateContract\", data);\n return promise.then((data) => exports.MsgMigrateContractResponse.decode(new minimal_1.default.Reader(data)));\n }\n UpdateContractAdmin(request) {\n const data = exports.MsgUpdateContractAdmin.encode(request).finish();\n const promise = this.rpc.request(\"terra.wasm.v1beta1.Msg\", \"UpdateContractAdmin\", data);\n return promise.then((data) => exports.MsgUpdateContractAdminResponse.decode(new minimal_1.default.Reader(data)));\n }\n ClearContractAdmin(request) {\n const data = exports.MsgClearContractAdmin.encode(request).finish();\n const promise = this.rpc.request(\"terra.wasm.v1beta1.Msg\", \"ClearContractAdmin\", data);\n return promise.then((data) => exports.MsgClearContractAdminResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n/**/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/**/\n\nmodule.exports = Duplex;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","// NFKC (composed) // (decomposed)\nexport const EtherSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n//# sourceMappingURL=strings.js.map","\"use strict\";\nimport hash from \"hash.js\";\n//const _ripemd160 = _hash.ripemd160;\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { SupportedAlgorithm } from \"./types\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport function ripemd160(data) {\n return \"0x\" + (hash.ripemd160().update(arrayify(data)).digest(\"hex\"));\n}\nexport function sha256(data) {\n return \"0x\" + (hash.sha256().update(arrayify(data)).digest(\"hex\"));\n}\nexport function sha512(data) {\n return \"0x\" + (hash.sha512().update(arrayify(data)).digest(\"hex\"));\n}\nexport function computeHmac(algorithm, key, data) {\n if (!SupportedAlgorithm[algorithm]) {\n logger.throwError(\"unsupported algorithm \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"hmac\",\n algorithm: algorithm\n });\n }\n return \"0x\" + hash.hmac(hash[algorithm], arrayify(key)).update(arrayify(data)).digest(\"hex\");\n}\n//# sourceMappingURL=sha2.js.map","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","import { PublicKey, TransactionInstruction, } from \"@solana/web3.js\";\n// begin from clients\\solana\\main.ts\nexport function ixFromRust(data) {\n var keys = data.accounts.map(accountMetaFromRust);\n return new TransactionInstruction({\n programId: new PublicKey(data.program_id),\n data: Buffer.from(data.data),\n keys: keys,\n });\n}\nfunction accountMetaFromRust(meta) {\n return {\n pubkey: new PublicKey(meta.pubkey),\n isSigner: meta.is_signer,\n isWritable: meta.is_writable,\n };\n}\n// end from clients\\solana\\main.ts\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n margin: 0\n },\n\n /* Styles applied to the root element if `variant=\"body2\"`. */\n body2: theme.typography.body2,\n\n /* Styles applied to the root element if `variant=\"body1\"`. */\n body1: theme.typography.body1,\n\n /* Styles applied to the root element if `variant=\"caption\"`. */\n caption: theme.typography.caption,\n\n /* Styles applied to the root element if `variant=\"button\"`. */\n button: theme.typography.button,\n\n /* Styles applied to the root element if `variant=\"h1\"`. */\n h1: theme.typography.h1,\n\n /* Styles applied to the root element if `variant=\"h2\"`. */\n h2: theme.typography.h2,\n\n /* Styles applied to the root element if `variant=\"h3\"`. */\n h3: theme.typography.h3,\n\n /* Styles applied to the root element if `variant=\"h4\"`. */\n h4: theme.typography.h4,\n\n /* Styles applied to the root element if `variant=\"h5\"`. */\n h5: theme.typography.h5,\n\n /* Styles applied to the root element if `variant=\"h6\"`. */\n h6: theme.typography.h6,\n\n /* Styles applied to the root element if `variant=\"subtitle1\"`. */\n subtitle1: theme.typography.subtitle1,\n\n /* Styles applied to the root element if `variant=\"subtitle2\"`. */\n subtitle2: theme.typography.subtitle2,\n\n /* Styles applied to the root element if `variant=\"overline\"`. */\n overline: theme.typography.overline,\n\n /* Styles applied to the root element if `variant=\"srOnly\"`. Only accessible to screen readers. */\n srOnly: {\n position: 'absolute',\n height: 1,\n width: 1,\n overflow: 'hidden'\n },\n\n /* Styles applied to the root element if `align=\"left\"`. */\n alignLeft: {\n textAlign: 'left'\n },\n\n /* Styles applied to the root element if `align=\"center\"`. */\n alignCenter: {\n textAlign: 'center'\n },\n\n /* Styles applied to the root element if `align=\"right\"`. */\n alignRight: {\n textAlign: 'right'\n },\n\n /* Styles applied to the root element if `align=\"justify\"`. */\n alignJustify: {\n textAlign: 'justify'\n },\n\n /* Styles applied to the root element if `nowrap={true}`. */\n noWrap: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n },\n\n /* Styles applied to the root element if `gutterBottom={true}`. */\n gutterBottom: {\n marginBottom: '0.35em'\n },\n\n /* Styles applied to the root element if `paragraph={true}`. */\n paragraph: {\n marginBottom: 16\n },\n\n /* Styles applied to the root element if `color=\"inherit\"`. */\n colorInherit: {\n color: 'inherit'\n },\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n color: theme.palette.primary.main\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n color: theme.palette.secondary.main\n },\n\n /* Styles applied to the root element if `color=\"textPrimary\"`. */\n colorTextPrimary: {\n color: theme.palette.text.primary\n },\n\n /* Styles applied to the root element if `color=\"textSecondary\"`. */\n colorTextSecondary: {\n color: theme.palette.text.secondary\n },\n\n /* Styles applied to the root element if `color=\"error\"`. */\n colorError: {\n color: theme.palette.error.main\n },\n\n /* Styles applied to the root element if `display=\"inline\"`. */\n displayInline: {\n display: 'inline'\n },\n\n /* Styles applied to the root element if `display=\"block\"`. */\n displayBlock: {\n display: 'block'\n }\n };\n};\nvar defaultVariantMapping = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p'\n};\nvar Typography = /*#__PURE__*/React.forwardRef(function Typography(props, ref) {\n var _props$align = props.align,\n align = _props$align === void 0 ? 'inherit' : _props$align,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'initial' : _props$color,\n component = props.component,\n _props$display = props.display,\n display = _props$display === void 0 ? 'initial' : _props$display,\n _props$gutterBottom = props.gutterBottom,\n gutterBottom = _props$gutterBottom === void 0 ? false : _props$gutterBottom,\n _props$noWrap = props.noWrap,\n noWrap = _props$noWrap === void 0 ? false : _props$noWrap,\n _props$paragraph = props.paragraph,\n paragraph = _props$paragraph === void 0 ? false : _props$paragraph,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'body1' : _props$variant,\n _props$variantMapping = props.variantMapping,\n variantMapping = _props$variantMapping === void 0 ? defaultVariantMapping : _props$variantMapping,\n other = _objectWithoutProperties(props, [\"align\", \"classes\", \"className\", \"color\", \"component\", \"display\", \"gutterBottom\", \"noWrap\", \"paragraph\", \"variant\", \"variantMapping\"]);\n\n var Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';\n return /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, className, variant !== 'inherit' && classes[variant], color !== 'initial' && classes[\"color\".concat(capitalize(color))], noWrap && classes.noWrap, gutterBottom && classes.gutterBottom, paragraph && classes.paragraph, align !== 'inherit' && classes[\"align\".concat(capitalize(align))], display !== 'initial' && classes[\"display\".concat(capitalize(display))]),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Typography.propTypes = {\n /**\n * Set the text-align on the component.\n */\n align: PropTypes.oneOf(['inherit', 'left', 'center', 'right', 'justify']),\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['initial', 'inherit', 'primary', 'secondary', 'textPrimary', 'textSecondary', 'error']),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n * Overrides the behavior of the `variantMapping` prop.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * Controls the display type\n */\n display: PropTypes.oneOf(['initial', 'block', 'inline']),\n\n /**\n * If `true`, the text will have a bottom margin.\n */\n gutterBottom: PropTypes.bool,\n\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n */\n noWrap: PropTypes.bool,\n\n /**\n * If `true`, the text will have a bottom margin.\n */\n paragraph: PropTypes.bool,\n\n /**\n * Applies the theme typography styles.\n */\n variant: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline', 'srOnly', 'inherit']),\n\n /**\n * The component maps the variant prop to a range of different HTML element types.\n * For instance, subtitle1 to `
`.\n * If you wish to change that mapping, you can provide your own.\n * Alternatively, you can use the `component` prop.\n */\n variantMapping: PropTypes.object\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiTypography'\n})(Typography);","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Params = exports.Height = exports.UpgradeProposal = exports.ClientUpdateProposal = exports.ClientConsensusStates = exports.ConsensusStateWithHeight = exports.IdentifiedClientState = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../../google/protobuf/any\");\nconst upgrade_1 = require(\"../../../../cosmos/upgrade/v1beta1/upgrade\");\nexports.protobufPackage = \"ibc.core.client.v1\";\nconst baseIdentifiedClientState = { clientId: \"\" };\nexports.IdentifiedClientState = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n if (message.clientState !== undefined) {\n any_1.Any.encode(message.clientState, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseIdentifiedClientState);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.clientState = any_1.Any.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseIdentifiedClientState);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromJSON(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n message.clientState !== undefined &&\n (obj.clientState = message.clientState ? any_1.Any.toJSON(message.clientState) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseIdentifiedClientState);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromPartial(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n return message;\n },\n};\nconst baseConsensusStateWithHeight = {};\nexports.ConsensusStateWithHeight = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.height !== undefined) {\n exports.Height.encode(message.height, writer.uint32(10).fork()).ldelim();\n }\n if (message.consensusState !== undefined) {\n any_1.Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseConsensusStateWithHeight);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.height = exports.Height.decode(reader, reader.uint32());\n break;\n case 2:\n message.consensusState = any_1.Any.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseConsensusStateWithHeight);\n if (object.height !== undefined && object.height !== null) {\n message.height = exports.Height.fromJSON(object.height);\n }\n else {\n message.height = undefined;\n }\n if (object.consensusState !== undefined && object.consensusState !== null) {\n message.consensusState = any_1.Any.fromJSON(object.consensusState);\n }\n else {\n message.consensusState = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.height !== undefined && (obj.height = message.height ? exports.Height.toJSON(message.height) : undefined);\n message.consensusState !== undefined &&\n (obj.consensusState = message.consensusState ? any_1.Any.toJSON(message.consensusState) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseConsensusStateWithHeight);\n if (object.height !== undefined && object.height !== null) {\n message.height = exports.Height.fromPartial(object.height);\n }\n else {\n message.height = undefined;\n }\n if (object.consensusState !== undefined && object.consensusState !== null) {\n message.consensusState = any_1.Any.fromPartial(object.consensusState);\n }\n else {\n message.consensusState = undefined;\n }\n return message;\n },\n};\nconst baseClientConsensusStates = { clientId: \"\" };\nexports.ClientConsensusStates = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n for (const v of message.consensusStates) {\n exports.ConsensusStateWithHeight.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseClientConsensusStates);\n message.consensusStates = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.consensusStates.push(exports.ConsensusStateWithHeight.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseClientConsensusStates);\n message.consensusStates = [];\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.consensusStates !== undefined && object.consensusStates !== null) {\n for (const e of object.consensusStates) {\n message.consensusStates.push(exports.ConsensusStateWithHeight.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n if (message.consensusStates) {\n obj.consensusStates = message.consensusStates.map((e) => e ? exports.ConsensusStateWithHeight.toJSON(e) : undefined);\n }\n else {\n obj.consensusStates = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseClientConsensusStates);\n message.consensusStates = [];\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.consensusStates !== undefined && object.consensusStates !== null) {\n for (const e of object.consensusStates) {\n message.consensusStates.push(exports.ConsensusStateWithHeight.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseClientUpdateProposal = {\n title: \"\",\n description: \"\",\n subjectClientId: \"\",\n substituteClientId: \"\",\n};\nexports.ClientUpdateProposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.title !== \"\") {\n writer.uint32(10).string(message.title);\n }\n if (message.description !== \"\") {\n writer.uint32(18).string(message.description);\n }\n if (message.subjectClientId !== \"\") {\n writer.uint32(26).string(message.subjectClientId);\n }\n if (message.substituteClientId !== \"\") {\n writer.uint32(34).string(message.substituteClientId);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseClientUpdateProposal);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.title = reader.string();\n break;\n case 2:\n message.description = reader.string();\n break;\n case 3:\n message.subjectClientId = reader.string();\n break;\n case 4:\n message.substituteClientId = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseClientUpdateProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = String(object.title);\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = String(object.description);\n }\n else {\n message.description = \"\";\n }\n if (object.subjectClientId !== undefined && object.subjectClientId !== null) {\n message.subjectClientId = String(object.subjectClientId);\n }\n else {\n message.subjectClientId = \"\";\n }\n if (object.substituteClientId !== undefined && object.substituteClientId !== null) {\n message.substituteClientId = String(object.substituteClientId);\n }\n else {\n message.substituteClientId = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.title !== undefined && (obj.title = message.title);\n message.description !== undefined && (obj.description = message.description);\n message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId);\n message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseClientUpdateProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = object.title;\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = object.description;\n }\n else {\n message.description = \"\";\n }\n if (object.subjectClientId !== undefined && object.subjectClientId !== null) {\n message.subjectClientId = object.subjectClientId;\n }\n else {\n message.subjectClientId = \"\";\n }\n if (object.substituteClientId !== undefined && object.substituteClientId !== null) {\n message.substituteClientId = object.substituteClientId;\n }\n else {\n message.substituteClientId = \"\";\n }\n return message;\n },\n};\nconst baseUpgradeProposal = { title: \"\", description: \"\" };\nexports.UpgradeProposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.title !== \"\") {\n writer.uint32(10).string(message.title);\n }\n if (message.description !== \"\") {\n writer.uint32(18).string(message.description);\n }\n if (message.plan !== undefined) {\n upgrade_1.Plan.encode(message.plan, writer.uint32(26).fork()).ldelim();\n }\n if (message.upgradedClientState !== undefined) {\n any_1.Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseUpgradeProposal);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.title = reader.string();\n break;\n case 2:\n message.description = reader.string();\n break;\n case 3:\n message.plan = upgrade_1.Plan.decode(reader, reader.uint32());\n break;\n case 4:\n message.upgradedClientState = any_1.Any.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseUpgradeProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = String(object.title);\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = String(object.description);\n }\n else {\n message.description = \"\";\n }\n if (object.plan !== undefined && object.plan !== null) {\n message.plan = upgrade_1.Plan.fromJSON(object.plan);\n }\n else {\n message.plan = undefined;\n }\n if (object.upgradedClientState !== undefined && object.upgradedClientState !== null) {\n message.upgradedClientState = any_1.Any.fromJSON(object.upgradedClientState);\n }\n else {\n message.upgradedClientState = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.title !== undefined && (obj.title = message.title);\n message.description !== undefined && (obj.description = message.description);\n message.plan !== undefined && (obj.plan = message.plan ? upgrade_1.Plan.toJSON(message.plan) : undefined);\n message.upgradedClientState !== undefined &&\n (obj.upgradedClientState = message.upgradedClientState\n ? any_1.Any.toJSON(message.upgradedClientState)\n : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseUpgradeProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = object.title;\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = object.description;\n }\n else {\n message.description = \"\";\n }\n if (object.plan !== undefined && object.plan !== null) {\n message.plan = upgrade_1.Plan.fromPartial(object.plan);\n }\n else {\n message.plan = undefined;\n }\n if (object.upgradedClientState !== undefined && object.upgradedClientState !== null) {\n message.upgradedClientState = any_1.Any.fromPartial(object.upgradedClientState);\n }\n else {\n message.upgradedClientState = undefined;\n }\n return message;\n },\n};\nconst baseHeight = { revisionNumber: long_1.default.UZERO, revisionHeight: long_1.default.UZERO };\nexports.Height = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.revisionNumber.isZero()) {\n writer.uint32(8).uint64(message.revisionNumber);\n }\n if (!message.revisionHeight.isZero()) {\n writer.uint32(16).uint64(message.revisionHeight);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseHeight);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.revisionNumber = reader.uint64();\n break;\n case 2:\n message.revisionHeight = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseHeight);\n if (object.revisionNumber !== undefined && object.revisionNumber !== null) {\n message.revisionNumber = long_1.default.fromString(object.revisionNumber);\n }\n else {\n message.revisionNumber = long_1.default.UZERO;\n }\n if (object.revisionHeight !== undefined && object.revisionHeight !== null) {\n message.revisionHeight = long_1.default.fromString(object.revisionHeight);\n }\n else {\n message.revisionHeight = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.revisionNumber !== undefined &&\n (obj.revisionNumber = (message.revisionNumber || long_1.default.UZERO).toString());\n message.revisionHeight !== undefined &&\n (obj.revisionHeight = (message.revisionHeight || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseHeight);\n if (object.revisionNumber !== undefined && object.revisionNumber !== null) {\n message.revisionNumber = object.revisionNumber;\n }\n else {\n message.revisionNumber = long_1.default.UZERO;\n }\n if (object.revisionHeight !== undefined && object.revisionHeight !== null) {\n message.revisionHeight = object.revisionHeight;\n }\n else {\n message.revisionHeight = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseParams = { allowedClients: \"\" };\nexports.Params = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.allowedClients) {\n writer.uint32(10).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParams);\n message.allowedClients = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.allowedClients.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParams);\n message.allowedClients = [];\n if (object.allowedClients !== undefined && object.allowedClients !== null) {\n for (const e of object.allowedClients) {\n message.allowedClients.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.allowedClients) {\n obj.allowedClients = message.allowedClients.map((e) => e);\n }\n else {\n obj.allowedClients = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParams);\n message.allowedClients = [];\n if (object.allowedClients !== undefined && object.allowedClients !== null) {\n for (const e of object.allowedClients) {\n message.allowedClients.push(e);\n }\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=client.js.map","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar codes = {};\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n\n var NodeError =\n /*#__PURE__*/\n function (_Base) {\n _inheritsLoose(NodeError, _Base);\n\n function NodeError(arg1, arg2, arg3) {\n return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;\n }\n\n return NodeError;\n }(Base);\n\n NodeError.prototype.name = Base.name;\n NodeError.prototype.code = code;\n codes[code] = NodeError;\n} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\n\n\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n\n\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n\n\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {\n return 'The value \"' + value + '\" is invalid for option \"' + name + '\"';\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n // determiner: 'must be' or 'must not be'\n var determiner;\n\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n var msg;\n\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n msg += \". Received type \".concat(typeof actual);\n return msg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');\ncreateErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {\n return 'The ' + name + ' method is not implemented';\n});\ncreateErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');\ncreateErrorType('ERR_STREAM_DESTROYED', function (name) {\n return 'Cannot call ' + name + ' after a stream was destroyed';\n});\ncreateErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');\ncreateErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');\ncreateErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');\ncreateErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);\ncreateErrorType('ERR_UNKNOWN_ENCODING', function (arg) {\n return 'Unknown encoding: ' + arg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');\nmodule.exports.codes = codes;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n'use strict';\n/**/\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n\n for (var key in obj) {\n keys.push(key);\n }\n\n return keys;\n};\n/**/\n\n\nmodule.exports = Duplex;\n\nvar Readable = require('./_stream_readable');\n\nvar Writable = require('./_stream_writable');\n\nrequire('inherits')(Duplex, Readable);\n\n{\n // Allow the keys array to be GC'ed.\n var keys = objectKeys(Writable.prototype);\n\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n this.allowHalfOpen = true;\n\n if (options) {\n if (options.readable === false) this.readable = false;\n if (options.writable === false) this.writable = false;\n\n if (options.allowHalfOpen === false) {\n this.allowHalfOpen = false;\n this.once('end', onend);\n }\n }\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n}); // the no-half-open enforcer\n\nfunction onend() {\n // If the writable side ended, then we're ok.\n if (this._writableState.ended) return; // no more data can be written.\n // But allow more writes to happen in this tick.\n\n process.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport aes from \"aes-js\";\nimport scrypt from \"scrypt-js\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { arrayify, concat, hexlify } from \"@ethersproject/bytes\";\nimport { defaultPath, entropyToMnemonic, HDNode, mnemonicToEntropy } from \"@ethersproject/hdnode\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { pbkdf2 as _pbkdf2 } from \"@ethersproject/pbkdf2\";\nimport { randomBytes } from \"@ethersproject/random\";\nimport { Description } from \"@ethersproject/properties\";\nimport { computeAddress } from \"@ethersproject/transactions\";\nimport { getPassword, looseArrayify, searchPath, uuidV4, zpad } from \"./utils\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n// Exported Types\nfunction hasMnemonic(value) {\n return (value != null && value.mnemonic && value.mnemonic.phrase);\n}\nexport class KeystoreAccount extends Description {\n isKeystoreAccount(value) {\n return !!(value && value._isKeystoreAccount);\n }\n}\nfunction _decrypt(data, key, ciphertext) {\n const cipher = searchPath(data, \"crypto/cipher\");\n if (cipher === \"aes-128-ctr\") {\n const iv = looseArrayify(searchPath(data, \"crypto/cipherparams/iv\"));\n const counter = new aes.Counter(iv);\n const aesCtr = new aes.ModeOfOperation.ctr(key, counter);\n return arrayify(aesCtr.decrypt(ciphertext));\n }\n return null;\n}\nfunction _getAccount(data, key) {\n const ciphertext = looseArrayify(searchPath(data, \"crypto/ciphertext\"));\n const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n if (computedMAC !== searchPath(data, \"crypto/mac\").toLowerCase()) {\n throw new Error(\"invalid password\");\n }\n const privateKey = _decrypt(data, key.slice(0, 16), ciphertext);\n if (!privateKey) {\n logger.throwError(\"unsupported cipher\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"decrypt\"\n });\n }\n const mnemonicKey = key.slice(32, 64);\n const address = computeAddress(privateKey);\n if (data.address) {\n let check = data.address.toLowerCase();\n if (check.substring(0, 2) !== \"0x\") {\n check = \"0x\" + check;\n }\n if (getAddress(check) !== address) {\n throw new Error(\"address mismatch\");\n }\n }\n const account = {\n _isKeystoreAccount: true,\n address: address,\n privateKey: hexlify(privateKey)\n };\n // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase\n if (searchPath(data, \"x-ethers/version\") === \"0.1\") {\n const mnemonicCiphertext = looseArrayify(searchPath(data, \"x-ethers/mnemonicCiphertext\"));\n const mnemonicIv = looseArrayify(searchPath(data, \"x-ethers/mnemonicCounter\"));\n const mnemonicCounter = new aes.Counter(mnemonicIv);\n const mnemonicAesCtr = new aes.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);\n const path = searchPath(data, \"x-ethers/path\") || defaultPath;\n const locale = searchPath(data, \"x-ethers/locale\") || \"en\";\n const entropy = arrayify(mnemonicAesCtr.decrypt(mnemonicCiphertext));\n try {\n const mnemonic = entropyToMnemonic(entropy, locale);\n const node = HDNode.fromMnemonic(mnemonic, null, locale).derivePath(path);\n if (node.privateKey != account.privateKey) {\n throw new Error(\"mnemonic mismatch\");\n }\n account.mnemonic = node.mnemonic;\n }\n catch (error) {\n // If we don't have the locale wordlist installed to\n // read this mnemonic, just bail and don't set the\n // mnemonic\n if (error.code !== Logger.errors.INVALID_ARGUMENT || error.argument !== \"wordlist\") {\n throw error;\n }\n }\n }\n return new KeystoreAccount(account);\n}\nfunction pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc) {\n return arrayify(_pbkdf2(passwordBytes, salt, count, dkLen, prfFunc));\n}\nfunction pbkdf2(passwordBytes, salt, count, dkLen, prfFunc) {\n return Promise.resolve(pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc));\n}\nfunction _computeKdfKey(data, password, pbkdf2Func, scryptFunc, progressCallback) {\n const passwordBytes = getPassword(password);\n const kdf = searchPath(data, \"crypto/kdf\");\n if (kdf && typeof (kdf) === \"string\") {\n const throwError = function (name, value) {\n return logger.throwArgumentError(\"invalid key-derivation function parameters\", name, value);\n };\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = looseArrayify(searchPath(data, \"crypto/kdfparams/salt\"));\n const N = parseInt(searchPath(data, \"crypto/kdfparams/n\"));\n const r = parseInt(searchPath(data, \"crypto/kdfparams/r\"));\n const p = parseInt(searchPath(data, \"crypto/kdfparams/p\"));\n // Check for all required parameters\n if (!N || !r || !p) {\n throwError(\"kdf\", kdf);\n }\n // Make sure N is a power of 2\n if ((N & (N - 1)) !== 0) {\n throwError(\"N\", N);\n }\n const dkLen = parseInt(searchPath(data, \"crypto/kdfparams/dklen\"));\n if (dkLen !== 32) {\n throwError(\"dklen\", dkLen);\n }\n return scryptFunc(passwordBytes, salt, N, r, p, 64, progressCallback);\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = looseArrayify(searchPath(data, \"crypto/kdfparams/salt\"));\n let prfFunc = null;\n const prf = searchPath(data, \"crypto/kdfparams/prf\");\n if (prf === \"hmac-sha256\") {\n prfFunc = \"sha256\";\n }\n else if (prf === \"hmac-sha512\") {\n prfFunc = \"sha512\";\n }\n else {\n throwError(\"prf\", prf);\n }\n const count = parseInt(searchPath(data, \"crypto/kdfparams/c\"));\n const dkLen = parseInt(searchPath(data, \"crypto/kdfparams/dklen\"));\n if (dkLen !== 32) {\n throwError(\"dklen\", dkLen);\n }\n return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);\n }\n }\n return logger.throwArgumentError(\"unsupported key-derivation function\", \"kdf\", kdf);\n}\nexport function decryptSync(json, password) {\n const data = JSON.parse(json);\n const key = _computeKdfKey(data, password, pbkdf2Sync, scrypt.syncScrypt);\n return _getAccount(data, key);\n}\nexport function decrypt(json, password, progressCallback) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.parse(json);\n const key = yield _computeKdfKey(data, password, pbkdf2, scrypt.scrypt, progressCallback);\n return _getAccount(data, key);\n });\n}\nexport function encrypt(account, password, options, progressCallback) {\n try {\n // Check the address matches the private key\n if (getAddress(account.address) !== computeAddress(account.privateKey)) {\n throw new Error(\"address/privateKey mismatch\");\n }\n // Check the mnemonic (if any) matches the private key\n if (hasMnemonic(account)) {\n const mnemonic = account.mnemonic;\n const node = HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path || defaultPath);\n if (node.privateKey != account.privateKey) {\n throw new Error(\"mnemonic mismatch\");\n }\n }\n }\n catch (e) {\n return Promise.reject(e);\n }\n // The options are optional, so adjust the call as needed\n if (typeof (options) === \"function\" && !progressCallback) {\n progressCallback = options;\n options = {};\n }\n if (!options) {\n options = {};\n }\n const privateKey = arrayify(account.privateKey);\n const passwordBytes = getPassword(password);\n let entropy = null;\n let path = null;\n let locale = null;\n if (hasMnemonic(account)) {\n const srcMnemonic = account.mnemonic;\n entropy = arrayify(mnemonicToEntropy(srcMnemonic.phrase, srcMnemonic.locale || \"en\"));\n path = srcMnemonic.path || defaultPath;\n locale = srcMnemonic.locale || \"en\";\n }\n let client = options.client;\n if (!client) {\n client = \"ethers.js\";\n }\n // Check/generate the salt\n let salt = null;\n if (options.salt) {\n salt = arrayify(options.salt);\n }\n else {\n salt = randomBytes(32);\n ;\n }\n // Override initialization vector\n let iv = null;\n if (options.iv) {\n iv = arrayify(options.iv);\n if (iv.length !== 16) {\n throw new Error(\"invalid iv\");\n }\n }\n else {\n iv = randomBytes(16);\n }\n // Override the uuid\n let uuidRandom = null;\n if (options.uuid) {\n uuidRandom = arrayify(options.uuid);\n if (uuidRandom.length !== 16) {\n throw new Error(\"invalid uuid\");\n }\n }\n else {\n uuidRandom = randomBytes(16);\n }\n // Override the scrypt password-based key derivation function parameters\n let N = (1 << 17), r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p) {\n p = options.scrypt.p;\n }\n }\n // We take 64 bytes:\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet)\n return scrypt.scrypt(passwordBytes, salt, N, r, p, 64, progressCallback).then((key) => {\n key = arrayify(key);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // This will be used to encrypt the mnemonic phrase (if any)\n const mnemonicKey = key.slice(32, 64);\n // Encrypt the private key\n const counter = new aes.Counter(iv);\n const aesCtr = new aes.ModeOfOperation.ctr(derivedKey, counter);\n const ciphertext = arrayify(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = keccak256(concat([macPrefix, ciphertext]));\n // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(salt).substring(2),\n n: N,\n dklen: 32,\n p: p,\n r: r\n },\n mac: mac.substring(2)\n }\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (entropy) {\n const mnemonicIv = randomBytes(16);\n const mnemonicCounter = new aes.Counter(mnemonicIv);\n const mnemonicAesCtr = new aes.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);\n const mnemonicCiphertext = arrayify(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = (now.getUTCFullYear() + \"-\" +\n zpad(now.getUTCMonth() + 1, 2) + \"-\" +\n zpad(now.getUTCDate(), 2) + \"T\" +\n zpad(now.getUTCHours(), 2) + \"-\" +\n zpad(now.getUTCMinutes(), 2) + \"-\" +\n zpad(now.getUTCSeconds(), 2) + \".0Z\");\n data[\"x-ethers\"] = {\n client: client,\n gethFilename: (\"UTC--\" + timestamp + \"--\" + data.address),\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n path: path,\n locale: locale,\n version: \"0.1\"\n };\n }\n return JSON.stringify(data);\n });\n}\n//# sourceMappingURL=keystore.js.map","/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled(_ref) {\n var controlled = _ref.controlled,\n defaultProp = _ref.default,\n name = _ref.name,\n _ref$state = _ref.state,\n state = _ref$state === void 0 ? 'value' : _ref$state;\n\n var _React$useRef = React.useRef(controlled !== undefined),\n isControlled = _React$useRef.current;\n\n var _React$useState = React.useState(defaultProp),\n valueState = _React$useState[0],\n setValue = _React$useState[1];\n\n var value = isControlled ? controlled : valueState;\n\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(function () {\n if (isControlled !== (controlled !== undefined)) {\n console.error([\"Material-UI: A component is changing the \".concat(isControlled ? '' : 'un', \"controlled \").concat(state, \" state of \").concat(name, \" to be \").concat(isControlled ? 'un' : '', \"controlled.\"), 'Elements should not switch from uncontrolled to controlled (or vice versa).', \"Decide between using a controlled or uncontrolled \".concat(name, \" \") + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render, it's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [controlled]);\n\n var _React$useRef2 = React.useRef(defaultProp),\n defaultValue = _React$useRef2.current;\n\n React.useEffect(function () {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([\"Material-UI: A component is changing the default \".concat(state, \" state of an uncontrolled \").concat(name, \" after being initialized. \") + \"To suppress this warning opt to use a controlled \".concat(name, \".\")].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n\n var setValueIfUncontrolled = React.useCallback(function (newValue) {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","import ownerDocument from './ownerDocument';\nexport default function ownerWindow(node) {\n var doc = ownerDocument(node);\n return doc.defaultView || window;\n}","import createTheme from './createTheme';\nvar defaultTheme = createTheme();\nexport default defaultTheme;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport SvgIcon from '../SvgIcon';\n/**\n * Private module reserved for @material-ui/x packages.\n */\n\nexport default function createSvgIcon(path, displayName) {\n var Component = function Component(props, ref) {\n return /*#__PURE__*/React.createElement(SvgIcon, _extends({\n ref: ref\n }, props), path);\n };\n\n if (process.env.NODE_ENV !== 'production') {\n // Need to set `displayName` on the inner component for React.memo.\n // React prior to 16.14 ignores `displayName` on the wrapper.\n Component.displayName = \"\".concat(displayName, \"Icon\");\n }\n\n Component.muiName = SvgIcon.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\n}","import React from 'react';\nexport default React.createContext(null);","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n// Debugging line for testing browser lib in node\n//const window = { crypto: { getRandomValues: () => { } } };\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\nfunction getGlobal() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n}\n;\nconst anyGlobal = getGlobal();\nlet crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nif (!crypto || !crypto.getRandomValues) {\n logger.warn(\"WARNING: Missing strong random number source\");\n crypto = {\n getRandomValues: function (buffer) {\n return logger.throwError(\"no secure random source avaialble\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"crypto.getRandomValues\"\n });\n }\n };\n}\nexport function randomBytes(length) {\n if (length <= 0 || length > 1024 || (length % 1) || length != length) {\n logger.throwArgumentError(\"invalid length\", \"length\", length);\n }\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return arrayify(result);\n}\n;\n//# sourceMappingURL=random.js.map","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\n/* eslint-disable */\nimport Long from \"long\";\nimport _m0 from \"protobufjs/minimal\";\nexport var protobufPackage = \"gossip.v1\";\nvar baseGossipMessage = {};\nexport var GossipMessage = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.signedObservation !== undefined) {\n SignedObservation.encode(message.signedObservation, writer.uint32(18).fork()).ldelim();\n }\n if (message.signedHeartbeat !== undefined) {\n SignedHeartbeat.encode(message.signedHeartbeat, writer.uint32(26).fork()).ldelim();\n }\n if (message.signedVaaWithQuorum !== undefined) {\n SignedVAAWithQuorum.encode(message.signedVaaWithQuorum, writer.uint32(34).fork()).ldelim();\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGossipMessage);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2:\n message.signedObservation = SignedObservation.decode(reader, reader.uint32());\n break;\n case 3:\n message.signedHeartbeat = SignedHeartbeat.decode(reader, reader.uint32());\n break;\n case 4:\n message.signedVaaWithQuorum = SignedVAAWithQuorum.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseGossipMessage);\n if (object.signedObservation !== undefined &&\n object.signedObservation !== null) {\n message.signedObservation = SignedObservation.fromJSON(object.signedObservation);\n }\n else {\n message.signedObservation = undefined;\n }\n if (object.signedHeartbeat !== undefined &&\n object.signedHeartbeat !== null) {\n message.signedHeartbeat = SignedHeartbeat.fromJSON(object.signedHeartbeat);\n }\n else {\n message.signedHeartbeat = undefined;\n }\n if (object.signedVaaWithQuorum !== undefined &&\n object.signedVaaWithQuorum !== null) {\n message.signedVaaWithQuorum = SignedVAAWithQuorum.fromJSON(object.signedVaaWithQuorum);\n }\n else {\n message.signedVaaWithQuorum = undefined;\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.signedObservation !== undefined &&\n (obj.signedObservation = message.signedObservation\n ? SignedObservation.toJSON(message.signedObservation)\n : undefined);\n message.signedHeartbeat !== undefined &&\n (obj.signedHeartbeat = message.signedHeartbeat\n ? SignedHeartbeat.toJSON(message.signedHeartbeat)\n : undefined);\n message.signedVaaWithQuorum !== undefined &&\n (obj.signedVaaWithQuorum = message.signedVaaWithQuorum\n ? SignedVAAWithQuorum.toJSON(message.signedVaaWithQuorum)\n : undefined);\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseGossipMessage);\n if (object.signedObservation !== undefined &&\n object.signedObservation !== null) {\n message.signedObservation = SignedObservation.fromPartial(object.signedObservation);\n }\n else {\n message.signedObservation = undefined;\n }\n if (object.signedHeartbeat !== undefined &&\n object.signedHeartbeat !== null) {\n message.signedHeartbeat = SignedHeartbeat.fromPartial(object.signedHeartbeat);\n }\n else {\n message.signedHeartbeat = undefined;\n }\n if (object.signedVaaWithQuorum !== undefined &&\n object.signedVaaWithQuorum !== null) {\n message.signedVaaWithQuorum = SignedVAAWithQuorum.fromPartial(object.signedVaaWithQuorum);\n }\n else {\n message.signedVaaWithQuorum = undefined;\n }\n return message;\n },\n};\nvar baseSignedHeartbeat = {};\nexport var SignedHeartbeat = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.heartbeat.length !== 0) {\n writer.uint32(10).bytes(message.heartbeat);\n }\n if (message.signature.length !== 0) {\n writer.uint32(18).bytes(message.signature);\n }\n if (message.guardianAddr.length !== 0) {\n writer.uint32(26).bytes(message.guardianAddr);\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseSignedHeartbeat);\n message.heartbeat = new Uint8Array();\n message.signature = new Uint8Array();\n message.guardianAddr = new Uint8Array();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.heartbeat = reader.bytes();\n break;\n case 2:\n message.signature = reader.bytes();\n break;\n case 3:\n message.guardianAddr = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseSignedHeartbeat);\n message.heartbeat = new Uint8Array();\n message.signature = new Uint8Array();\n message.guardianAddr = new Uint8Array();\n if (object.heartbeat !== undefined && object.heartbeat !== null) {\n message.heartbeat = bytesFromBase64(object.heartbeat);\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = bytesFromBase64(object.signature);\n }\n if (object.guardianAddr !== undefined && object.guardianAddr !== null) {\n message.guardianAddr = bytesFromBase64(object.guardianAddr);\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.heartbeat !== undefined &&\n (obj.heartbeat = base64FromBytes(message.heartbeat !== undefined ? message.heartbeat : new Uint8Array()));\n message.signature !== undefined &&\n (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));\n message.guardianAddr !== undefined &&\n (obj.guardianAddr = base64FromBytes(message.guardianAddr !== undefined\n ? message.guardianAddr\n : new Uint8Array()));\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseSignedHeartbeat);\n if (object.heartbeat !== undefined && object.heartbeat !== null) {\n message.heartbeat = object.heartbeat;\n }\n else {\n message.heartbeat = new Uint8Array();\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = object.signature;\n }\n else {\n message.signature = new Uint8Array();\n }\n if (object.guardianAddr !== undefined && object.guardianAddr !== null) {\n message.guardianAddr = object.guardianAddr;\n }\n else {\n message.guardianAddr = new Uint8Array();\n }\n return message;\n },\n};\nvar baseHeartbeat = {\n nodeName: \"\",\n counter: \"0\",\n timestamp: \"0\",\n version: \"\",\n guardianAddr: \"\",\n bootTimestamp: \"0\",\n};\nexport var Heartbeat = {\n encode: function (message, writer) {\n var e_1, _a;\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.nodeName !== \"\") {\n writer.uint32(10).string(message.nodeName);\n }\n if (message.counter !== \"0\") {\n writer.uint32(16).int64(message.counter);\n }\n if (message.timestamp !== \"0\") {\n writer.uint32(24).int64(message.timestamp);\n }\n try {\n for (var _b = __values(message.networks), _c = _b.next(); !_c.done; _c = _b.next()) {\n var v = _c.value;\n Heartbeat_Network.encode(v, writer.uint32(34).fork()).ldelim();\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (message.version !== \"\") {\n writer.uint32(42).string(message.version);\n }\n if (message.guardianAddr !== \"\") {\n writer.uint32(50).string(message.guardianAddr);\n }\n if (message.bootTimestamp !== \"0\") {\n writer.uint32(56).int64(message.bootTimestamp);\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseHeartbeat);\n message.networks = [];\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.nodeName = reader.string();\n break;\n case 2:\n message.counter = longToString(reader.int64());\n break;\n case 3:\n message.timestamp = longToString(reader.int64());\n break;\n case 4:\n message.networks.push(Heartbeat_Network.decode(reader, reader.uint32()));\n break;\n case 5:\n message.version = reader.string();\n break;\n case 6:\n message.guardianAddr = reader.string();\n break;\n case 7:\n message.bootTimestamp = longToString(reader.int64());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var e_2, _a;\n var message = __assign({}, baseHeartbeat);\n message.networks = [];\n if (object.nodeName !== undefined && object.nodeName !== null) {\n message.nodeName = String(object.nodeName);\n }\n else {\n message.nodeName = \"\";\n }\n if (object.counter !== undefined && object.counter !== null) {\n message.counter = String(object.counter);\n }\n else {\n message.counter = \"0\";\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = String(object.timestamp);\n }\n else {\n message.timestamp = \"0\";\n }\n if (object.networks !== undefined && object.networks !== null) {\n try {\n for (var _b = __values(object.networks), _c = _b.next(); !_c.done; _c = _b.next()) {\n var e = _c.value;\n message.networks.push(Heartbeat_Network.fromJSON(e));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = String(object.version);\n }\n else {\n message.version = \"\";\n }\n if (object.guardianAddr !== undefined && object.guardianAddr !== null) {\n message.guardianAddr = String(object.guardianAddr);\n }\n else {\n message.guardianAddr = \"\";\n }\n if (object.bootTimestamp !== undefined && object.bootTimestamp !== null) {\n message.bootTimestamp = String(object.bootTimestamp);\n }\n else {\n message.bootTimestamp = \"0\";\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.nodeName !== undefined && (obj.nodeName = message.nodeName);\n message.counter !== undefined && (obj.counter = message.counter);\n message.timestamp !== undefined && (obj.timestamp = message.timestamp);\n if (message.networks) {\n obj.networks = message.networks.map(function (e) {\n return e ? Heartbeat_Network.toJSON(e) : undefined;\n });\n }\n else {\n obj.networks = [];\n }\n message.version !== undefined && (obj.version = message.version);\n message.guardianAddr !== undefined &&\n (obj.guardianAddr = message.guardianAddr);\n message.bootTimestamp !== undefined &&\n (obj.bootTimestamp = message.bootTimestamp);\n return obj;\n },\n fromPartial: function (object) {\n var e_3, _a;\n var message = __assign({}, baseHeartbeat);\n message.networks = [];\n if (object.nodeName !== undefined && object.nodeName !== null) {\n message.nodeName = object.nodeName;\n }\n else {\n message.nodeName = \"\";\n }\n if (object.counter !== undefined && object.counter !== null) {\n message.counter = object.counter;\n }\n else {\n message.counter = \"0\";\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = object.timestamp;\n }\n else {\n message.timestamp = \"0\";\n }\n if (object.networks !== undefined && object.networks !== null) {\n try {\n for (var _b = __values(object.networks), _c = _b.next(); !_c.done; _c = _b.next()) {\n var e = _c.value;\n message.networks.push(Heartbeat_Network.fromPartial(e));\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_3) throw e_3.error; }\n }\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = object.version;\n }\n else {\n message.version = \"\";\n }\n if (object.guardianAddr !== undefined && object.guardianAddr !== null) {\n message.guardianAddr = object.guardianAddr;\n }\n else {\n message.guardianAddr = \"\";\n }\n if (object.bootTimestamp !== undefined && object.bootTimestamp !== null) {\n message.bootTimestamp = object.bootTimestamp;\n }\n else {\n message.bootTimestamp = \"0\";\n }\n return message;\n },\n};\nvar baseHeartbeat_Network = {\n id: 0,\n height: \"0\",\n contractAddress: \"\",\n errorCount: \"0\",\n};\nexport var Heartbeat_Network = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.id !== 0) {\n writer.uint32(8).uint32(message.id);\n }\n if (message.height !== \"0\") {\n writer.uint32(16).int64(message.height);\n }\n if (message.contractAddress !== \"\") {\n writer.uint32(26).string(message.contractAddress);\n }\n if (message.errorCount !== \"0\") {\n writer.uint32(32).uint64(message.errorCount);\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseHeartbeat_Network);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.id = reader.uint32();\n break;\n case 2:\n message.height = longToString(reader.int64());\n break;\n case 3:\n message.contractAddress = reader.string();\n break;\n case 4:\n message.errorCount = longToString(reader.uint64());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseHeartbeat_Network);\n if (object.id !== undefined && object.id !== null) {\n message.id = Number(object.id);\n }\n else {\n message.id = 0;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = String(object.height);\n }\n else {\n message.height = \"0\";\n }\n if (object.contractAddress !== undefined &&\n object.contractAddress !== null) {\n message.contractAddress = String(object.contractAddress);\n }\n else {\n message.contractAddress = \"\";\n }\n if (object.errorCount !== undefined && object.errorCount !== null) {\n message.errorCount = String(object.errorCount);\n }\n else {\n message.errorCount = \"0\";\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.id !== undefined && (obj.id = message.id);\n message.height !== undefined && (obj.height = message.height);\n message.contractAddress !== undefined &&\n (obj.contractAddress = message.contractAddress);\n message.errorCount !== undefined && (obj.errorCount = message.errorCount);\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseHeartbeat_Network);\n if (object.id !== undefined && object.id !== null) {\n message.id = object.id;\n }\n else {\n message.id = 0;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = object.height;\n }\n else {\n message.height = \"0\";\n }\n if (object.contractAddress !== undefined &&\n object.contractAddress !== null) {\n message.contractAddress = object.contractAddress;\n }\n else {\n message.contractAddress = \"\";\n }\n if (object.errorCount !== undefined && object.errorCount !== null) {\n message.errorCount = object.errorCount;\n }\n else {\n message.errorCount = \"0\";\n }\n return message;\n },\n};\nvar baseSignedObservation = { messageId: \"\" };\nexport var SignedObservation = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.addr.length !== 0) {\n writer.uint32(10).bytes(message.addr);\n }\n if (message.hash.length !== 0) {\n writer.uint32(18).bytes(message.hash);\n }\n if (message.signature.length !== 0) {\n writer.uint32(26).bytes(message.signature);\n }\n if (message.txHash.length !== 0) {\n writer.uint32(34).bytes(message.txHash);\n }\n if (message.messageId !== \"\") {\n writer.uint32(42).string(message.messageId);\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseSignedObservation);\n message.addr = new Uint8Array();\n message.hash = new Uint8Array();\n message.signature = new Uint8Array();\n message.txHash = new Uint8Array();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.addr = reader.bytes();\n break;\n case 2:\n message.hash = reader.bytes();\n break;\n case 3:\n message.signature = reader.bytes();\n break;\n case 4:\n message.txHash = reader.bytes();\n break;\n case 5:\n message.messageId = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseSignedObservation);\n message.addr = new Uint8Array();\n message.hash = new Uint8Array();\n message.signature = new Uint8Array();\n message.txHash = new Uint8Array();\n if (object.addr !== undefined && object.addr !== null) {\n message.addr = bytesFromBase64(object.addr);\n }\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = bytesFromBase64(object.hash);\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = bytesFromBase64(object.signature);\n }\n if (object.txHash !== undefined && object.txHash !== null) {\n message.txHash = bytesFromBase64(object.txHash);\n }\n if (object.messageId !== undefined && object.messageId !== null) {\n message.messageId = String(object.messageId);\n }\n else {\n message.messageId = \"\";\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.addr !== undefined &&\n (obj.addr = base64FromBytes(message.addr !== undefined ? message.addr : new Uint8Array()));\n message.hash !== undefined &&\n (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));\n message.signature !== undefined &&\n (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));\n message.txHash !== undefined &&\n (obj.txHash = base64FromBytes(message.txHash !== undefined ? message.txHash : new Uint8Array()));\n message.messageId !== undefined && (obj.messageId = message.messageId);\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseSignedObservation);\n if (object.addr !== undefined && object.addr !== null) {\n message.addr = object.addr;\n }\n else {\n message.addr = new Uint8Array();\n }\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = object.hash;\n }\n else {\n message.hash = new Uint8Array();\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = object.signature;\n }\n else {\n message.signature = new Uint8Array();\n }\n if (object.txHash !== undefined && object.txHash !== null) {\n message.txHash = object.txHash;\n }\n else {\n message.txHash = new Uint8Array();\n }\n if (object.messageId !== undefined && object.messageId !== null) {\n message.messageId = object.messageId;\n }\n else {\n message.messageId = \"\";\n }\n return message;\n },\n};\nvar baseSignedVAAWithQuorum = {};\nexport var SignedVAAWithQuorum = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.vaa.length !== 0) {\n writer.uint32(10).bytes(message.vaa);\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseSignedVAAWithQuorum);\n message.vaa = new Uint8Array();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.vaa = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseSignedVAAWithQuorum);\n message.vaa = new Uint8Array();\n if (object.vaa !== undefined && object.vaa !== null) {\n message.vaa = bytesFromBase64(object.vaa);\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.vaa !== undefined &&\n (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array()));\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseSignedVAAWithQuorum);\n if (object.vaa !== undefined && object.vaa !== null) {\n message.vaa = object.vaa;\n }\n else {\n message.vaa = new Uint8Array();\n }\n return message;\n },\n};\nvar globalThis = (function () {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nvar atob = globalThis.atob ||\n (function (b64) { return globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"); });\nfunction bytesFromBase64(b64) {\n var bin = atob(b64);\n var arr = new Uint8Array(bin.length);\n for (var i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nvar btoa = globalThis.btoa ||\n (function (bin) { return globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"); });\nfunction base64FromBytes(arr) {\n var e_4, _a;\n var bin = [];\n try {\n for (var arr_1 = __values(arr), arr_1_1 = arr_1.next(); !arr_1_1.done; arr_1_1 = arr_1.next()) {\n var byte = arr_1_1.value;\n bin.push(String.fromCharCode(byte));\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (arr_1_1 && !arr_1_1.done && (_a = arr_1.return)) _a.call(arr_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n return btoa(bin.join(\"\"));\n}\nfunction longToString(long) {\n return long.toString();\n}\nif (_m0.util.Long !== Long) {\n _m0.util.Long = Long;\n _m0.configure();\n}\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n","var setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgUndelegateResponse = exports.MsgUndelegate = exports.MsgBeginRedelegateResponse = exports.MsgBeginRedelegate = exports.MsgDelegateResponse = exports.MsgDelegate = exports.MsgEditValidatorResponse = exports.MsgEditValidator = exports.MsgCreateValidatorResponse = exports.MsgCreateValidator = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst staking_1 = require(\"../../../cosmos/staking/v1beta1/staking\");\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nconst timestamp_1 = require(\"../../../google/protobuf/timestamp\");\nexports.protobufPackage = \"cosmos.staking.v1beta1\";\nconst baseMsgCreateValidator = { minSelfDelegation: \"\", delegatorAddress: \"\", validatorAddress: \"\" };\nexports.MsgCreateValidator = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.description !== undefined) {\n staking_1.Description.encode(message.description, writer.uint32(10).fork()).ldelim();\n }\n if (message.commission !== undefined) {\n staking_1.CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim();\n }\n if (message.minSelfDelegation !== \"\") {\n writer.uint32(26).string(message.minSelfDelegation);\n }\n if (message.delegatorAddress !== \"\") {\n writer.uint32(34).string(message.delegatorAddress);\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(42).string(message.validatorAddress);\n }\n if (message.pubkey !== undefined) {\n any_1.Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim();\n }\n if (message.value !== undefined) {\n coin_1.Coin.encode(message.value, writer.uint32(58).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgCreateValidator);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.description = staking_1.Description.decode(reader, reader.uint32());\n break;\n case 2:\n message.commission = staking_1.CommissionRates.decode(reader, reader.uint32());\n break;\n case 3:\n message.minSelfDelegation = reader.string();\n break;\n case 4:\n message.delegatorAddress = reader.string();\n break;\n case 5:\n message.validatorAddress = reader.string();\n break;\n case 6:\n message.pubkey = any_1.Any.decode(reader, reader.uint32());\n break;\n case 7:\n message.value = coin_1.Coin.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgCreateValidator);\n if (object.description !== undefined && object.description !== null) {\n message.description = staking_1.Description.fromJSON(object.description);\n }\n else {\n message.description = undefined;\n }\n if (object.commission !== undefined && object.commission !== null) {\n message.commission = staking_1.CommissionRates.fromJSON(object.commission);\n }\n else {\n message.commission = undefined;\n }\n if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) {\n message.minSelfDelegation = String(object.minSelfDelegation);\n }\n else {\n message.minSelfDelegation = \"\";\n }\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.pubkey !== undefined && object.pubkey !== null) {\n message.pubkey = any_1.Any.fromJSON(object.pubkey);\n }\n else {\n message.pubkey = undefined;\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = coin_1.Coin.fromJSON(object.value);\n }\n else {\n message.value = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.description !== undefined &&\n (obj.description = message.description ? staking_1.Description.toJSON(message.description) : undefined);\n message.commission !== undefined &&\n (obj.commission = message.commission ? staking_1.CommissionRates.toJSON(message.commission) : undefined);\n message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation);\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n message.pubkey !== undefined && (obj.pubkey = message.pubkey ? any_1.Any.toJSON(message.pubkey) : undefined);\n message.value !== undefined && (obj.value = message.value ? coin_1.Coin.toJSON(message.value) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgCreateValidator);\n if (object.description !== undefined && object.description !== null) {\n message.description = staking_1.Description.fromPartial(object.description);\n }\n else {\n message.description = undefined;\n }\n if (object.commission !== undefined && object.commission !== null) {\n message.commission = staking_1.CommissionRates.fromPartial(object.commission);\n }\n else {\n message.commission = undefined;\n }\n if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) {\n message.minSelfDelegation = object.minSelfDelegation;\n }\n else {\n message.minSelfDelegation = \"\";\n }\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.pubkey !== undefined && object.pubkey !== null) {\n message.pubkey = any_1.Any.fromPartial(object.pubkey);\n }\n else {\n message.pubkey = undefined;\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = coin_1.Coin.fromPartial(object.value);\n }\n else {\n message.value = undefined;\n }\n return message;\n },\n};\nconst baseMsgCreateValidatorResponse = {};\nexports.MsgCreateValidatorResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgCreateValidatorResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgCreateValidatorResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgCreateValidatorResponse);\n return message;\n },\n};\nconst baseMsgEditValidator = { validatorAddress: \"\", commissionRate: \"\", minSelfDelegation: \"\" };\nexports.MsgEditValidator = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.description !== undefined) {\n staking_1.Description.encode(message.description, writer.uint32(10).fork()).ldelim();\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(18).string(message.validatorAddress);\n }\n if (message.commissionRate !== \"\") {\n writer.uint32(26).string(message.commissionRate);\n }\n if (message.minSelfDelegation !== \"\") {\n writer.uint32(34).string(message.minSelfDelegation);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgEditValidator);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.description = staking_1.Description.decode(reader, reader.uint32());\n break;\n case 2:\n message.validatorAddress = reader.string();\n break;\n case 3:\n message.commissionRate = reader.string();\n break;\n case 4:\n message.minSelfDelegation = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgEditValidator);\n if (object.description !== undefined && object.description !== null) {\n message.description = staking_1.Description.fromJSON(object.description);\n }\n else {\n message.description = undefined;\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.commissionRate !== undefined && object.commissionRate !== null) {\n message.commissionRate = String(object.commissionRate);\n }\n else {\n message.commissionRate = \"\";\n }\n if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) {\n message.minSelfDelegation = String(object.minSelfDelegation);\n }\n else {\n message.minSelfDelegation = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.description !== undefined &&\n (obj.description = message.description ? staking_1.Description.toJSON(message.description) : undefined);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n message.commissionRate !== undefined && (obj.commissionRate = message.commissionRate);\n message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgEditValidator);\n if (object.description !== undefined && object.description !== null) {\n message.description = staking_1.Description.fromPartial(object.description);\n }\n else {\n message.description = undefined;\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.commissionRate !== undefined && object.commissionRate !== null) {\n message.commissionRate = object.commissionRate;\n }\n else {\n message.commissionRate = \"\";\n }\n if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) {\n message.minSelfDelegation = object.minSelfDelegation;\n }\n else {\n message.minSelfDelegation = \"\";\n }\n return message;\n },\n};\nconst baseMsgEditValidatorResponse = {};\nexports.MsgEditValidatorResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgEditValidatorResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgEditValidatorResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgEditValidatorResponse);\n return message;\n },\n};\nconst baseMsgDelegate = { delegatorAddress: \"\", validatorAddress: \"\" };\nexports.MsgDelegate = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(18).string(message.validatorAddress);\n }\n if (message.amount !== undefined) {\n coin_1.Coin.encode(message.amount, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgDelegate);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorAddress = reader.string();\n break;\n case 3:\n message.amount = coin_1.Coin.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgDelegate);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = coin_1.Coin.fromJSON(object.amount);\n }\n else {\n message.amount = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n message.amount !== undefined && (obj.amount = message.amount ? coin_1.Coin.toJSON(message.amount) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgDelegate);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = coin_1.Coin.fromPartial(object.amount);\n }\n else {\n message.amount = undefined;\n }\n return message;\n },\n};\nconst baseMsgDelegateResponse = {};\nexports.MsgDelegateResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgDelegateResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgDelegateResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgDelegateResponse);\n return message;\n },\n};\nconst baseMsgBeginRedelegate = {\n delegatorAddress: \"\",\n validatorSrcAddress: \"\",\n validatorDstAddress: \"\",\n};\nexports.MsgBeginRedelegate = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorSrcAddress !== \"\") {\n writer.uint32(18).string(message.validatorSrcAddress);\n }\n if (message.validatorDstAddress !== \"\") {\n writer.uint32(26).string(message.validatorDstAddress);\n }\n if (message.amount !== undefined) {\n coin_1.Coin.encode(message.amount, writer.uint32(34).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgBeginRedelegate);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorSrcAddress = reader.string();\n break;\n case 3:\n message.validatorDstAddress = reader.string();\n break;\n case 4:\n message.amount = coin_1.Coin.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgBeginRedelegate);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) {\n message.validatorSrcAddress = String(object.validatorSrcAddress);\n }\n else {\n message.validatorSrcAddress = \"\";\n }\n if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) {\n message.validatorDstAddress = String(object.validatorDstAddress);\n }\n else {\n message.validatorDstAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = coin_1.Coin.fromJSON(object.amount);\n }\n else {\n message.amount = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress);\n message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress);\n message.amount !== undefined && (obj.amount = message.amount ? coin_1.Coin.toJSON(message.amount) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgBeginRedelegate);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) {\n message.validatorSrcAddress = object.validatorSrcAddress;\n }\n else {\n message.validatorSrcAddress = \"\";\n }\n if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) {\n message.validatorDstAddress = object.validatorDstAddress;\n }\n else {\n message.validatorDstAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = coin_1.Coin.fromPartial(object.amount);\n }\n else {\n message.amount = undefined;\n }\n return message;\n },\n};\nconst baseMsgBeginRedelegateResponse = {};\nexports.MsgBeginRedelegateResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.completionTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgBeginRedelegateResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.completionTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgBeginRedelegateResponse);\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = fromJsonTimestamp(object.completionTime);\n }\n else {\n message.completionTime = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgBeginRedelegateResponse);\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = object.completionTime;\n }\n else {\n message.completionTime = undefined;\n }\n return message;\n },\n};\nconst baseMsgUndelegate = { delegatorAddress: \"\", validatorAddress: \"\" };\nexports.MsgUndelegate = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(18).string(message.validatorAddress);\n }\n if (message.amount !== undefined) {\n coin_1.Coin.encode(message.amount, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUndelegate);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorAddress = reader.string();\n break;\n case 3:\n message.amount = coin_1.Coin.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgUndelegate);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = coin_1.Coin.fromJSON(object.amount);\n }\n else {\n message.amount = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n message.amount !== undefined && (obj.amount = message.amount ? coin_1.Coin.toJSON(message.amount) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgUndelegate);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n message.amount = coin_1.Coin.fromPartial(object.amount);\n }\n else {\n message.amount = undefined;\n }\n return message;\n },\n};\nconst baseMsgUndelegateResponse = {};\nexports.MsgUndelegateResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.completionTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUndelegateResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.completionTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgUndelegateResponse);\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = fromJsonTimestamp(object.completionTime);\n }\n else {\n message.completionTime = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgUndelegateResponse);\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = object.completionTime;\n }\n else {\n message.completionTime = undefined;\n }\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.CreateValidator = this.CreateValidator.bind(this);\n this.EditValidator = this.EditValidator.bind(this);\n this.Delegate = this.Delegate.bind(this);\n this.BeginRedelegate = this.BeginRedelegate.bind(this);\n this.Undelegate = this.Undelegate.bind(this);\n }\n CreateValidator(request) {\n const data = exports.MsgCreateValidator.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.staking.v1beta1.Msg\", \"CreateValidator\", data);\n return promise.then((data) => exports.MsgCreateValidatorResponse.decode(new minimal_1.default.Reader(data)));\n }\n EditValidator(request) {\n const data = exports.MsgEditValidator.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.staking.v1beta1.Msg\", \"EditValidator\", data);\n return promise.then((data) => exports.MsgEditValidatorResponse.decode(new minimal_1.default.Reader(data)));\n }\n Delegate(request) {\n const data = exports.MsgDelegate.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.staking.v1beta1.Msg\", \"Delegate\", data);\n return promise.then((data) => exports.MsgDelegateResponse.decode(new minimal_1.default.Reader(data)));\n }\n BeginRedelegate(request) {\n const data = exports.MsgBeginRedelegate.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.staking.v1beta1.Msg\", \"BeginRedelegate\", data);\n return promise.then((data) => exports.MsgBeginRedelegateResponse.decode(new minimal_1.default.Reader(data)));\n }\n Undelegate(request) {\n const data = exports.MsgUndelegate.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.staking.v1beta1.Msg\", \"Undelegate\", data);\n return promise.then((data) => exports.MsgUndelegateResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nfunction toTimestamp(date) {\n const seconds = numberToLong(date.getTime() / 1000);\n const nanos = (date.getTime() % 1000) * 1000000;\n return { seconds, nanos };\n}\nfunction fromTimestamp(t) {\n let millis = t.seconds.toNumber() * 1000;\n millis += t.nanos / 1000000;\n return new Date(millis);\n}\nfunction fromJsonTimestamp(o) {\n if (o instanceof Date) {\n return o;\n }\n else if (typeof o === \"string\") {\n return new Date(o);\n }\n else {\n return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));\n }\n}\nfunction numberToLong(number) {\n return long_1.default.fromNumber(number);\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pool = exports.RedelegationResponse = exports.RedelegationEntryResponse = exports.DelegationResponse = exports.Params = exports.Redelegation = exports.RedelegationEntry = exports.UnbondingDelegationEntry = exports.UnbondingDelegation = exports.Delegation = exports.DVVTriplets = exports.DVVTriplet = exports.DVPairs = exports.DVPair = exports.ValAddresses = exports.Validator = exports.Description = exports.Commission = exports.CommissionRates = exports.HistoricalInfo = exports.bondStatusToJSON = exports.bondStatusFromJSON = exports.BondStatus = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst types_1 = require(\"../../../tendermint/types/types\");\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst duration_1 = require(\"../../../google/protobuf/duration\");\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nconst timestamp_1 = require(\"../../../google/protobuf/timestamp\");\nexports.protobufPackage = \"cosmos.staking.v1beta1\";\n/** BondStatus is the status of a validator. */\nvar BondStatus;\n(function (BondStatus) {\n /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */\n BondStatus[BondStatus[\"BOND_STATUS_UNSPECIFIED\"] = 0] = \"BOND_STATUS_UNSPECIFIED\";\n /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */\n BondStatus[BondStatus[\"BOND_STATUS_UNBONDED\"] = 1] = \"BOND_STATUS_UNBONDED\";\n /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */\n BondStatus[BondStatus[\"BOND_STATUS_UNBONDING\"] = 2] = \"BOND_STATUS_UNBONDING\";\n /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */\n BondStatus[BondStatus[\"BOND_STATUS_BONDED\"] = 3] = \"BOND_STATUS_BONDED\";\n BondStatus[BondStatus[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(BondStatus = exports.BondStatus || (exports.BondStatus = {}));\nfunction bondStatusFromJSON(object) {\n switch (object) {\n case 0:\n case \"BOND_STATUS_UNSPECIFIED\":\n return BondStatus.BOND_STATUS_UNSPECIFIED;\n case 1:\n case \"BOND_STATUS_UNBONDED\":\n return BondStatus.BOND_STATUS_UNBONDED;\n case 2:\n case \"BOND_STATUS_UNBONDING\":\n return BondStatus.BOND_STATUS_UNBONDING;\n case 3:\n case \"BOND_STATUS_BONDED\":\n return BondStatus.BOND_STATUS_BONDED;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return BondStatus.UNRECOGNIZED;\n }\n}\nexports.bondStatusFromJSON = bondStatusFromJSON;\nfunction bondStatusToJSON(object) {\n switch (object) {\n case BondStatus.BOND_STATUS_UNSPECIFIED:\n return \"BOND_STATUS_UNSPECIFIED\";\n case BondStatus.BOND_STATUS_UNBONDED:\n return \"BOND_STATUS_UNBONDED\";\n case BondStatus.BOND_STATUS_UNBONDING:\n return \"BOND_STATUS_UNBONDING\";\n case BondStatus.BOND_STATUS_BONDED:\n return \"BOND_STATUS_BONDED\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.bondStatusToJSON = bondStatusToJSON;\nconst baseHistoricalInfo = {};\nexports.HistoricalInfo = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.header !== undefined) {\n types_1.Header.encode(message.header, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.valset) {\n exports.Validator.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseHistoricalInfo);\n message.valset = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.header = types_1.Header.decode(reader, reader.uint32());\n break;\n case 2:\n message.valset.push(exports.Validator.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseHistoricalInfo);\n message.valset = [];\n if (object.header !== undefined && object.header !== null) {\n message.header = types_1.Header.fromJSON(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.valset !== undefined && object.valset !== null) {\n for (const e of object.valset) {\n message.valset.push(exports.Validator.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.header !== undefined && (obj.header = message.header ? types_1.Header.toJSON(message.header) : undefined);\n if (message.valset) {\n obj.valset = message.valset.map((e) => (e ? exports.Validator.toJSON(e) : undefined));\n }\n else {\n obj.valset = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseHistoricalInfo);\n message.valset = [];\n if (object.header !== undefined && object.header !== null) {\n message.header = types_1.Header.fromPartial(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.valset !== undefined && object.valset !== null) {\n for (const e of object.valset) {\n message.valset.push(exports.Validator.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseCommissionRates = { rate: \"\", maxRate: \"\", maxChangeRate: \"\" };\nexports.CommissionRates = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.rate !== \"\") {\n writer.uint32(10).string(message.rate);\n }\n if (message.maxRate !== \"\") {\n writer.uint32(18).string(message.maxRate);\n }\n if (message.maxChangeRate !== \"\") {\n writer.uint32(26).string(message.maxChangeRate);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCommissionRates);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.rate = reader.string();\n break;\n case 2:\n message.maxRate = reader.string();\n break;\n case 3:\n message.maxChangeRate = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCommissionRates);\n if (object.rate !== undefined && object.rate !== null) {\n message.rate = String(object.rate);\n }\n else {\n message.rate = \"\";\n }\n if (object.maxRate !== undefined && object.maxRate !== null) {\n message.maxRate = String(object.maxRate);\n }\n else {\n message.maxRate = \"\";\n }\n if (object.maxChangeRate !== undefined && object.maxChangeRate !== null) {\n message.maxChangeRate = String(object.maxChangeRate);\n }\n else {\n message.maxChangeRate = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.rate !== undefined && (obj.rate = message.rate);\n message.maxRate !== undefined && (obj.maxRate = message.maxRate);\n message.maxChangeRate !== undefined && (obj.maxChangeRate = message.maxChangeRate);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCommissionRates);\n if (object.rate !== undefined && object.rate !== null) {\n message.rate = object.rate;\n }\n else {\n message.rate = \"\";\n }\n if (object.maxRate !== undefined && object.maxRate !== null) {\n message.maxRate = object.maxRate;\n }\n else {\n message.maxRate = \"\";\n }\n if (object.maxChangeRate !== undefined && object.maxChangeRate !== null) {\n message.maxChangeRate = object.maxChangeRate;\n }\n else {\n message.maxChangeRate = \"\";\n }\n return message;\n },\n};\nconst baseCommission = {};\nexports.Commission = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.commissionRates !== undefined) {\n exports.CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim();\n }\n if (message.updateTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCommission);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.commissionRates = exports.CommissionRates.decode(reader, reader.uint32());\n break;\n case 2:\n message.updateTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCommission);\n if (object.commissionRates !== undefined && object.commissionRates !== null) {\n message.commissionRates = exports.CommissionRates.fromJSON(object.commissionRates);\n }\n else {\n message.commissionRates = undefined;\n }\n if (object.updateTime !== undefined && object.updateTime !== null) {\n message.updateTime = fromJsonTimestamp(object.updateTime);\n }\n else {\n message.updateTime = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.commissionRates !== undefined &&\n (obj.commissionRates = message.commissionRates\n ? exports.CommissionRates.toJSON(message.commissionRates)\n : undefined);\n message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCommission);\n if (object.commissionRates !== undefined && object.commissionRates !== null) {\n message.commissionRates = exports.CommissionRates.fromPartial(object.commissionRates);\n }\n else {\n message.commissionRates = undefined;\n }\n if (object.updateTime !== undefined && object.updateTime !== null) {\n message.updateTime = object.updateTime;\n }\n else {\n message.updateTime = undefined;\n }\n return message;\n },\n};\nconst baseDescription = { moniker: \"\", identity: \"\", website: \"\", securityContact: \"\", details: \"\" };\nexports.Description = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.moniker !== \"\") {\n writer.uint32(10).string(message.moniker);\n }\n if (message.identity !== \"\") {\n writer.uint32(18).string(message.identity);\n }\n if (message.website !== \"\") {\n writer.uint32(26).string(message.website);\n }\n if (message.securityContact !== \"\") {\n writer.uint32(34).string(message.securityContact);\n }\n if (message.details !== \"\") {\n writer.uint32(42).string(message.details);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDescription);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.moniker = reader.string();\n break;\n case 2:\n message.identity = reader.string();\n break;\n case 3:\n message.website = reader.string();\n break;\n case 4:\n message.securityContact = reader.string();\n break;\n case 5:\n message.details = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDescription);\n if (object.moniker !== undefined && object.moniker !== null) {\n message.moniker = String(object.moniker);\n }\n else {\n message.moniker = \"\";\n }\n if (object.identity !== undefined && object.identity !== null) {\n message.identity = String(object.identity);\n }\n else {\n message.identity = \"\";\n }\n if (object.website !== undefined && object.website !== null) {\n message.website = String(object.website);\n }\n else {\n message.website = \"\";\n }\n if (object.securityContact !== undefined && object.securityContact !== null) {\n message.securityContact = String(object.securityContact);\n }\n else {\n message.securityContact = \"\";\n }\n if (object.details !== undefined && object.details !== null) {\n message.details = String(object.details);\n }\n else {\n message.details = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.moniker !== undefined && (obj.moniker = message.moniker);\n message.identity !== undefined && (obj.identity = message.identity);\n message.website !== undefined && (obj.website = message.website);\n message.securityContact !== undefined && (obj.securityContact = message.securityContact);\n message.details !== undefined && (obj.details = message.details);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDescription);\n if (object.moniker !== undefined && object.moniker !== null) {\n message.moniker = object.moniker;\n }\n else {\n message.moniker = \"\";\n }\n if (object.identity !== undefined && object.identity !== null) {\n message.identity = object.identity;\n }\n else {\n message.identity = \"\";\n }\n if (object.website !== undefined && object.website !== null) {\n message.website = object.website;\n }\n else {\n message.website = \"\";\n }\n if (object.securityContact !== undefined && object.securityContact !== null) {\n message.securityContact = object.securityContact;\n }\n else {\n message.securityContact = \"\";\n }\n if (object.details !== undefined && object.details !== null) {\n message.details = object.details;\n }\n else {\n message.details = \"\";\n }\n return message;\n },\n};\nconst baseValidator = {\n operatorAddress: \"\",\n jailed: false,\n status: 0,\n tokens: \"\",\n delegatorShares: \"\",\n unbondingHeight: long_1.default.ZERO,\n minSelfDelegation: \"\",\n};\nexports.Validator = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.operatorAddress !== \"\") {\n writer.uint32(10).string(message.operatorAddress);\n }\n if (message.consensusPubkey !== undefined) {\n any_1.Any.encode(message.consensusPubkey, writer.uint32(18).fork()).ldelim();\n }\n if (message.jailed === true) {\n writer.uint32(24).bool(message.jailed);\n }\n if (message.status !== 0) {\n writer.uint32(32).int32(message.status);\n }\n if (message.tokens !== \"\") {\n writer.uint32(42).string(message.tokens);\n }\n if (message.delegatorShares !== \"\") {\n writer.uint32(50).string(message.delegatorShares);\n }\n if (message.description !== undefined) {\n exports.Description.encode(message.description, writer.uint32(58).fork()).ldelim();\n }\n if (!message.unbondingHeight.isZero()) {\n writer.uint32(64).int64(message.unbondingHeight);\n }\n if (message.unbondingTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim();\n }\n if (message.commission !== undefined) {\n exports.Commission.encode(message.commission, writer.uint32(82).fork()).ldelim();\n }\n if (message.minSelfDelegation !== \"\") {\n writer.uint32(90).string(message.minSelfDelegation);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseValidator);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.operatorAddress = reader.string();\n break;\n case 2:\n message.consensusPubkey = any_1.Any.decode(reader, reader.uint32());\n break;\n case 3:\n message.jailed = reader.bool();\n break;\n case 4:\n message.status = reader.int32();\n break;\n case 5:\n message.tokens = reader.string();\n break;\n case 6:\n message.delegatorShares = reader.string();\n break;\n case 7:\n message.description = exports.Description.decode(reader, reader.uint32());\n break;\n case 8:\n message.unbondingHeight = reader.int64();\n break;\n case 9:\n message.unbondingTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 10:\n message.commission = exports.Commission.decode(reader, reader.uint32());\n break;\n case 11:\n message.minSelfDelegation = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseValidator);\n if (object.operatorAddress !== undefined && object.operatorAddress !== null) {\n message.operatorAddress = String(object.operatorAddress);\n }\n else {\n message.operatorAddress = \"\";\n }\n if (object.consensusPubkey !== undefined && object.consensusPubkey !== null) {\n message.consensusPubkey = any_1.Any.fromJSON(object.consensusPubkey);\n }\n else {\n message.consensusPubkey = undefined;\n }\n if (object.jailed !== undefined && object.jailed !== null) {\n message.jailed = Boolean(object.jailed);\n }\n else {\n message.jailed = false;\n }\n if (object.status !== undefined && object.status !== null) {\n message.status = bondStatusFromJSON(object.status);\n }\n else {\n message.status = 0;\n }\n if (object.tokens !== undefined && object.tokens !== null) {\n message.tokens = String(object.tokens);\n }\n else {\n message.tokens = \"\";\n }\n if (object.delegatorShares !== undefined && object.delegatorShares !== null) {\n message.delegatorShares = String(object.delegatorShares);\n }\n else {\n message.delegatorShares = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = exports.Description.fromJSON(object.description);\n }\n else {\n message.description = undefined;\n }\n if (object.unbondingHeight !== undefined && object.unbondingHeight !== null) {\n message.unbondingHeight = long_1.default.fromString(object.unbondingHeight);\n }\n else {\n message.unbondingHeight = long_1.default.ZERO;\n }\n if (object.unbondingTime !== undefined && object.unbondingTime !== null) {\n message.unbondingTime = fromJsonTimestamp(object.unbondingTime);\n }\n else {\n message.unbondingTime = undefined;\n }\n if (object.commission !== undefined && object.commission !== null) {\n message.commission = exports.Commission.fromJSON(object.commission);\n }\n else {\n message.commission = undefined;\n }\n if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) {\n message.minSelfDelegation = String(object.minSelfDelegation);\n }\n else {\n message.minSelfDelegation = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress);\n message.consensusPubkey !== undefined &&\n (obj.consensusPubkey = message.consensusPubkey ? any_1.Any.toJSON(message.consensusPubkey) : undefined);\n message.jailed !== undefined && (obj.jailed = message.jailed);\n message.status !== undefined && (obj.status = bondStatusToJSON(message.status));\n message.tokens !== undefined && (obj.tokens = message.tokens);\n message.delegatorShares !== undefined && (obj.delegatorShares = message.delegatorShares);\n message.description !== undefined &&\n (obj.description = message.description ? exports.Description.toJSON(message.description) : undefined);\n message.unbondingHeight !== undefined &&\n (obj.unbondingHeight = (message.unbondingHeight || long_1.default.ZERO).toString());\n message.unbondingTime !== undefined && (obj.unbondingTime = message.unbondingTime.toISOString());\n message.commission !== undefined &&\n (obj.commission = message.commission ? exports.Commission.toJSON(message.commission) : undefined);\n message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseValidator);\n if (object.operatorAddress !== undefined && object.operatorAddress !== null) {\n message.operatorAddress = object.operatorAddress;\n }\n else {\n message.operatorAddress = \"\";\n }\n if (object.consensusPubkey !== undefined && object.consensusPubkey !== null) {\n message.consensusPubkey = any_1.Any.fromPartial(object.consensusPubkey);\n }\n else {\n message.consensusPubkey = undefined;\n }\n if (object.jailed !== undefined && object.jailed !== null) {\n message.jailed = object.jailed;\n }\n else {\n message.jailed = false;\n }\n if (object.status !== undefined && object.status !== null) {\n message.status = object.status;\n }\n else {\n message.status = 0;\n }\n if (object.tokens !== undefined && object.tokens !== null) {\n message.tokens = object.tokens;\n }\n else {\n message.tokens = \"\";\n }\n if (object.delegatorShares !== undefined && object.delegatorShares !== null) {\n message.delegatorShares = object.delegatorShares;\n }\n else {\n message.delegatorShares = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = exports.Description.fromPartial(object.description);\n }\n else {\n message.description = undefined;\n }\n if (object.unbondingHeight !== undefined && object.unbondingHeight !== null) {\n message.unbondingHeight = object.unbondingHeight;\n }\n else {\n message.unbondingHeight = long_1.default.ZERO;\n }\n if (object.unbondingTime !== undefined && object.unbondingTime !== null) {\n message.unbondingTime = object.unbondingTime;\n }\n else {\n message.unbondingTime = undefined;\n }\n if (object.commission !== undefined && object.commission !== null) {\n message.commission = exports.Commission.fromPartial(object.commission);\n }\n else {\n message.commission = undefined;\n }\n if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) {\n message.minSelfDelegation = object.minSelfDelegation;\n }\n else {\n message.minSelfDelegation = \"\";\n }\n return message;\n },\n};\nconst baseValAddresses = { addresses: \"\" };\nexports.ValAddresses = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.addresses) {\n writer.uint32(10).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseValAddresses);\n message.addresses = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.addresses.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseValAddresses);\n message.addresses = [];\n if (object.addresses !== undefined && object.addresses !== null) {\n for (const e of object.addresses) {\n message.addresses.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.addresses) {\n obj.addresses = message.addresses.map((e) => e);\n }\n else {\n obj.addresses = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseValAddresses);\n message.addresses = [];\n if (object.addresses !== undefined && object.addresses !== null) {\n for (const e of object.addresses) {\n message.addresses.push(e);\n }\n }\n return message;\n },\n};\nconst baseDVPair = { delegatorAddress: \"\", validatorAddress: \"\" };\nexports.DVPair = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(18).string(message.validatorAddress);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDVPair);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorAddress = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDVPair);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDVPair);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n return message;\n },\n};\nconst baseDVPairs = {};\nexports.DVPairs = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.pairs) {\n exports.DVPair.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDVPairs);\n message.pairs = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.pairs.push(exports.DVPair.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDVPairs);\n message.pairs = [];\n if (object.pairs !== undefined && object.pairs !== null) {\n for (const e of object.pairs) {\n message.pairs.push(exports.DVPair.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.pairs) {\n obj.pairs = message.pairs.map((e) => (e ? exports.DVPair.toJSON(e) : undefined));\n }\n else {\n obj.pairs = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDVPairs);\n message.pairs = [];\n if (object.pairs !== undefined && object.pairs !== null) {\n for (const e of object.pairs) {\n message.pairs.push(exports.DVPair.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseDVVTriplet = { delegatorAddress: \"\", validatorSrcAddress: \"\", validatorDstAddress: \"\" };\nexports.DVVTriplet = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorSrcAddress !== \"\") {\n writer.uint32(18).string(message.validatorSrcAddress);\n }\n if (message.validatorDstAddress !== \"\") {\n writer.uint32(26).string(message.validatorDstAddress);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDVVTriplet);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorSrcAddress = reader.string();\n break;\n case 3:\n message.validatorDstAddress = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDVVTriplet);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) {\n message.validatorSrcAddress = String(object.validatorSrcAddress);\n }\n else {\n message.validatorSrcAddress = \"\";\n }\n if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) {\n message.validatorDstAddress = String(object.validatorDstAddress);\n }\n else {\n message.validatorDstAddress = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress);\n message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDVVTriplet);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) {\n message.validatorSrcAddress = object.validatorSrcAddress;\n }\n else {\n message.validatorSrcAddress = \"\";\n }\n if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) {\n message.validatorDstAddress = object.validatorDstAddress;\n }\n else {\n message.validatorDstAddress = \"\";\n }\n return message;\n },\n};\nconst baseDVVTriplets = {};\nexports.DVVTriplets = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.triplets) {\n exports.DVVTriplet.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDVVTriplets);\n message.triplets = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.triplets.push(exports.DVVTriplet.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDVVTriplets);\n message.triplets = [];\n if (object.triplets !== undefined && object.triplets !== null) {\n for (const e of object.triplets) {\n message.triplets.push(exports.DVVTriplet.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.triplets) {\n obj.triplets = message.triplets.map((e) => (e ? exports.DVVTriplet.toJSON(e) : undefined));\n }\n else {\n obj.triplets = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDVVTriplets);\n message.triplets = [];\n if (object.triplets !== undefined && object.triplets !== null) {\n for (const e of object.triplets) {\n message.triplets.push(exports.DVVTriplet.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseDelegation = { delegatorAddress: \"\", validatorAddress: \"\", shares: \"\" };\nexports.Delegation = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(18).string(message.validatorAddress);\n }\n if (message.shares !== \"\") {\n writer.uint32(26).string(message.shares);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDelegation);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorAddress = reader.string();\n break;\n case 3:\n message.shares = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDelegation);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.shares !== undefined && object.shares !== null) {\n message.shares = String(object.shares);\n }\n else {\n message.shares = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n message.shares !== undefined && (obj.shares = message.shares);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDelegation);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.shares !== undefined && object.shares !== null) {\n message.shares = object.shares;\n }\n else {\n message.shares = \"\";\n }\n return message;\n },\n};\nconst baseUnbondingDelegation = { delegatorAddress: \"\", validatorAddress: \"\" };\nexports.UnbondingDelegation = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(18).string(message.validatorAddress);\n }\n for (const v of message.entries) {\n exports.UnbondingDelegationEntry.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseUnbondingDelegation);\n message.entries = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorAddress = reader.string();\n break;\n case 3:\n message.entries.push(exports.UnbondingDelegationEntry.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseUnbondingDelegation);\n message.entries = [];\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.entries !== undefined && object.entries !== null) {\n for (const e of object.entries) {\n message.entries.push(exports.UnbondingDelegationEntry.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n if (message.entries) {\n obj.entries = message.entries.map((e) => (e ? exports.UnbondingDelegationEntry.toJSON(e) : undefined));\n }\n else {\n obj.entries = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseUnbondingDelegation);\n message.entries = [];\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n if (object.entries !== undefined && object.entries !== null) {\n for (const e of object.entries) {\n message.entries.push(exports.UnbondingDelegationEntry.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseUnbondingDelegationEntry = { creationHeight: long_1.default.ZERO, initialBalance: \"\", balance: \"\" };\nexports.UnbondingDelegationEntry = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.creationHeight.isZero()) {\n writer.uint32(8).int64(message.creationHeight);\n }\n if (message.completionTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim();\n }\n if (message.initialBalance !== \"\") {\n writer.uint32(26).string(message.initialBalance);\n }\n if (message.balance !== \"\") {\n writer.uint32(34).string(message.balance);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseUnbondingDelegationEntry);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.creationHeight = reader.int64();\n break;\n case 2:\n message.completionTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 3:\n message.initialBalance = reader.string();\n break;\n case 4:\n message.balance = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseUnbondingDelegationEntry);\n if (object.creationHeight !== undefined && object.creationHeight !== null) {\n message.creationHeight = long_1.default.fromString(object.creationHeight);\n }\n else {\n message.creationHeight = long_1.default.ZERO;\n }\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = fromJsonTimestamp(object.completionTime);\n }\n else {\n message.completionTime = undefined;\n }\n if (object.initialBalance !== undefined && object.initialBalance !== null) {\n message.initialBalance = String(object.initialBalance);\n }\n else {\n message.initialBalance = \"\";\n }\n if (object.balance !== undefined && object.balance !== null) {\n message.balance = String(object.balance);\n }\n else {\n message.balance = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.creationHeight !== undefined &&\n (obj.creationHeight = (message.creationHeight || long_1.default.ZERO).toString());\n message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString());\n message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance);\n message.balance !== undefined && (obj.balance = message.balance);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseUnbondingDelegationEntry);\n if (object.creationHeight !== undefined && object.creationHeight !== null) {\n message.creationHeight = object.creationHeight;\n }\n else {\n message.creationHeight = long_1.default.ZERO;\n }\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = object.completionTime;\n }\n else {\n message.completionTime = undefined;\n }\n if (object.initialBalance !== undefined && object.initialBalance !== null) {\n message.initialBalance = object.initialBalance;\n }\n else {\n message.initialBalance = \"\";\n }\n if (object.balance !== undefined && object.balance !== null) {\n message.balance = object.balance;\n }\n else {\n message.balance = \"\";\n }\n return message;\n },\n};\nconst baseRedelegationEntry = { creationHeight: long_1.default.ZERO, initialBalance: \"\", sharesDst: \"\" };\nexports.RedelegationEntry = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.creationHeight.isZero()) {\n writer.uint32(8).int64(message.creationHeight);\n }\n if (message.completionTime !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim();\n }\n if (message.initialBalance !== \"\") {\n writer.uint32(26).string(message.initialBalance);\n }\n if (message.sharesDst !== \"\") {\n writer.uint32(34).string(message.sharesDst);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseRedelegationEntry);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.creationHeight = reader.int64();\n break;\n case 2:\n message.completionTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 3:\n message.initialBalance = reader.string();\n break;\n case 4:\n message.sharesDst = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseRedelegationEntry);\n if (object.creationHeight !== undefined && object.creationHeight !== null) {\n message.creationHeight = long_1.default.fromString(object.creationHeight);\n }\n else {\n message.creationHeight = long_1.default.ZERO;\n }\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = fromJsonTimestamp(object.completionTime);\n }\n else {\n message.completionTime = undefined;\n }\n if (object.initialBalance !== undefined && object.initialBalance !== null) {\n message.initialBalance = String(object.initialBalance);\n }\n else {\n message.initialBalance = \"\";\n }\n if (object.sharesDst !== undefined && object.sharesDst !== null) {\n message.sharesDst = String(object.sharesDst);\n }\n else {\n message.sharesDst = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.creationHeight !== undefined &&\n (obj.creationHeight = (message.creationHeight || long_1.default.ZERO).toString());\n message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString());\n message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance);\n message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseRedelegationEntry);\n if (object.creationHeight !== undefined && object.creationHeight !== null) {\n message.creationHeight = object.creationHeight;\n }\n else {\n message.creationHeight = long_1.default.ZERO;\n }\n if (object.completionTime !== undefined && object.completionTime !== null) {\n message.completionTime = object.completionTime;\n }\n else {\n message.completionTime = undefined;\n }\n if (object.initialBalance !== undefined && object.initialBalance !== null) {\n message.initialBalance = object.initialBalance;\n }\n else {\n message.initialBalance = \"\";\n }\n if (object.sharesDst !== undefined && object.sharesDst !== null) {\n message.sharesDst = object.sharesDst;\n }\n else {\n message.sharesDst = \"\";\n }\n return message;\n },\n};\nconst baseRedelegation = { delegatorAddress: \"\", validatorSrcAddress: \"\", validatorDstAddress: \"\" };\nexports.Redelegation = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorSrcAddress !== \"\") {\n writer.uint32(18).string(message.validatorSrcAddress);\n }\n if (message.validatorDstAddress !== \"\") {\n writer.uint32(26).string(message.validatorDstAddress);\n }\n for (const v of message.entries) {\n exports.RedelegationEntry.encode(v, writer.uint32(34).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseRedelegation);\n message.entries = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorSrcAddress = reader.string();\n break;\n case 3:\n message.validatorDstAddress = reader.string();\n break;\n case 4:\n message.entries.push(exports.RedelegationEntry.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseRedelegation);\n message.entries = [];\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) {\n message.validatorSrcAddress = String(object.validatorSrcAddress);\n }\n else {\n message.validatorSrcAddress = \"\";\n }\n if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) {\n message.validatorDstAddress = String(object.validatorDstAddress);\n }\n else {\n message.validatorDstAddress = \"\";\n }\n if (object.entries !== undefined && object.entries !== null) {\n for (const e of object.entries) {\n message.entries.push(exports.RedelegationEntry.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress);\n message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress);\n if (message.entries) {\n obj.entries = message.entries.map((e) => (e ? exports.RedelegationEntry.toJSON(e) : undefined));\n }\n else {\n obj.entries = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseRedelegation);\n message.entries = [];\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) {\n message.validatorSrcAddress = object.validatorSrcAddress;\n }\n else {\n message.validatorSrcAddress = \"\";\n }\n if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) {\n message.validatorDstAddress = object.validatorDstAddress;\n }\n else {\n message.validatorDstAddress = \"\";\n }\n if (object.entries !== undefined && object.entries !== null) {\n for (const e of object.entries) {\n message.entries.push(exports.RedelegationEntry.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseParams = { maxValidators: 0, maxEntries: 0, historicalEntries: 0, bondDenom: \"\" };\nexports.Params = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.unbondingTime !== undefined) {\n duration_1.Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim();\n }\n if (message.maxValidators !== 0) {\n writer.uint32(16).uint32(message.maxValidators);\n }\n if (message.maxEntries !== 0) {\n writer.uint32(24).uint32(message.maxEntries);\n }\n if (message.historicalEntries !== 0) {\n writer.uint32(32).uint32(message.historicalEntries);\n }\n if (message.bondDenom !== \"\") {\n writer.uint32(42).string(message.bondDenom);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParams);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.unbondingTime = duration_1.Duration.decode(reader, reader.uint32());\n break;\n case 2:\n message.maxValidators = reader.uint32();\n break;\n case 3:\n message.maxEntries = reader.uint32();\n break;\n case 4:\n message.historicalEntries = reader.uint32();\n break;\n case 5:\n message.bondDenom = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParams);\n if (object.unbondingTime !== undefined && object.unbondingTime !== null) {\n message.unbondingTime = duration_1.Duration.fromJSON(object.unbondingTime);\n }\n else {\n message.unbondingTime = undefined;\n }\n if (object.maxValidators !== undefined && object.maxValidators !== null) {\n message.maxValidators = Number(object.maxValidators);\n }\n else {\n message.maxValidators = 0;\n }\n if (object.maxEntries !== undefined && object.maxEntries !== null) {\n message.maxEntries = Number(object.maxEntries);\n }\n else {\n message.maxEntries = 0;\n }\n if (object.historicalEntries !== undefined && object.historicalEntries !== null) {\n message.historicalEntries = Number(object.historicalEntries);\n }\n else {\n message.historicalEntries = 0;\n }\n if (object.bondDenom !== undefined && object.bondDenom !== null) {\n message.bondDenom = String(object.bondDenom);\n }\n else {\n message.bondDenom = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.unbondingTime !== undefined &&\n (obj.unbondingTime = message.unbondingTime ? duration_1.Duration.toJSON(message.unbondingTime) : undefined);\n message.maxValidators !== undefined && (obj.maxValidators = message.maxValidators);\n message.maxEntries !== undefined && (obj.maxEntries = message.maxEntries);\n message.historicalEntries !== undefined && (obj.historicalEntries = message.historicalEntries);\n message.bondDenom !== undefined && (obj.bondDenom = message.bondDenom);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParams);\n if (object.unbondingTime !== undefined && object.unbondingTime !== null) {\n message.unbondingTime = duration_1.Duration.fromPartial(object.unbondingTime);\n }\n else {\n message.unbondingTime = undefined;\n }\n if (object.maxValidators !== undefined && object.maxValidators !== null) {\n message.maxValidators = object.maxValidators;\n }\n else {\n message.maxValidators = 0;\n }\n if (object.maxEntries !== undefined && object.maxEntries !== null) {\n message.maxEntries = object.maxEntries;\n }\n else {\n message.maxEntries = 0;\n }\n if (object.historicalEntries !== undefined && object.historicalEntries !== null) {\n message.historicalEntries = object.historicalEntries;\n }\n else {\n message.historicalEntries = 0;\n }\n if (object.bondDenom !== undefined && object.bondDenom !== null) {\n message.bondDenom = object.bondDenom;\n }\n else {\n message.bondDenom = \"\";\n }\n return message;\n },\n};\nconst baseDelegationResponse = {};\nexports.DelegationResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegation !== undefined) {\n exports.Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim();\n }\n if (message.balance !== undefined) {\n coin_1.Coin.encode(message.balance, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDelegationResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegation = exports.Delegation.decode(reader, reader.uint32());\n break;\n case 2:\n message.balance = coin_1.Coin.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDelegationResponse);\n if (object.delegation !== undefined && object.delegation !== null) {\n message.delegation = exports.Delegation.fromJSON(object.delegation);\n }\n else {\n message.delegation = undefined;\n }\n if (object.balance !== undefined && object.balance !== null) {\n message.balance = coin_1.Coin.fromJSON(object.balance);\n }\n else {\n message.balance = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegation !== undefined &&\n (obj.delegation = message.delegation ? exports.Delegation.toJSON(message.delegation) : undefined);\n message.balance !== undefined &&\n (obj.balance = message.balance ? coin_1.Coin.toJSON(message.balance) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDelegationResponse);\n if (object.delegation !== undefined && object.delegation !== null) {\n message.delegation = exports.Delegation.fromPartial(object.delegation);\n }\n else {\n message.delegation = undefined;\n }\n if (object.balance !== undefined && object.balance !== null) {\n message.balance = coin_1.Coin.fromPartial(object.balance);\n }\n else {\n message.balance = undefined;\n }\n return message;\n },\n};\nconst baseRedelegationEntryResponse = { balance: \"\" };\nexports.RedelegationEntryResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.redelegationEntry !== undefined) {\n exports.RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim();\n }\n if (message.balance !== \"\") {\n writer.uint32(34).string(message.balance);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseRedelegationEntryResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.redelegationEntry = exports.RedelegationEntry.decode(reader, reader.uint32());\n break;\n case 4:\n message.balance = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseRedelegationEntryResponse);\n if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) {\n message.redelegationEntry = exports.RedelegationEntry.fromJSON(object.redelegationEntry);\n }\n else {\n message.redelegationEntry = undefined;\n }\n if (object.balance !== undefined && object.balance !== null) {\n message.balance = String(object.balance);\n }\n else {\n message.balance = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.redelegationEntry !== undefined &&\n (obj.redelegationEntry = message.redelegationEntry\n ? exports.RedelegationEntry.toJSON(message.redelegationEntry)\n : undefined);\n message.balance !== undefined && (obj.balance = message.balance);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseRedelegationEntryResponse);\n if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) {\n message.redelegationEntry = exports.RedelegationEntry.fromPartial(object.redelegationEntry);\n }\n else {\n message.redelegationEntry = undefined;\n }\n if (object.balance !== undefined && object.balance !== null) {\n message.balance = object.balance;\n }\n else {\n message.balance = \"\";\n }\n return message;\n },\n};\nconst baseRedelegationResponse = {};\nexports.RedelegationResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.redelegation !== undefined) {\n exports.Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.entries) {\n exports.RedelegationEntryResponse.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseRedelegationResponse);\n message.entries = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.redelegation = exports.Redelegation.decode(reader, reader.uint32());\n break;\n case 2:\n message.entries.push(exports.RedelegationEntryResponse.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseRedelegationResponse);\n message.entries = [];\n if (object.redelegation !== undefined && object.redelegation !== null) {\n message.redelegation = exports.Redelegation.fromJSON(object.redelegation);\n }\n else {\n message.redelegation = undefined;\n }\n if (object.entries !== undefined && object.entries !== null) {\n for (const e of object.entries) {\n message.entries.push(exports.RedelegationEntryResponse.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.redelegation !== undefined &&\n (obj.redelegation = message.redelegation ? exports.Redelegation.toJSON(message.redelegation) : undefined);\n if (message.entries) {\n obj.entries = message.entries.map((e) => (e ? exports.RedelegationEntryResponse.toJSON(e) : undefined));\n }\n else {\n obj.entries = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseRedelegationResponse);\n message.entries = [];\n if (object.redelegation !== undefined && object.redelegation !== null) {\n message.redelegation = exports.Redelegation.fromPartial(object.redelegation);\n }\n else {\n message.redelegation = undefined;\n }\n if (object.entries !== undefined && object.entries !== null) {\n for (const e of object.entries) {\n message.entries.push(exports.RedelegationEntryResponse.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst basePool = { notBondedTokens: \"\", bondedTokens: \"\" };\nexports.Pool = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.notBondedTokens !== \"\") {\n writer.uint32(10).string(message.notBondedTokens);\n }\n if (message.bondedTokens !== \"\") {\n writer.uint32(18).string(message.bondedTokens);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePool);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.notBondedTokens = reader.string();\n break;\n case 2:\n message.bondedTokens = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePool);\n if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) {\n message.notBondedTokens = String(object.notBondedTokens);\n }\n else {\n message.notBondedTokens = \"\";\n }\n if (object.bondedTokens !== undefined && object.bondedTokens !== null) {\n message.bondedTokens = String(object.bondedTokens);\n }\n else {\n message.bondedTokens = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.notBondedTokens !== undefined && (obj.notBondedTokens = message.notBondedTokens);\n message.bondedTokens !== undefined && (obj.bondedTokens = message.bondedTokens);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePool);\n if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) {\n message.notBondedTokens = object.notBondedTokens;\n }\n else {\n message.notBondedTokens = \"\";\n }\n if (object.bondedTokens !== undefined && object.bondedTokens !== null) {\n message.bondedTokens = object.bondedTokens;\n }\n else {\n message.bondedTokens = \"\";\n }\n return message;\n },\n};\nfunction toTimestamp(date) {\n const seconds = numberToLong(date.getTime() / 1000);\n const nanos = (date.getTime() % 1000) * 1000000;\n return { seconds, nanos };\n}\nfunction fromTimestamp(t) {\n let millis = t.seconds.toNumber() * 1000;\n millis += t.nanos / 1000000;\n return new Date(millis);\n}\nfunction fromJsonTimestamp(o) {\n if (o instanceof Date) {\n return o;\n }\n else if (typeof o === \"string\") {\n return new Date(o);\n }\n else {\n return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));\n }\n}\nfunction numberToLong(number) {\n return long_1.default.fromNumber(number);\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=staking.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SignatureDescriptor_Data_Multi = exports.SignatureDescriptor_Data_Single = exports.SignatureDescriptor_Data = exports.SignatureDescriptor = exports.SignatureDescriptors = exports.signModeToJSON = exports.signModeFromJSON = exports.SignMode = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../../google/protobuf/any\");\nconst multisig_1 = require(\"../../../../cosmos/crypto/multisig/v1beta1/multisig\");\nexports.protobufPackage = \"cosmos.tx.signing.v1beta1\";\n/** SignMode represents a signing mode with its own security guarantees. */\nvar SignMode;\n(function (SignMode) {\n /**\n * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be\n * rejected\n */\n SignMode[SignMode[\"SIGN_MODE_UNSPECIFIED\"] = 0] = \"SIGN_MODE_UNSPECIFIED\";\n /**\n * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is\n * verified with raw bytes from Tx\n */\n SignMode[SignMode[\"SIGN_MODE_DIRECT\"] = 1] = \"SIGN_MODE_DIRECT\";\n /**\n * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some\n * human-readable textual representation on top of the binary representation\n * from SIGN_MODE_DIRECT\n */\n SignMode[SignMode[\"SIGN_MODE_TEXTUAL\"] = 2] = \"SIGN_MODE_TEXTUAL\";\n /**\n * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses\n * Amino JSON and will be removed in the future\n */\n SignMode[SignMode[\"SIGN_MODE_LEGACY_AMINO_JSON\"] = 127] = \"SIGN_MODE_LEGACY_AMINO_JSON\";\n SignMode[SignMode[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(SignMode = exports.SignMode || (exports.SignMode = {}));\nfunction signModeFromJSON(object) {\n switch (object) {\n case 0:\n case \"SIGN_MODE_UNSPECIFIED\":\n return SignMode.SIGN_MODE_UNSPECIFIED;\n case 1:\n case \"SIGN_MODE_DIRECT\":\n return SignMode.SIGN_MODE_DIRECT;\n case 2:\n case \"SIGN_MODE_TEXTUAL\":\n return SignMode.SIGN_MODE_TEXTUAL;\n case 127:\n case \"SIGN_MODE_LEGACY_AMINO_JSON\":\n return SignMode.SIGN_MODE_LEGACY_AMINO_JSON;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return SignMode.UNRECOGNIZED;\n }\n}\nexports.signModeFromJSON = signModeFromJSON;\nfunction signModeToJSON(object) {\n switch (object) {\n case SignMode.SIGN_MODE_UNSPECIFIED:\n return \"SIGN_MODE_UNSPECIFIED\";\n case SignMode.SIGN_MODE_DIRECT:\n return \"SIGN_MODE_DIRECT\";\n case SignMode.SIGN_MODE_TEXTUAL:\n return \"SIGN_MODE_TEXTUAL\";\n case SignMode.SIGN_MODE_LEGACY_AMINO_JSON:\n return \"SIGN_MODE_LEGACY_AMINO_JSON\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.signModeToJSON = signModeToJSON;\nconst baseSignatureDescriptors = {};\nexports.SignatureDescriptors = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.signatures) {\n exports.SignatureDescriptor.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignatureDescriptors);\n message.signatures = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.signatures.push(exports.SignatureDescriptor.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignatureDescriptors);\n message.signatures = [];\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(exports.SignatureDescriptor.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.signatures) {\n obj.signatures = message.signatures.map((e) => (e ? exports.SignatureDescriptor.toJSON(e) : undefined));\n }\n else {\n obj.signatures = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignatureDescriptors);\n message.signatures = [];\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(exports.SignatureDescriptor.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseSignatureDescriptor = { sequence: long_1.default.UZERO };\nexports.SignatureDescriptor = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.publicKey !== undefined) {\n any_1.Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim();\n }\n if (message.data !== undefined) {\n exports.SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim();\n }\n if (!message.sequence.isZero()) {\n writer.uint32(24).uint64(message.sequence);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignatureDescriptor);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.publicKey = any_1.Any.decode(reader, reader.uint32());\n break;\n case 2:\n message.data = exports.SignatureDescriptor_Data.decode(reader, reader.uint32());\n break;\n case 3:\n message.sequence = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignatureDescriptor);\n if (object.publicKey !== undefined && object.publicKey !== null) {\n message.publicKey = any_1.Any.fromJSON(object.publicKey);\n }\n else {\n message.publicKey = undefined;\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = exports.SignatureDescriptor_Data.fromJSON(object.data);\n }\n else {\n message.data = undefined;\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = long_1.default.fromString(object.sequence);\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.publicKey !== undefined &&\n (obj.publicKey = message.publicKey ? any_1.Any.toJSON(message.publicKey) : undefined);\n message.data !== undefined &&\n (obj.data = message.data ? exports.SignatureDescriptor_Data.toJSON(message.data) : undefined);\n message.sequence !== undefined && (obj.sequence = (message.sequence || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignatureDescriptor);\n if (object.publicKey !== undefined && object.publicKey !== null) {\n message.publicKey = any_1.Any.fromPartial(object.publicKey);\n }\n else {\n message.publicKey = undefined;\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = exports.SignatureDescriptor_Data.fromPartial(object.data);\n }\n else {\n message.data = undefined;\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = object.sequence;\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseSignatureDescriptor_Data = {};\nexports.SignatureDescriptor_Data = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.single !== undefined) {\n exports.SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim();\n }\n if (message.multi !== undefined) {\n exports.SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignatureDescriptor_Data);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.single = exports.SignatureDescriptor_Data_Single.decode(reader, reader.uint32());\n break;\n case 2:\n message.multi = exports.SignatureDescriptor_Data_Multi.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignatureDescriptor_Data);\n if (object.single !== undefined && object.single !== null) {\n message.single = exports.SignatureDescriptor_Data_Single.fromJSON(object.single);\n }\n else {\n message.single = undefined;\n }\n if (object.multi !== undefined && object.multi !== null) {\n message.multi = exports.SignatureDescriptor_Data_Multi.fromJSON(object.multi);\n }\n else {\n message.multi = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.single !== undefined &&\n (obj.single = message.single ? exports.SignatureDescriptor_Data_Single.toJSON(message.single) : undefined);\n message.multi !== undefined &&\n (obj.multi = message.multi ? exports.SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignatureDescriptor_Data);\n if (object.single !== undefined && object.single !== null) {\n message.single = exports.SignatureDescriptor_Data_Single.fromPartial(object.single);\n }\n else {\n message.single = undefined;\n }\n if (object.multi !== undefined && object.multi !== null) {\n message.multi = exports.SignatureDescriptor_Data_Multi.fromPartial(object.multi);\n }\n else {\n message.multi = undefined;\n }\n return message;\n },\n};\nconst baseSignatureDescriptor_Data_Single = { mode: 0 };\nexports.SignatureDescriptor_Data_Single = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.mode !== 0) {\n writer.uint32(8).int32(message.mode);\n }\n if (message.signature.length !== 0) {\n writer.uint32(18).bytes(message.signature);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignatureDescriptor_Data_Single);\n message.signature = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.mode = reader.int32();\n break;\n case 2:\n message.signature = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignatureDescriptor_Data_Single);\n message.signature = new Uint8Array();\n if (object.mode !== undefined && object.mode !== null) {\n message.mode = signModeFromJSON(object.mode);\n }\n else {\n message.mode = 0;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = bytesFromBase64(object.signature);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));\n message.signature !== undefined &&\n (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignatureDescriptor_Data_Single);\n if (object.mode !== undefined && object.mode !== null) {\n message.mode = object.mode;\n }\n else {\n message.mode = 0;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = object.signature;\n }\n else {\n message.signature = new Uint8Array();\n }\n return message;\n },\n};\nconst baseSignatureDescriptor_Data_Multi = {};\nexports.SignatureDescriptor_Data_Multi = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.bitarray !== undefined) {\n multisig_1.CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.signatures) {\n exports.SignatureDescriptor_Data.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignatureDescriptor_Data_Multi);\n message.signatures = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.bitarray = multisig_1.CompactBitArray.decode(reader, reader.uint32());\n break;\n case 2:\n message.signatures.push(exports.SignatureDescriptor_Data.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignatureDescriptor_Data_Multi);\n message.signatures = [];\n if (object.bitarray !== undefined && object.bitarray !== null) {\n message.bitarray = multisig_1.CompactBitArray.fromJSON(object.bitarray);\n }\n else {\n message.bitarray = undefined;\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(exports.SignatureDescriptor_Data.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.bitarray !== undefined &&\n (obj.bitarray = message.bitarray ? multisig_1.CompactBitArray.toJSON(message.bitarray) : undefined);\n if (message.signatures) {\n obj.signatures = message.signatures.map((e) => (e ? exports.SignatureDescriptor_Data.toJSON(e) : undefined));\n }\n else {\n obj.signatures = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignatureDescriptor_Data_Multi);\n message.signatures = [];\n if (object.bitarray !== undefined && object.bitarray !== null) {\n message.bitarray = multisig_1.CompactBitArray.fromPartial(object.bitarray);\n }\n else {\n message.bitarray = undefined;\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(exports.SignatureDescriptor_Data.fromPartial(e));\n }\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=signing.js.map","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('buffer').Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","\"use strict\";\nimport { getAddress, getContractAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { hexDataLength, hexDataSlice, hexValue, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { AddressZero } from \"@ethersproject/constants\";\nimport { shallowCopy } from \"@ethersproject/properties\";\nimport { accessListify, parse as parseTransaction } from \"@ethersproject/transactions\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport class Formatter {\n constructor() {\n logger.checkNew(new.target, Formatter);\n this.formats = this.getDefaultFormats();\n }\n getDefaultFormats() {\n const formats = ({});\n const address = this.address.bind(this);\n const bigNumber = this.bigNumber.bind(this);\n const blockTag = this.blockTag.bind(this);\n const data = this.data.bind(this);\n const hash = this.hash.bind(this);\n const hex = this.hex.bind(this);\n const number = this.number.bind(this);\n const type = this.type.bind(this);\n const strictData = (v) => { return this.data(v, true); };\n formats.transaction = {\n hash: hash,\n type: type,\n accessList: Formatter.allowNull(this.accessList.bind(this), null),\n blockHash: Formatter.allowNull(hash, null),\n blockNumber: Formatter.allowNull(number, null),\n transactionIndex: Formatter.allowNull(number, null),\n confirmations: Formatter.allowNull(number, null),\n from: address,\n // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas)\n // must be set\n gasPrice: Formatter.allowNull(bigNumber),\n maxPriorityFeePerGas: Formatter.allowNull(bigNumber),\n maxFeePerGas: Formatter.allowNull(bigNumber),\n gasLimit: bigNumber,\n to: Formatter.allowNull(address, null),\n value: bigNumber,\n nonce: number,\n data: data,\n r: Formatter.allowNull(this.uint256),\n s: Formatter.allowNull(this.uint256),\n v: Formatter.allowNull(number),\n creates: Formatter.allowNull(address, null),\n raw: Formatter.allowNull(data),\n };\n formats.transactionRequest = {\n from: Formatter.allowNull(address),\n nonce: Formatter.allowNull(number),\n gasLimit: Formatter.allowNull(bigNumber),\n gasPrice: Formatter.allowNull(bigNumber),\n maxPriorityFeePerGas: Formatter.allowNull(bigNumber),\n maxFeePerGas: Formatter.allowNull(bigNumber),\n to: Formatter.allowNull(address),\n value: Formatter.allowNull(bigNumber),\n data: Formatter.allowNull(strictData),\n type: Formatter.allowNull(number),\n accessList: Formatter.allowNull(this.accessList.bind(this), null),\n };\n formats.receiptLog = {\n transactionIndex: number,\n blockNumber: number,\n transactionHash: hash,\n address: address,\n topics: Formatter.arrayOf(hash),\n data: data,\n logIndex: number,\n blockHash: hash,\n };\n formats.receipt = {\n to: Formatter.allowNull(this.address, null),\n from: Formatter.allowNull(this.address, null),\n contractAddress: Formatter.allowNull(address, null),\n transactionIndex: number,\n // should be allowNull(hash), but broken-EIP-658 support is handled in receipt\n root: Formatter.allowNull(hex),\n gasUsed: bigNumber,\n logsBloom: Formatter.allowNull(data),\n blockHash: hash,\n transactionHash: hash,\n logs: Formatter.arrayOf(this.receiptLog.bind(this)),\n blockNumber: number,\n confirmations: Formatter.allowNull(number, null),\n cumulativeGasUsed: bigNumber,\n effectiveGasPrice: Formatter.allowNull(bigNumber),\n status: Formatter.allowNull(number),\n type: type\n };\n formats.block = {\n hash: hash,\n parentHash: hash,\n number: number,\n timestamp: number,\n nonce: Formatter.allowNull(hex),\n difficulty: this.difficulty.bind(this),\n gasLimit: bigNumber,\n gasUsed: bigNumber,\n miner: address,\n extraData: data,\n transactions: Formatter.allowNull(Formatter.arrayOf(hash)),\n baseFeePerGas: Formatter.allowNull(bigNumber)\n };\n formats.blockWithTransactions = shallowCopy(formats.block);\n formats.blockWithTransactions.transactions = Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this)));\n formats.filter = {\n fromBlock: Formatter.allowNull(blockTag, undefined),\n toBlock: Formatter.allowNull(blockTag, undefined),\n blockHash: Formatter.allowNull(hash, undefined),\n address: Formatter.allowNull(address, undefined),\n topics: Formatter.allowNull(this.topics.bind(this), undefined),\n };\n formats.filterLog = {\n blockNumber: Formatter.allowNull(number),\n blockHash: Formatter.allowNull(hash),\n transactionIndex: number,\n removed: Formatter.allowNull(this.boolean.bind(this)),\n address: address,\n data: Formatter.allowFalsish(data, \"0x\"),\n topics: Formatter.arrayOf(hash),\n transactionHash: hash,\n logIndex: number,\n };\n return formats;\n }\n accessList(accessList) {\n return accessListify(accessList || []);\n }\n // Requires a BigNumberish that is within the IEEE754 safe integer range; returns a number\n // Strict! Used on input.\n number(number) {\n if (number === \"0x\") {\n return 0;\n }\n return BigNumber.from(number).toNumber();\n }\n type(number) {\n if (number === \"0x\" || number == null) {\n return 0;\n }\n return BigNumber.from(number).toNumber();\n }\n // Strict! Used on input.\n bigNumber(value) {\n return BigNumber.from(value);\n }\n // Requires a boolean, \"true\" or \"false\"; returns a boolean\n boolean(value) {\n if (typeof (value) === \"boolean\") {\n return value;\n }\n if (typeof (value) === \"string\") {\n value = value.toLowerCase();\n if (value === \"true\") {\n return true;\n }\n if (value === \"false\") {\n return false;\n }\n }\n throw new Error(\"invalid boolean - \" + value);\n }\n hex(value, strict) {\n if (typeof (value) === \"string\") {\n if (!strict && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexString(value)) {\n return value.toLowerCase();\n }\n }\n return logger.throwArgumentError(\"invalid hash\", \"value\", value);\n }\n data(value, strict) {\n const result = this.hex(value, strict);\n if ((result.length % 2) !== 0) {\n throw new Error(\"invalid data; odd-length - \" + value);\n }\n return result;\n }\n // Requires an address\n // Strict! Used on input.\n address(value) {\n return getAddress(value);\n }\n callAddress(value) {\n if (!isHexString(value, 32)) {\n return null;\n }\n const address = getAddress(hexDataSlice(value, 12));\n return (address === AddressZero) ? null : address;\n }\n contractAddress(value) {\n return getContractAddress(value);\n }\n // Strict! Used on input.\n blockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n if (blockTag === \"earliest\") {\n return \"0x0\";\n }\n if (blockTag === \"latest\" || blockTag === \"pending\") {\n return blockTag;\n }\n if (typeof (blockTag) === \"number\" || isHexString(blockTag)) {\n return hexValue(blockTag);\n }\n throw new Error(\"invalid blockTag\");\n }\n // Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash.\n hash(value, strict) {\n const result = this.hex(value, strict);\n if (hexDataLength(result) !== 32) {\n return logger.throwArgumentError(\"invalid hash\", \"value\", value);\n }\n return result;\n }\n // Returns the difficulty as a number, or if too large (i.e. PoA network) null\n difficulty(value) {\n if (value == null) {\n return null;\n }\n const v = BigNumber.from(value);\n try {\n return v.toNumber();\n }\n catch (error) { }\n return null;\n }\n uint256(value) {\n if (!isHexString(value)) {\n throw new Error(\"invalid uint256\");\n }\n return hexZeroPad(value, 32);\n }\n _block(value, format) {\n if (value.author != null && value.miner == null) {\n value.miner = value.author;\n }\n // The difficulty may need to come from _difficulty in recursed blocks\n const difficulty = (value._difficulty != null) ? value._difficulty : value.difficulty;\n const result = Formatter.check(format, value);\n result._difficulty = ((difficulty == null) ? null : BigNumber.from(difficulty));\n return result;\n }\n block(value) {\n return this._block(value, this.formats.block);\n }\n blockWithTransactions(value) {\n return this._block(value, this.formats.blockWithTransactions);\n }\n // Strict! Used on input.\n transactionRequest(value) {\n return Formatter.check(this.formats.transactionRequest, value);\n }\n transactionResponse(transaction) {\n // Rename gas to gasLimit\n if (transaction.gas != null && transaction.gasLimit == null) {\n transaction.gasLimit = transaction.gas;\n }\n // Some clients (TestRPC) do strange things like return 0x0 for the\n // 0 address; correct this to be a real address\n if (transaction.to && BigNumber.from(transaction.to).isZero()) {\n transaction.to = \"0x0000000000000000000000000000000000000000\";\n }\n // Rename input to data\n if (transaction.input != null && transaction.data == null) {\n transaction.data = transaction.input;\n }\n // If to and creates are empty, populate the creates from the transaction\n if (transaction.to == null && transaction.creates == null) {\n transaction.creates = this.contractAddress(transaction);\n }\n if ((transaction.type === 1 || transaction.type === 2) && transaction.accessList == null) {\n transaction.accessList = [];\n }\n const result = Formatter.check(this.formats.transaction, transaction);\n if (transaction.chainId != null) {\n let chainId = transaction.chainId;\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n result.chainId = chainId;\n }\n else {\n let chainId = transaction.networkId;\n // geth-etc returns chainId\n if (chainId == null && result.v == null) {\n chainId = transaction.chainId;\n }\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n if (typeof (chainId) !== \"number\" && result.v != null) {\n chainId = (result.v - 35) / 2;\n if (chainId < 0) {\n chainId = 0;\n }\n chainId = parseInt(chainId);\n }\n if (typeof (chainId) !== \"number\") {\n chainId = 0;\n }\n result.chainId = chainId;\n }\n // 0x0000... should actually be null\n if (result.blockHash && result.blockHash.replace(/0/g, \"\") === \"x\") {\n result.blockHash = null;\n }\n return result;\n }\n transaction(value) {\n return parseTransaction(value);\n }\n receiptLog(value) {\n return Formatter.check(this.formats.receiptLog, value);\n }\n receipt(value) {\n const result = Formatter.check(this.formats.receipt, value);\n // RSK incorrectly implemented EIP-658, so we munge things a bit here for it\n if (result.root != null) {\n if (result.root.length <= 4) {\n // Could be 0x00, 0x0, 0x01 or 0x1\n const value = BigNumber.from(result.root).toNumber();\n if (value === 0 || value === 1) {\n // Make sure if both are specified, they match\n if (result.status != null && (result.status !== value)) {\n logger.throwArgumentError(\"alt-root-status/status mismatch\", \"value\", { root: result.root, status: result.status });\n }\n result.status = value;\n delete result.root;\n }\n else {\n logger.throwArgumentError(\"invalid alt-root-status\", \"value.root\", result.root);\n }\n }\n else if (result.root.length !== 66) {\n // Must be a valid bytes32\n logger.throwArgumentError(\"invalid root hash\", \"value.root\", result.root);\n }\n }\n if (result.status != null) {\n result.byzantium = true;\n }\n return result;\n }\n topics(value) {\n if (Array.isArray(value)) {\n return value.map((v) => this.topics(v));\n }\n else if (value != null) {\n return this.hash(value, true);\n }\n return null;\n }\n filter(value) {\n return Formatter.check(this.formats.filter, value);\n }\n filterLog(value) {\n return Formatter.check(this.formats.filterLog, value);\n }\n static check(format, object) {\n const result = {};\n for (const key in format) {\n try {\n const value = format[key](object[key]);\n if (value !== undefined) {\n result[key] = value;\n }\n }\n catch (error) {\n error.checkKey = key;\n error.checkValue = object[key];\n throw error;\n }\n }\n return result;\n }\n // if value is null-ish, nullValue is returned\n static allowNull(format, nullValue) {\n return (function (value) {\n if (value == null) {\n return nullValue;\n }\n return format(value);\n });\n }\n // If value is false-ish, replaceValue is returned\n static allowFalsish(format, replaceValue) {\n return (function (value) {\n if (!value) {\n return replaceValue;\n }\n return format(value);\n });\n }\n // Requires an Array satisfying check\n static arrayOf(format) {\n return (function (array) {\n if (!Array.isArray(array)) {\n throw new Error(\"not an array\");\n }\n const result = [];\n array.forEach(function (value) {\n result.push(format(value));\n });\n return result;\n });\n }\n}\nexport function isCommunityResourcable(value) {\n return (value && typeof (value.isCommunityResource) === \"function\");\n}\nexport function isCommunityResource(value) {\n return (isCommunityResourcable(value) && value.isCommunityResource());\n}\n// Show the throttle message only once\nlet throttleMessage = false;\nexport function showThrottleMessage() {\n if (throttleMessage) {\n return;\n }\n throttleMessage = true;\n console.log(\"========= NOTICE =========\");\n console.log(\"Request-Rate Exceeded (this message will not be repeated)\");\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n console.log(\"For more details: https:/\\/docs.ethers.io/api-keys/\");\n console.log(\"==========================\");\n}\n//# sourceMappingURL=formatter.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ForkEvent, Provider } from \"@ethersproject/abstract-provider\";\nimport { Base58 } from \"@ethersproject/basex\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexConcat, hexDataLength, hexDataSlice, hexlify, hexValue, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { HashZero } from \"@ethersproject/constants\";\nimport { namehash } from \"@ethersproject/hash\";\nimport { getNetwork } from \"@ethersproject/networks\";\nimport { defineReadOnly, getStatic, resolveProperties } from \"@ethersproject/properties\";\nimport { sha256 } from \"@ethersproject/sha2\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { fetchJson, poll } from \"@ethersproject/web\";\nimport bech32 from \"bech32\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { Formatter } from \"./formatter\";\n//////////////////////////////\n// Event Serializeing\nfunction checkTopic(topic) {\n if (topic == null) {\n return \"null\";\n }\n if (hexDataLength(topic) !== 32) {\n logger.throwArgumentError(\"invalid topic\", \"topic\", topic);\n }\n return topic.toLowerCase();\n}\nfunction serializeTopics(topics) {\n // Remove trailing null AND-topics; they are redundant\n topics = topics.slice();\n while (topics.length > 0 && topics[topics.length - 1] == null) {\n topics.pop();\n }\n return topics.map((topic) => {\n if (Array.isArray(topic)) {\n // Only track unique OR-topics\n const unique = {};\n topic.forEach((topic) => {\n unique[checkTopic(topic)] = true;\n });\n // The order of OR-topics does not matter\n const sorted = Object.keys(unique);\n sorted.sort();\n return sorted.join(\"|\");\n }\n else {\n return checkTopic(topic);\n }\n }).join(\"&\");\n}\nfunction deserializeTopics(data) {\n if (data === \"\") {\n return [];\n }\n return data.split(/&/g).map((topic) => {\n if (topic === \"\") {\n return [];\n }\n const comps = topic.split(\"|\").map((topic) => {\n return ((topic === \"null\") ? null : topic);\n });\n return ((comps.length === 1) ? comps[0] : comps);\n });\n}\nfunction getEventTag(eventName) {\n if (typeof (eventName) === \"string\") {\n eventName = eventName.toLowerCase();\n if (hexDataLength(eventName) === 32) {\n return \"tx:\" + eventName;\n }\n if (eventName.indexOf(\":\") === -1) {\n return eventName;\n }\n }\n else if (Array.isArray(eventName)) {\n return \"filter:*:\" + serializeTopics(eventName);\n }\n else if (ForkEvent.isForkEvent(eventName)) {\n logger.warn(\"not implemented\");\n throw new Error(\"not implemented\");\n }\n else if (eventName && typeof (eventName) === \"object\") {\n return \"filter:\" + (eventName.address || \"*\") + \":\" + serializeTopics(eventName.topics || []);\n }\n throw new Error(\"invalid event - \" + eventName);\n}\n//////////////////////////////\n// Helper Object\nfunction getTime() {\n return (new Date()).getTime();\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\n//////////////////////////////\n// Provider Object\n/**\n * EventType\n * - \"block\"\n * - \"poll\"\n * - \"didPoll\"\n * - \"pending\"\n * - \"error\"\n * - \"network\"\n * - filter\n * - topics array\n * - transaction hash\n */\nconst PollableEvents = [\"block\", \"network\", \"pending\", \"poll\"];\nexport class Event {\n constructor(tag, listener, once) {\n defineReadOnly(this, \"tag\", tag);\n defineReadOnly(this, \"listener\", listener);\n defineReadOnly(this, \"once\", once);\n }\n get event() {\n switch (this.type) {\n case \"tx\":\n return this.hash;\n case \"filter\":\n return this.filter;\n }\n return this.tag;\n }\n get type() {\n return this.tag.split(\":\")[0];\n }\n get hash() {\n const comps = this.tag.split(\":\");\n if (comps[0] !== \"tx\") {\n return null;\n }\n return comps[1];\n }\n get filter() {\n const comps = this.tag.split(\":\");\n if (comps[0] !== \"filter\") {\n return null;\n }\n const address = comps[1];\n const topics = deserializeTopics(comps[2]);\n const filter = {};\n if (topics.length > 0) {\n filter.topics = topics;\n }\n if (address && address !== \"*\") {\n filter.address = address;\n }\n return filter;\n }\n pollable() {\n return (this.tag.indexOf(\":\") >= 0 || PollableEvents.indexOf(this.tag) >= 0);\n }\n}\n;\n// https://github.com/satoshilabs/slips/blob/master/slip-0044.md\nconst coinInfos = {\n \"0\": { symbol: \"btc\", p2pkh: 0x00, p2sh: 0x05, prefix: \"bc\" },\n \"2\": { symbol: \"ltc\", p2pkh: 0x30, p2sh: 0x32, prefix: \"ltc\" },\n \"3\": { symbol: \"doge\", p2pkh: 0x1e, p2sh: 0x16 },\n \"60\": { symbol: \"eth\", ilk: \"eth\" },\n \"61\": { symbol: \"etc\", ilk: \"eth\" },\n \"700\": { symbol: \"xdai\", ilk: \"eth\" },\n};\nfunction bytes32ify(value) {\n return hexZeroPad(BigNumber.from(value).toHexString(), 32);\n}\n// Compute the Base58Check encoded data (checksum is first 4 bytes of sha256d)\nfunction base58Encode(data) {\n return Base58.encode(concat([data, hexDataSlice(sha256(sha256(data)), 0, 4)]));\n}\nconst matcherIpfs = new RegExp(\"^(ipfs):/\\/(.*)$\", \"i\");\nconst matchers = [\n new RegExp(\"^(https):/\\/(.*)$\", \"i\"),\n new RegExp(\"^(data):(.*)$\", \"i\"),\n matcherIpfs,\n new RegExp(\"^eip155:[0-9]+/(erc[0-9]+):(.*)$\", \"i\"),\n];\nfunction _parseString(result) {\n try {\n return toUtf8String(_parseBytes(result));\n }\n catch (error) { }\n return null;\n}\nfunction _parseBytes(result) {\n if (result === \"0x\") {\n return null;\n }\n const offset = BigNumber.from(hexDataSlice(result, 0, 32)).toNumber();\n const length = BigNumber.from(hexDataSlice(result, offset, offset + 32)).toNumber();\n return hexDataSlice(result, offset + 32, offset + 32 + length);\n}\n// Trim off the ipfs:// prefix and return the default gateway URL\nfunction getIpfsLink(link) {\n return `https:/\\/gateway.ipfs.io/ipfs/${link.substring(7)}`;\n}\nexport class Resolver {\n // The resolvedAddress is only for creating a ReverseLookup resolver\n constructor(provider, address, name, resolvedAddress) {\n defineReadOnly(this, \"provider\", provider);\n defineReadOnly(this, \"name\", name);\n defineReadOnly(this, \"address\", provider.formatter.address(address));\n defineReadOnly(this, \"_resolvedAddress\", resolvedAddress);\n }\n _fetchBytes(selector, parameters) {\n return __awaiter(this, void 0, void 0, function* () {\n // e.g. keccak256(\"addr(bytes32,uint256)\")\n const tx = {\n to: this.address,\n data: hexConcat([selector, namehash(this.name), (parameters || \"0x\")])\n };\n try {\n return _parseBytes(yield this.provider.call(tx));\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n return null;\n }\n return null;\n }\n });\n }\n _getAddress(coinType, hexBytes) {\n const coinInfo = coinInfos[String(coinType)];\n if (coinInfo == null) {\n logger.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: `getAddress(${coinType})`\n });\n }\n if (coinInfo.ilk === \"eth\") {\n return this.provider.formatter.address(hexBytes);\n }\n const bytes = arrayify(hexBytes);\n // P2PKH: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG\n if (coinInfo.p2pkh != null) {\n const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);\n if (p2pkh) {\n const length = parseInt(p2pkh[1], 16);\n if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {\n return base58Encode(concat([[coinInfo.p2pkh], (\"0x\" + p2pkh[2])]));\n }\n }\n }\n // P2SH: OP_HASH160 OP_EQUAL\n if (coinInfo.p2sh != null) {\n const p2sh = hexBytes.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);\n if (p2sh) {\n const length = parseInt(p2sh[1], 16);\n if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {\n return base58Encode(concat([[coinInfo.p2sh], (\"0x\" + p2sh[2])]));\n }\n }\n }\n // Bech32\n if (coinInfo.prefix != null) {\n const length = bytes[1];\n // https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program\n let version = bytes[0];\n if (version === 0x00) {\n if (length !== 20 && length !== 32) {\n version = -1;\n }\n }\n else {\n version = -1;\n }\n if (version >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {\n const words = bech32.toWords(bytes.slice(2));\n words.unshift(version);\n return bech32.encode(coinInfo.prefix, words);\n }\n }\n return null;\n }\n getAddress(coinType) {\n return __awaiter(this, void 0, void 0, function* () {\n if (coinType == null) {\n coinType = 60;\n }\n // If Ethereum, use the standard `addr(bytes32)`\n if (coinType === 60) {\n try {\n // keccak256(\"addr(bytes32)\")\n const transaction = {\n to: this.address,\n data: (\"0x3b3b57de\" + namehash(this.name).substring(2))\n };\n const hexBytes = yield this.provider.call(transaction);\n // No address\n if (hexBytes === \"0x\" || hexBytes === HashZero) {\n return null;\n }\n return this.provider.formatter.callAddress(hexBytes);\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n return null;\n }\n throw error;\n }\n }\n // keccak256(\"addr(bytes32,uint256\")\n const hexBytes = yield this._fetchBytes(\"0xf1cb7e06\", bytes32ify(coinType));\n // No address\n if (hexBytes == null || hexBytes === \"0x\") {\n return null;\n }\n // Compute the address\n const address = this._getAddress(coinType, hexBytes);\n if (address == null) {\n logger.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: `getAddress(${coinType})`,\n coinType: coinType,\n data: hexBytes\n });\n }\n return address;\n });\n }\n getAvatar() {\n return __awaiter(this, void 0, void 0, function* () {\n const linkage = [{ type: \"name\", content: this.name }];\n try {\n // test data for ricmoo.eth\n //const avatar = \"eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233\";\n const avatar = yield this.getText(\"avatar\");\n if (avatar == null) {\n return null;\n }\n for (let i = 0; i < matchers.length; i++) {\n const match = avatar.match(matchers[i]);\n if (match == null) {\n continue;\n }\n const scheme = match[1].toLowerCase();\n switch (scheme) {\n case \"https\":\n linkage.push({ type: \"url\", content: avatar });\n return { linkage, url: avatar };\n case \"data\":\n linkage.push({ type: \"data\", content: avatar });\n return { linkage, url: avatar };\n case \"ipfs\":\n linkage.push({ type: \"ipfs\", content: avatar });\n return { linkage, url: getIpfsLink(avatar) };\n case \"erc721\":\n case \"erc1155\": {\n // Depending on the ERC type, use tokenURI(uint256) or url(uint256)\n const selector = (scheme === \"erc721\") ? \"0xc87b56dd\" : \"0x0e89341c\";\n linkage.push({ type: scheme, content: avatar });\n // The owner of this name\n const owner = (this._resolvedAddress || (yield this.getAddress()));\n const comps = (match[2] || \"\").split(\"/\");\n if (comps.length !== 2) {\n return null;\n }\n const addr = yield this.provider.formatter.address(comps[0]);\n const tokenId = hexZeroPad(BigNumber.from(comps[1]).toHexString(), 32);\n // Check that this account owns the token\n if (scheme === \"erc721\") {\n // ownerOf(uint256 tokenId)\n const tokenOwner = this.provider.formatter.callAddress(yield this.provider.call({\n to: addr, data: hexConcat([\"0x6352211e\", tokenId])\n }));\n if (owner !== tokenOwner) {\n return null;\n }\n linkage.push({ type: \"owner\", content: tokenOwner });\n }\n else if (scheme === \"erc1155\") {\n // balanceOf(address owner, uint256 tokenId)\n const balance = BigNumber.from(yield this.provider.call({\n to: addr, data: hexConcat([\"0x00fdd58e\", hexZeroPad(owner, 32), tokenId])\n }));\n if (balance.isZero()) {\n return null;\n }\n linkage.push({ type: \"balance\", content: balance.toString() });\n }\n // Call the token contract for the metadata URL\n const tx = {\n to: this.provider.formatter.address(comps[0]),\n data: hexConcat([selector, tokenId])\n };\n let metadataUrl = _parseString(yield this.provider.call(tx));\n if (metadataUrl == null) {\n return null;\n }\n linkage.push({ type: \"metadata-url\", content: metadataUrl });\n // ERC-1155 allows a generic {id} in the URL\n if (scheme === \"erc1155\") {\n metadataUrl = metadataUrl.replace(\"{id}\", tokenId.substring(2));\n linkage.push({ type: \"metadata-url-expanded\", content: metadataUrl });\n }\n // Get the token metadata\n const metadata = yield fetchJson(metadataUrl);\n if (!metadata) {\n return null;\n }\n linkage.push({ type: \"metadata\", content: JSON.stringify(metadata) });\n // Pull the image URL out\n let imageUrl = metadata.image;\n if (typeof (imageUrl) !== \"string\") {\n return null;\n }\n if (imageUrl.match(/^(https:\\/\\/|data:)/i)) {\n // Allow\n }\n else {\n // Transform IPFS link to gateway\n const ipfs = imageUrl.match(matcherIpfs);\n if (ipfs == null) {\n return null;\n }\n linkage.push({ type: \"url-ipfs\", content: imageUrl });\n imageUrl = getIpfsLink(imageUrl);\n }\n linkage.push({ type: \"url\", content: imageUrl });\n return { linkage, url: imageUrl };\n }\n }\n }\n }\n catch (error) { }\n return null;\n });\n }\n getContentHash() {\n return __awaiter(this, void 0, void 0, function* () {\n // keccak256(\"contenthash()\")\n const hexBytes = yield this._fetchBytes(\"0xbc1c58d1\");\n // No contenthash\n if (hexBytes == null || hexBytes === \"0x\") {\n return null;\n }\n // IPFS (CID: 1, Type: DAG-PB)\n const ipfs = hexBytes.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);\n if (ipfs) {\n const length = parseInt(ipfs[3], 16);\n if (ipfs[4].length === length * 2) {\n return \"ipfs:/\\/\" + Base58.encode(\"0x\" + ipfs[1]);\n }\n }\n // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32)\n const swarm = hexBytes.match(/^0xe40101fa011b20([0-9a-f]*)$/);\n if (swarm) {\n if (swarm[1].length === (32 * 2)) {\n return \"bzz:/\\/\" + swarm[1];\n }\n }\n return logger.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"getContentHash()\",\n data: hexBytes\n });\n });\n }\n getText(key) {\n return __awaiter(this, void 0, void 0, function* () {\n // The key encoded as parameter to fetchBytes\n let keyBytes = toUtf8Bytes(key);\n // The nodehash consumes the first slot, so the string pointer targets\n // offset 64, with the length at offset 64 and data starting at offset 96\n keyBytes = concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);\n // Pad to word-size (32 bytes)\n if ((keyBytes.length % 32) !== 0) {\n keyBytes = concat([keyBytes, hexZeroPad(\"0x\", 32 - (key.length % 32))]);\n }\n const hexBytes = yield this._fetchBytes(\"0x59d1d43c\", hexlify(keyBytes));\n if (hexBytes == null || hexBytes === \"0x\") {\n return null;\n }\n return toUtf8String(hexBytes);\n });\n }\n}\nlet defaultFormatter = null;\nlet nextPollId = 1;\nexport class BaseProvider extends Provider {\n /**\n * ready\n *\n * A Promise that resolves only once the provider is ready.\n *\n * Sub-classes that call the super with a network without a chainId\n * MUST set this. Standard named networks have a known chainId.\n *\n */\n constructor(network) {\n logger.checkNew(new.target, Provider);\n super();\n // Events being listened to\n this._events = [];\n this._emitted = { block: -2 };\n this.formatter = new.target.getFormatter();\n // If network is any, this Provider allows the underlying\n // network to change dynamically, and we auto-detect the\n // current network\n defineReadOnly(this, \"anyNetwork\", (network === \"any\"));\n if (this.anyNetwork) {\n network = this.detectNetwork();\n }\n if (network instanceof Promise) {\n this._networkPromise = network;\n // Squash any \"unhandled promise\" errors; that do not need to be handled\n network.catch((error) => { });\n // Trigger initial network setting (async)\n this._ready().catch((error) => { });\n }\n else {\n const knownNetwork = getStatic(new.target, \"getNetwork\")(network);\n if (knownNetwork) {\n defineReadOnly(this, \"_network\", knownNetwork);\n this.emit(\"network\", knownNetwork, null);\n }\n else {\n logger.throwArgumentError(\"invalid network\", \"network\", network);\n }\n }\n this._maxInternalBlockNumber = -1024;\n this._lastBlockNumber = -2;\n this._pollingInterval = 4000;\n this._fastQueryDate = 0;\n }\n _ready() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._network == null) {\n let network = null;\n if (this._networkPromise) {\n try {\n network = yield this._networkPromise;\n }\n catch (error) { }\n }\n // Try the Provider's network detection (this MUST throw if it cannot)\n if (network == null) {\n network = yield this.detectNetwork();\n }\n // This should never happen; every Provider sub-class should have\n // suggested a network by here (or have thrown).\n if (!network) {\n logger.throwError(\"no network detected\", Logger.errors.UNKNOWN_ERROR, {});\n }\n // Possible this call stacked so do not call defineReadOnly again\n if (this._network == null) {\n if (this.anyNetwork) {\n this._network = network;\n }\n else {\n defineReadOnly(this, \"_network\", network);\n }\n this.emit(\"network\", network, null);\n }\n }\n return this._network;\n });\n }\n // This will always return the most recently established network.\n // For \"any\", this can change (a \"network\" event is emitted before\n // any change is reflected); otherwise this cannot change\n get ready() {\n return poll(() => {\n return this._ready().then((network) => {\n return network;\n }, (error) => {\n // If the network isn't running yet, we will wait\n if (error.code === Logger.errors.NETWORK_ERROR && error.event === \"noNetwork\") {\n return undefined;\n }\n throw error;\n });\n });\n }\n // @TODO: Remove this and just create a singleton formatter\n static getFormatter() {\n if (defaultFormatter == null) {\n defaultFormatter = new Formatter();\n }\n return defaultFormatter;\n }\n // @TODO: Remove this and just use getNetwork\n static getNetwork(network) {\n return getNetwork((network == null) ? \"homestead\" : network);\n }\n // Fetches the blockNumber, but will reuse any result that is less\n // than maxAge old or has been requested since the last request\n _getInternalBlockNumber(maxAge) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this._ready();\n // Allowing stale data up to maxAge old\n if (maxAge > 0) {\n // While there are pending internal block requests...\n while (this._internalBlockNumber) {\n // ...\"remember\" which fetch we started with\n const internalBlockNumber = this._internalBlockNumber;\n try {\n // Check the result is not too stale\n const result = yield internalBlockNumber;\n if ((getTime() - result.respTime) <= maxAge) {\n return result.blockNumber;\n }\n // Too old; fetch a new value\n break;\n }\n catch (error) {\n // The fetch rejected; if we are the first to get the\n // rejection, drop through so we replace it with a new\n // fetch; all others blocked will then get that fetch\n // which won't match the one they \"remembered\" and loop\n if (this._internalBlockNumber === internalBlockNumber) {\n break;\n }\n }\n }\n }\n const reqTime = getTime();\n const checkInternalBlockNumber = resolveProperties({\n blockNumber: this.perform(\"getBlockNumber\", {}),\n networkError: this.getNetwork().then((network) => (null), (error) => (error))\n }).then(({ blockNumber, networkError }) => {\n if (networkError) {\n // Unremember this bad internal block number\n if (this._internalBlockNumber === checkInternalBlockNumber) {\n this._internalBlockNumber = null;\n }\n throw networkError;\n }\n const respTime = getTime();\n blockNumber = BigNumber.from(blockNumber).toNumber();\n if (blockNumber < this._maxInternalBlockNumber) {\n blockNumber = this._maxInternalBlockNumber;\n }\n this._maxInternalBlockNumber = blockNumber;\n this._setFastBlockNumber(blockNumber); // @TODO: Still need this?\n return { blockNumber, reqTime, respTime };\n });\n this._internalBlockNumber = checkInternalBlockNumber;\n // Swallow unhandled exceptions; if needed they are handled else where\n checkInternalBlockNumber.catch((error) => {\n // Don't null the dead (rejected) fetch, if it has already been updated\n if (this._internalBlockNumber === checkInternalBlockNumber) {\n this._internalBlockNumber = null;\n }\n });\n return (yield checkInternalBlockNumber).blockNumber;\n });\n }\n poll() {\n return __awaiter(this, void 0, void 0, function* () {\n const pollId = nextPollId++;\n // Track all running promises, so we can trigger a post-poll once they are complete\n const runners = [];\n let blockNumber = null;\n try {\n blockNumber = yield this._getInternalBlockNumber(100 + this.pollingInterval / 2);\n }\n catch (error) {\n this.emit(\"error\", error);\n return;\n }\n this._setFastBlockNumber(blockNumber);\n // Emit a poll event after we have the latest (fast) block number\n this.emit(\"poll\", pollId, blockNumber);\n // If the block has not changed, meh.\n if (blockNumber === this._lastBlockNumber) {\n this.emit(\"didPoll\", pollId);\n return;\n }\n // First polling cycle, trigger a \"block\" events\n if (this._emitted.block === -2) {\n this._emitted.block = blockNumber - 1;\n }\n if (Math.abs((this._emitted.block) - blockNumber) > 1000) {\n logger.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);\n this.emit(\"error\", logger.makeError(\"network block skew detected\", Logger.errors.NETWORK_ERROR, {\n blockNumber: blockNumber,\n event: \"blockSkew\",\n previousBlockNumber: this._emitted.block\n }));\n this.emit(\"block\", blockNumber);\n }\n else {\n // Notify all listener for each block that has passed\n for (let i = this._emitted.block + 1; i <= blockNumber; i++) {\n this.emit(\"block\", i);\n }\n }\n // The emitted block was updated, check for obsolete events\n if (this._emitted.block !== blockNumber) {\n this._emitted.block = blockNumber;\n Object.keys(this._emitted).forEach((key) => {\n // The block event does not expire\n if (key === \"block\") {\n return;\n }\n // The block we were at when we emitted this event\n const eventBlockNumber = this._emitted[key];\n // We cannot garbage collect pending transactions or blocks here\n // They should be garbage collected by the Provider when setting\n // \"pending\" events\n if (eventBlockNumber === \"pending\") {\n return;\n }\n // Evict any transaction hashes or block hashes over 12 blocks\n // old, since they should not return null anyways\n if (blockNumber - eventBlockNumber > 12) {\n delete this._emitted[key];\n }\n });\n }\n // First polling cycle\n if (this._lastBlockNumber === -2) {\n this._lastBlockNumber = blockNumber - 1;\n }\n // Find all transaction hashes we are waiting on\n this._events.forEach((event) => {\n switch (event.type) {\n case \"tx\": {\n const hash = event.hash;\n let runner = this.getTransactionReceipt(hash).then((receipt) => {\n if (!receipt || receipt.blockNumber == null) {\n return null;\n }\n this._emitted[\"t:\" + hash] = receipt.blockNumber;\n this.emit(hash, receipt);\n return null;\n }).catch((error) => { this.emit(\"error\", error); });\n runners.push(runner);\n break;\n }\n case \"filter\": {\n const filter = event.filter;\n filter.fromBlock = this._lastBlockNumber + 1;\n filter.toBlock = blockNumber;\n const runner = this.getLogs(filter).then((logs) => {\n if (logs.length === 0) {\n return;\n }\n logs.forEach((log) => {\n this._emitted[\"b:\" + log.blockHash] = log.blockNumber;\n this._emitted[\"t:\" + log.transactionHash] = log.blockNumber;\n this.emit(filter, log);\n });\n }).catch((error) => { this.emit(\"error\", error); });\n runners.push(runner);\n break;\n }\n }\n });\n this._lastBlockNumber = blockNumber;\n // Once all events for this loop have been processed, emit \"didPoll\"\n Promise.all(runners).then(() => {\n this.emit(\"didPoll\", pollId);\n }).catch((error) => { this.emit(\"error\", error); });\n return;\n });\n }\n // Deprecated; do not use this\n resetEventsBlock(blockNumber) {\n this._lastBlockNumber = blockNumber - 1;\n if (this.polling) {\n this.poll();\n }\n }\n get network() {\n return this._network;\n }\n // This method should query the network if the underlying network\n // can change, such as when connected to a JSON-RPC backend\n detectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n return logger.throwError(\"provider does not support network detection\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"provider.detectNetwork\"\n });\n });\n }\n getNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n const network = yield this._ready();\n // Make sure we are still connected to the same network; this is\n // only an external call for backends which can have the underlying\n // network change spontaneously\n const currentNetwork = yield this.detectNetwork();\n if (network.chainId !== currentNetwork.chainId) {\n // We are allowing network changes, things can get complex fast;\n // make sure you know what you are doing if you use \"any\"\n if (this.anyNetwork) {\n this._network = currentNetwork;\n // Reset all internal block number guards and caches\n this._lastBlockNumber = -2;\n this._fastBlockNumber = null;\n this._fastBlockNumberPromise = null;\n this._fastQueryDate = 0;\n this._emitted.block = -2;\n this._maxInternalBlockNumber = -1024;\n this._internalBlockNumber = null;\n // The \"network\" event MUST happen before this method resolves\n // so any events have a chance to unregister, so we stall an\n // additional event loop before returning from /this/ call\n this.emit(\"network\", currentNetwork, network);\n yield stall(0);\n return this._network;\n }\n const error = logger.makeError(\"underlying network changed\", Logger.errors.NETWORK_ERROR, {\n event: \"changed\",\n network: network,\n detectedNetwork: currentNetwork\n });\n this.emit(\"error\", error);\n throw error;\n }\n return network;\n });\n }\n get blockNumber() {\n this._getInternalBlockNumber(100 + this.pollingInterval / 2).then((blockNumber) => {\n this._setFastBlockNumber(blockNumber);\n }, (error) => { });\n return (this._fastBlockNumber != null) ? this._fastBlockNumber : -1;\n }\n get polling() {\n return (this._poller != null);\n }\n set polling(value) {\n if (value && !this._poller) {\n this._poller = setInterval(() => { this.poll(); }, this.pollingInterval);\n if (!this._bootstrapPoll) {\n this._bootstrapPoll = setTimeout(() => {\n this.poll();\n // We block additional polls until the polling interval\n // is done, to prevent overwhelming the poll function\n this._bootstrapPoll = setTimeout(() => {\n // If polling was disabled, something may require a poke\n // since starting the bootstrap poll and it was disabled\n if (!this._poller) {\n this.poll();\n }\n // Clear out the bootstrap so we can do another\n this._bootstrapPoll = null;\n }, this.pollingInterval);\n }, 0);\n }\n }\n else if (!value && this._poller) {\n clearInterval(this._poller);\n this._poller = null;\n }\n }\n get pollingInterval() {\n return this._pollingInterval;\n }\n set pollingInterval(value) {\n if (typeof (value) !== \"number\" || value <= 0 || parseInt(String(value)) != value) {\n throw new Error(\"invalid polling interval\");\n }\n this._pollingInterval = value;\n if (this._poller) {\n clearInterval(this._poller);\n this._poller = setInterval(() => { this.poll(); }, this._pollingInterval);\n }\n }\n _getFastBlockNumber() {\n const now = getTime();\n // Stale block number, request a newer value\n if ((now - this._fastQueryDate) > 2 * this._pollingInterval) {\n this._fastQueryDate = now;\n this._fastBlockNumberPromise = this.getBlockNumber().then((blockNumber) => {\n if (this._fastBlockNumber == null || blockNumber > this._fastBlockNumber) {\n this._fastBlockNumber = blockNumber;\n }\n return this._fastBlockNumber;\n });\n }\n return this._fastBlockNumberPromise;\n }\n _setFastBlockNumber(blockNumber) {\n // Older block, maybe a stale request\n if (this._fastBlockNumber != null && blockNumber < this._fastBlockNumber) {\n return;\n }\n // Update the time we updated the blocknumber\n this._fastQueryDate = getTime();\n // Newer block number, use it\n if (this._fastBlockNumber == null || blockNumber > this._fastBlockNumber) {\n this._fastBlockNumber = blockNumber;\n this._fastBlockNumberPromise = Promise.resolve(blockNumber);\n }\n }\n waitForTransaction(transactionHash, confirmations, timeout) {\n return __awaiter(this, void 0, void 0, function* () {\n return this._waitForTransaction(transactionHash, (confirmations == null) ? 1 : confirmations, timeout || 0, null);\n });\n }\n _waitForTransaction(transactionHash, confirmations, timeout, replaceable) {\n return __awaiter(this, void 0, void 0, function* () {\n const receipt = yield this.getTransactionReceipt(transactionHash);\n // Receipt is already good\n if ((receipt ? receipt.confirmations : 0) >= confirmations) {\n return receipt;\n }\n // Poll until the receipt is good...\n return new Promise((resolve, reject) => {\n const cancelFuncs = [];\n let done = false;\n const alreadyDone = function () {\n if (done) {\n return true;\n }\n done = true;\n cancelFuncs.forEach((func) => { func(); });\n return false;\n };\n const minedHandler = (receipt) => {\n if (receipt.confirmations < confirmations) {\n return;\n }\n if (alreadyDone()) {\n return;\n }\n resolve(receipt);\n };\n this.on(transactionHash, minedHandler);\n cancelFuncs.push(() => { this.removeListener(transactionHash, minedHandler); });\n if (replaceable) {\n let lastBlockNumber = replaceable.startBlock;\n let scannedBlock = null;\n const replaceHandler = (blockNumber) => __awaiter(this, void 0, void 0, function* () {\n if (done) {\n return;\n }\n // Wait 1 second; this is only used in the case of a fault, so\n // we will trade off a little bit of latency for more consistent\n // results and fewer JSON-RPC calls\n yield stall(1000);\n this.getTransactionCount(replaceable.from).then((nonce) => __awaiter(this, void 0, void 0, function* () {\n if (done) {\n return;\n }\n if (nonce <= replaceable.nonce) {\n lastBlockNumber = blockNumber;\n }\n else {\n // First check if the transaction was mined\n {\n const mined = yield this.getTransaction(transactionHash);\n if (mined && mined.blockNumber != null) {\n return;\n }\n }\n // First time scanning. We start a little earlier for some\n // wiggle room here to handle the eventually consistent nature\n // of blockchain (e.g. the getTransactionCount was for a\n // different block)\n if (scannedBlock == null) {\n scannedBlock = lastBlockNumber - 3;\n if (scannedBlock < replaceable.startBlock) {\n scannedBlock = replaceable.startBlock;\n }\n }\n while (scannedBlock <= blockNumber) {\n if (done) {\n return;\n }\n const block = yield this.getBlockWithTransactions(scannedBlock);\n for (let ti = 0; ti < block.transactions.length; ti++) {\n const tx = block.transactions[ti];\n // Successfully mined!\n if (tx.hash === transactionHash) {\n return;\n }\n // Matches our transaction from and nonce; its a replacement\n if (tx.from === replaceable.from && tx.nonce === replaceable.nonce) {\n if (done) {\n return;\n }\n // Get the receipt of the replacement\n const receipt = yield this.waitForTransaction(tx.hash, confirmations);\n // Already resolved or rejected (prolly a timeout)\n if (alreadyDone()) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === replaceable.data && tx.to === replaceable.to && tx.value.eq(replaceable.value)) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" && tx.from === tx.to && tx.value.isZero()) {\n reason = \"cancelled\";\n }\n // Explain why we were replaced\n reject(logger.makeError(\"transaction was replaced\", Logger.errors.TRANSACTION_REPLACED, {\n cancelled: (reason === \"replaced\" || reason === \"cancelled\"),\n reason,\n replacement: this._wrapTransaction(tx),\n hash: transactionHash,\n receipt\n }));\n return;\n }\n }\n scannedBlock++;\n }\n }\n if (done) {\n return;\n }\n this.once(\"block\", replaceHandler);\n }), (error) => {\n if (done) {\n return;\n }\n this.once(\"block\", replaceHandler);\n });\n });\n if (done) {\n return;\n }\n this.once(\"block\", replaceHandler);\n cancelFuncs.push(() => {\n this.removeListener(\"block\", replaceHandler);\n });\n }\n if (typeof (timeout) === \"number\" && timeout > 0) {\n const timer = setTimeout(() => {\n if (alreadyDone()) {\n return;\n }\n reject(logger.makeError(\"timeout exceeded\", Logger.errors.TIMEOUT, { timeout: timeout }));\n }, timeout);\n if (timer.unref) {\n timer.unref();\n }\n cancelFuncs.push(() => { clearTimeout(timer); });\n }\n });\n });\n }\n getBlockNumber() {\n return __awaiter(this, void 0, void 0, function* () {\n return this._getInternalBlockNumber(0);\n });\n }\n getGasPrice() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const result = yield this.perform(\"getGasPrice\", {});\n try {\n return BigNumber.from(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getGasPrice\",\n result, error\n });\n }\n });\n }\n getBalance(addressOrName, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n const result = yield this.perform(\"getBalance\", params);\n try {\n return BigNumber.from(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getBalance\",\n params, result, error\n });\n }\n });\n }\n getTransactionCount(addressOrName, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n const result = yield this.perform(\"getTransactionCount\", params);\n try {\n return BigNumber.from(result).toNumber();\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getTransactionCount\",\n params, result, error\n });\n }\n });\n }\n getCode(addressOrName, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag)\n });\n const result = yield this.perform(\"getCode\", params);\n try {\n return hexlify(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getCode\",\n params, result, error\n });\n }\n });\n }\n getStorageAt(addressOrName, position, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n address: this._getAddress(addressOrName),\n blockTag: this._getBlockTag(blockTag),\n position: Promise.resolve(position).then((p) => hexValue(p))\n });\n const result = yield this.perform(\"getStorageAt\", params);\n try {\n return hexlify(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"getStorageAt\",\n params, result, error\n });\n }\n });\n }\n // This should be called by any subclass wrapping a TransactionResponse\n _wrapTransaction(tx, hash, startBlock) {\n if (hash != null && hexDataLength(hash) !== 32) {\n throw new Error(\"invalid response - sendTransaction\");\n }\n const result = tx;\n // Check the hash we expect is the same as the hash the server reported\n if (hash != null && tx.hash !== hash) {\n logger.throwError(\"Transaction hash mismatch from Provider.sendTransaction.\", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });\n }\n result.wait = (confirms, timeout) => __awaiter(this, void 0, void 0, function* () {\n if (confirms == null) {\n confirms = 1;\n }\n if (timeout == null) {\n timeout = 0;\n }\n // Get the details to detect replacement\n let replacement = undefined;\n if (confirms !== 0 && startBlock != null) {\n replacement = {\n data: tx.data,\n from: tx.from,\n nonce: tx.nonce,\n to: tx.to,\n value: tx.value,\n startBlock\n };\n }\n const receipt = yield this._waitForTransaction(tx.hash, confirms, timeout, replacement);\n if (receipt == null && confirms === 0) {\n return null;\n }\n // No longer pending, allow the polling loop to garbage collect this\n this._emitted[\"t:\" + tx.hash] = receipt.blockNumber;\n if (receipt.status === 0) {\n logger.throwError(\"transaction failed\", Logger.errors.CALL_EXCEPTION, {\n transactionHash: tx.hash,\n transaction: tx,\n receipt: receipt\n });\n }\n return receipt;\n });\n return result;\n }\n sendTransaction(signedTransaction) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const hexTx = yield Promise.resolve(signedTransaction).then(t => hexlify(t));\n const tx = this.formatter.transaction(signedTransaction);\n if (tx.confirmations == null) {\n tx.confirmations = 0;\n }\n const blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n try {\n const hash = yield this.perform(\"sendTransaction\", { signedTransaction: hexTx });\n return this._wrapTransaction(tx, hash, blockNumber);\n }\n catch (error) {\n error.transaction = tx;\n error.transactionHash = tx.hash;\n throw error;\n }\n });\n }\n _getTransactionRequest(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n const values = yield transaction;\n const tx = {};\n [\"from\", \"to\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? this._getAddress(v) : null));\n });\n [\"gasLimit\", \"gasPrice\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"value\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? BigNumber.from(v) : null));\n });\n [\"type\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => ((v != null) ? v : null));\n });\n if (values.accessList) {\n tx.accessList = this.formatter.accessList(values.accessList);\n }\n [\"data\"].forEach((key) => {\n if (values[key] == null) {\n return;\n }\n tx[key] = Promise.resolve(values[key]).then((v) => (v ? hexlify(v) : null));\n });\n return this.formatter.transactionRequest(yield resolveProperties(tx));\n });\n }\n _getFilter(filter) {\n return __awaiter(this, void 0, void 0, function* () {\n filter = yield filter;\n const result = {};\n if (filter.address != null) {\n result.address = this._getAddress(filter.address);\n }\n [\"blockHash\", \"topics\"].forEach((key) => {\n if (filter[key] == null) {\n return;\n }\n result[key] = filter[key];\n });\n [\"fromBlock\", \"toBlock\"].forEach((key) => {\n if (filter[key] == null) {\n return;\n }\n result[key] = this._getBlockTag(filter[key]);\n });\n return this.formatter.filter(yield resolveProperties(result));\n });\n }\n call(transaction, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n transaction: this._getTransactionRequest(transaction),\n blockTag: this._getBlockTag(blockTag)\n });\n const result = yield this.perform(\"call\", params);\n try {\n return hexlify(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"call\",\n params, result, error\n });\n }\n });\n }\n estimateGas(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({\n transaction: this._getTransactionRequest(transaction)\n });\n const result = yield this.perform(\"estimateGas\", params);\n try {\n return BigNumber.from(result);\n }\n catch (error) {\n return logger.throwError(\"bad result from backend\", Logger.errors.SERVER_ERROR, {\n method: \"estimateGas\",\n params, result, error\n });\n }\n });\n }\n _getAddress(addressOrName) {\n return __awaiter(this, void 0, void 0, function* () {\n addressOrName = yield addressOrName;\n if (typeof (addressOrName) !== \"string\") {\n logger.throwArgumentError(\"invalid address or ENS name\", \"name\", addressOrName);\n }\n const address = yield this.resolveName(addressOrName);\n if (address == null) {\n logger.throwError(\"ENS name not configured\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: `resolveName(${JSON.stringify(addressOrName)})`\n });\n }\n return address;\n });\n }\n _getBlock(blockHashOrBlockTag, includeTransactions) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n blockHashOrBlockTag = yield blockHashOrBlockTag;\n // If blockTag is a number (not \"latest\", etc), this is the block number\n let blockNumber = -128;\n const params = {\n includeTransactions: !!includeTransactions\n };\n if (isHexString(blockHashOrBlockTag, 32)) {\n params.blockHash = blockHashOrBlockTag;\n }\n else {\n try {\n params.blockTag = yield this._getBlockTag(blockHashOrBlockTag);\n if (isHexString(params.blockTag)) {\n blockNumber = parseInt(params.blockTag.substring(2), 16);\n }\n }\n catch (error) {\n logger.throwArgumentError(\"invalid block hash or block tag\", \"blockHashOrBlockTag\", blockHashOrBlockTag);\n }\n }\n return poll(() => __awaiter(this, void 0, void 0, function* () {\n const block = yield this.perform(\"getBlock\", params);\n // Block was not found\n if (block == null) {\n // For blockhashes, if we didn't say it existed, that blockhash may\n // not exist. If we did see it though, perhaps from a log, we know\n // it exists, and this node is just not caught up yet.\n if (params.blockHash != null) {\n if (this._emitted[\"b:\" + params.blockHash] == null) {\n return null;\n }\n }\n // For block tags, if we are asking for a future block, we return null\n if (params.blockTag != null) {\n if (blockNumber > this._emitted.block) {\n return null;\n }\n }\n // Retry on the next block\n return undefined;\n }\n // Add transactions\n if (includeTransactions) {\n let blockNumber = null;\n for (let i = 0; i < block.transactions.length; i++) {\n const tx = block.transactions[i];\n if (tx.blockNumber == null) {\n tx.confirmations = 0;\n }\n else if (tx.confirmations == null) {\n if (blockNumber == null) {\n blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n }\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - tx.blockNumber) + 1;\n if (confirmations <= 0) {\n confirmations = 1;\n }\n tx.confirmations = confirmations;\n }\n }\n const blockWithTxs = this.formatter.blockWithTransactions(block);\n blockWithTxs.transactions = blockWithTxs.transactions.map((tx) => this._wrapTransaction(tx));\n return blockWithTxs;\n }\n return this.formatter.block(block);\n }), { oncePoll: this });\n });\n }\n getBlock(blockHashOrBlockTag) {\n return (this._getBlock(blockHashOrBlockTag, false));\n }\n getBlockWithTransactions(blockHashOrBlockTag) {\n return (this._getBlock(blockHashOrBlockTag, true));\n }\n getTransaction(transactionHash) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n transactionHash = yield transactionHash;\n const params = { transactionHash: this.formatter.hash(transactionHash, true) };\n return poll(() => __awaiter(this, void 0, void 0, function* () {\n const result = yield this.perform(\"getTransaction\", params);\n if (result == null) {\n if (this._emitted[\"t:\" + transactionHash] == null) {\n return null;\n }\n return undefined;\n }\n const tx = this.formatter.transactionResponse(result);\n if (tx.blockNumber == null) {\n tx.confirmations = 0;\n }\n else if (tx.confirmations == null) {\n const blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - tx.blockNumber) + 1;\n if (confirmations <= 0) {\n confirmations = 1;\n }\n tx.confirmations = confirmations;\n }\n return this._wrapTransaction(tx);\n }), { oncePoll: this });\n });\n }\n getTransactionReceipt(transactionHash) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n transactionHash = yield transactionHash;\n const params = { transactionHash: this.formatter.hash(transactionHash, true) };\n return poll(() => __awaiter(this, void 0, void 0, function* () {\n const result = yield this.perform(\"getTransactionReceipt\", params);\n if (result == null) {\n if (this._emitted[\"t:\" + transactionHash] == null) {\n return null;\n }\n return undefined;\n }\n // \"geth-etc\" returns receipts before they are ready\n if (result.blockHash == null) {\n return undefined;\n }\n const receipt = this.formatter.receipt(result);\n if (receipt.blockNumber == null) {\n receipt.confirmations = 0;\n }\n else if (receipt.confirmations == null) {\n const blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n // Add the confirmations using the fast block number (pessimistic)\n let confirmations = (blockNumber - receipt.blockNumber) + 1;\n if (confirmations <= 0) {\n confirmations = 1;\n }\n receipt.confirmations = confirmations;\n }\n return receipt;\n }), { oncePoll: this });\n });\n }\n getLogs(filter) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n const params = yield resolveProperties({ filter: this._getFilter(filter) });\n const logs = yield this.perform(\"getLogs\", params);\n logs.forEach((log) => {\n if (log.removed == null) {\n log.removed = false;\n }\n });\n return Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(logs);\n });\n }\n getEtherPrice() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getNetwork();\n return this.perform(\"getEtherPrice\", {});\n });\n }\n _getBlockTag(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n blockTag = yield blockTag;\n if (typeof (blockTag) === \"number\" && blockTag < 0) {\n if (blockTag % 1) {\n logger.throwArgumentError(\"invalid BlockTag\", \"blockTag\", blockTag);\n }\n let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);\n blockNumber += blockTag;\n if (blockNumber < 0) {\n blockNumber = 0;\n }\n return this.formatter.blockTag(blockNumber);\n }\n return this.formatter.blockTag(blockTag);\n });\n }\n getResolver(name) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const address = yield this._getResolver(name);\n if (address == null) {\n return null;\n }\n return new Resolver(this, address, name);\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n return null;\n }\n throw error;\n }\n });\n }\n _getResolver(name) {\n return __awaiter(this, void 0, void 0, function* () {\n // Get the resolver from the blockchain\n const network = yield this.getNetwork();\n // No ENS...\n if (!network.ensAddress) {\n logger.throwError(\"network does not support ENS\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"ENS\", network: network.name });\n }\n // keccak256(\"resolver(bytes32)\")\n const transaction = {\n to: network.ensAddress,\n data: (\"0x0178b8bf\" + namehash(name).substring(2))\n };\n try {\n return this.formatter.callAddress(yield this.call(transaction));\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n return null;\n }\n throw error;\n }\n });\n }\n resolveName(name) {\n return __awaiter(this, void 0, void 0, function* () {\n name = yield name;\n // If it is already an address, nothing to resolve\n try {\n return Promise.resolve(this.formatter.address(name));\n }\n catch (error) {\n // If is is a hexstring, the address is bad (See #694)\n if (isHexString(name)) {\n throw error;\n }\n }\n if (typeof (name) !== \"string\") {\n logger.throwArgumentError(\"invalid ENS name\", \"name\", name);\n }\n // Get the addr from the resovler\n const resolver = yield this.getResolver(name);\n if (!resolver) {\n return null;\n }\n return yield resolver.getAddress();\n });\n }\n lookupAddress(address) {\n return __awaiter(this, void 0, void 0, function* () {\n address = yield address;\n address = this.formatter.address(address);\n const reverseName = address.substring(2).toLowerCase() + \".addr.reverse\";\n const resolverAddress = yield this._getResolver(reverseName);\n if (!resolverAddress) {\n return null;\n }\n // keccak(\"name(bytes32)\")\n let bytes = arrayify(yield this.call({\n to: resolverAddress,\n data: (\"0x691f3431\" + namehash(reverseName).substring(2))\n }));\n // Strip off the dynamic string pointer (0x20)\n if (bytes.length < 32 || !BigNumber.from(bytes.slice(0, 32)).eq(32)) {\n return null;\n }\n bytes = bytes.slice(32);\n // Not a length-prefixed string\n if (bytes.length < 32) {\n return null;\n }\n // Get the length of the string (from the length-prefix)\n const length = BigNumber.from(bytes.slice(0, 32)).toNumber();\n bytes = bytes.slice(32);\n // Length longer than available data\n if (length > bytes.length) {\n return null;\n }\n const name = toUtf8String(bytes.slice(0, length));\n // Make sure the reverse record matches the foward record\n const addr = yield this.resolveName(name);\n if (addr != address) {\n return null;\n }\n return name;\n });\n }\n getAvatar(nameOrAddress) {\n return __awaiter(this, void 0, void 0, function* () {\n let resolver = null;\n if (isHexString(nameOrAddress)) {\n // Address; reverse lookup\n const address = this.formatter.address(nameOrAddress);\n const reverseName = address.substring(2).toLowerCase() + \".addr.reverse\";\n const resolverAddress = yield this._getResolver(reverseName);\n if (!resolverAddress) {\n return null;\n }\n resolver = new Resolver(this, resolverAddress, \"_\", address);\n }\n else {\n // ENS name; forward lookup\n resolver = yield this.getResolver(nameOrAddress);\n if (!resolver) {\n return null;\n }\n }\n const avatar = yield resolver.getAvatar();\n if (avatar == null) {\n return null;\n }\n return avatar.url;\n });\n }\n perform(method, params) {\n return logger.throwError(method + \" not implemented\", Logger.errors.NOT_IMPLEMENTED, { operation: method });\n }\n _startEvent(event) {\n this.polling = (this._events.filter((e) => e.pollable()).length > 0);\n }\n _stopEvent(event) {\n this.polling = (this._events.filter((e) => e.pollable()).length > 0);\n }\n _addEventListener(eventName, listener, once) {\n const event = new Event(getEventTag(eventName), listener, once);\n this._events.push(event);\n this._startEvent(event);\n return this;\n }\n on(eventName, listener) {\n return this._addEventListener(eventName, listener, false);\n }\n once(eventName, listener) {\n return this._addEventListener(eventName, listener, true);\n }\n emit(eventName, ...args) {\n let result = false;\n let stopped = [];\n let eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag) {\n return true;\n }\n setTimeout(() => {\n event.listener.apply(this, args);\n }, 0);\n result = true;\n if (event.once) {\n stopped.push(event);\n return false;\n }\n return true;\n });\n stopped.forEach((event) => { this._stopEvent(event); });\n return result;\n }\n listenerCount(eventName) {\n if (!eventName) {\n return this._events.length;\n }\n let eventTag = getEventTag(eventName);\n return this._events.filter((event) => {\n return (event.tag === eventTag);\n }).length;\n }\n listeners(eventName) {\n if (eventName == null) {\n return this._events.map((event) => event.listener);\n }\n let eventTag = getEventTag(eventName);\n return this._events\n .filter((event) => (event.tag === eventTag))\n .map((event) => event.listener);\n }\n off(eventName, listener) {\n if (listener == null) {\n return this.removeAllListeners(eventName);\n }\n const stopped = [];\n let found = false;\n let eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag || event.listener != listener) {\n return true;\n }\n if (found) {\n return true;\n }\n found = true;\n stopped.push(event);\n return false;\n });\n stopped.forEach((event) => { this._stopEvent(event); });\n return this;\n }\n removeAllListeners(eventName) {\n let stopped = [];\n if (eventName == null) {\n stopped = this._events;\n this._events = [];\n }\n else {\n const eventTag = getEventTag(eventName);\n this._events = this._events.filter((event) => {\n if (event.tag !== eventTag) {\n return true;\n }\n stopped.push(event);\n return false;\n });\n }\n stopped.forEach((event) => { this._stopEvent(event); });\n return this;\n }\n}\n//# sourceMappingURL=base-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Signer } from \"@ethersproject/abstract-signer\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { hexlify, hexValue, isHexString } from \"@ethersproject/bytes\";\nimport { _TypedDataEncoder } from \"@ethersproject/hash\";\nimport { checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nimport { accessListify } from \"@ethersproject/transactions\";\nimport { fetchJson, poll } from \"@ethersproject/web\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { BaseProvider } from \"./base-provider\";\nconst errorGas = [\"call\", \"estimateGas\"];\nfunction checkError(method, error, params) {\n // Undo the \"convenience\" some nodes are attempting to prevent backwards\n // incompatibility; maybe for v6 consider forwarding reverts as errors\n if (method === \"call\" && error.code === Logger.errors.SERVER_ERROR) {\n const e = error.error;\n if (e && e.message.match(\"reverted\") && isHexString(e.data)) {\n return e.data;\n }\n logger.throwError(\"missing revert data in call exception\", Logger.errors.CALL_EXCEPTION, {\n error, data: \"0x\"\n });\n }\n let message = error.message;\n if (error.code === Logger.errors.SERVER_ERROR && error.error && typeof (error.error.message) === \"string\") {\n message = error.error.message;\n }\n else if (typeof (error.body) === \"string\") {\n message = error.body;\n }\n else if (typeof (error.responseText) === \"string\") {\n message = error.responseText;\n }\n message = (message || \"\").toLowerCase();\n const transaction = params.transaction || params.signedTransaction;\n // \"insufficient funds for gas * price + value + cost(data)\"\n if (message.match(/insufficient funds|base fee exceeds gas limit/)) {\n logger.throwError(\"insufficient funds for intrinsic transaction cost\", Logger.errors.INSUFFICIENT_FUNDS, {\n error, method, transaction\n });\n }\n // \"nonce too low\"\n if (message.match(/nonce too low/)) {\n logger.throwError(\"nonce has already been used\", Logger.errors.NONCE_EXPIRED, {\n error, method, transaction\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction underpriced/)) {\n logger.throwError(\"replacement fee too low\", Logger.errors.REPLACEMENT_UNDERPRICED, {\n error, method, transaction\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/only replay-protected/)) {\n logger.throwError(\"legacy pre-eip-155 transactions not supported\", Logger.errors.UNSUPPORTED_OPERATION, {\n error, method, transaction\n });\n }\n if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted/)) {\n logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n error, method, transaction\n });\n }\n throw error;\n}\nfunction timer(timeout) {\n return new Promise(function (resolve) {\n setTimeout(resolve, timeout);\n });\n}\nfunction getResult(payload) {\n if (payload.error) {\n // @TODO: not any\n const error = new Error(payload.error.message);\n error.code = payload.error.code;\n error.data = payload.error.data;\n throw error;\n }\n return payload.result;\n}\nfunction getLowerCase(value) {\n if (value) {\n return value.toLowerCase();\n }\n return value;\n}\nconst _constructorGuard = {};\nexport class JsonRpcSigner extends Signer {\n constructor(constructorGuard, provider, addressOrIndex) {\n logger.checkNew(new.target, JsonRpcSigner);\n super();\n if (constructorGuard !== _constructorGuard) {\n throw new Error(\"do not call the JsonRpcSigner constructor directly; use provider.getSigner\");\n }\n defineReadOnly(this, \"provider\", provider);\n if (addressOrIndex == null) {\n addressOrIndex = 0;\n }\n if (typeof (addressOrIndex) === \"string\") {\n defineReadOnly(this, \"_address\", this.provider.formatter.address(addressOrIndex));\n defineReadOnly(this, \"_index\", null);\n }\n else if (typeof (addressOrIndex) === \"number\") {\n defineReadOnly(this, \"_index\", addressOrIndex);\n defineReadOnly(this, \"_address\", null);\n }\n else {\n logger.throwArgumentError(\"invalid address or index\", \"addressOrIndex\", addressOrIndex);\n }\n }\n connect(provider) {\n return logger.throwError(\"cannot alter JSON-RPC Signer connection\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"connect\"\n });\n }\n connectUnchecked() {\n return new UncheckedJsonRpcSigner(_constructorGuard, this.provider, this._address || this._index);\n }\n getAddress() {\n if (this._address) {\n return Promise.resolve(this._address);\n }\n return this.provider.send(\"eth_accounts\", []).then((accounts) => {\n if (accounts.length <= this._index) {\n logger.throwError(\"unknown account #\" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"getAddress\"\n });\n }\n return this.provider.formatter.address(accounts[this._index]);\n });\n }\n sendUncheckedTransaction(transaction) {\n transaction = shallowCopy(transaction);\n const fromAddress = this.getAddress().then((address) => {\n if (address) {\n address = address.toLowerCase();\n }\n return address;\n });\n // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user\n // wishes to use this, it is easy to specify explicitly, otherwise\n // we look it up for them.\n if (transaction.gasLimit == null) {\n const estimate = shallowCopy(transaction);\n estimate.from = fromAddress;\n transaction.gasLimit = this.provider.estimateGas(estimate);\n }\n if (transaction.to != null) {\n transaction.to = Promise.resolve(transaction.to).then((to) => __awaiter(this, void 0, void 0, function* () {\n if (to == null) {\n return null;\n }\n const address = yield this.provider.resolveName(to);\n if (address == null) {\n logger.throwArgumentError(\"provided ENS name resolves to null\", \"tx.to\", to);\n }\n return address;\n }));\n }\n return resolveProperties({\n tx: resolveProperties(transaction),\n sender: fromAddress\n }).then(({ tx, sender }) => {\n if (tx.from != null) {\n if (tx.from.toLowerCase() !== sender) {\n logger.throwArgumentError(\"from address mismatch\", \"transaction\", transaction);\n }\n }\n else {\n tx.from = sender;\n }\n const hexTx = this.provider.constructor.hexlifyTransaction(tx, { from: true });\n return this.provider.send(\"eth_sendTransaction\", [hexTx]).then((hash) => {\n return hash;\n }, (error) => {\n return checkError(\"sendTransaction\", error, hexTx);\n });\n });\n }\n signTransaction(transaction) {\n return logger.throwError(\"signing transactions is unsupported\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"signTransaction\"\n });\n }\n sendTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n // This cannot be mined any earlier than any recent block\n const blockNumber = yield this.provider._getInternalBlockNumber(100 + 2 * this.provider.pollingInterval);\n // Send the transaction\n const hash = yield this.sendUncheckedTransaction(transaction);\n try {\n // Unfortunately, JSON-RPC only provides and opaque transaction hash\n // for a response, and we need the actual transaction, so we poll\n // for it; it should show up very quickly\n return yield poll(() => __awaiter(this, void 0, void 0, function* () {\n const tx = yield this.provider.getTransaction(hash);\n if (tx === null) {\n return undefined;\n }\n return this.provider._wrapTransaction(tx, hash, blockNumber);\n }), { oncePoll: this.provider });\n }\n catch (error) {\n error.transactionHash = hash;\n throw error;\n }\n });\n }\n signMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = ((typeof (message) === \"string\") ? toUtf8Bytes(message) : message);\n const address = yield this.getAddress();\n return yield this.provider.send(\"personal_sign\", [hexlify(data), address.toLowerCase()]);\n });\n }\n _legacySignMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = ((typeof (message) === \"string\") ? toUtf8Bytes(message) : message);\n const address = yield this.getAddress();\n // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign\n return yield this.provider.send(\"eth_sign\", [address.toLowerCase(), hexlify(data)]);\n });\n }\n _signTypedData(domain, types, value) {\n return __awaiter(this, void 0, void 0, function* () {\n // Populate any ENS names (in-place)\n const populated = yield _TypedDataEncoder.resolveNames(domain, types, value, (name) => {\n return this.provider.resolveName(name);\n });\n const address = yield this.getAddress();\n return yield this.provider.send(\"eth_signTypedData_v4\", [\n address.toLowerCase(),\n JSON.stringify(_TypedDataEncoder.getPayload(populated.domain, types, populated.value))\n ]);\n });\n }\n unlock(password) {\n return __awaiter(this, void 0, void 0, function* () {\n const provider = this.provider;\n const address = yield this.getAddress();\n return provider.send(\"personal_unlockAccount\", [address.toLowerCase(), password, null]);\n });\n }\n}\nclass UncheckedJsonRpcSigner extends JsonRpcSigner {\n sendTransaction(transaction) {\n return this.sendUncheckedTransaction(transaction).then((hash) => {\n return {\n hash: hash,\n nonce: null,\n gasLimit: null,\n gasPrice: null,\n data: null,\n value: null,\n chainId: null,\n confirmations: 0,\n from: null,\n wait: (confirmations) => { return this.provider.waitForTransaction(hash, confirmations); }\n };\n });\n }\n}\nconst allowedTransactionKeys = {\n chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, value: true,\n type: true, accessList: true,\n maxFeePerGas: true, maxPriorityFeePerGas: true\n};\nexport class JsonRpcProvider extends BaseProvider {\n constructor(url, network) {\n logger.checkNew(new.target, JsonRpcProvider);\n let networkOrReady = network;\n // The network is unknown, query the JSON-RPC for it\n if (networkOrReady == null) {\n networkOrReady = new Promise((resolve, reject) => {\n setTimeout(() => {\n this.detectNetwork().then((network) => {\n resolve(network);\n }, (error) => {\n reject(error);\n });\n }, 0);\n });\n }\n super(networkOrReady);\n // Default URL\n if (!url) {\n url = getStatic(this.constructor, \"defaultUrl\")();\n }\n if (typeof (url) === \"string\") {\n defineReadOnly(this, \"connection\", Object.freeze({\n url: url\n }));\n }\n else {\n defineReadOnly(this, \"connection\", Object.freeze(shallowCopy(url)));\n }\n this._nextId = 42;\n }\n get _cache() {\n if (this._eventLoopCache == null) {\n this._eventLoopCache = {};\n }\n return this._eventLoopCache;\n }\n static defaultUrl() {\n return \"http:/\\/localhost:8545\";\n }\n detectNetwork() {\n if (!this._cache[\"detectNetwork\"]) {\n this._cache[\"detectNetwork\"] = this._uncachedDetectNetwork();\n // Clear this cache at the beginning of the next event loop\n setTimeout(() => {\n this._cache[\"detectNetwork\"] = null;\n }, 0);\n }\n return this._cache[\"detectNetwork\"];\n }\n _uncachedDetectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n yield timer(0);\n let chainId = null;\n try {\n chainId = yield this.send(\"eth_chainId\", []);\n }\n catch (error) {\n try {\n chainId = yield this.send(\"net_version\", []);\n }\n catch (error) { }\n }\n if (chainId != null) {\n const getNetwork = getStatic(this.constructor, \"getNetwork\");\n try {\n return getNetwork(BigNumber.from(chainId).toNumber());\n }\n catch (error) {\n return logger.throwError(\"could not detect network\", Logger.errors.NETWORK_ERROR, {\n chainId: chainId,\n event: \"invalidNetwork\",\n serverError: error\n });\n }\n }\n return logger.throwError(\"could not detect network\", Logger.errors.NETWORK_ERROR, {\n event: \"noNetwork\"\n });\n });\n }\n getSigner(addressOrIndex) {\n return new JsonRpcSigner(_constructorGuard, this, addressOrIndex);\n }\n getUncheckedSigner(addressOrIndex) {\n return this.getSigner(addressOrIndex).connectUnchecked();\n }\n listAccounts() {\n return this.send(\"eth_accounts\", []).then((accounts) => {\n return accounts.map((a) => this.formatter.address(a));\n });\n }\n send(method, params) {\n const request = {\n method: method,\n params: params,\n id: (this._nextId++),\n jsonrpc: \"2.0\"\n };\n this.emit(\"debug\", {\n action: \"request\",\n request: deepCopy(request),\n provider: this\n });\n // We can expand this in the future to any call, but for now these\n // are the biggest wins and do not require any serializing parameters.\n const cache = ([\"eth_chainId\", \"eth_blockNumber\"].indexOf(method) >= 0);\n if (cache && this._cache[method]) {\n return this._cache[method];\n }\n const result = fetchJson(this.connection, JSON.stringify(request), getResult).then((result) => {\n this.emit(\"debug\", {\n action: \"response\",\n request: request,\n response: result,\n provider: this\n });\n return result;\n }, (error) => {\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: request,\n provider: this\n });\n throw error;\n });\n // Cache the fetch, but clear it on the next event loop\n if (cache) {\n this._cache[method] = result;\n setTimeout(() => {\n this._cache[method] = null;\n }, 0);\n }\n return result;\n }\n prepareRequest(method, params) {\n switch (method) {\n case \"getBlockNumber\":\n return [\"eth_blockNumber\", []];\n case \"getGasPrice\":\n return [\"eth_gasPrice\", []];\n case \"getBalance\":\n return [\"eth_getBalance\", [getLowerCase(params.address), params.blockTag]];\n case \"getTransactionCount\":\n return [\"eth_getTransactionCount\", [getLowerCase(params.address), params.blockTag]];\n case \"getCode\":\n return [\"eth_getCode\", [getLowerCase(params.address), params.blockTag]];\n case \"getStorageAt\":\n return [\"eth_getStorageAt\", [getLowerCase(params.address), params.position, params.blockTag]];\n case \"sendTransaction\":\n return [\"eth_sendRawTransaction\", [params.signedTransaction]];\n case \"getBlock\":\n if (params.blockTag) {\n return [\"eth_getBlockByNumber\", [params.blockTag, !!params.includeTransactions]];\n }\n else if (params.blockHash) {\n return [\"eth_getBlockByHash\", [params.blockHash, !!params.includeTransactions]];\n }\n return null;\n case \"getTransaction\":\n return [\"eth_getTransactionByHash\", [params.transactionHash]];\n case \"getTransactionReceipt\":\n return [\"eth_getTransactionReceipt\", [params.transactionHash]];\n case \"call\": {\n const hexlifyTransaction = getStatic(this.constructor, \"hexlifyTransaction\");\n return [\"eth_call\", [hexlifyTransaction(params.transaction, { from: true }), params.blockTag]];\n }\n case \"estimateGas\": {\n const hexlifyTransaction = getStatic(this.constructor, \"hexlifyTransaction\");\n return [\"eth_estimateGas\", [hexlifyTransaction(params.transaction, { from: true })]];\n }\n case \"getLogs\":\n if (params.filter && params.filter.address != null) {\n params.filter.address = getLowerCase(params.filter.address);\n }\n return [\"eth_getLogs\", [params.filter]];\n default:\n break;\n }\n return null;\n }\n perform(method, params) {\n return __awaiter(this, void 0, void 0, function* () {\n // Legacy networks do not like the type field being passed along (which\n // is fair), so we delete type if it is 0 and a non-EIP-1559 network\n if (method === \"call\" || method === \"estimateGas\") {\n const tx = params.transaction;\n if (tx && tx.type != null && BigNumber.from(tx.type).isZero()) {\n // If there are no EIP-1559 properties, it might be non-EIP-a559\n if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {\n const feeData = yield this.getFeeData();\n if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {\n // Network doesn't know about EIP-1559 (and hence type)\n params = shallowCopy(params);\n params.transaction = shallowCopy(tx);\n delete params.transaction.type;\n }\n }\n }\n }\n const args = this.prepareRequest(method, params);\n if (args == null) {\n logger.throwError(method + \" not implemented\", Logger.errors.NOT_IMPLEMENTED, { operation: method });\n }\n try {\n return yield this.send(args[0], args[1]);\n }\n catch (error) {\n return checkError(method, error, params);\n }\n });\n }\n _startEvent(event) {\n if (event.tag === \"pending\") {\n this._startPending();\n }\n super._startEvent(event);\n }\n _startPending() {\n if (this._pendingFilter != null) {\n return;\n }\n const self = this;\n const pendingFilter = this.send(\"eth_newPendingTransactionFilter\", []);\n this._pendingFilter = pendingFilter;\n pendingFilter.then(function (filterId) {\n function poll() {\n self.send(\"eth_getFilterChanges\", [filterId]).then(function (hashes) {\n if (self._pendingFilter != pendingFilter) {\n return null;\n }\n let seq = Promise.resolve();\n hashes.forEach(function (hash) {\n // @TODO: This should be garbage collected at some point... How? When?\n self._emitted[\"t:\" + hash.toLowerCase()] = \"pending\";\n seq = seq.then(function () {\n return self.getTransaction(hash).then(function (tx) {\n self.emit(\"pending\", tx);\n return null;\n });\n });\n });\n return seq.then(function () {\n return timer(1000);\n });\n }).then(function () {\n if (self._pendingFilter != pendingFilter) {\n self.send(\"eth_uninstallFilter\", [filterId]);\n return;\n }\n setTimeout(function () { poll(); }, 0);\n return null;\n }).catch((error) => { });\n }\n poll();\n return filterId;\n }).catch((error) => { });\n }\n _stopEvent(event) {\n if (event.tag === \"pending\" && this.listenerCount(\"pending\") === 0) {\n this._pendingFilter = null;\n }\n super._stopEvent(event);\n }\n // Convert an ethers.js transaction into a JSON-RPC transaction\n // - gasLimit => gas\n // - All values hexlified\n // - All numeric values zero-striped\n // - All addresses are lowercased\n // NOTE: This allows a TransactionRequest, but all values should be resolved\n // before this is called\n // @TODO: This will likely be removed in future versions and prepareRequest\n // will be the preferred method for this.\n static hexlifyTransaction(transaction, allowExtra) {\n // Check only allowed properties are given\n const allowed = shallowCopy(allowedTransactionKeys);\n if (allowExtra) {\n for (const key in allowExtra) {\n if (allowExtra[key]) {\n allowed[key] = true;\n }\n }\n }\n checkProperties(transaction, allowed);\n const result = {};\n // Some nodes (INFURA ropsten; INFURA mainnet is fine) do not like leading zeros.\n [\"gasLimit\", \"gasPrice\", \"type\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"value\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n const value = hexValue(transaction[key]);\n if (key === \"gasLimit\") {\n key = \"gas\";\n }\n result[key] = value;\n });\n [\"from\", \"to\", \"data\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n result[key] = hexlify(transaction[key]);\n });\n if (transaction.accessList) {\n result[\"accessList\"] = accessListify(transaction.accessList);\n }\n return result;\n }\n}\n//# sourceMappingURL=json-rpc-provider.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nlet WS = null;\ntry {\n WS = WebSocket;\n if (WS == null) {\n throw new Error(\"inject please\");\n }\n}\ncatch (error) {\n const logger = new Logger(version);\n WS = function () {\n logger.throwError(\"WebSockets not supported in this environment\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new WebSocket()\"\n });\n };\n}\n//export default WS;\n//module.exports = WS;\nexport { WS as WebSocket };\n//# sourceMappingURL=ws.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\nimport { WebSocket } from \"./ws\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n/**\n * Notes:\n *\n * This provider differs a bit from the polling providers. One main\n * difference is how it handles consistency. The polling providers\n * will stall responses to ensure a consistent state, while this\n * WebSocket provider assumes the connected backend will manage this.\n *\n * For example, if a polling provider emits an event which indicates\n * the event occurred in blockhash XXX, a call to fetch that block by\n * its hash XXX, if not present will retry until it is present. This\n * can occur when querying a pool of nodes that are mildly out of sync\n * with each other.\n */\nlet NextId = 1;\n// For more info about the Real-time Event API see:\n// https://geth.ethereum.org/docs/rpc/pubsub\nexport class WebSocketProvider extends JsonRpcProvider {\n constructor(url, network) {\n // This will be added in the future; please open an issue to expedite\n if (network === \"any\") {\n logger.throwError(\"WebSocketProvider does not support 'any' network yet\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"network:any\"\n });\n }\n super(url, network);\n this._pollingInterval = -1;\n this._wsReady = false;\n defineReadOnly(this, \"_websocket\", new WebSocket(this.connection.url));\n defineReadOnly(this, \"_requests\", {});\n defineReadOnly(this, \"_subs\", {});\n defineReadOnly(this, \"_subIds\", {});\n defineReadOnly(this, \"_detectNetwork\", super.detectNetwork());\n // Stall sending requests until the socket is open...\n this._websocket.onopen = () => {\n this._wsReady = true;\n Object.keys(this._requests).forEach((id) => {\n this._websocket.send(this._requests[id].payload);\n });\n };\n this._websocket.onmessage = (messageEvent) => {\n const data = messageEvent.data;\n const result = JSON.parse(data);\n if (result.id != null) {\n const id = String(result.id);\n const request = this._requests[id];\n delete this._requests[id];\n if (result.result !== undefined) {\n request.callback(null, result.result);\n this.emit(\"debug\", {\n action: \"response\",\n request: JSON.parse(request.payload),\n response: result.result,\n provider: this\n });\n }\n else {\n let error = null;\n if (result.error) {\n error = new Error(result.error.message || \"unknown error\");\n defineReadOnly(error, \"code\", result.error.code || null);\n defineReadOnly(error, \"response\", data);\n }\n else {\n error = new Error(\"unknown error\");\n }\n request.callback(error, undefined);\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: JSON.parse(request.payload),\n provider: this\n });\n }\n }\n else if (result.method === \"eth_subscription\") {\n // Subscription...\n const sub = this._subs[result.params.subscription];\n if (sub) {\n //this.emit.apply(this, );\n sub.processFunc(result.params.result);\n }\n }\n else {\n console.warn(\"this should not happen\");\n }\n };\n // This Provider does not actually poll, but we want to trigger\n // poll events for things that depend on them (like stalling for\n // block and transaction lookups)\n const fauxPoll = setInterval(() => {\n this.emit(\"poll\");\n }, 1000);\n if (fauxPoll.unref) {\n fauxPoll.unref();\n }\n }\n detectNetwork() {\n return this._detectNetwork;\n }\n get pollingInterval() {\n return 0;\n }\n resetEventsBlock(blockNumber) {\n logger.throwError(\"cannot reset events block on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"resetEventBlock\"\n });\n }\n set pollingInterval(value) {\n logger.throwError(\"cannot set polling interval on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setPollingInterval\"\n });\n }\n poll() {\n return __awaiter(this, void 0, void 0, function* () {\n return null;\n });\n }\n set polling(value) {\n if (!value) {\n return;\n }\n logger.throwError(\"cannot set polling on WebSocketProvider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setPolling\"\n });\n }\n send(method, params) {\n const rid = NextId++;\n return new Promise((resolve, reject) => {\n function callback(error, result) {\n if (error) {\n return reject(error);\n }\n return resolve(result);\n }\n const payload = JSON.stringify({\n method: method,\n params: params,\n id: rid,\n jsonrpc: \"2.0\"\n });\n this.emit(\"debug\", {\n action: \"request\",\n request: JSON.parse(payload),\n provider: this\n });\n this._requests[String(rid)] = { callback, payload };\n if (this._wsReady) {\n this._websocket.send(payload);\n }\n });\n }\n static defaultUrl() {\n return \"ws:/\\/localhost:8546\";\n }\n _subscribe(tag, param, processFunc) {\n return __awaiter(this, void 0, void 0, function* () {\n let subIdPromise = this._subIds[tag];\n if (subIdPromise == null) {\n subIdPromise = Promise.all(param).then((param) => {\n return this.send(\"eth_subscribe\", param);\n });\n this._subIds[tag] = subIdPromise;\n }\n const subId = yield subIdPromise;\n this._subs[subId] = { tag, processFunc };\n });\n }\n _startEvent(event) {\n switch (event.type) {\n case \"block\":\n this._subscribe(\"block\", [\"newHeads\"], (result) => {\n const blockNumber = BigNumber.from(result.number).toNumber();\n this._emitted.block = blockNumber;\n this.emit(\"block\", blockNumber);\n });\n break;\n case \"pending\":\n this._subscribe(\"pending\", [\"newPendingTransactions\"], (result) => {\n this.emit(\"pending\", result);\n });\n break;\n case \"filter\":\n this._subscribe(event.tag, [\"logs\", this._getFilter(event.filter)], (result) => {\n if (result.removed == null) {\n result.removed = false;\n }\n this.emit(event.filter, this.formatter.filterLog(result));\n });\n break;\n case \"tx\": {\n const emitReceipt = (event) => {\n const hash = event.hash;\n this.getTransactionReceipt(hash).then((receipt) => {\n if (!receipt) {\n return;\n }\n this.emit(hash, receipt);\n });\n };\n // In case it is already mined\n emitReceipt(event);\n // To keep things simple, we start up a single newHeads subscription\n // to keep an eye out for transactions we are watching for.\n // Starting a subscription for an event (i.e. \"tx\") that is already\n // running is (basically) a nop.\n this._subscribe(\"tx\", [\"newHeads\"], (result) => {\n this._events.filter((e) => (e.type === \"tx\")).forEach(emitReceipt);\n });\n break;\n }\n // Nothing is needed\n case \"debug\":\n case \"poll\":\n case \"willPoll\":\n case \"didPoll\":\n case \"error\":\n break;\n default:\n console.log(\"unhandled:\", event);\n break;\n }\n }\n _stopEvent(event) {\n let tag = event.tag;\n if (event.type === \"tx\") {\n // There are remaining transaction event listeners\n if (this._events.filter((e) => (e.type === \"tx\")).length) {\n return;\n }\n tag = \"tx\";\n }\n else if (this.listenerCount(event.event)) {\n // There are remaining event listeners\n return;\n }\n const subId = this._subIds[tag];\n if (!subId) {\n return;\n }\n delete this._subIds[tag];\n subId.then((subId) => {\n if (!this._subs[subId]) {\n return;\n }\n delete this._subs[subId];\n this.send(\"eth_unsubscribe\", [subId]);\n });\n }\n destroy() {\n return __awaiter(this, void 0, void 0, function* () {\n // Wait until we have connected before trying to disconnect\n if (this._websocket.readyState === WebSocket.CONNECTING) {\n yield (new Promise((resolve) => {\n this._websocket.onopen = function () {\n resolve(true);\n };\n this._websocket.onerror = function () {\n resolve(false);\n };\n }));\n }\n // Hangup\n // See: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes\n this._websocket.close(1000);\n });\n }\n}\n//# sourceMappingURL=websocket-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { defineReadOnly, getStatic } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\n// A StaticJsonRpcProvider is useful when you *know* for certain that\n// the backend will never change, as it never calls eth_chainId to\n// verify its backend. However, if the backend does change, the effects\n// are undefined and may include:\n// - inconsistent results\n// - locking up the UI\n// - block skew warnings\n// - wrong results\n// If the network is not explicit (i.e. auto-detection is expected), the\n// node MUST be running and available to respond to requests BEFORE this\n// is instantiated.\nexport class StaticJsonRpcProvider extends JsonRpcProvider {\n detectNetwork() {\n const _super = Object.create(null, {\n detectNetwork: { get: () => super.detectNetwork }\n });\n return __awaiter(this, void 0, void 0, function* () {\n let network = this.network;\n if (network == null) {\n network = yield _super.detectNetwork.call(this);\n if (!network) {\n logger.throwError(\"no network detected\", Logger.errors.UNKNOWN_ERROR, {});\n }\n // If still not set, set it\n if (this._network == null) {\n // A static network does not support \"any\"\n defineReadOnly(this, \"_network\", network);\n this.emit(\"network\", network, null);\n }\n }\n return network;\n });\n }\n}\nexport class UrlJsonRpcProvider extends StaticJsonRpcProvider {\n constructor(network, apiKey) {\n logger.checkAbstract(new.target, UrlJsonRpcProvider);\n // Normalize the Network and API Key\n network = getStatic(new.target, \"getNetwork\")(network);\n apiKey = getStatic(new.target, \"getApiKey\")(apiKey);\n const connection = getStatic(new.target, \"getUrl\")(network, apiKey);\n super(connection, network);\n if (typeof (apiKey) === \"string\") {\n defineReadOnly(this, \"apiKey\", apiKey);\n }\n else if (apiKey != null) {\n Object.keys(apiKey).forEach((key) => {\n defineReadOnly(this, key, apiKey[key]);\n });\n }\n }\n _startPending() {\n logger.warn(\"WARNING: API provider does not support pending filters\");\n }\n isCommunityResource() {\n return false;\n }\n getSigner(address) {\n return logger.throwError(\"API provider does not support signing\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"getSigner\" });\n }\n listAccounts() {\n return Promise.resolve([]);\n }\n // Return a defaultApiKey if null, otherwise validate the API key\n static getApiKey(apiKey) {\n return apiKey;\n }\n // Returns the url or connection for the given network and API key. The\n // API key will have been sanitized by the getApiKey first, so any validation\n // or transformations can be done there.\n static getUrl(network, apiKey) {\n return logger.throwError(\"not implemented; sub-classes must override getUrl\", Logger.errors.NOT_IMPLEMENTED, {\n operation: \"getUrl\"\n });\n }\n}\n//# sourceMappingURL=url-json-rpc-provider.js.map","\"use strict\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { showThrottleMessage } from \"./formatter\";\nimport { WebSocketProvider } from \"./websocket-provider\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n// This key was provided to ethers.js by Alchemy to be used by the\n// default provider, but it is recommended that for your own\n// production environments, that you acquire your own API key at:\n// https://dashboard.alchemyapi.io\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nexport class AlchemyWebSocketProvider extends WebSocketProvider {\n constructor(network, apiKey) {\n const provider = new AlchemyProvider(network, apiKey);\n const url = provider.connection.url.replace(/^http/i, \"ws\")\n .replace(\".alchemyapi.\", \".ws.alchemyapi.\");\n super(url, provider.network);\n defineReadOnly(this, \"apiKey\", provider.apiKey);\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n}\nexport class AlchemyProvider extends UrlJsonRpcProvider {\n static getWebSocketProvider(network, apiKey) {\n return new AlchemyWebSocketProvider(network, apiKey);\n }\n static getApiKey(apiKey) {\n if (apiKey == null) {\n return defaultApiKey;\n }\n if (apiKey && typeof (apiKey) !== \"string\") {\n logger.throwArgumentError(\"invalid apiKey\", \"apiKey\", apiKey);\n }\n return apiKey;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network.name) {\n case \"homestead\":\n host = \"eth-mainnet.alchemyapi.io/v2/\";\n break;\n case \"ropsten\":\n host = \"eth-ropsten.alchemyapi.io/v2/\";\n break;\n case \"rinkeby\":\n host = \"eth-rinkeby.alchemyapi.io/v2/\";\n break;\n case \"goerli\":\n host = \"eth-goerli.alchemyapi.io/v2/\";\n break;\n case \"kovan\":\n host = \"eth-kovan.alchemyapi.io/v2/\";\n break;\n case \"matic\":\n host = \"polygon-mainnet.g.alchemy.com/v2/\";\n break;\n case \"maticmum\":\n host = \"polygon-mumbai.g.alchemy.com/v2/\";\n break;\n case \"arbitrum\":\n host = \"arb-mainnet.g.alchemy.com/v2/\";\n break;\n case \"arbitrum-rinkeby\":\n host = \"arb-rinkeby.g.alchemy.com/v2/\";\n break;\n case \"optimism\":\n host = \"opt-mainnet.g.alchemy.com/v2/\";\n break;\n case \"optimism-kovan\":\n host = \"opt-kovan.g.alchemy.com/v2/\";\n break;\n default:\n logger.throwArgumentError(\"unsupported network\", \"network\", arguments[0]);\n }\n return {\n allowGzip: true,\n url: (\"https:/\" + \"/\" + host + apiKey),\n throttleCallback: (attempt, url) => {\n if (apiKey === defaultApiKey) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n}\n//# sourceMappingURL=alchemy-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport class CloudflareProvider extends UrlJsonRpcProvider {\n static getApiKey(apiKey) {\n if (apiKey != null) {\n logger.throwArgumentError(\"apiKey not supported for cloudflare\", \"apiKey\", apiKey);\n }\n return null;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network.name) {\n case \"homestead\":\n host = \"https://cloudflare-eth.com/\";\n break;\n default:\n logger.throwArgumentError(\"unsupported network\", \"network\", arguments[0]);\n }\n return host;\n }\n perform(method, params) {\n const _super = Object.create(null, {\n perform: { get: () => super.perform }\n });\n return __awaiter(this, void 0, void 0, function* () {\n // The Cloudflare provider does not support eth_blockNumber,\n // so we get the latest block and pull it from that\n if (method === \"getBlockNumber\") {\n const block = yield _super.perform.call(this, \"getBlock\", { blockTag: \"latest\" });\n return block.number;\n }\n return _super.perform.call(this, method, params);\n });\n }\n}\n//# sourceMappingURL=cloudflare-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { hexlify, hexValue, isHexString } from \"@ethersproject/bytes\";\nimport { deepCopy, defineReadOnly } from \"@ethersproject/properties\";\nimport { accessListify } from \"@ethersproject/transactions\";\nimport { fetchJson } from \"@ethersproject/web\";\nimport { showThrottleMessage } from \"./formatter\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { BaseProvider } from \"./base-provider\";\n// The transaction has already been sanitized by the calls in Provider\nfunction getTransactionPostData(transaction) {\n const result = {};\n for (let key in transaction) {\n if (transaction[key] == null) {\n continue;\n }\n let value = transaction[key];\n if (key === \"type\" && value === 0) {\n continue;\n }\n // Quantity-types require no leading zero, unless 0\n if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {\n value = hexValue(hexlify(value));\n }\n else if (key === \"accessList\") {\n value = \"[\" + accessListify(value).map((set) => {\n return `{address:\"${set.address}\",storageKeys:[\"${set.storageKeys.join('\",\"')}\"]}`;\n }).join(\",\") + \"]\";\n }\n else {\n value = hexlify(value);\n }\n result[key] = value;\n }\n return result;\n}\nfunction getResult(result) {\n // getLogs, getHistory have weird success responses\n if (result.status == 0 && (result.message === \"No records found\" || result.message === \"No transactions found\")) {\n return result.result;\n }\n if (result.status != 1 || result.message != \"OK\") {\n const error = new Error(\"invalid response\");\n error.result = JSON.stringify(result);\n if ((result.result || \"\").toLowerCase().indexOf(\"rate limit\") >= 0) {\n error.throttleRetry = true;\n }\n throw error;\n }\n return result.result;\n}\nfunction getJsonResult(result) {\n // This response indicates we are being throttled\n if (result && result.status == 0 && result.message == \"NOTOK\" && (result.result || \"\").toLowerCase().indexOf(\"rate limit\") >= 0) {\n const error = new Error(\"throttled response\");\n error.result = JSON.stringify(result);\n error.throttleRetry = true;\n throw error;\n }\n if (result.jsonrpc != \"2.0\") {\n // @TODO: not any\n const error = new Error(\"invalid response\");\n error.result = JSON.stringify(result);\n throw error;\n }\n if (result.error) {\n // @TODO: not any\n const error = new Error(result.error.message || \"unknown error\");\n if (result.error.code) {\n error.code = result.error.code;\n }\n if (result.error.data) {\n error.data = result.error.data;\n }\n throw error;\n }\n return result.result;\n}\n// The blockTag was normalized as a string by the Provider pre-perform operations\nfunction checkLogTag(blockTag) {\n if (blockTag === \"pending\") {\n throw new Error(\"pending not supported\");\n }\n if (blockTag === \"latest\") {\n return blockTag;\n }\n return parseInt(blockTag.substring(2), 16);\n}\nconst defaultApiKey = \"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB\";\nfunction checkError(method, error, transaction) {\n // Undo the \"convenience\" some nodes are attempting to prevent backwards\n // incompatibility; maybe for v6 consider forwarding reverts as errors\n if (method === \"call\" && error.code === Logger.errors.SERVER_ERROR) {\n const e = error.error;\n // Etherscan keeps changing their string\n if (e && (e.message.match(/reverted/i) || e.message.match(/VM execution error/i))) {\n // Etherscan prefixes the data like \"Reverted 0x1234\"\n let data = e.data;\n if (data) {\n data = \"0x\" + data.replace(/^.*0x/i, \"\");\n }\n if (isHexString(data)) {\n return data;\n }\n logger.throwError(\"missing revert data in call exception\", Logger.errors.CALL_EXCEPTION, {\n error, data: \"0x\"\n });\n }\n }\n // Get the message from any nested error structure\n let message = error.message;\n if (error.code === Logger.errors.SERVER_ERROR) {\n if (error.error && typeof (error.error.message) === \"string\") {\n message = error.error.message;\n }\n else if (typeof (error.body) === \"string\") {\n message = error.body;\n }\n else if (typeof (error.responseText) === \"string\") {\n message = error.responseText;\n }\n }\n message = (message || \"\").toLowerCase();\n // \"Insufficient funds. The account you tried to send transaction from does not have enough funds. Required 21464000000000 and got: 0\"\n if (message.match(/insufficient funds/)) {\n logger.throwError(\"insufficient funds for intrinsic transaction cost\", Logger.errors.INSUFFICIENT_FUNDS, {\n error, method, transaction\n });\n }\n // \"Transaction with the same hash was already imported.\"\n if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {\n logger.throwError(\"nonce has already been used\", Logger.errors.NONCE_EXPIRED, {\n error, method, transaction\n });\n }\n // \"Transaction gas price is too low. There is another transaction with same nonce in the queue. Try increasing the gas price or incrementing the nonce.\"\n if (message.match(/another transaction with same nonce/)) {\n logger.throwError(\"replacement fee too low\", Logger.errors.REPLACEMENT_UNDERPRICED, {\n error, method, transaction\n });\n }\n if (message.match(/execution failed due to an exception|execution reverted/)) {\n logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n error, method, transaction\n });\n }\n throw error;\n}\nexport class EtherscanProvider extends BaseProvider {\n constructor(network, apiKey) {\n logger.checkNew(new.target, EtherscanProvider);\n super(network);\n defineReadOnly(this, \"baseUrl\", this.getBaseUrl());\n defineReadOnly(this, \"apiKey\", apiKey || defaultApiKey);\n }\n getBaseUrl() {\n switch (this.network ? this.network.name : \"invalid\") {\n case \"homestead\":\n return \"https:/\\/api.etherscan.io\";\n case \"ropsten\":\n return \"https:/\\/api-ropsten.etherscan.io\";\n case \"rinkeby\":\n return \"https:/\\/api-rinkeby.etherscan.io\";\n case \"kovan\":\n return \"https:/\\/api-kovan.etherscan.io\";\n case \"goerli\":\n return \"https:/\\/api-goerli.etherscan.io\";\n default:\n }\n return logger.throwArgumentError(\"unsupported network\", \"network\", name);\n }\n getUrl(module, params) {\n const query = Object.keys(params).reduce((accum, key) => {\n const value = params[key];\n if (value != null) {\n accum += `&${key}=${value}`;\n }\n return accum;\n }, \"\");\n const apiKey = ((this.apiKey) ? `&apikey=${this.apiKey}` : \"\");\n return `${this.baseUrl}/api?module=${module}${query}${apiKey}`;\n }\n getPostUrl() {\n return `${this.baseUrl}/api`;\n }\n getPostData(module, params) {\n params.module = module;\n params.apikey = this.apiKey;\n return params;\n }\n fetch(module, params, post) {\n return __awaiter(this, void 0, void 0, function* () {\n const url = (post ? this.getPostUrl() : this.getUrl(module, params));\n const payload = (post ? this.getPostData(module, params) : null);\n const procFunc = (module === \"proxy\") ? getJsonResult : getResult;\n this.emit(\"debug\", {\n action: \"request\",\n request: url,\n provider: this\n });\n const connection = {\n url: url,\n throttleSlotInterval: 1000,\n throttleCallback: (attempt, url) => {\n if (this.isCommunityResource()) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n let payloadStr = null;\n if (payload) {\n connection.headers = { \"content-type\": \"application/x-www-form-urlencoded; charset=UTF-8\" };\n payloadStr = Object.keys(payload).map((key) => {\n return `${key}=${payload[key]}`;\n }).join(\"&\");\n }\n const result = yield fetchJson(connection, payloadStr, procFunc || getJsonResult);\n this.emit(\"debug\", {\n action: \"response\",\n request: url,\n response: deepCopy(result),\n provider: this\n });\n return result;\n });\n }\n detectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.network;\n });\n }\n perform(method, params) {\n const _super = Object.create(null, {\n perform: { get: () => super.perform }\n });\n return __awaiter(this, void 0, void 0, function* () {\n switch (method) {\n case \"getBlockNumber\":\n return this.fetch(\"proxy\", { action: \"eth_blockNumber\" });\n case \"getGasPrice\":\n return this.fetch(\"proxy\", { action: \"eth_gasPrice\" });\n case \"getBalance\":\n // Returns base-10 result\n return this.fetch(\"account\", {\n action: \"balance\",\n address: params.address,\n tag: params.blockTag\n });\n case \"getTransactionCount\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionCount\",\n address: params.address,\n tag: params.blockTag\n });\n case \"getCode\":\n return this.fetch(\"proxy\", {\n action: \"eth_getCode\",\n address: params.address,\n tag: params.blockTag\n });\n case \"getStorageAt\":\n return this.fetch(\"proxy\", {\n action: \"eth_getStorageAt\",\n address: params.address,\n position: params.position,\n tag: params.blockTag\n });\n case \"sendTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_sendRawTransaction\",\n hex: params.signedTransaction\n }, true).catch((error) => {\n return checkError(\"sendTransaction\", error, params.signedTransaction);\n });\n case \"getBlock\":\n if (params.blockTag) {\n return this.fetch(\"proxy\", {\n action: \"eth_getBlockByNumber\",\n tag: params.blockTag,\n boolean: (params.includeTransactions ? \"true\" : \"false\")\n });\n }\n throw new Error(\"getBlock by blockHash not implemented\");\n case \"getTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionByHash\",\n txhash: params.transactionHash\n });\n case \"getTransactionReceipt\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionReceipt\",\n txhash: params.transactionHash\n });\n case \"call\": {\n if (params.blockTag !== \"latest\") {\n throw new Error(\"EtherscanProvider does not support blockTag for call\");\n }\n const postData = getTransactionPostData(params.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_call\";\n try {\n return yield this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return checkError(\"call\", error, params.transaction);\n }\n }\n case \"estimateGas\": {\n const postData = getTransactionPostData(params.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_estimateGas\";\n try {\n return yield this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return checkError(\"estimateGas\", error, params.transaction);\n }\n }\n case \"getLogs\": {\n const args = { action: \"getLogs\" };\n if (params.filter.fromBlock) {\n args.fromBlock = checkLogTag(params.filter.fromBlock);\n }\n if (params.filter.toBlock) {\n args.toBlock = checkLogTag(params.filter.toBlock);\n }\n if (params.filter.address) {\n args.address = params.filter.address;\n }\n // @TODO: We can handle slightly more complicated logs using the logs API\n if (params.filter.topics && params.filter.topics.length > 0) {\n if (params.filter.topics.length > 1) {\n logger.throwError(\"unsupported topic count\", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });\n }\n if (params.filter.topics.length === 1) {\n const topic0 = params.filter.topics[0];\n if (typeof (topic0) !== \"string\" || topic0.length !== 66) {\n logger.throwError(\"unsupported topic format\", Logger.errors.UNSUPPORTED_OPERATION, { topic0: topic0 });\n }\n args.topic0 = topic0;\n }\n }\n const logs = yield this.fetch(\"logs\", args);\n // Cache txHash => blockHash\n let blocks = {};\n // Add any missing blockHash to the logs\n for (let i = 0; i < logs.length; i++) {\n const log = logs[i];\n if (log.blockHash != null) {\n continue;\n }\n if (blocks[log.blockNumber] == null) {\n const block = yield this.getBlock(log.blockNumber);\n if (block) {\n blocks[log.blockNumber] = block.hash;\n }\n }\n log.blockHash = blocks[log.blockNumber];\n }\n return logs;\n }\n case \"getEtherPrice\":\n if (this.network.name !== \"homestead\") {\n return 0.0;\n }\n return parseFloat((yield this.fetch(\"stats\", { action: \"ethprice\" })).ethusd);\n default:\n break;\n }\n return _super.perform.call(this, method, params);\n });\n }\n // Note: The `page` page parameter only allows pagination within the\n // 10,000 window available without a page and offset parameter\n // Error: Result window is too large, PageNo x Offset size must\n // be less than or equal to 10000\n getHistory(addressOrName, startBlock, endBlock) {\n return __awaiter(this, void 0, void 0, function* () {\n const params = {\n action: \"txlist\",\n address: (yield this.resolveName(addressOrName)),\n startblock: ((startBlock == null) ? 0 : startBlock),\n endblock: ((endBlock == null) ? 99999999 : endBlock),\n sort: \"asc\"\n };\n const result = yield this.fetch(\"account\", params);\n return result.map((tx) => {\n [\"contractAddress\", \"to\"].forEach(function (key) {\n if (tx[key] == \"\") {\n delete tx[key];\n }\n });\n if (tx.creates == null && tx.contractAddress != null) {\n tx.creates = tx.contractAddress;\n }\n const item = this.formatter.transactionResponse(tx);\n if (tx.timeStamp) {\n item.timestamp = parseInt(tx.timeStamp);\n }\n return item;\n });\n });\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n}\n//# sourceMappingURL=etherscan-provider.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { isHexString } from \"@ethersproject/bytes\";\nimport { deepCopy, defineReadOnly, shallowCopy } from \"@ethersproject/properties\";\nimport { shuffled } from \"@ethersproject/random\";\nimport { poll } from \"@ethersproject/web\";\nimport { BaseProvider } from \"./base-provider\";\nimport { isCommunityResource } from \"./formatter\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction now() { return (new Date()).getTime(); }\n// Returns to network as long as all agree, or null if any is null.\n// Throws an error if any two networks do not match.\nfunction checkNetworks(networks) {\n let result = null;\n for (let i = 0; i < networks.length; i++) {\n const network = networks[i];\n // Null! We do not know our network; bail.\n if (network == null) {\n return null;\n }\n if (result) {\n // Make sure the network matches the previous networks\n if (!(result.name === network.name && result.chainId === network.chainId &&\n ((result.ensAddress === network.ensAddress) || (result.ensAddress == null && network.ensAddress == null)))) {\n logger.throwArgumentError(\"provider mismatch\", \"networks\", networks);\n }\n }\n else {\n result = network;\n }\n }\n return result;\n}\nfunction median(values, maxDelta) {\n values = values.slice().sort();\n const middle = Math.floor(values.length / 2);\n // Odd length; take the middle\n if (values.length % 2) {\n return values[middle];\n }\n // Even length; take the average of the two middle\n const a = values[middle - 1], b = values[middle];\n if (maxDelta != null && Math.abs(a - b) > maxDelta) {\n return null;\n }\n return (a + b) / 2;\n}\nfunction serialize(value) {\n if (value === null) {\n return \"null\";\n }\n else if (typeof (value) === \"number\" || typeof (value) === \"boolean\") {\n return JSON.stringify(value);\n }\n else if (typeof (value) === \"string\") {\n return value;\n }\n else if (BigNumber.isBigNumber(value)) {\n return value.toString();\n }\n else if (Array.isArray(value)) {\n return JSON.stringify(value.map((i) => serialize(i)));\n }\n else if (typeof (value) === \"object\") {\n const keys = Object.keys(value);\n keys.sort();\n return \"{\" + keys.map((key) => {\n let v = value[key];\n if (typeof (v) === \"function\") {\n v = \"[function]\";\n }\n else {\n v = serialize(v);\n }\n return JSON.stringify(key) + \":\" + v;\n }).join(\",\") + \"}\";\n }\n throw new Error(\"unknown value type: \" + typeof (value));\n}\n// Next request ID to use for emitting debug info\nlet nextRid = 1;\n;\nfunction stall(duration) {\n let cancel = null;\n let timer = null;\n let promise = (new Promise((resolve) => {\n cancel = function () {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n resolve();\n };\n timer = setTimeout(cancel, duration);\n }));\n const wait = (func) => {\n promise = promise.then(func);\n return promise;\n };\n function getPromise() {\n return promise;\n }\n return { cancel, getPromise, wait };\n}\nconst ForwardErrors = [\n Logger.errors.CALL_EXCEPTION,\n Logger.errors.INSUFFICIENT_FUNDS,\n Logger.errors.NONCE_EXPIRED,\n Logger.errors.REPLACEMENT_UNDERPRICED,\n Logger.errors.UNPREDICTABLE_GAS_LIMIT\n];\nconst ForwardProperties = [\n \"address\",\n \"args\",\n \"errorArgs\",\n \"errorSignature\",\n \"method\",\n \"transaction\",\n];\n;\nfunction exposeDebugConfig(config, now) {\n const result = {\n weight: config.weight\n };\n Object.defineProperty(result, \"provider\", { get: () => config.provider });\n if (config.start) {\n result.start = config.start;\n }\n if (now) {\n result.duration = (now - config.start);\n }\n if (config.done) {\n if (config.error) {\n result.error = config.error;\n }\n else {\n result.result = config.result || null;\n }\n }\n return result;\n}\nfunction normalizedTally(normalize, quorum) {\n return function (configs) {\n // Count the votes for each result\n const tally = {};\n configs.forEach((c) => {\n const value = normalize(c.result);\n if (!tally[value]) {\n tally[value] = { count: 0, result: c.result };\n }\n tally[value].count++;\n });\n // Check for a quorum on any given result\n const keys = Object.keys(tally);\n for (let i = 0; i < keys.length; i++) {\n const check = tally[keys[i]];\n if (check.count >= quorum) {\n return check.result;\n }\n }\n // No quroum\n return undefined;\n };\n}\nfunction getProcessFunc(provider, method, params) {\n let normalize = serialize;\n switch (method) {\n case \"getBlockNumber\":\n // Return the median value, unless there is (median + 1) is also\n // present, in which case that is probably true and the median\n // is going to be stale soon. In the event of a malicious node,\n // the lie will be true soon enough.\n return function (configs) {\n const values = configs.map((c) => c.result);\n // Get the median block number\n let blockNumber = median(configs.map((c) => c.result), 2);\n if (blockNumber == null) {\n return undefined;\n }\n blockNumber = Math.ceil(blockNumber);\n // If the next block height is present, its prolly safe to use\n if (values.indexOf(blockNumber + 1) >= 0) {\n blockNumber++;\n }\n // Don't ever roll back the blockNumber\n if (blockNumber >= provider._highestBlockNumber) {\n provider._highestBlockNumber = blockNumber;\n }\n return provider._highestBlockNumber;\n };\n case \"getGasPrice\":\n // Return the middle (round index up) value, similar to median\n // but do not average even entries and choose the higher.\n // Malicious actors must compromise 50% of the nodes to lie.\n return function (configs) {\n const values = configs.map((c) => c.result);\n values.sort();\n return values[Math.floor(values.length / 2)];\n };\n case \"getEtherPrice\":\n // Returns the median price. Malicious actors must compromise at\n // least 50% of the nodes to lie (in a meaningful way).\n return function (configs) {\n return median(configs.map((c) => c.result));\n };\n // No additional normalizing required; serialize is enough\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorageAt\":\n case \"call\":\n case \"estimateGas\":\n case \"getLogs\":\n break;\n // We drop the confirmations from transactions as it is approximate\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n normalize = function (tx) {\n if (tx == null) {\n return null;\n }\n tx = shallowCopy(tx);\n tx.confirmations = -1;\n return serialize(tx);\n };\n break;\n // We drop the confirmations from transactions as it is approximate\n case \"getBlock\":\n // We drop the confirmations from transactions as it is approximate\n if (params.includeTransactions) {\n normalize = function (block) {\n if (block == null) {\n return null;\n }\n block = shallowCopy(block);\n block.transactions = block.transactions.map((tx) => {\n tx = shallowCopy(tx);\n tx.confirmations = -1;\n return tx;\n });\n return serialize(block);\n };\n }\n else {\n normalize = function (block) {\n if (block == null) {\n return null;\n }\n return serialize(block);\n };\n }\n break;\n default:\n throw new Error(\"unknown method: \" + method);\n }\n // Return the result if and only if the expected quorum is\n // satisfied and agreed upon for the final result.\n return normalizedTally(normalize, provider.quorum);\n}\n// If we are doing a blockTag query, we need to make sure the backend is\n// caught up to the FallbackProvider, before sending a request to it.\nfunction waitForSync(config, blockNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n const provider = (config.provider);\n if ((provider.blockNumber != null && provider.blockNumber >= blockNumber) || blockNumber === -1) {\n return provider;\n }\n return poll(() => {\n return new Promise((resolve, reject) => {\n setTimeout(function () {\n // We are synced\n if (provider.blockNumber >= blockNumber) {\n return resolve(provider);\n }\n // We're done; just quit\n if (config.cancelled) {\n return resolve(null);\n }\n // Try again, next block\n return resolve(undefined);\n }, 0);\n });\n }, { oncePoll: provider });\n });\n}\nfunction getRunner(config, currentBlockNumber, method, params) {\n return __awaiter(this, void 0, void 0, function* () {\n let provider = config.provider;\n switch (method) {\n case \"getBlockNumber\":\n case \"getGasPrice\":\n return provider[method]();\n case \"getEtherPrice\":\n if (provider.getEtherPrice) {\n return provider.getEtherPrice();\n }\n break;\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider[method](params.address, params.blockTag || \"latest\");\n case \"getStorageAt\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider.getStorageAt(params.address, params.position, params.blockTag || \"latest\");\n case \"getBlock\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider[(params.includeTransactions ? \"getBlockWithTransactions\" : \"getBlock\")](params.blockTag || params.blockHash);\n case \"call\":\n case \"estimateGas\":\n if (params.blockTag && isHexString(params.blockTag)) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider[method](params.transaction);\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n return provider[method](params.transactionHash);\n case \"getLogs\": {\n let filter = params.filter;\n if ((filter.fromBlock && isHexString(filter.fromBlock)) || (filter.toBlock && isHexString(filter.toBlock))) {\n provider = yield waitForSync(config, currentBlockNumber);\n }\n return provider.getLogs(filter);\n }\n }\n return logger.throwError(\"unknown method error\", Logger.errors.UNKNOWN_ERROR, {\n method: method,\n params: params\n });\n });\n}\nexport class FallbackProvider extends BaseProvider {\n constructor(providers, quorum) {\n logger.checkNew(new.target, FallbackProvider);\n if (providers.length === 0) {\n logger.throwArgumentError(\"missing providers\", \"providers\", providers);\n }\n const providerConfigs = providers.map((configOrProvider, index) => {\n if (Provider.isProvider(configOrProvider)) {\n const stallTimeout = isCommunityResource(configOrProvider) ? 2000 : 750;\n const priority = 1;\n return Object.freeze({ provider: configOrProvider, weight: 1, stallTimeout, priority });\n }\n const config = shallowCopy(configOrProvider);\n if (config.priority == null) {\n config.priority = 1;\n }\n if (config.stallTimeout == null) {\n config.stallTimeout = isCommunityResource(configOrProvider) ? 2000 : 750;\n }\n if (config.weight == null) {\n config.weight = 1;\n }\n const weight = config.weight;\n if (weight % 1 || weight > 512 || weight < 1) {\n logger.throwArgumentError(\"invalid weight; must be integer in [1, 512]\", `providers[${index}].weight`, weight);\n }\n return Object.freeze(config);\n });\n const total = providerConfigs.reduce((accum, c) => (accum + c.weight), 0);\n if (quorum == null) {\n quorum = total / 2;\n }\n else if (quorum > total) {\n logger.throwArgumentError(\"quorum will always fail; larger than total weight\", \"quorum\", quorum);\n }\n // Are all providers' networks are known\n let networkOrReady = checkNetworks(providerConfigs.map((c) => (c.provider).network));\n // Not all networks are known; we must stall\n if (networkOrReady == null) {\n networkOrReady = new Promise((resolve, reject) => {\n setTimeout(() => {\n this.detectNetwork().then(resolve, reject);\n }, 0);\n });\n }\n super(networkOrReady);\n // Preserve a copy, so we do not get mutated\n defineReadOnly(this, \"providerConfigs\", Object.freeze(providerConfigs));\n defineReadOnly(this, \"quorum\", quorum);\n this._highestBlockNumber = -1;\n }\n detectNetwork() {\n return __awaiter(this, void 0, void 0, function* () {\n const networks = yield Promise.all(this.providerConfigs.map((c) => c.provider.getNetwork()));\n return checkNetworks(networks);\n });\n }\n perform(method, params) {\n return __awaiter(this, void 0, void 0, function* () {\n // Sending transactions is special; always broadcast it to all backends\n if (method === \"sendTransaction\") {\n const results = yield Promise.all(this.providerConfigs.map((c) => {\n return c.provider.sendTransaction(params.signedTransaction).then((result) => {\n return result.hash;\n }, (error) => {\n return error;\n });\n }));\n // Any success is good enough (other errors are likely \"already seen\" errors\n for (let i = 0; i < results.length; i++) {\n const result = results[i];\n if (typeof (result) === \"string\") {\n return result;\n }\n }\n // They were all an error; pick the first error\n throw results[0];\n }\n // We need to make sure we are in sync with our backends, so we need\n // to know this before we can make a lot of calls\n if (this._highestBlockNumber === -1 && method !== \"getBlockNumber\") {\n yield this.getBlockNumber();\n }\n const processFunc = getProcessFunc(this, method, params);\n // Shuffle the providers and then sort them by their priority; we\n // shallowCopy them since we will store the result in them too\n const configs = shuffled(this.providerConfigs.map(shallowCopy));\n configs.sort((a, b) => (a.priority - b.priority));\n const currentBlockNumber = this._highestBlockNumber;\n let i = 0;\n let first = true;\n while (true) {\n const t0 = now();\n // Compute the inflight weight (exclude anything past)\n let inflightWeight = configs.filter((c) => (c.runner && ((t0 - c.start) < c.stallTimeout)))\n .reduce((accum, c) => (accum + c.weight), 0);\n // Start running enough to meet quorum\n while (inflightWeight < this.quorum && i < configs.length) {\n const config = configs[i++];\n const rid = nextRid++;\n config.start = now();\n config.staller = stall(config.stallTimeout);\n config.staller.wait(() => { config.staller = null; });\n config.runner = getRunner(config, currentBlockNumber, method, params).then((result) => {\n config.done = true;\n config.result = result;\n if (this.listenerCount(\"debug\")) {\n this.emit(\"debug\", {\n action: \"request\",\n rid: rid,\n backend: exposeDebugConfig(config, now()),\n request: { method: method, params: deepCopy(params) },\n provider: this\n });\n }\n }, (error) => {\n config.done = true;\n config.error = error;\n if (this.listenerCount(\"debug\")) {\n this.emit(\"debug\", {\n action: \"request\",\n rid: rid,\n backend: exposeDebugConfig(config, now()),\n request: { method: method, params: deepCopy(params) },\n provider: this\n });\n }\n });\n if (this.listenerCount(\"debug\")) {\n this.emit(\"debug\", {\n action: \"request\",\n rid: rid,\n backend: exposeDebugConfig(config, null),\n request: { method: method, params: deepCopy(params) },\n provider: this\n });\n }\n inflightWeight += config.weight;\n }\n // Wait for anything meaningful to finish or stall out\n const waiting = [];\n configs.forEach((c) => {\n if (c.done || !c.runner) {\n return;\n }\n waiting.push(c.runner);\n if (c.staller) {\n waiting.push(c.staller.getPromise());\n }\n });\n if (waiting.length) {\n yield Promise.race(waiting);\n }\n // Check the quorum and process the results; the process function\n // may additionally decide the quorum is not met\n const results = configs.filter((c) => (c.done && c.error == null));\n if (results.length >= this.quorum) {\n const result = processFunc(results);\n if (result !== undefined) {\n // Shut down any stallers\n configs.forEach(c => {\n if (c.staller) {\n c.staller.cancel();\n }\n c.cancelled = true;\n });\n return result;\n }\n if (!first) {\n yield stall(100).getPromise();\n }\n first = false;\n }\n // No result, check for errors that should be forwarded\n const errors = configs.reduce((accum, c) => {\n if (!c.done || c.error == null) {\n return accum;\n }\n const code = (c.error).code;\n if (ForwardErrors.indexOf(code) >= 0) {\n if (!accum[code]) {\n accum[code] = { error: c.error, weight: 0 };\n }\n accum[code].weight += c.weight;\n }\n return accum;\n }, ({}));\n Object.keys(errors).forEach((errorCode) => {\n const tally = errors[errorCode];\n if (tally.weight < this.quorum) {\n return;\n }\n // Shut down any stallers\n configs.forEach(c => {\n if (c.staller) {\n c.staller.cancel();\n }\n c.cancelled = true;\n });\n const e = (tally.error);\n const props = {};\n ForwardProperties.forEach((name) => {\n if (e[name] == null) {\n return;\n }\n props[name] = e[name];\n });\n logger.throwError(e.reason || e.message, errorCode, props);\n });\n // All configs have run to completion; we will never get more data\n if (configs.filter((c) => !c.done).length === 0) {\n break;\n }\n }\n // Shut down any stallers; shouldn't be any\n configs.forEach(c => {\n if (c.staller) {\n c.staller.cancel();\n }\n c.cancelled = true;\n });\n return logger.throwError(\"failed to meet quorum\", Logger.errors.SERVER_ERROR, {\n method: method,\n params: params,\n //results: configs.map((c) => c.result),\n //errors: configs.map((c) => c.error),\n results: configs.map((c) => exposeDebugConfig(c)),\n provider: this\n });\n });\n }\n}\n//# sourceMappingURL=fallback-provider.js.map","\"use strict\";\nconst IpcProvider = null;\nexport { IpcProvider };\n//# sourceMappingURL=ipc-provider.js.map","\"use strict\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { WebSocketProvider } from \"./websocket-provider\";\nimport { showThrottleMessage } from \"./formatter\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n constructor(network, apiKey) {\n const provider = new InfuraProvider(network, apiKey);\n const connection = provider.connection;\n if (connection.password) {\n logger.throwError(\"INFURA WebSocket project secrets unsupported\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"InfuraProvider.getWebSocketProvider()\"\n });\n }\n const url = connection.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineReadOnly(this, \"apiKey\", provider.projectId);\n defineReadOnly(this, \"projectId\", provider.projectId);\n defineReadOnly(this, \"projectSecret\", provider.projectSecret);\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n}\nexport class InfuraProvider extends UrlJsonRpcProvider {\n static getWebSocketProvider(network, apiKey) {\n return new InfuraWebSocketProvider(network, apiKey);\n }\n static getApiKey(apiKey) {\n const apiKeyObj = {\n apiKey: defaultProjectId,\n projectId: defaultProjectId,\n projectSecret: null\n };\n if (apiKey == null) {\n return apiKeyObj;\n }\n if (typeof (apiKey) === \"string\") {\n apiKeyObj.projectId = apiKey;\n }\n else if (apiKey.projectSecret != null) {\n logger.assertArgument((typeof (apiKey.projectId) === \"string\"), \"projectSecret requires a projectId\", \"projectId\", apiKey.projectId);\n logger.assertArgument((typeof (apiKey.projectSecret) === \"string\"), \"invalid projectSecret\", \"projectSecret\", \"[REDACTED]\");\n apiKeyObj.projectId = apiKey.projectId;\n apiKeyObj.projectSecret = apiKey.projectSecret;\n }\n else if (apiKey.projectId) {\n apiKeyObj.projectId = apiKey.projectId;\n }\n apiKeyObj.apiKey = apiKeyObj.projectId;\n return apiKeyObj;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network ? network.name : \"unknown\") {\n case \"homestead\":\n host = \"mainnet.infura.io\";\n break;\n case \"ropsten\":\n host = \"ropsten.infura.io\";\n break;\n case \"rinkeby\":\n host = \"rinkeby.infura.io\";\n break;\n case \"kovan\":\n host = \"kovan.infura.io\";\n break;\n case \"goerli\":\n host = \"goerli.infura.io\";\n break;\n case \"matic\":\n host = \"polygon-mainnet.infura.io\";\n break;\n case \"maticmum\":\n host = \"polygon-mumbai.infura.io\";\n break;\n case \"optimism\":\n host = \"optimism-mainnet.infura.io\";\n break;\n case \"optimism-kovan\":\n host = \"optimism-kovan.infura.io\";\n break;\n case \"arbitrum\":\n host = \"arbitrum-mainnet.infura.io\";\n break;\n case \"arbitrum-rinkeby\":\n host = \"arbitrum-rinkeby.infura.io\";\n break;\n default:\n logger.throwError(\"unsupported network\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"network\",\n value: network\n });\n }\n const connection = {\n allowGzip: true,\n url: (\"https:/\" + \"/\" + host + \"/v3/\" + apiKey.projectId),\n throttleCallback: (attempt, url) => {\n if (apiKey.projectId === defaultProjectId) {\n showThrottleMessage();\n }\n return Promise.resolve(true);\n }\n };\n if (apiKey.projectSecret != null) {\n connection.user = \"\";\n connection.password = apiKey.projectSecret;\n }\n return connection;\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n}\n//# sourceMappingURL=infura-provider.js.map","import { deepCopy } from \"@ethersproject/properties\";\nimport { fetchJson } from \"@ethersproject/web\";\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\n// Experimental\nexport class JsonRpcBatchProvider extends JsonRpcProvider {\n send(method, params) {\n const request = {\n method: method,\n params: params,\n id: (this._nextId++),\n jsonrpc: \"2.0\"\n };\n if (this._pendingBatch == null) {\n this._pendingBatch = [];\n }\n const inflightRequest = { request, resolve: null, reject: null };\n const promise = new Promise((resolve, reject) => {\n inflightRequest.resolve = resolve;\n inflightRequest.reject = reject;\n });\n this._pendingBatch.push(inflightRequest);\n if (!this._pendingBatchAggregator) {\n // Schedule batch for next event loop + short duration\n this._pendingBatchAggregator = setTimeout(() => {\n // Get teh current batch and clear it, so new requests\n // go into the next batch\n const batch = this._pendingBatch;\n this._pendingBatch = null;\n this._pendingBatchAggregator = null;\n // Get the request as an array of requests\n const request = batch.map((inflight) => inflight.request);\n this.emit(\"debug\", {\n action: \"requestBatch\",\n request: deepCopy(request),\n provider: this\n });\n return fetchJson(this.connection, JSON.stringify(request)).then((result) => {\n this.emit(\"debug\", {\n action: \"response\",\n request: request,\n response: result,\n provider: this\n });\n // For each result, feed it to the correct Promise, depending\n // on whether it was a success or error\n batch.forEach((inflightRequest, index) => {\n const payload = result[index];\n if (payload.error) {\n const error = new Error(payload.error.message);\n error.code = payload.error.code;\n error.data = payload.error.data;\n inflightRequest.reject(error);\n }\n else {\n inflightRequest.resolve(payload.result);\n }\n });\n }, (error) => {\n this.emit(\"debug\", {\n action: \"response\",\n error: error,\n request: request,\n provider: this\n });\n batch.forEach((inflightRequest) => {\n inflightRequest.reject(error);\n });\n });\n }, 10);\n }\n return promise;\n }\n}\n//# sourceMappingURL=json-rpc-batch-provider.js.map","/* istanbul ignore file */\n\"use strict\";\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n// Special API key provided by Nodesmith for ethers.js\nconst defaultApiKey = \"ETHERS_JS_SHARED\";\nexport class NodesmithProvider extends UrlJsonRpcProvider {\n static getApiKey(apiKey) {\n if (apiKey && typeof (apiKey) !== \"string\") {\n logger.throwArgumentError(\"invalid apiKey\", \"apiKey\", apiKey);\n }\n return apiKey || defaultApiKey;\n }\n static getUrl(network, apiKey) {\n logger.warn(\"NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.\");\n let host = null;\n switch (network.name) {\n case \"homestead\":\n host = \"https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc\";\n break;\n case \"ropsten\":\n host = \"https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc\";\n break;\n case \"rinkeby\":\n host = \"https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc\";\n break;\n case \"goerli\":\n host = \"https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc\";\n break;\n case \"kovan\":\n host = \"https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc\";\n break;\n default:\n logger.throwArgumentError(\"unsupported network\", \"network\", arguments[0]);\n }\n return (host + \"?apiKey=\" + apiKey);\n }\n}\n//# sourceMappingURL=nodesmith-provider.js.map","\"use strict\";\nimport { getStatic } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { UrlJsonRpcProvider } from \"./url-json-rpc-provider\";\n// These are load-balancer-based application IDs\nconst defaultApplicationIds = {\n homestead: \"6004bcd10040261633ade990\",\n ropsten: \"6004bd4d0040261633ade991\",\n rinkeby: \"6004bda20040261633ade994\",\n goerli: \"6004bd860040261633ade992\",\n};\nexport class PocketProvider extends UrlJsonRpcProvider {\n constructor(network, apiKey) {\n // We need a bit of creativity in the constructor because\n // Pocket uses different default API keys based on the network\n if (apiKey == null) {\n const n = getStatic(new.target, \"getNetwork\")(network);\n if (n) {\n const applicationId = defaultApplicationIds[n.name];\n if (applicationId) {\n apiKey = {\n applicationId: applicationId,\n loadBalancer: true\n };\n }\n }\n // If there was any issue above, we don't know this network\n if (apiKey == null) {\n logger.throwError(\"unsupported network\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"network\",\n value: network\n });\n }\n }\n super(network, apiKey);\n }\n static getApiKey(apiKey) {\n // Most API Providers allow null to get the default configuration, but\n // Pocket requires the network to decide the default provider, so we\n // rely on hijacking the constructor to add a sensible default for us\n if (apiKey == null) {\n logger.throwArgumentError(\"PocketProvider.getApiKey does not support null apiKey\", \"apiKey\", apiKey);\n }\n const apiKeyObj = {\n applicationId: null,\n loadBalancer: false,\n applicationSecretKey: null\n };\n // Parse applicationId and applicationSecretKey\n if (typeof (apiKey) === \"string\") {\n apiKeyObj.applicationId = apiKey;\n }\n else if (apiKey.applicationSecretKey != null) {\n logger.assertArgument((typeof (apiKey.applicationId) === \"string\"), \"applicationSecretKey requires an applicationId\", \"applicationId\", apiKey.applicationId);\n logger.assertArgument((typeof (apiKey.applicationSecretKey) === \"string\"), \"invalid applicationSecretKey\", \"applicationSecretKey\", \"[REDACTED]\");\n apiKeyObj.applicationId = apiKey.applicationId;\n apiKeyObj.applicationSecretKey = apiKey.applicationSecretKey;\n apiKeyObj.loadBalancer = !!apiKey.loadBalancer;\n }\n else if (apiKey.applicationId) {\n logger.assertArgument((typeof (apiKey.applicationId) === \"string\"), \"apiKey.applicationId must be a string\", \"apiKey.applicationId\", apiKey.applicationId);\n apiKeyObj.applicationId = apiKey.applicationId;\n apiKeyObj.loadBalancer = !!apiKey.loadBalancer;\n }\n else {\n logger.throwArgumentError(\"unsupported PocketProvider apiKey\", \"apiKey\", apiKey);\n }\n return apiKeyObj;\n }\n static getUrl(network, apiKey) {\n let host = null;\n switch (network ? network.name : \"unknown\") {\n case \"homestead\":\n host = \"eth-mainnet.gateway.pokt.network\";\n break;\n case \"ropsten\":\n host = \"eth-ropsten.gateway.pokt.network\";\n break;\n case \"rinkeby\":\n host = \"eth-rinkeby.gateway.pokt.network\";\n break;\n case \"goerli\":\n host = \"eth-goerli.gateway.pokt.network\";\n break;\n default:\n logger.throwError(\"unsupported network\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"network\",\n value: network\n });\n }\n let url = null;\n if (apiKey.loadBalancer) {\n url = `https:/\\/${host}/v1/lb/${apiKey.applicationId}`;\n }\n else {\n url = `https:/\\/${host}/v1/${apiKey.applicationId}`;\n }\n const connection = { url };\n // Initialize empty headers\n connection.headers = {};\n // Apply application secret key\n if (apiKey.applicationSecretKey != null) {\n connection.user = \"\";\n connection.password = apiKey.applicationSecretKey;\n }\n return connection;\n }\n isCommunityResource() {\n return (this.applicationId === defaultApplicationIds[this.network.name]);\n }\n}\n//# sourceMappingURL=pocket-provider.js.map","\"use strict\";\nimport { deepCopy, defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { JsonRpcProvider } from \"./json-rpc-provider\";\nlet _nextId = 1;\nfunction buildWeb3LegacyFetcher(provider, sendFunc) {\n const fetcher = \"Web3LegacyFetcher\";\n return function (method, params) {\n const request = {\n method: method,\n params: params,\n id: (_nextId++),\n jsonrpc: \"2.0\"\n };\n return new Promise((resolve, reject) => {\n this.emit(\"debug\", {\n action: \"request\",\n fetcher,\n request: deepCopy(request),\n provider: this\n });\n sendFunc(request, (error, response) => {\n if (error) {\n this.emit(\"debug\", {\n action: \"response\",\n fetcher,\n error,\n request,\n provider: this\n });\n return reject(error);\n }\n this.emit(\"debug\", {\n action: \"response\",\n fetcher,\n request,\n response,\n provider: this\n });\n if (response.error) {\n const error = new Error(response.error.message);\n error.code = response.error.code;\n error.data = response.error.data;\n return reject(error);\n }\n resolve(response.result);\n });\n });\n };\n}\nfunction buildEip1193Fetcher(provider) {\n return function (method, params) {\n if (params == null) {\n params = [];\n }\n const request = { method, params };\n this.emit(\"debug\", {\n action: \"request\",\n fetcher: \"Eip1193Fetcher\",\n request: deepCopy(request),\n provider: this\n });\n return provider.request(request).then((response) => {\n this.emit(\"debug\", {\n action: \"response\",\n fetcher: \"Eip1193Fetcher\",\n request,\n response,\n provider: this\n });\n return response;\n }, (error) => {\n this.emit(\"debug\", {\n action: \"response\",\n fetcher: \"Eip1193Fetcher\",\n request,\n error,\n provider: this\n });\n throw error;\n });\n };\n}\nexport class Web3Provider extends JsonRpcProvider {\n constructor(provider, network) {\n logger.checkNew(new.target, Web3Provider);\n if (provider == null) {\n logger.throwArgumentError(\"missing provider\", \"provider\", provider);\n }\n let path = null;\n let jsonRpcFetchFunc = null;\n let subprovider = null;\n if (typeof (provider) === \"function\") {\n path = \"unknown:\";\n jsonRpcFetchFunc = provider;\n }\n else {\n path = provider.host || provider.path || \"\";\n if (!path && provider.isMetaMask) {\n path = \"metamask\";\n }\n subprovider = provider;\n if (provider.request) {\n if (path === \"\") {\n path = \"eip-1193:\";\n }\n jsonRpcFetchFunc = buildEip1193Fetcher(provider);\n }\n else if (provider.sendAsync) {\n jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.sendAsync.bind(provider));\n }\n else if (provider.send) {\n jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));\n }\n else {\n logger.throwArgumentError(\"unsupported provider\", \"provider\", provider);\n }\n if (!path) {\n path = \"unknown:\";\n }\n }\n super(path, network);\n defineReadOnly(this, \"jsonRpcFetchFunc\", jsonRpcFetchFunc);\n defineReadOnly(this, \"provider\", subprovider);\n }\n send(method, params) {\n return this.jsonRpcFetchFunc(method, params);\n }\n}\n//# sourceMappingURL=web3-provider.js.map","export function createNonce() {\n var nonceConst = Math.random() * 100000;\n var nonceBuffer = Buffer.alloc(4);\n nonceBuffer.writeUInt32LE(nonceConst, 0);\n return nonceBuffer;\n}\n","\"use strict\";\nimport aes from \"aes-js\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { pbkdf2 } from \"@ethersproject/pbkdf2\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nimport { Description } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { getPassword, looseArrayify, searchPath } from \"./utils\";\nexport class CrowdsaleAccount extends Description {\n isCrowdsaleAccount(value) {\n return !!(value && value._isCrowdsaleAccount);\n }\n}\n// See: https://github.com/ethereum/pyethsaletool\nexport function decrypt(json, password) {\n const data = JSON.parse(json);\n password = getPassword(password);\n // Ethereum Address\n const ethaddr = getAddress(searchPath(data, \"ethaddr\"));\n // Encrypted Seed\n const encseed = looseArrayify(searchPath(data, \"encseed\"));\n if (!encseed || (encseed.length % 16) !== 0) {\n logger.throwArgumentError(\"invalid encseed\", \"json\", json);\n }\n const key = arrayify(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new aes.ModeOfOperation.cbc(key, iv);\n const seed = aes.padding.pkcs7.strip(arrayify(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n const seedHexBytes = toUtf8Bytes(seedHex);\n const privateKey = keccak256(seedHexBytes);\n return new CrowdsaleAccount({\n _isCrowdsaleAccount: true,\n address: ethaddr,\n privateKey: privateKey\n });\n}\n//# sourceMappingURL=crowdsale.js.map","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.8.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var INPUT_ERROR = 'input is invalid type';\n var FINALIZE_ERROR = 'finalize already called';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA3_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\n var PADDING = [6, 1536, 393216, 100663296];\n var SHIFT = [0, 8, 16, 24];\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n var BITS = [224, 256, 384, 512];\n var SHAKE_BITS = [128, 256];\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n var CSHAKE_BYTEPAD = {\n '128': 168,\n '256': 136\n };\n\n if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {\n Array.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n }\n\n if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n ArrayBuffer.isView = function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n };\n }\n\n var createOutputMethod = function (bits, padding, outputType) {\n return function (message) {\n return new Keccak(bits, padding, bits).update(message)[outputType]();\n };\n };\n\n var createShakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits) {\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n };\n };\n\n var createCshakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits, n, s) {\n return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n };\n };\n\n var createKmacOutputMethod = function (bits, padding, outputType) {\n return function (key, message, outputBits, s) {\n return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n };\n };\n\n var createOutputMethods = function (method, createMethod, bits, padding) {\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createMethod(bits, padding, type);\n }\n return method;\n };\n\n var createMethod = function (bits, padding) {\n var method = createOutputMethod(bits, padding, 'hex');\n method.create = function () {\n return new Keccak(bits, padding, bits);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n return createOutputMethods(method, createOutputMethod, bits, padding);\n };\n\n var createShakeMethod = function (bits, padding) {\n var method = createShakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits) {\n return new Keccak(bits, padding, outputBits);\n };\n method.update = function (message, outputBits) {\n return method.create(outputBits).update(message);\n };\n return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n };\n\n var createCshakeMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createCshakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits, n, s) {\n if (!n && !s) {\n return methods['shake' + bits].create(outputBits);\n } else {\n return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n }\n };\n method.update = function (message, outputBits, n, s) {\n return method.create(outputBits, n, s).update(message);\n };\n return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n };\n\n var createKmacMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createKmacOutputMethod(bits, padding, 'hex');\n method.create = function (key, outputBits, s) {\n return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n };\n method.update = function (key, message, outputBits, s) {\n return method.create(key, outputBits, s).update(message);\n };\n return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n };\n\n var algorithms = [\n { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n ];\n\n var methods = {}, methodNames = [];\n\n for (var i = 0; i < algorithms.length; ++i) {\n var algorithm = algorithms[i];\n var bits = algorithm.bits;\n for (var j = 0; j < bits.length; ++j) {\n var methodName = algorithm.name + '_' + bits[j];\n methodNames.push(methodName);\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n if (algorithm.name !== 'sha3') {\n var newMethodName = algorithm.name + bits[j];\n methodNames.push(newMethodName);\n methods[newMethodName] = methods[methodName];\n }\n }\n }\n\n function Keccak(bits, padding, outputBits) {\n this.blocks = [];\n this.s = [];\n this.padding = padding;\n this.outputBits = outputBits;\n this.reset = true;\n this.finalized = false;\n this.block = 0;\n this.start = 0;\n this.blockCount = (1600 - (bits << 1)) >> 5;\n this.byteCount = this.blockCount << 2;\n this.outputBlocks = outputBits >> 5;\n this.extraBytes = (outputBits & 31) >> 3;\n\n for (var i = 0; i < 50; ++i) {\n this.s[i] = 0;\n }\n }\n\n Keccak.prototype.update = function (message) {\n if (this.finalized) {\n throw new Error(FINALIZE_ERROR);\n }\n var notString, type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n while (index < length) {\n if (this.reset) {\n this.reset = false;\n blocks[0] = this.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (notString) {\n for (i = this.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n this.lastByteIndex = i;\n if (i >= byteCount) {\n this.start = i - byteCount;\n this.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n this.reset = true;\n } else {\n this.start = i;\n }\n }\n return this;\n };\n\n Keccak.prototype.encode = function (x, right) {\n var o = x & 255, n = 1;\n var bytes = [o];\n x = x >> 8;\n o = x & 255;\n while (o > 0) {\n bytes.unshift(o);\n x = x >> 8;\n o = x & 255;\n ++n;\n }\n if (right) {\n bytes.push(n);\n } else {\n bytes.unshift(n);\n }\n this.update(bytes);\n return bytes.length;\n };\n\n Keccak.prototype.encodeString = function (str) {\n var notString, type = typeof str;\n if (type !== 'string') {\n if (type === 'object') {\n if (str === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {\n str = new Uint8Array(str);\n } else if (!Array.isArray(str)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var bytes = 0, length = str.length;\n if (notString) {\n bytes = length;\n } else {\n for (var i = 0; i < str.length; ++i) {\n var code = str.charCodeAt(i);\n if (code < 0x80) {\n bytes += 1;\n } else if (code < 0x800) {\n bytes += 2;\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes += 3;\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n bytes += 4;\n }\n }\n }\n bytes += this.encode(bytes * 8);\n this.update(str);\n return bytes;\n };\n\n Keccak.prototype.bytepad = function (strs, w) {\n var bytes = this.encode(w);\n for (var i = 0; i < strs.length; ++i) {\n bytes += this.encodeString(strs[i]);\n }\n var paddingBytes = w - bytes % w;\n var zeros = [];\n zeros.length = paddingBytes;\n this.update(zeros);\n return this;\n };\n\n Keccak.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n blocks[i >> 2] |= this.padding[i & 3];\n if (this.lastByteIndex === this.byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n };\n\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var hex = '', block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n }\n if (j % blockCount === 0) {\n f(s);\n i = 0;\n }\n }\n if (extraBytes) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n if (extraBytes > 1) {\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n }\n if (extraBytes > 2) {\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n }\n }\n return hex;\n };\n\n Keccak.prototype.arrayBuffer = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var bytes = this.outputBits >> 3;\n var buffer;\n if (extraBytes) {\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n } else {\n buffer = new ArrayBuffer(bytes);\n }\n var array = new Uint32Array(buffer);\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n array[j] = s[i];\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n array[i] = s[i];\n buffer = buffer.slice(0, bytes);\n }\n return buffer;\n };\n\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n Keccak.prototype.digest = Keccak.prototype.array = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var array = [], offset, block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n array[offset + 1] = (block >> 8) & 0xFF;\n array[offset + 2] = (block >> 16) & 0xFF;\n array[offset + 3] = (block >> 24) & 0xFF;\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n if (extraBytes > 1) {\n array[offset + 1] = (block >> 8) & 0xFF;\n }\n if (extraBytes > 2) {\n array[offset + 2] = (block >> 16) & 0xFF;\n }\n }\n return array;\n };\n\n function Kmac(bits, padding, outputBits) {\n Keccak.call(this, bits, padding, outputBits);\n }\n\n Kmac.prototype = new Keccak();\n\n Kmac.prototype.finalize = function () {\n this.encode(this.outputBits, true);\n return Keccak.prototype.finalize.call(this);\n };\n\n var f = function (s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = (s[11] << 4) | (s[10] >>> 28);\n b33 = (s[10] << 4) | (s[11] >>> 28);\n b14 = (s[20] << 3) | (s[21] >>> 29);\n b15 = (s[21] << 3) | (s[20] >>> 29);\n b46 = (s[31] << 9) | (s[30] >>> 23);\n b47 = (s[30] << 9) | (s[31] >>> 23);\n b28 = (s[40] << 18) | (s[41] >>> 14);\n b29 = (s[41] << 18) | (s[40] >>> 14);\n b20 = (s[2] << 1) | (s[3] >>> 31);\n b21 = (s[3] << 1) | (s[2] >>> 31);\n b2 = (s[13] << 12) | (s[12] >>> 20);\n b3 = (s[12] << 12) | (s[13] >>> 20);\n b34 = (s[22] << 10) | (s[23] >>> 22);\n b35 = (s[23] << 10) | (s[22] >>> 22);\n b16 = (s[33] << 13) | (s[32] >>> 19);\n b17 = (s[32] << 13) | (s[33] >>> 19);\n b48 = (s[42] << 2) | (s[43] >>> 30);\n b49 = (s[43] << 2) | (s[42] >>> 30);\n b40 = (s[5] << 30) | (s[4] >>> 2);\n b41 = (s[4] << 30) | (s[5] >>> 2);\n b22 = (s[14] << 6) | (s[15] >>> 26);\n b23 = (s[15] << 6) | (s[14] >>> 26);\n b4 = (s[25] << 11) | (s[24] >>> 21);\n b5 = (s[24] << 11) | (s[25] >>> 21);\n b36 = (s[34] << 15) | (s[35] >>> 17);\n b37 = (s[35] << 15) | (s[34] >>> 17);\n b18 = (s[45] << 29) | (s[44] >>> 3);\n b19 = (s[44] << 29) | (s[45] >>> 3);\n b10 = (s[6] << 28) | (s[7] >>> 4);\n b11 = (s[7] << 28) | (s[6] >>> 4);\n b42 = (s[17] << 23) | (s[16] >>> 9);\n b43 = (s[16] << 23) | (s[17] >>> 9);\n b24 = (s[26] << 25) | (s[27] >>> 7);\n b25 = (s[27] << 25) | (s[26] >>> 7);\n b6 = (s[36] << 21) | (s[37] >>> 11);\n b7 = (s[37] << 21) | (s[36] >>> 11);\n b38 = (s[47] << 24) | (s[46] >>> 8);\n b39 = (s[46] << 24) | (s[47] >>> 8);\n b30 = (s[8] << 27) | (s[9] >>> 5);\n b31 = (s[9] << 27) | (s[8] >>> 5);\n b12 = (s[18] << 20) | (s[19] >>> 12);\n b13 = (s[19] << 20) | (s[18] >>> 12);\n b44 = (s[29] << 7) | (s[28] >>> 25);\n b45 = (s[28] << 7) | (s[29] >>> 25);\n b26 = (s[38] << 8) | (s[39] >>> 24);\n b27 = (s[39] << 8) | (s[38] >>> 24);\n b8 = (s[48] << 14) | (s[49] >>> 18);\n b9 = (s[49] << 14) | (s[48] >>> 18);\n\n s[0] = b0 ^ (~b2 & b4);\n s[1] = b1 ^ (~b3 & b5);\n s[10] = b10 ^ (~b12 & b14);\n s[11] = b11 ^ (~b13 & b15);\n s[20] = b20 ^ (~b22 & b24);\n s[21] = b21 ^ (~b23 & b25);\n s[30] = b30 ^ (~b32 & b34);\n s[31] = b31 ^ (~b33 & b35);\n s[40] = b40 ^ (~b42 & b44);\n s[41] = b41 ^ (~b43 & b45);\n s[2] = b2 ^ (~b4 & b6);\n s[3] = b3 ^ (~b5 & b7);\n s[12] = b12 ^ (~b14 & b16);\n s[13] = b13 ^ (~b15 & b17);\n s[22] = b22 ^ (~b24 & b26);\n s[23] = b23 ^ (~b25 & b27);\n s[32] = b32 ^ (~b34 & b36);\n s[33] = b33 ^ (~b35 & b37);\n s[42] = b42 ^ (~b44 & b46);\n s[43] = b43 ^ (~b45 & b47);\n s[4] = b4 ^ (~b6 & b8);\n s[5] = b5 ^ (~b7 & b9);\n s[14] = b14 ^ (~b16 & b18);\n s[15] = b15 ^ (~b17 & b19);\n s[24] = b24 ^ (~b26 & b28);\n s[25] = b25 ^ (~b27 & b29);\n s[34] = b34 ^ (~b36 & b38);\n s[35] = b35 ^ (~b37 & b39);\n s[44] = b44 ^ (~b46 & b48);\n s[45] = b45 ^ (~b47 & b49);\n s[6] = b6 ^ (~b8 & b0);\n s[7] = b7 ^ (~b9 & b1);\n s[16] = b16 ^ (~b18 & b10);\n s[17] = b17 ^ (~b19 & b11);\n s[26] = b26 ^ (~b28 & b20);\n s[27] = b27 ^ (~b29 & b21);\n s[36] = b36 ^ (~b38 & b30);\n s[37] = b37 ^ (~b39 & b31);\n s[46] = b46 ^ (~b48 & b40);\n s[47] = b47 ^ (~b49 & b41);\n s[8] = b8 ^ (~b0 & b2);\n s[9] = b9 ^ (~b1 & b3);\n s[18] = b18 ^ (~b10 & b12);\n s[19] = b19 ^ (~b11 & b13);\n s[28] = b28 ^ (~b20 & b22);\n s[29] = b29 ^ (~b21 & b23);\n s[38] = b38 ^ (~b30 & b32);\n s[39] = b39 ^ (~b31 & b33);\n s[48] = b48 ^ (~b40 & b42);\n s[49] = b49 ^ (~b41 & b43);\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n };\n\n if (COMMON_JS) {\n module.exports = methods;\n } else {\n for (i = 0; i < methodNames.length; ++i) {\n root[methodNames[i]] = methods[methodNames[i]];\n }\n if (AMD) {\n define(function () {\n return methods;\n });\n }\n }\n})();\n","\"use strict\";\n// This gets overridden by rollup\nconst exportWordlist = false;\nimport { id } from \"@ethersproject/hash\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nexport const logger = new Logger(version);\nexport class Wordlist {\n constructor(locale) {\n logger.checkAbstract(new.target, Wordlist);\n defineReadOnly(this, \"locale\", locale);\n }\n // Subclasses may override this\n split(mnemonic) {\n return mnemonic.toLowerCase().split(/ +/g);\n }\n // Subclasses may override this\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n static register(lang, name) {\n if (!name) {\n name = lang.locale;\n }\n /* istanbul ignore if */\n if (exportWordlist) {\n try {\n const anyGlobal = window;\n if (anyGlobal._ethers && anyGlobal._ethers.wordlists) {\n if (!anyGlobal._ethers.wordlists[name]) {\n defineReadOnly(anyGlobal._ethers.wordlists, name, lang);\n }\n }\n }\n catch (error) { }\n }\n }\n}\n//# sourceMappingURL=wordlist.js.map","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new BN(conf.p, 16);\n\n // Use Montgomery, when there is no fast reduction for the prime\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n // Useful for many curves\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n\n // Curve configuration, optional\n this.n = conf.n && new BN(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n // Temporary arrays\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4);\n\n this._bitLength = this.n ? this.n.bitLength() : 0;\n\n // Generalized Greg Maxwell's trick\n var adjustCount = this.n && this.p.div(this.n);\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1, this._bitLength);\n var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3;\n\n // Translate into more windowed form\n var repr = [];\n var j;\n var nafW;\n for (j = 0; j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1; l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n for (var i = I; i > 0; i--) {\n for (j = 0; j < repr.length; j++) {\n nafW = repr[j];\n if (nafW === i)\n b = b.mixedAdd(doubles.points[j]);\n else if (nafW === -i)\n b = b.mixedAdd(doubles.points[j].neg());\n }\n a = a.add(b);\n }\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4;\n\n // Precompute window\n var nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n var wnd = nafPoints.points;\n\n // Get NAF form\n var naf = getNAF(k, w, this._bitLength);\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = this.jpoint(null, null, null);\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var l = 0; i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0)\n l++;\n acc = acc.dblp(l);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert(z !== 0);\n if (p.type === 'affine') {\n // J +- P\n if (z > 0)\n acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n else\n acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n } else {\n // J +- J\n if (z > 0)\n acc = acc.add(wnd[(z - 1) >> 1]);\n else\n acc = acc.add(wnd[(-z - 1) >> 1].neg());\n }\n }\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n points,\n coeffs,\n len,\n jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3;\n\n // Fill all arrays\n var max = 0;\n var i;\n var j;\n var p;\n for (i = 0; i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n }\n\n // Comb small window NAFs\n for (i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);\n naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [\n points[a], /* 1 */\n null, /* 3 */\n null, /* 5 */\n points[b], /* 7 */\n ];\n\n // Try to avoid Projective points, if possible\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [\n -3, /* -1 -1 */\n -1, /* -1 0 */\n -5, /* -1 1 */\n -7, /* 0 -1 */\n 0, /* 0 0 */\n 7, /* 0 1 */\n 5, /* 1 -1 */\n 1, /* 1 0 */\n 3, /* 1 1 */\n ];\n\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n for (j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n for (i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0)\n zero = false;\n }\n if (!zero)\n break;\n k++;\n i--;\n }\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n if (i < 0)\n break;\n\n for (j = 0; j < len; j++) {\n var z = tmp[j];\n p;\n if (z === 0)\n continue;\n else if (z > 0)\n p = wnd[j][(z - 1) >> 1];\n else if (z < 0)\n p = wnd[j][(-z - 1) >> 1].neg();\n\n if (p.type === 'affine')\n acc = acc.mixedAdd(p);\n else\n acc = acc.add(p);\n }\n }\n // Zeroify references\n for (i = 0; i < len; i++)\n wnd[i] = null;\n\n if (jacobianResult)\n return acc;\n else\n return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n\n var len = this.p.byteLength();\n\n // uncompressed, hybrid-odd, hybrid-even\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06)\n assert(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert(bytes[bytes.length - 1] % 2 === 1);\n\n var res = this.point(bytes.slice(1, 1 + len),\n bytes.slice(1 + len, 1 + 2 * len));\n\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n\n if (compact)\n return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n return [ 0x04 ].concat(x, this.getY().toArray('be', len));\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed)\n return this;\n\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null,\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed)\n return false;\n\n var doubles = this.precomputed.doubles;\n if (!doubles)\n return false;\n\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n\n var doubles = [ this ];\n var acc = this;\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step: step,\n points: doubles,\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n\n var res = [ this ];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n for (var i = 1; i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd: wnd,\n points: res,\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n for (var i = 0; i < k; i++)\n r = r.dbl();\n return r;\n};\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgFundCommunityPoolResponse = exports.MsgFundCommunityPool = exports.MsgWithdrawValidatorCommissionResponse = exports.MsgWithdrawValidatorCommission = exports.MsgWithdrawDelegatorRewardResponse = exports.MsgWithdrawDelegatorReward = exports.MsgSetWithdrawAddressResponse = exports.MsgSetWithdrawAddress = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"cosmos.distribution.v1beta1\";\nconst baseMsgSetWithdrawAddress = { delegatorAddress: \"\", withdrawAddress: \"\" };\nexports.MsgSetWithdrawAddress = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.withdrawAddress !== \"\") {\n writer.uint32(18).string(message.withdrawAddress);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSetWithdrawAddress);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.withdrawAddress = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSetWithdrawAddress);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) {\n message.withdrawAddress = String(object.withdrawAddress);\n }\n else {\n message.withdrawAddress = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSetWithdrawAddress);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) {\n message.withdrawAddress = object.withdrawAddress;\n }\n else {\n message.withdrawAddress = \"\";\n }\n return message;\n },\n};\nconst baseMsgSetWithdrawAddressResponse = {};\nexports.MsgSetWithdrawAddressResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSetWithdrawAddressResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgSetWithdrawAddressResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgSetWithdrawAddressResponse);\n return message;\n },\n};\nconst baseMsgWithdrawDelegatorReward = { delegatorAddress: \"\", validatorAddress: \"\" };\nexports.MsgWithdrawDelegatorReward = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.delegatorAddress !== \"\") {\n writer.uint32(10).string(message.delegatorAddress);\n }\n if (message.validatorAddress !== \"\") {\n writer.uint32(18).string(message.validatorAddress);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgWithdrawDelegatorReward);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.delegatorAddress = reader.string();\n break;\n case 2:\n message.validatorAddress = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgWithdrawDelegatorReward);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = String(object.delegatorAddress);\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgWithdrawDelegatorReward);\n if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {\n message.delegatorAddress = object.delegatorAddress;\n }\n else {\n message.delegatorAddress = \"\";\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n return message;\n },\n};\nconst baseMsgWithdrawDelegatorRewardResponse = {};\nexports.MsgWithdrawDelegatorRewardResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgWithdrawDelegatorRewardResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgWithdrawDelegatorRewardResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgWithdrawDelegatorRewardResponse);\n return message;\n },\n};\nconst baseMsgWithdrawValidatorCommission = { validatorAddress: \"\" };\nexports.MsgWithdrawValidatorCommission = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.validatorAddress !== \"\") {\n writer.uint32(10).string(message.validatorAddress);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgWithdrawValidatorCommission);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.validatorAddress = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgWithdrawValidatorCommission);\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = String(object.validatorAddress);\n }\n else {\n message.validatorAddress = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgWithdrawValidatorCommission);\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = \"\";\n }\n return message;\n },\n};\nconst baseMsgWithdrawValidatorCommissionResponse = {};\nexports.MsgWithdrawValidatorCommissionResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgWithdrawValidatorCommissionResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgWithdrawValidatorCommissionResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgWithdrawValidatorCommissionResponse);\n return message;\n },\n};\nconst baseMsgFundCommunityPool = { depositor: \"\" };\nexports.MsgFundCommunityPool = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.amount) {\n coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (message.depositor !== \"\") {\n writer.uint32(18).string(message.depositor);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgFundCommunityPool);\n message.amount = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 2:\n message.depositor = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgFundCommunityPool);\n message.amount = [];\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.depositor !== undefined && object.depositor !== null) {\n message.depositor = String(object.depositor);\n }\n else {\n message.depositor = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.amount) {\n obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.amount = [];\n }\n message.depositor !== undefined && (obj.depositor = message.depositor);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgFundCommunityPool);\n message.amount = [];\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.depositor !== undefined && object.depositor !== null) {\n message.depositor = object.depositor;\n }\n else {\n message.depositor = \"\";\n }\n return message;\n },\n};\nconst baseMsgFundCommunityPoolResponse = {};\nexports.MsgFundCommunityPoolResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgFundCommunityPoolResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgFundCommunityPoolResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgFundCommunityPoolResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.SetWithdrawAddress = this.SetWithdrawAddress.bind(this);\n this.WithdrawDelegatorReward = this.WithdrawDelegatorReward.bind(this);\n this.WithdrawValidatorCommission = this.WithdrawValidatorCommission.bind(this);\n this.FundCommunityPool = this.FundCommunityPool.bind(this);\n }\n SetWithdrawAddress(request) {\n const data = exports.MsgSetWithdrawAddress.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.distribution.v1beta1.Msg\", \"SetWithdrawAddress\", data);\n return promise.then((data) => exports.MsgSetWithdrawAddressResponse.decode(new minimal_1.default.Reader(data)));\n }\n WithdrawDelegatorReward(request) {\n const data = exports.MsgWithdrawDelegatorReward.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.distribution.v1beta1.Msg\", \"WithdrawDelegatorReward\", data);\n return promise.then((data) => exports.MsgWithdrawDelegatorRewardResponse.decode(new minimal_1.default.Reader(data)));\n }\n WithdrawValidatorCommission(request) {\n const data = exports.MsgWithdrawValidatorCommission.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.distribution.v1beta1.Msg\", \"WithdrawValidatorCommission\", data);\n return promise.then((data) => exports.MsgWithdrawValidatorCommissionResponse.decode(new minimal_1.default.Reader(data)));\n }\n FundCommunityPool(request) {\n const data = exports.MsgFundCommunityPool.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.distribution.v1beta1.Msg\", \"FundCommunityPool\", data);\n return promise.then((data) => exports.MsgFundCommunityPoolResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BasicAllowance = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar feegrant_1 = require(\"@terra-money/terra.proto/cosmos/feegrant/v1beta1/feegrant\");\n/**\n * BasicAllowance implements Allowance with a one-time grant of tokens\n * that optionally expires. The grantee can use up to SpendLimit to cover fees.\n */\nvar BasicAllowance = /** @class */ (function (_super) {\n __extends(BasicAllowance, _super);\n /**\n * @param spend_limit spend_limit allowed to be spent as fee\n * @param expiration allowance's expiration\n */\n function BasicAllowance(spend_limit, expiration) {\n var _this = _super.call(this) || this;\n _this.expiration = expiration;\n _this.spend_limit = new Coins_1.Coins(spend_limit);\n return _this;\n }\n BasicAllowance.fromAmino = function (data) {\n var _a = data.value, spend_limit = _a.spend_limit, expiration = _a.expiration;\n return new BasicAllowance(Coins_1.Coins.fromAmino(spend_limit), new Date(expiration));\n };\n BasicAllowance.prototype.toAmino = function () {\n var _a = this, spend_limit = _a.spend_limit, expiration = _a.expiration;\n return {\n type: 'feegrant/BasicAllowance',\n value: {\n spend_limit: spend_limit.toAmino(),\n expiration: expiration.toISOString().replace(/\\.000Z$/, 'Z'),\n },\n };\n };\n BasicAllowance.fromData = function (proto) {\n var spend_limit = proto.spend_limit, expiration = proto.expiration;\n return new BasicAllowance(Coins_1.Coins.fromData(spend_limit), new Date(expiration));\n };\n BasicAllowance.prototype.toData = function () {\n var _a = this, spend_limit = _a.spend_limit, expiration = _a.expiration;\n return {\n '@type': '/cosmos.feegrant.v1beta1.BasicAllowance',\n spend_limit: spend_limit.toData(),\n expiration: expiration.toISOString().replace(/\\.000Z$/, 'Z'),\n };\n };\n BasicAllowance.fromProto = function (proto) {\n return new BasicAllowance(Coins_1.Coins.fromProto(proto.spendLimit), proto.expiration);\n };\n BasicAllowance.prototype.toProto = function () {\n var _a = this, spend_limit = _a.spend_limit, expiration = _a.expiration;\n return feegrant_1.BasicAllowance.fromPartial({\n expiration: expiration,\n spendLimit: spend_limit.toProto(),\n });\n };\n BasicAllowance.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.feegrant.v1beta1.BasicAllowance',\n value: feegrant_1.BasicAllowance.encode(this.toProto()).finish(),\n });\n };\n BasicAllowance.unpackAny = function (msgAny) {\n return BasicAllowance.fromProto(feegrant_1.BasicAllowance.decode(msgAny.value));\n };\n return BasicAllowance;\n}(json_1.JSONSerializable));\nexports.BasicAllowance = BasicAllowance;\n//# sourceMappingURL=BasicAllowance.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Duration = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"google.protobuf\";\nconst baseDuration = { seconds: long_1.default.ZERO, nanos: 0 };\nexports.Duration = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.seconds.isZero()) {\n writer.uint32(8).int64(message.seconds);\n }\n if (message.nanos !== 0) {\n writer.uint32(16).int32(message.nanos);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDuration);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.seconds = reader.int64();\n break;\n case 2:\n message.nanos = reader.int32();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDuration);\n if (object.seconds !== undefined && object.seconds !== null) {\n message.seconds = long_1.default.fromString(object.seconds);\n }\n else {\n message.seconds = long_1.default.ZERO;\n }\n if (object.nanos !== undefined && object.nanos !== null) {\n message.nanos = Number(object.nanos);\n }\n else {\n message.nanos = 0;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.seconds !== undefined && (obj.seconds = (message.seconds || long_1.default.ZERO).toString());\n message.nanos !== undefined && (obj.nanos = message.nanos);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDuration);\n if (object.seconds !== undefined && object.seconds !== null) {\n message.seconds = object.seconds;\n }\n else {\n message.seconds = long_1.default.ZERO;\n }\n if (object.nanos !== undefined && object.nanos !== null) {\n message.nanos = object.nanos;\n }\n else {\n message.nanos = 0;\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=duration.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgDepositResponse = exports.MsgDeposit = exports.MsgVoteWeightedResponse = exports.MsgVoteWeighted = exports.MsgVoteResponse = exports.MsgVote = exports.MsgSubmitProposalResponse = exports.MsgSubmitProposal = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst gov_1 = require(\"../../../cosmos/gov/v1beta1/gov\");\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"cosmos.gov.v1beta1\";\nconst baseMsgSubmitProposal = { proposer: \"\" };\nexports.MsgSubmitProposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.content !== undefined) {\n any_1.Any.encode(message.content, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.initialDeposit) {\n coin_1.Coin.encode(v, writer.uint32(18).fork()).ldelim();\n }\n if (message.proposer !== \"\") {\n writer.uint32(26).string(message.proposer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSubmitProposal);\n message.initialDeposit = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.content = any_1.Any.decode(reader, reader.uint32());\n break;\n case 2:\n message.initialDeposit.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 3:\n message.proposer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSubmitProposal);\n message.initialDeposit = [];\n if (object.content !== undefined && object.content !== null) {\n message.content = any_1.Any.fromJSON(object.content);\n }\n else {\n message.content = undefined;\n }\n if (object.initialDeposit !== undefined && object.initialDeposit !== null) {\n for (const e of object.initialDeposit) {\n message.initialDeposit.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.proposer !== undefined && object.proposer !== null) {\n message.proposer = String(object.proposer);\n }\n else {\n message.proposer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.content !== undefined &&\n (obj.content = message.content ? any_1.Any.toJSON(message.content) : undefined);\n if (message.initialDeposit) {\n obj.initialDeposit = message.initialDeposit.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.initialDeposit = [];\n }\n message.proposer !== undefined && (obj.proposer = message.proposer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSubmitProposal);\n message.initialDeposit = [];\n if (object.content !== undefined && object.content !== null) {\n message.content = any_1.Any.fromPartial(object.content);\n }\n else {\n message.content = undefined;\n }\n if (object.initialDeposit !== undefined && object.initialDeposit !== null) {\n for (const e of object.initialDeposit) {\n message.initialDeposit.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.proposer !== undefined && object.proposer !== null) {\n message.proposer = object.proposer;\n }\n else {\n message.proposer = \"\";\n }\n return message;\n },\n};\nconst baseMsgSubmitProposalResponse = { proposalId: long_1.default.UZERO };\nexports.MsgSubmitProposalResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.proposalId.isZero()) {\n writer.uint32(8).uint64(message.proposalId);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSubmitProposalResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proposalId = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSubmitProposalResponse);\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = long_1.default.fromString(object.proposalId);\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.proposalId !== undefined && (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSubmitProposalResponse);\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = object.proposalId;\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseMsgVote = { proposalId: long_1.default.UZERO, voter: \"\", option: 0 };\nexports.MsgVote = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.proposalId.isZero()) {\n writer.uint32(8).uint64(message.proposalId);\n }\n if (message.voter !== \"\") {\n writer.uint32(18).string(message.voter);\n }\n if (message.option !== 0) {\n writer.uint32(24).int32(message.option);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgVote);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proposalId = reader.uint64();\n break;\n case 2:\n message.voter = reader.string();\n break;\n case 3:\n message.option = reader.int32();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgVote);\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = long_1.default.fromString(object.proposalId);\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = String(object.voter);\n }\n else {\n message.voter = \"\";\n }\n if (object.option !== undefined && object.option !== null) {\n message.option = gov_1.voteOptionFromJSON(object.option);\n }\n else {\n message.option = 0;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.proposalId !== undefined && (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());\n message.voter !== undefined && (obj.voter = message.voter);\n message.option !== undefined && (obj.option = gov_1.voteOptionToJSON(message.option));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgVote);\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = object.proposalId;\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = object.voter;\n }\n else {\n message.voter = \"\";\n }\n if (object.option !== undefined && object.option !== null) {\n message.option = object.option;\n }\n else {\n message.option = 0;\n }\n return message;\n },\n};\nconst baseMsgVoteResponse = {};\nexports.MsgVoteResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgVoteResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgVoteResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgVoteResponse);\n return message;\n },\n};\nconst baseMsgVoteWeighted = { proposalId: long_1.default.UZERO, voter: \"\" };\nexports.MsgVoteWeighted = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.proposalId.isZero()) {\n writer.uint32(8).uint64(message.proposalId);\n }\n if (message.voter !== \"\") {\n writer.uint32(18).string(message.voter);\n }\n for (const v of message.options) {\n gov_1.WeightedVoteOption.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgVoteWeighted);\n message.options = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proposalId = reader.uint64();\n break;\n case 2:\n message.voter = reader.string();\n break;\n case 3:\n message.options.push(gov_1.WeightedVoteOption.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgVoteWeighted);\n message.options = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = long_1.default.fromString(object.proposalId);\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = String(object.voter);\n }\n else {\n message.voter = \"\";\n }\n if (object.options !== undefined && object.options !== null) {\n for (const e of object.options) {\n message.options.push(gov_1.WeightedVoteOption.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.proposalId !== undefined && (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());\n message.voter !== undefined && (obj.voter = message.voter);\n if (message.options) {\n obj.options = message.options.map((e) => (e ? gov_1.WeightedVoteOption.toJSON(e) : undefined));\n }\n else {\n obj.options = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgVoteWeighted);\n message.options = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = object.proposalId;\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = object.voter;\n }\n else {\n message.voter = \"\";\n }\n if (object.options !== undefined && object.options !== null) {\n for (const e of object.options) {\n message.options.push(gov_1.WeightedVoteOption.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseMsgVoteWeightedResponse = {};\nexports.MsgVoteWeightedResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgVoteWeightedResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgVoteWeightedResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgVoteWeightedResponse);\n return message;\n },\n};\nconst baseMsgDeposit = { proposalId: long_1.default.UZERO, depositor: \"\" };\nexports.MsgDeposit = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.proposalId.isZero()) {\n writer.uint32(8).uint64(message.proposalId);\n }\n if (message.depositor !== \"\") {\n writer.uint32(18).string(message.depositor);\n }\n for (const v of message.amount) {\n coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgDeposit);\n message.amount = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proposalId = reader.uint64();\n break;\n case 2:\n message.depositor = reader.string();\n break;\n case 3:\n message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgDeposit);\n message.amount = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = long_1.default.fromString(object.proposalId);\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.depositor !== undefined && object.depositor !== null) {\n message.depositor = String(object.depositor);\n }\n else {\n message.depositor = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.proposalId !== undefined && (obj.proposalId = (message.proposalId || long_1.default.UZERO).toString());\n message.depositor !== undefined && (obj.depositor = message.depositor);\n if (message.amount) {\n obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.amount = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgDeposit);\n message.amount = [];\n if (object.proposalId !== undefined && object.proposalId !== null) {\n message.proposalId = object.proposalId;\n }\n else {\n message.proposalId = long_1.default.UZERO;\n }\n if (object.depositor !== undefined && object.depositor !== null) {\n message.depositor = object.depositor;\n }\n else {\n message.depositor = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseMsgDepositResponse = {};\nexports.MsgDepositResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgDepositResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgDepositResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgDepositResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.SubmitProposal = this.SubmitProposal.bind(this);\n this.Vote = this.Vote.bind(this);\n this.VoteWeighted = this.VoteWeighted.bind(this);\n this.Deposit = this.Deposit.bind(this);\n }\n SubmitProposal(request) {\n const data = exports.MsgSubmitProposal.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.gov.v1beta1.Msg\", \"SubmitProposal\", data);\n return promise.then((data) => exports.MsgSubmitProposalResponse.decode(new minimal_1.default.Reader(data)));\n }\n Vote(request) {\n const data = exports.MsgVote.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.gov.v1beta1.Msg\", \"Vote\", data);\n return promise.then((data) => exports.MsgVoteResponse.decode(new minimal_1.default.Reader(data)));\n }\n VoteWeighted(request) {\n const data = exports.MsgVoteWeighted.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.gov.v1beta1.Msg\", \"VoteWeighted\", data);\n return promise.then((data) => exports.MsgVoteWeightedResponse.decode(new minimal_1.default.Reader(data)));\n }\n Deposit(request) {\n const data = exports.MsgDeposit.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.gov.v1beta1.Msg\", \"Deposit\", data);\n return promise.then((data) => exports.MsgDepositResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ModuleVersion = exports.CancelSoftwareUpgradeProposal = exports.SoftwareUpgradeProposal = exports.Plan = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst timestamp_1 = require(\"../../../google/protobuf/timestamp\");\nexports.protobufPackage = \"cosmos.upgrade.v1beta1\";\nconst basePlan = { name: \"\", height: long_1.default.ZERO, info: \"\" };\nexports.Plan = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.name !== \"\") {\n writer.uint32(10).string(message.name);\n }\n if (message.time !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim();\n }\n if (!message.height.isZero()) {\n writer.uint32(24).int64(message.height);\n }\n if (message.info !== \"\") {\n writer.uint32(34).string(message.info);\n }\n if (message.upgradedClientState !== undefined) {\n any_1.Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePlan);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.name = reader.string();\n break;\n case 2:\n message.time = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 3:\n message.height = reader.int64();\n break;\n case 4:\n message.info = reader.string();\n break;\n case 5:\n message.upgradedClientState = any_1.Any.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePlan);\n if (object.name !== undefined && object.name !== null) {\n message.name = String(object.name);\n }\n else {\n message.name = \"\";\n }\n if (object.time !== undefined && object.time !== null) {\n message.time = fromJsonTimestamp(object.time);\n }\n else {\n message.time = undefined;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = long_1.default.fromString(object.height);\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.info !== undefined && object.info !== null) {\n message.info = String(object.info);\n }\n else {\n message.info = \"\";\n }\n if (object.upgradedClientState !== undefined && object.upgradedClientState !== null) {\n message.upgradedClientState = any_1.Any.fromJSON(object.upgradedClientState);\n }\n else {\n message.upgradedClientState = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.name !== undefined && (obj.name = message.name);\n message.time !== undefined && (obj.time = message.time.toISOString());\n message.height !== undefined && (obj.height = (message.height || long_1.default.ZERO).toString());\n message.info !== undefined && (obj.info = message.info);\n message.upgradedClientState !== undefined &&\n (obj.upgradedClientState = message.upgradedClientState\n ? any_1.Any.toJSON(message.upgradedClientState)\n : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePlan);\n if (object.name !== undefined && object.name !== null) {\n message.name = object.name;\n }\n else {\n message.name = \"\";\n }\n if (object.time !== undefined && object.time !== null) {\n message.time = object.time;\n }\n else {\n message.time = undefined;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = object.height;\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.info !== undefined && object.info !== null) {\n message.info = object.info;\n }\n else {\n message.info = \"\";\n }\n if (object.upgradedClientState !== undefined && object.upgradedClientState !== null) {\n message.upgradedClientState = any_1.Any.fromPartial(object.upgradedClientState);\n }\n else {\n message.upgradedClientState = undefined;\n }\n return message;\n },\n};\nconst baseSoftwareUpgradeProposal = { title: \"\", description: \"\" };\nexports.SoftwareUpgradeProposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.title !== \"\") {\n writer.uint32(10).string(message.title);\n }\n if (message.description !== \"\") {\n writer.uint32(18).string(message.description);\n }\n if (message.plan !== undefined) {\n exports.Plan.encode(message.plan, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSoftwareUpgradeProposal);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.title = reader.string();\n break;\n case 2:\n message.description = reader.string();\n break;\n case 3:\n message.plan = exports.Plan.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSoftwareUpgradeProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = String(object.title);\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = String(object.description);\n }\n else {\n message.description = \"\";\n }\n if (object.plan !== undefined && object.plan !== null) {\n message.plan = exports.Plan.fromJSON(object.plan);\n }\n else {\n message.plan = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.title !== undefined && (obj.title = message.title);\n message.description !== undefined && (obj.description = message.description);\n message.plan !== undefined && (obj.plan = message.plan ? exports.Plan.toJSON(message.plan) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSoftwareUpgradeProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = object.title;\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = object.description;\n }\n else {\n message.description = \"\";\n }\n if (object.plan !== undefined && object.plan !== null) {\n message.plan = exports.Plan.fromPartial(object.plan);\n }\n else {\n message.plan = undefined;\n }\n return message;\n },\n};\nconst baseCancelSoftwareUpgradeProposal = { title: \"\", description: \"\" };\nexports.CancelSoftwareUpgradeProposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.title !== \"\") {\n writer.uint32(10).string(message.title);\n }\n if (message.description !== \"\") {\n writer.uint32(18).string(message.description);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCancelSoftwareUpgradeProposal);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.title = reader.string();\n break;\n case 2:\n message.description = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCancelSoftwareUpgradeProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = String(object.title);\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = String(object.description);\n }\n else {\n message.description = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.title !== undefined && (obj.title = message.title);\n message.description !== undefined && (obj.description = message.description);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCancelSoftwareUpgradeProposal);\n if (object.title !== undefined && object.title !== null) {\n message.title = object.title;\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = object.description;\n }\n else {\n message.description = \"\";\n }\n return message;\n },\n};\nconst baseModuleVersion = { name: \"\", version: long_1.default.UZERO };\nexports.ModuleVersion = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.name !== \"\") {\n writer.uint32(10).string(message.name);\n }\n if (!message.version.isZero()) {\n writer.uint32(16).uint64(message.version);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseModuleVersion);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.name = reader.string();\n break;\n case 2:\n message.version = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseModuleVersion);\n if (object.name !== undefined && object.name !== null) {\n message.name = String(object.name);\n }\n else {\n message.name = \"\";\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = long_1.default.fromString(object.version);\n }\n else {\n message.version = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.name !== undefined && (obj.name = message.name);\n message.version !== undefined && (obj.version = (message.version || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseModuleVersion);\n if (object.name !== undefined && object.name !== null) {\n message.name = object.name;\n }\n else {\n message.name = \"\";\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = object.version;\n }\n else {\n message.version = long_1.default.UZERO;\n }\n return message;\n },\n};\nfunction toTimestamp(date) {\n const seconds = numberToLong(date.getTime() / 1000);\n const nanos = (date.getTime() % 1000) * 1000000;\n return { seconds, nanos };\n}\nfunction fromTimestamp(t) {\n let millis = t.seconds.toNumber() * 1000;\n millis += t.nanos / 1000000;\n return new Date(millis);\n}\nfunction fromJsonTimestamp(o) {\n if (o instanceof Date) {\n return o;\n }\n else if (typeof o === \"string\") {\n return new Date(o);\n }\n else {\n return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));\n }\n}\nfunction numberToLong(number) {\n return long_1.default.fromNumber(number);\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=upgrade.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Validator = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\nvar PublicKey_1 = require(\"../PublicKey\");\nvar staking_1 = require(\"@terra-money/terra.proto/cosmos/staking/v1beta1/staking\");\nvar Long = __importStar(require(\"long\"));\n/**\n * Stores information fetched from the blockchain about the current status of a validator.\n * As an end user, you will not have to create an instance of this class, one will be\n * generated for you to store information about a validator polled from the API functions\n * in [[StakingAPI]].\n */\nvar Validator = /** @class */ (function (_super) {\n __extends(Validator, _super);\n /**\n *\n * @param operator_address validator's operator address\n * @param consensus_pubkey validator's consensus public key\n * @param jailed whether the current validator is jailed\n * @param status unbonded `0`, unbonding `1`, bonded `2`\n * @param tokens total Luna from all delegations (including self)\n * @param delegator_shares total shares of all delegators\n * @param description validator's delegate description\n * @param unbonding_height if unbonding, height at which this validator began unbonding\n * @param unbonding_time if unbonding, min time for the validator to complete unbonding\n * @param commission validator commission\n * @param min_self_delegation minimum self delegation\n */\n function Validator(operator_address, consensus_pubkey, jailed, status, tokens, delegator_shares, description, unbonding_height, unbonding_time, commission, min_self_delegation) {\n var _this = _super.call(this) || this;\n _this.operator_address = operator_address;\n _this.consensus_pubkey = consensus_pubkey;\n _this.jailed = jailed;\n _this.status = status;\n _this.tokens = tokens;\n _this.delegator_shares = delegator_shares;\n _this.description = description;\n _this.unbonding_height = unbonding_height;\n _this.unbonding_time = unbonding_time;\n _this.commission = commission;\n _this.min_self_delegation = min_self_delegation;\n return _this;\n }\n Validator.prototype.toAmino = function () {\n return {\n operator_address: this.operator_address,\n consensus_pubkey: this.consensus_pubkey.toAmino(),\n jailed: this.jailed,\n status: this.status,\n tokens: this.tokens.toString(),\n delegator_shares: this.delegator_shares.toString(),\n description: this.description,\n unbonding_height: this.unbonding_height.toFixed(),\n unbonding_time: this.unbonding_time.toISOString(),\n commission: this.commission.toAmino(),\n min_self_delegation: this.min_self_delegation.toString(),\n };\n };\n Validator.fromAmino = function (data) {\n return new Validator(data.operator_address, PublicKey_1.ValConsPublicKey.fromAmino(data.consensus_pubkey), data.jailed || false, data.status || 0, new numeric_1.Int(data.tokens), new numeric_1.Dec(data.delegator_shares), Validator.Description.fromAmino(data.description), Number.parseInt(data.unbonding_height), new Date(data.unbonding_time), Validator.Commission.fromAmino(data.commission), new numeric_1.Int(data.min_self_delegation));\n };\n Validator.prototype.toData = function () {\n return {\n operator_address: this.operator_address,\n consensus_pubkey: this.consensus_pubkey.toData(),\n jailed: this.jailed,\n status: this.status,\n tokens: this.tokens.toString(),\n delegator_shares: this.delegator_shares.toString(),\n description: this.description,\n unbonding_height: this.unbonding_height.toFixed(),\n unbonding_time: this.unbonding_time.toISOString(),\n commission: this.commission.toData(),\n min_self_delegation: this.min_self_delegation.toString(),\n };\n };\n Validator.fromData = function (data) {\n return new Validator(data.operator_address, PublicKey_1.ValConsPublicKey.fromData(data.consensus_pubkey), data.jailed || false, data.status || 0, new numeric_1.Int(data.tokens), new numeric_1.Dec(data.delegator_shares), Validator.Description.fromData(data.description), Number.parseInt(data.unbonding_height), new Date(data.unbonding_time), Validator.Commission.fromData(data.commission), new numeric_1.Int(data.min_self_delegation));\n };\n Validator.prototype.toProto = function () {\n var _a = this, operator_address = _a.operator_address, consensus_pubkey = _a.consensus_pubkey, jailed = _a.jailed, status = _a.status, tokens = _a.tokens, delegator_shares = _a.delegator_shares, description = _a.description, unbonding_height = _a.unbonding_height, unbonding_time = _a.unbonding_time, commission = _a.commission, min_self_delegation = _a.min_self_delegation;\n return staking_1.Validator.fromPartial({\n commission: commission.toProto(),\n consensusPubkey: consensus_pubkey.packAny(),\n delegatorShares: delegator_shares.toString(),\n description: description.toProto(),\n jailed: jailed,\n minSelfDelegation: min_self_delegation.toString(),\n operatorAddress: operator_address,\n status: status,\n tokens: tokens.toString(),\n unbondingHeight: Long.fromNumber(unbonding_height),\n unbondingTime: unbonding_time,\n });\n };\n Validator.fromProto = function (data) {\n return new Validator(data.operatorAddress, PublicKey_1.ValConsPublicKey.unpackAny(data.consensusPubkey), data.jailed, data.status, new numeric_1.Int(data.tokens), new numeric_1.Dec(data.delegatorShares), Validator.Description.fromProto(data.description), data.unbondingHeight.toNumber(), data.unbondingTime, Validator.Commission.fromProto(data.commission), new numeric_1.Int(data.minSelfDelegation));\n };\n return Validator;\n}(json_1.JSONSerializable));\nexports.Validator = Validator;\n(function (Validator) {\n Validator.Status = staking_1.BondStatus;\n var Description = /** @class */ (function (_super) {\n __extends(Description, _super);\n /**\n * @param moniker Identifying name, e.g. \"Hashed\"\n * @param identity time at which commission was last updated\n * @param website validator's website\n * @param details long description\n * @param security_contact validator's contact\n */\n function Description(moniker, identity, website, details, security_contact) {\n var _this = _super.call(this) || this;\n _this.moniker = moniker;\n _this.identity = identity;\n _this.website = website;\n _this.details = details;\n _this.security_contact = security_contact;\n return _this;\n }\n Description.prototype.toAmino = function () {\n return {\n moniker: this.moniker,\n identity: this.identity,\n website: this.website,\n details: this.details,\n security_contact: this.security_contact,\n };\n };\n Description.fromAmino = function (data) {\n return new Description(data.moniker, data.identity || '', data.website || '', data.details || '', data.security_contact || '');\n };\n Description.prototype.toData = function () {\n return {\n moniker: this.moniker,\n identity: this.identity,\n website: this.website,\n details: this.details,\n security_contact: this.security_contact,\n };\n };\n Description.fromData = function (data) {\n return new Description(data.moniker, data.identity || '', data.website || '', data.details || '', data.security_contact || '');\n };\n Description.prototype.toProto = function () {\n var _a = this, moniker = _a.moniker, identity = _a.identity, website = _a.website, details = _a.details, security_contact = _a.security_contact;\n return staking_1.Description.fromPartial({\n details: details,\n identity: identity,\n moniker: moniker,\n securityContact: security_contact,\n website: website,\n });\n };\n Description.fromProto = function (proto) {\n return new Description(proto.moniker, proto.identity, proto.website, proto.details, proto.securityContact);\n };\n return Description;\n }(json_1.JSONSerializable));\n Validator.Description = Description;\n var CommissionRates = /** @class */ (function (_super) {\n __extends(CommissionRates, _super);\n /**\n * @param rate current commission rate\n * @param max_rate max commission rate\n * @param max_change_rate max percentage commission can change in 24hrs\n */\n function CommissionRates(rate, max_rate, max_change_rate) {\n var _this = _super.call(this) || this;\n _this.rate = rate;\n _this.max_rate = max_rate;\n _this.max_change_rate = max_change_rate;\n return _this;\n }\n CommissionRates.fromAmino = function (data) {\n var rate = data.rate, max_rate = data.max_rate, max_change_rate = data.max_change_rate;\n return new CommissionRates(new numeric_1.Dec(rate), new numeric_1.Dec(max_rate), new numeric_1.Dec(max_change_rate));\n };\n CommissionRates.prototype.toAmino = function () {\n var _a = this, rate = _a.rate, max_rate = _a.max_rate, max_change_rate = _a.max_change_rate;\n return {\n rate: rate.toString(),\n max_rate: max_rate.toString(),\n max_change_rate: max_change_rate.toString(),\n };\n };\n CommissionRates.fromData = function (data) {\n var rate = data.rate, max_rate = data.max_rate, max_change_rate = data.max_change_rate;\n return new CommissionRates(new numeric_1.Dec(rate), new numeric_1.Dec(max_rate), new numeric_1.Dec(max_change_rate));\n };\n CommissionRates.prototype.toData = function () {\n var _a = this, rate = _a.rate, max_rate = _a.max_rate, max_change_rate = _a.max_change_rate;\n return {\n rate: rate.toString(),\n max_rate: max_rate.toString(),\n max_change_rate: max_change_rate.toString(),\n };\n };\n CommissionRates.fromProto = function (proto) {\n return new CommissionRates(new numeric_1.Dec(proto.rate), new numeric_1.Dec(proto.maxRate), new numeric_1.Dec(proto.maxChangeRate));\n };\n CommissionRates.prototype.toProto = function () {\n var _a = this, rate = _a.rate, max_rate = _a.max_rate, max_change_rate = _a.max_change_rate;\n return staking_1.CommissionRates.fromPartial({\n maxChangeRate: max_change_rate.toString(),\n maxRate: max_rate.toString(),\n rate: rate.toString(),\n });\n };\n return CommissionRates;\n }(json_1.JSONSerializable));\n Validator.CommissionRates = CommissionRates;\n var Commission = /** @class */ (function (_super) {\n __extends(Commission, _super);\n /**\n * @param commission_rates commission rates\n * @param update_time time at which commission was last updated\n */\n function Commission(commission_rates, update_time) {\n var _this = _super.call(this) || this;\n _this.commission_rates = commission_rates;\n _this.update_time = update_time;\n return _this;\n }\n Commission.prototype.toAmino = function () {\n return {\n commission_rates: this.commission_rates.toAmino(),\n update_time: this.update_time.toISOString(),\n };\n };\n Commission.fromAmino = function (data) {\n return new Commission(CommissionRates.fromAmino(data.commission_rates), new Date(data.update_time));\n };\n Commission.prototype.toData = function () {\n return {\n commission_rates: this.commission_rates.toData(),\n update_time: this.update_time.toISOString(),\n };\n };\n Commission.fromData = function (data) {\n return new Commission(CommissionRates.fromData(data.commission_rates), new Date(data.update_time));\n };\n Commission.prototype.toProto = function () {\n var _a = this, commission_rates = _a.commission_rates, update_time = _a.update_time;\n return staking_1.Commission.fromPartial({\n commissionRates: commission_rates.toProto(),\n updateTime: update_time,\n });\n };\n Commission.fromProto = function (proto) {\n return new Commission(CommissionRates.fromProto(proto.commissionRates), proto.updateTime);\n };\n return Commission;\n }(json_1.JSONSerializable));\n Validator.Commission = Commission;\n})(Validator = exports.Validator || (exports.Validator = {}));\nexports.Validator = Validator;\n//# sourceMappingURL=Validator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ripemd160 = exports.sha256 = exports.hashToHex = void 0;\nvar SHA256_1 = require(\"jscrypto/SHA256\");\nvar RIPEMD160_1 = require(\"jscrypto/RIPEMD160\");\nvar Base64_1 = require(\"jscrypto/Base64\");\nvar jscrypto_1 = require(\"jscrypto\");\n/*\nDEPRECATED (was used by crypto-js)\nfunction byteArrayToWordArray(ba: Uint8Array): CryptoJS.LibWordArray {\n const wa: number[] = [];\n for (let i = 0; i < ba.length; i += 1) {\n wa[(i / 4) | 0] |= ba[i] << (24 - 8 * i);\n }\n return crypto.lib.WordArray.create(wa);\n}*/\n/**\n * Calculates the transaction hash from Amino-encoded string.\n * @param data Amino-encoded string (base64)\n */\nfunction hashToHex(data) {\n return SHA256_1.SHA256.hash(Base64_1.Base64.parse(data)).toString().toUpperCase();\n}\nexports.hashToHex = hashToHex;\n/**\n * Calculates the transaction hash from Amino-encoded string.\n * @param data raw bytes\n */\nfunction sha256(data) {\n return SHA256_1.SHA256.hash(new jscrypto_1.Word32Array(data)).toUint8Array();\n}\nexports.sha256 = sha256;\nfunction ripemd160(data) {\n return RIPEMD160_1.RIPEMD160.hash(new jscrypto_1.Word32Array(data)).toUint8Array();\n}\nexports.ripemd160 = ripemd160;\n//# sourceMappingURL=hash.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgSubmitMisbehaviourResponse = exports.MsgSubmitMisbehaviour = exports.MsgUpgradeClientResponse = exports.MsgUpgradeClient = exports.MsgUpdateClientResponse = exports.MsgUpdateClient = exports.MsgCreateClientResponse = exports.MsgCreateClient = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../../google/protobuf/any\");\nexports.protobufPackage = \"ibc.core.client.v1\";\nconst baseMsgCreateClient = { signer: \"\" };\nexports.MsgCreateClient = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientState !== undefined) {\n any_1.Any.encode(message.clientState, writer.uint32(10).fork()).ldelim();\n }\n if (message.consensusState !== undefined) {\n any_1.Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(26).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgCreateClient);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientState = any_1.Any.decode(reader, reader.uint32());\n break;\n case 2:\n message.consensusState = any_1.Any.decode(reader, reader.uint32());\n break;\n case 3:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgCreateClient);\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromJSON(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.consensusState !== undefined && object.consensusState !== null) {\n message.consensusState = any_1.Any.fromJSON(object.consensusState);\n }\n else {\n message.consensusState = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientState !== undefined &&\n (obj.clientState = message.clientState ? any_1.Any.toJSON(message.clientState) : undefined);\n message.consensusState !== undefined &&\n (obj.consensusState = message.consensusState ? any_1.Any.toJSON(message.consensusState) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgCreateClient);\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromPartial(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.consensusState !== undefined && object.consensusState !== null) {\n message.consensusState = any_1.Any.fromPartial(object.consensusState);\n }\n else {\n message.consensusState = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgCreateClientResponse = {};\nexports.MsgCreateClientResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgCreateClientResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgCreateClientResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgCreateClientResponse);\n return message;\n },\n};\nconst baseMsgUpdateClient = { clientId: \"\", signer: \"\" };\nexports.MsgUpdateClient = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n if (message.header !== undefined) {\n any_1.Any.encode(message.header, writer.uint32(18).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(26).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUpdateClient);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.header = any_1.Any.decode(reader, reader.uint32());\n break;\n case 3:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgUpdateClient);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.header !== undefined && object.header !== null) {\n message.header = any_1.Any.fromJSON(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n message.header !== undefined && (obj.header = message.header ? any_1.Any.toJSON(message.header) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgUpdateClient);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.header !== undefined && object.header !== null) {\n message.header = any_1.Any.fromPartial(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgUpdateClientResponse = {};\nexports.MsgUpdateClientResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUpdateClientResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgUpdateClientResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgUpdateClientResponse);\n return message;\n },\n};\nconst baseMsgUpgradeClient = { clientId: \"\", signer: \"\" };\nexports.MsgUpgradeClient = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n if (message.clientState !== undefined) {\n any_1.Any.encode(message.clientState, writer.uint32(18).fork()).ldelim();\n }\n if (message.consensusState !== undefined) {\n any_1.Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim();\n }\n if (message.proofUpgradeClient.length !== 0) {\n writer.uint32(34).bytes(message.proofUpgradeClient);\n }\n if (message.proofUpgradeConsensusState.length !== 0) {\n writer.uint32(42).bytes(message.proofUpgradeConsensusState);\n }\n if (message.signer !== \"\") {\n writer.uint32(50).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUpgradeClient);\n message.proofUpgradeClient = new Uint8Array();\n message.proofUpgradeConsensusState = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.clientState = any_1.Any.decode(reader, reader.uint32());\n break;\n case 3:\n message.consensusState = any_1.Any.decode(reader, reader.uint32());\n break;\n case 4:\n message.proofUpgradeClient = reader.bytes();\n break;\n case 5:\n message.proofUpgradeConsensusState = reader.bytes();\n break;\n case 6:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgUpgradeClient);\n message.proofUpgradeClient = new Uint8Array();\n message.proofUpgradeConsensusState = new Uint8Array();\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromJSON(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.consensusState !== undefined && object.consensusState !== null) {\n message.consensusState = any_1.Any.fromJSON(object.consensusState);\n }\n else {\n message.consensusState = undefined;\n }\n if (object.proofUpgradeClient !== undefined && object.proofUpgradeClient !== null) {\n message.proofUpgradeClient = bytesFromBase64(object.proofUpgradeClient);\n }\n if (object.proofUpgradeConsensusState !== undefined && object.proofUpgradeConsensusState !== null) {\n message.proofUpgradeConsensusState = bytesFromBase64(object.proofUpgradeConsensusState);\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n message.clientState !== undefined &&\n (obj.clientState = message.clientState ? any_1.Any.toJSON(message.clientState) : undefined);\n message.consensusState !== undefined &&\n (obj.consensusState = message.consensusState ? any_1.Any.toJSON(message.consensusState) : undefined);\n message.proofUpgradeClient !== undefined &&\n (obj.proofUpgradeClient = base64FromBytes(message.proofUpgradeClient !== undefined ? message.proofUpgradeClient : new Uint8Array()));\n message.proofUpgradeConsensusState !== undefined &&\n (obj.proofUpgradeConsensusState = base64FromBytes(message.proofUpgradeConsensusState !== undefined\n ? message.proofUpgradeConsensusState\n : new Uint8Array()));\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgUpgradeClient);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromPartial(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.consensusState !== undefined && object.consensusState !== null) {\n message.consensusState = any_1.Any.fromPartial(object.consensusState);\n }\n else {\n message.consensusState = undefined;\n }\n if (object.proofUpgradeClient !== undefined && object.proofUpgradeClient !== null) {\n message.proofUpgradeClient = object.proofUpgradeClient;\n }\n else {\n message.proofUpgradeClient = new Uint8Array();\n }\n if (object.proofUpgradeConsensusState !== undefined && object.proofUpgradeConsensusState !== null) {\n message.proofUpgradeConsensusState = object.proofUpgradeConsensusState;\n }\n else {\n message.proofUpgradeConsensusState = new Uint8Array();\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgUpgradeClientResponse = {};\nexports.MsgUpgradeClientResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgUpgradeClientResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgUpgradeClientResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgUpgradeClientResponse);\n return message;\n },\n};\nconst baseMsgSubmitMisbehaviour = { clientId: \"\", signer: \"\" };\nexports.MsgSubmitMisbehaviour = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n if (message.misbehaviour !== undefined) {\n any_1.Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(26).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSubmitMisbehaviour);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.misbehaviour = any_1.Any.decode(reader, reader.uint32());\n break;\n case 3:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSubmitMisbehaviour);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.misbehaviour !== undefined && object.misbehaviour !== null) {\n message.misbehaviour = any_1.Any.fromJSON(object.misbehaviour);\n }\n else {\n message.misbehaviour = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n message.misbehaviour !== undefined &&\n (obj.misbehaviour = message.misbehaviour ? any_1.Any.toJSON(message.misbehaviour) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSubmitMisbehaviour);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.misbehaviour !== undefined && object.misbehaviour !== null) {\n message.misbehaviour = any_1.Any.fromPartial(object.misbehaviour);\n }\n else {\n message.misbehaviour = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgSubmitMisbehaviourResponse = {};\nexports.MsgSubmitMisbehaviourResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSubmitMisbehaviourResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgSubmitMisbehaviourResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgSubmitMisbehaviourResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.CreateClient = this.CreateClient.bind(this);\n this.UpdateClient = this.UpdateClient.bind(this);\n this.UpgradeClient = this.UpgradeClient.bind(this);\n this.SubmitMisbehaviour = this.SubmitMisbehaviour.bind(this);\n }\n CreateClient(request) {\n const data = exports.MsgCreateClient.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.client.v1.Msg\", \"CreateClient\", data);\n return promise.then((data) => exports.MsgCreateClientResponse.decode(new minimal_1.default.Reader(data)));\n }\n UpdateClient(request) {\n const data = exports.MsgUpdateClient.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.client.v1.Msg\", \"UpdateClient\", data);\n return promise.then((data) => exports.MsgUpdateClientResponse.decode(new minimal_1.default.Reader(data)));\n }\n UpgradeClient(request) {\n const data = exports.MsgUpgradeClient.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.client.v1.Msg\", \"UpgradeClient\", data);\n return promise.then((data) => exports.MsgUpgradeClientResponse.decode(new minimal_1.default.Reader(data)));\n }\n SubmitMisbehaviour(request) {\n const data = exports.MsgSubmitMisbehaviour.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.client.v1.Msg\", \"SubmitMisbehaviour\", data);\n return promise.then((data) => exports.MsgSubmitMisbehaviourResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgConnectionOpenConfirmResponse = exports.MsgConnectionOpenConfirm = exports.MsgConnectionOpenAckResponse = exports.MsgConnectionOpenAck = exports.MsgConnectionOpenTryResponse = exports.MsgConnectionOpenTry = exports.MsgConnectionOpenInitResponse = exports.MsgConnectionOpenInit = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst connection_1 = require(\"../../../../ibc/core/connection/v1/connection\");\nconst any_1 = require(\"../../../../google/protobuf/any\");\nconst client_1 = require(\"../../../../ibc/core/client/v1/client\");\nexports.protobufPackage = \"ibc.core.connection.v1\";\nconst baseMsgConnectionOpenInit = { clientId: \"\", delayPeriod: long_1.default.UZERO, signer: \"\" };\nexports.MsgConnectionOpenInit = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n if (message.counterparty !== undefined) {\n connection_1.Counterparty.encode(message.counterparty, writer.uint32(18).fork()).ldelim();\n }\n if (message.version !== undefined) {\n connection_1.Version.encode(message.version, writer.uint32(26).fork()).ldelim();\n }\n if (!message.delayPeriod.isZero()) {\n writer.uint32(32).uint64(message.delayPeriod);\n }\n if (message.signer !== \"\") {\n writer.uint32(42).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenInit);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.counterparty = connection_1.Counterparty.decode(reader, reader.uint32());\n break;\n case 3:\n message.version = connection_1.Version.decode(reader, reader.uint32());\n break;\n case 4:\n message.delayPeriod = reader.uint64();\n break;\n case 5:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgConnectionOpenInit);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = connection_1.Counterparty.fromJSON(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = connection_1.Version.fromJSON(object.version);\n }\n else {\n message.version = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = long_1.default.fromString(object.delayPeriod);\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n message.counterparty !== undefined &&\n (obj.counterparty = message.counterparty ? connection_1.Counterparty.toJSON(message.counterparty) : undefined);\n message.version !== undefined &&\n (obj.version = message.version ? connection_1.Version.toJSON(message.version) : undefined);\n message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || long_1.default.UZERO).toString());\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgConnectionOpenInit);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = connection_1.Counterparty.fromPartial(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = connection_1.Version.fromPartial(object.version);\n }\n else {\n message.version = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = object.delayPeriod;\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgConnectionOpenInitResponse = {};\nexports.MsgConnectionOpenInitResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenInitResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgConnectionOpenInitResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgConnectionOpenInitResponse);\n return message;\n },\n};\nconst baseMsgConnectionOpenTry = {\n clientId: \"\",\n previousConnectionId: \"\",\n delayPeriod: long_1.default.UZERO,\n signer: \"\",\n};\nexports.MsgConnectionOpenTry = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n if (message.previousConnectionId !== \"\") {\n writer.uint32(18).string(message.previousConnectionId);\n }\n if (message.clientState !== undefined) {\n any_1.Any.encode(message.clientState, writer.uint32(26).fork()).ldelim();\n }\n if (message.counterparty !== undefined) {\n connection_1.Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim();\n }\n if (!message.delayPeriod.isZero()) {\n writer.uint32(40).uint64(message.delayPeriod);\n }\n for (const v of message.counterpartyVersions) {\n connection_1.Version.encode(v, writer.uint32(50).fork()).ldelim();\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim();\n }\n if (message.proofInit.length !== 0) {\n writer.uint32(66).bytes(message.proofInit);\n }\n if (message.proofClient.length !== 0) {\n writer.uint32(74).bytes(message.proofClient);\n }\n if (message.proofConsensus.length !== 0) {\n writer.uint32(82).bytes(message.proofConsensus);\n }\n if (message.consensusHeight !== undefined) {\n client_1.Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(98).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenTry);\n message.counterpartyVersions = [];\n message.proofInit = new Uint8Array();\n message.proofClient = new Uint8Array();\n message.proofConsensus = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.previousConnectionId = reader.string();\n break;\n case 3:\n message.clientState = any_1.Any.decode(reader, reader.uint32());\n break;\n case 4:\n message.counterparty = connection_1.Counterparty.decode(reader, reader.uint32());\n break;\n case 5:\n message.delayPeriod = reader.uint64();\n break;\n case 6:\n message.counterpartyVersions.push(connection_1.Version.decode(reader, reader.uint32()));\n break;\n case 7:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 8:\n message.proofInit = reader.bytes();\n break;\n case 9:\n message.proofClient = reader.bytes();\n break;\n case 10:\n message.proofConsensus = reader.bytes();\n break;\n case 11:\n message.consensusHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 12:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgConnectionOpenTry);\n message.counterpartyVersions = [];\n message.proofInit = new Uint8Array();\n message.proofClient = new Uint8Array();\n message.proofConsensus = new Uint8Array();\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.previousConnectionId !== undefined && object.previousConnectionId !== null) {\n message.previousConnectionId = String(object.previousConnectionId);\n }\n else {\n message.previousConnectionId = \"\";\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromJSON(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = connection_1.Counterparty.fromJSON(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = long_1.default.fromString(object.delayPeriod);\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n if (object.counterpartyVersions !== undefined && object.counterpartyVersions !== null) {\n for (const e of object.counterpartyVersions) {\n message.counterpartyVersions.push(connection_1.Version.fromJSON(e));\n }\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.proofInit !== undefined && object.proofInit !== null) {\n message.proofInit = bytesFromBase64(object.proofInit);\n }\n if (object.proofClient !== undefined && object.proofClient !== null) {\n message.proofClient = bytesFromBase64(object.proofClient);\n }\n if (object.proofConsensus !== undefined && object.proofConsensus !== null) {\n message.proofConsensus = bytesFromBase64(object.proofConsensus);\n }\n if (object.consensusHeight !== undefined && object.consensusHeight !== null) {\n message.consensusHeight = client_1.Height.fromJSON(object.consensusHeight);\n }\n else {\n message.consensusHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n message.previousConnectionId !== undefined && (obj.previousConnectionId = message.previousConnectionId);\n message.clientState !== undefined &&\n (obj.clientState = message.clientState ? any_1.Any.toJSON(message.clientState) : undefined);\n message.counterparty !== undefined &&\n (obj.counterparty = message.counterparty ? connection_1.Counterparty.toJSON(message.counterparty) : undefined);\n message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || long_1.default.UZERO).toString());\n if (message.counterpartyVersions) {\n obj.counterpartyVersions = message.counterpartyVersions.map((e) => (e ? connection_1.Version.toJSON(e) : undefined));\n }\n else {\n obj.counterpartyVersions = [];\n }\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.proofInit !== undefined &&\n (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array()));\n message.proofClient !== undefined &&\n (obj.proofClient = base64FromBytes(message.proofClient !== undefined ? message.proofClient : new Uint8Array()));\n message.proofConsensus !== undefined &&\n (obj.proofConsensus = base64FromBytes(message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array()));\n message.consensusHeight !== undefined &&\n (obj.consensusHeight = message.consensusHeight ? client_1.Height.toJSON(message.consensusHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgConnectionOpenTry);\n message.counterpartyVersions = [];\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.previousConnectionId !== undefined && object.previousConnectionId !== null) {\n message.previousConnectionId = object.previousConnectionId;\n }\n else {\n message.previousConnectionId = \"\";\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromPartial(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = connection_1.Counterparty.fromPartial(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = object.delayPeriod;\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n if (object.counterpartyVersions !== undefined && object.counterpartyVersions !== null) {\n for (const e of object.counterpartyVersions) {\n message.counterpartyVersions.push(connection_1.Version.fromPartial(e));\n }\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.proofInit !== undefined && object.proofInit !== null) {\n message.proofInit = object.proofInit;\n }\n else {\n message.proofInit = new Uint8Array();\n }\n if (object.proofClient !== undefined && object.proofClient !== null) {\n message.proofClient = object.proofClient;\n }\n else {\n message.proofClient = new Uint8Array();\n }\n if (object.proofConsensus !== undefined && object.proofConsensus !== null) {\n message.proofConsensus = object.proofConsensus;\n }\n else {\n message.proofConsensus = new Uint8Array();\n }\n if (object.consensusHeight !== undefined && object.consensusHeight !== null) {\n message.consensusHeight = client_1.Height.fromPartial(object.consensusHeight);\n }\n else {\n message.consensusHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgConnectionOpenTryResponse = {};\nexports.MsgConnectionOpenTryResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenTryResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgConnectionOpenTryResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgConnectionOpenTryResponse);\n return message;\n },\n};\nconst baseMsgConnectionOpenAck = { connectionId: \"\", counterpartyConnectionId: \"\", signer: \"\" };\nexports.MsgConnectionOpenAck = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.connectionId !== \"\") {\n writer.uint32(10).string(message.connectionId);\n }\n if (message.counterpartyConnectionId !== \"\") {\n writer.uint32(18).string(message.counterpartyConnectionId);\n }\n if (message.version !== undefined) {\n connection_1.Version.encode(message.version, writer.uint32(26).fork()).ldelim();\n }\n if (message.clientState !== undefined) {\n any_1.Any.encode(message.clientState, writer.uint32(34).fork()).ldelim();\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim();\n }\n if (message.proofTry.length !== 0) {\n writer.uint32(50).bytes(message.proofTry);\n }\n if (message.proofClient.length !== 0) {\n writer.uint32(58).bytes(message.proofClient);\n }\n if (message.proofConsensus.length !== 0) {\n writer.uint32(66).bytes(message.proofConsensus);\n }\n if (message.consensusHeight !== undefined) {\n client_1.Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(82).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenAck);\n message.proofTry = new Uint8Array();\n message.proofClient = new Uint8Array();\n message.proofConsensus = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.connectionId = reader.string();\n break;\n case 2:\n message.counterpartyConnectionId = reader.string();\n break;\n case 3:\n message.version = connection_1.Version.decode(reader, reader.uint32());\n break;\n case 4:\n message.clientState = any_1.Any.decode(reader, reader.uint32());\n break;\n case 5:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 6:\n message.proofTry = reader.bytes();\n break;\n case 7:\n message.proofClient = reader.bytes();\n break;\n case 8:\n message.proofConsensus = reader.bytes();\n break;\n case 9:\n message.consensusHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 10:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgConnectionOpenAck);\n message.proofTry = new Uint8Array();\n message.proofClient = new Uint8Array();\n message.proofConsensus = new Uint8Array();\n if (object.connectionId !== undefined && object.connectionId !== null) {\n message.connectionId = String(object.connectionId);\n }\n else {\n message.connectionId = \"\";\n }\n if (object.counterpartyConnectionId !== undefined && object.counterpartyConnectionId !== null) {\n message.counterpartyConnectionId = String(object.counterpartyConnectionId);\n }\n else {\n message.counterpartyConnectionId = \"\";\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = connection_1.Version.fromJSON(object.version);\n }\n else {\n message.version = undefined;\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromJSON(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.proofTry !== undefined && object.proofTry !== null) {\n message.proofTry = bytesFromBase64(object.proofTry);\n }\n if (object.proofClient !== undefined && object.proofClient !== null) {\n message.proofClient = bytesFromBase64(object.proofClient);\n }\n if (object.proofConsensus !== undefined && object.proofConsensus !== null) {\n message.proofConsensus = bytesFromBase64(object.proofConsensus);\n }\n if (object.consensusHeight !== undefined && object.consensusHeight !== null) {\n message.consensusHeight = client_1.Height.fromJSON(object.consensusHeight);\n }\n else {\n message.consensusHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.connectionId !== undefined && (obj.connectionId = message.connectionId);\n message.counterpartyConnectionId !== undefined &&\n (obj.counterpartyConnectionId = message.counterpartyConnectionId);\n message.version !== undefined &&\n (obj.version = message.version ? connection_1.Version.toJSON(message.version) : undefined);\n message.clientState !== undefined &&\n (obj.clientState = message.clientState ? any_1.Any.toJSON(message.clientState) : undefined);\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.proofTry !== undefined &&\n (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array()));\n message.proofClient !== undefined &&\n (obj.proofClient = base64FromBytes(message.proofClient !== undefined ? message.proofClient : new Uint8Array()));\n message.proofConsensus !== undefined &&\n (obj.proofConsensus = base64FromBytes(message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array()));\n message.consensusHeight !== undefined &&\n (obj.consensusHeight = message.consensusHeight ? client_1.Height.toJSON(message.consensusHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgConnectionOpenAck);\n if (object.connectionId !== undefined && object.connectionId !== null) {\n message.connectionId = object.connectionId;\n }\n else {\n message.connectionId = \"\";\n }\n if (object.counterpartyConnectionId !== undefined && object.counterpartyConnectionId !== null) {\n message.counterpartyConnectionId = object.counterpartyConnectionId;\n }\n else {\n message.counterpartyConnectionId = \"\";\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = connection_1.Version.fromPartial(object.version);\n }\n else {\n message.version = undefined;\n }\n if (object.clientState !== undefined && object.clientState !== null) {\n message.clientState = any_1.Any.fromPartial(object.clientState);\n }\n else {\n message.clientState = undefined;\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.proofTry !== undefined && object.proofTry !== null) {\n message.proofTry = object.proofTry;\n }\n else {\n message.proofTry = new Uint8Array();\n }\n if (object.proofClient !== undefined && object.proofClient !== null) {\n message.proofClient = object.proofClient;\n }\n else {\n message.proofClient = new Uint8Array();\n }\n if (object.proofConsensus !== undefined && object.proofConsensus !== null) {\n message.proofConsensus = object.proofConsensus;\n }\n else {\n message.proofConsensus = new Uint8Array();\n }\n if (object.consensusHeight !== undefined && object.consensusHeight !== null) {\n message.consensusHeight = client_1.Height.fromPartial(object.consensusHeight);\n }\n else {\n message.consensusHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgConnectionOpenAckResponse = {};\nexports.MsgConnectionOpenAckResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenAckResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgConnectionOpenAckResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgConnectionOpenAckResponse);\n return message;\n },\n};\nconst baseMsgConnectionOpenConfirm = { connectionId: \"\", signer: \"\" };\nexports.MsgConnectionOpenConfirm = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.connectionId !== \"\") {\n writer.uint32(10).string(message.connectionId);\n }\n if (message.proofAck.length !== 0) {\n writer.uint32(18).bytes(message.proofAck);\n }\n if (message.proofHeight !== undefined) {\n client_1.Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();\n }\n if (message.signer !== \"\") {\n writer.uint32(34).string(message.signer);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenConfirm);\n message.proofAck = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.connectionId = reader.string();\n break;\n case 2:\n message.proofAck = reader.bytes();\n break;\n case 3:\n message.proofHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 4:\n message.signer = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgConnectionOpenConfirm);\n message.proofAck = new Uint8Array();\n if (object.connectionId !== undefined && object.connectionId !== null) {\n message.connectionId = String(object.connectionId);\n }\n else {\n message.connectionId = \"\";\n }\n if (object.proofAck !== undefined && object.proofAck !== null) {\n message.proofAck = bytesFromBase64(object.proofAck);\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromJSON(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = String(object.signer);\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.connectionId !== undefined && (obj.connectionId = message.connectionId);\n message.proofAck !== undefined &&\n (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array()));\n message.proofHeight !== undefined &&\n (obj.proofHeight = message.proofHeight ? client_1.Height.toJSON(message.proofHeight) : undefined);\n message.signer !== undefined && (obj.signer = message.signer);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgConnectionOpenConfirm);\n if (object.connectionId !== undefined && object.connectionId !== null) {\n message.connectionId = object.connectionId;\n }\n else {\n message.connectionId = \"\";\n }\n if (object.proofAck !== undefined && object.proofAck !== null) {\n message.proofAck = object.proofAck;\n }\n else {\n message.proofAck = new Uint8Array();\n }\n if (object.proofHeight !== undefined && object.proofHeight !== null) {\n message.proofHeight = client_1.Height.fromPartial(object.proofHeight);\n }\n else {\n message.proofHeight = undefined;\n }\n if (object.signer !== undefined && object.signer !== null) {\n message.signer = object.signer;\n }\n else {\n message.signer = \"\";\n }\n return message;\n },\n};\nconst baseMsgConnectionOpenConfirmResponse = {};\nexports.MsgConnectionOpenConfirmResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgConnectionOpenConfirmResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgConnectionOpenConfirmResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgConnectionOpenConfirmResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.ConnectionOpenInit = this.ConnectionOpenInit.bind(this);\n this.ConnectionOpenTry = this.ConnectionOpenTry.bind(this);\n this.ConnectionOpenAck = this.ConnectionOpenAck.bind(this);\n this.ConnectionOpenConfirm = this.ConnectionOpenConfirm.bind(this);\n }\n ConnectionOpenInit(request) {\n const data = exports.MsgConnectionOpenInit.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.connection.v1.Msg\", \"ConnectionOpenInit\", data);\n return promise.then((data) => exports.MsgConnectionOpenInitResponse.decode(new minimal_1.default.Reader(data)));\n }\n ConnectionOpenTry(request) {\n const data = exports.MsgConnectionOpenTry.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.connection.v1.Msg\", \"ConnectionOpenTry\", data);\n return promise.then((data) => exports.MsgConnectionOpenTryResponse.decode(new minimal_1.default.Reader(data)));\n }\n ConnectionOpenAck(request) {\n const data = exports.MsgConnectionOpenAck.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.connection.v1.Msg\", \"ConnectionOpenAck\", data);\n return promise.then((data) => exports.MsgConnectionOpenAckResponse.decode(new minimal_1.default.Reader(data)));\n }\n ConnectionOpenConfirm(request) {\n const data = exports.MsgConnectionOpenConfirm.encode(request).finish();\n const promise = this.rpc.request(\"ibc.core.connection.v1.Msg\", \"ConnectionOpenConfirm\", data);\n return promise.then((data) => exports.MsgConnectionOpenConfirmResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Acknowledgement = exports.PacketState = exports.Packet = exports.Counterparty = exports.IdentifiedChannel = exports.Channel = exports.orderToJSON = exports.orderFromJSON = exports.Order = exports.stateToJSON = exports.stateFromJSON = exports.State = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst client_1 = require(\"../../../../ibc/core/client/v1/client\");\nexports.protobufPackage = \"ibc.core.channel.v1\";\n/**\n * State defines if a channel is in one of the following states:\n * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.\n */\nvar State;\n(function (State) {\n /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */\n State[State[\"STATE_UNINITIALIZED_UNSPECIFIED\"] = 0] = \"STATE_UNINITIALIZED_UNSPECIFIED\";\n /** STATE_INIT - A channel has just started the opening handshake. */\n State[State[\"STATE_INIT\"] = 1] = \"STATE_INIT\";\n /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */\n State[State[\"STATE_TRYOPEN\"] = 2] = \"STATE_TRYOPEN\";\n /**\n * STATE_OPEN - A channel has completed the handshake. Open channels are\n * ready to send and receive packets.\n */\n State[State[\"STATE_OPEN\"] = 3] = \"STATE_OPEN\";\n /**\n * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive\n * packets.\n */\n State[State[\"STATE_CLOSED\"] = 4] = \"STATE_CLOSED\";\n State[State[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(State = exports.State || (exports.State = {}));\nfunction stateFromJSON(object) {\n switch (object) {\n case 0:\n case \"STATE_UNINITIALIZED_UNSPECIFIED\":\n return State.STATE_UNINITIALIZED_UNSPECIFIED;\n case 1:\n case \"STATE_INIT\":\n return State.STATE_INIT;\n case 2:\n case \"STATE_TRYOPEN\":\n return State.STATE_TRYOPEN;\n case 3:\n case \"STATE_OPEN\":\n return State.STATE_OPEN;\n case 4:\n case \"STATE_CLOSED\":\n return State.STATE_CLOSED;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return State.UNRECOGNIZED;\n }\n}\nexports.stateFromJSON = stateFromJSON;\nfunction stateToJSON(object) {\n switch (object) {\n case State.STATE_UNINITIALIZED_UNSPECIFIED:\n return \"STATE_UNINITIALIZED_UNSPECIFIED\";\n case State.STATE_INIT:\n return \"STATE_INIT\";\n case State.STATE_TRYOPEN:\n return \"STATE_TRYOPEN\";\n case State.STATE_OPEN:\n return \"STATE_OPEN\";\n case State.STATE_CLOSED:\n return \"STATE_CLOSED\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.stateToJSON = stateToJSON;\n/** Order defines if a channel is ORDERED or UNORDERED */\nvar Order;\n(function (Order) {\n /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */\n Order[Order[\"ORDER_NONE_UNSPECIFIED\"] = 0] = \"ORDER_NONE_UNSPECIFIED\";\n /**\n * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in\n * which they were sent.\n */\n Order[Order[\"ORDER_UNORDERED\"] = 1] = \"ORDER_UNORDERED\";\n /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */\n Order[Order[\"ORDER_ORDERED\"] = 2] = \"ORDER_ORDERED\";\n Order[Order[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(Order = exports.Order || (exports.Order = {}));\nfunction orderFromJSON(object) {\n switch (object) {\n case 0:\n case \"ORDER_NONE_UNSPECIFIED\":\n return Order.ORDER_NONE_UNSPECIFIED;\n case 1:\n case \"ORDER_UNORDERED\":\n return Order.ORDER_UNORDERED;\n case 2:\n case \"ORDER_ORDERED\":\n return Order.ORDER_ORDERED;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return Order.UNRECOGNIZED;\n }\n}\nexports.orderFromJSON = orderFromJSON;\nfunction orderToJSON(object) {\n switch (object) {\n case Order.ORDER_NONE_UNSPECIFIED:\n return \"ORDER_NONE_UNSPECIFIED\";\n case Order.ORDER_UNORDERED:\n return \"ORDER_UNORDERED\";\n case Order.ORDER_ORDERED:\n return \"ORDER_ORDERED\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.orderToJSON = orderToJSON;\nconst baseChannel = { state: 0, ordering: 0, connectionHops: \"\", version: \"\" };\nexports.Channel = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.state !== 0) {\n writer.uint32(8).int32(message.state);\n }\n if (message.ordering !== 0) {\n writer.uint32(16).int32(message.ordering);\n }\n if (message.counterparty !== undefined) {\n exports.Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim();\n }\n for (const v of message.connectionHops) {\n writer.uint32(34).string(v);\n }\n if (message.version !== \"\") {\n writer.uint32(42).string(message.version);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseChannel);\n message.connectionHops = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.state = reader.int32();\n break;\n case 2:\n message.ordering = reader.int32();\n break;\n case 3:\n message.counterparty = exports.Counterparty.decode(reader, reader.uint32());\n break;\n case 4:\n message.connectionHops.push(reader.string());\n break;\n case 5:\n message.version = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseChannel);\n message.connectionHops = [];\n if (object.state !== undefined && object.state !== null) {\n message.state = stateFromJSON(object.state);\n }\n else {\n message.state = 0;\n }\n if (object.ordering !== undefined && object.ordering !== null) {\n message.ordering = orderFromJSON(object.ordering);\n }\n else {\n message.ordering = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromJSON(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.connectionHops !== undefined && object.connectionHops !== null) {\n for (const e of object.connectionHops) {\n message.connectionHops.push(String(e));\n }\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = String(object.version);\n }\n else {\n message.version = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.state !== undefined && (obj.state = stateToJSON(message.state));\n message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering));\n message.counterparty !== undefined &&\n (obj.counterparty = message.counterparty ? exports.Counterparty.toJSON(message.counterparty) : undefined);\n if (message.connectionHops) {\n obj.connectionHops = message.connectionHops.map((e) => e);\n }\n else {\n obj.connectionHops = [];\n }\n message.version !== undefined && (obj.version = message.version);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseChannel);\n message.connectionHops = [];\n if (object.state !== undefined && object.state !== null) {\n message.state = object.state;\n }\n else {\n message.state = 0;\n }\n if (object.ordering !== undefined && object.ordering !== null) {\n message.ordering = object.ordering;\n }\n else {\n message.ordering = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromPartial(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.connectionHops !== undefined && object.connectionHops !== null) {\n for (const e of object.connectionHops) {\n message.connectionHops.push(e);\n }\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = object.version;\n }\n else {\n message.version = \"\";\n }\n return message;\n },\n};\nconst baseIdentifiedChannel = {\n state: 0,\n ordering: 0,\n connectionHops: \"\",\n version: \"\",\n portId: \"\",\n channelId: \"\",\n};\nexports.IdentifiedChannel = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.state !== 0) {\n writer.uint32(8).int32(message.state);\n }\n if (message.ordering !== 0) {\n writer.uint32(16).int32(message.ordering);\n }\n if (message.counterparty !== undefined) {\n exports.Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim();\n }\n for (const v of message.connectionHops) {\n writer.uint32(34).string(v);\n }\n if (message.version !== \"\") {\n writer.uint32(42).string(message.version);\n }\n if (message.portId !== \"\") {\n writer.uint32(50).string(message.portId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(58).string(message.channelId);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseIdentifiedChannel);\n message.connectionHops = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.state = reader.int32();\n break;\n case 2:\n message.ordering = reader.int32();\n break;\n case 3:\n message.counterparty = exports.Counterparty.decode(reader, reader.uint32());\n break;\n case 4:\n message.connectionHops.push(reader.string());\n break;\n case 5:\n message.version = reader.string();\n break;\n case 6:\n message.portId = reader.string();\n break;\n case 7:\n message.channelId = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseIdentifiedChannel);\n message.connectionHops = [];\n if (object.state !== undefined && object.state !== null) {\n message.state = stateFromJSON(object.state);\n }\n else {\n message.state = 0;\n }\n if (object.ordering !== undefined && object.ordering !== null) {\n message.ordering = orderFromJSON(object.ordering);\n }\n else {\n message.ordering = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromJSON(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.connectionHops !== undefined && object.connectionHops !== null) {\n for (const e of object.connectionHops) {\n message.connectionHops.push(String(e));\n }\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = String(object.version);\n }\n else {\n message.version = \"\";\n }\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = String(object.channelId);\n }\n else {\n message.channelId = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.state !== undefined && (obj.state = stateToJSON(message.state));\n message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering));\n message.counterparty !== undefined &&\n (obj.counterparty = message.counterparty ? exports.Counterparty.toJSON(message.counterparty) : undefined);\n if (message.connectionHops) {\n obj.connectionHops = message.connectionHops.map((e) => e);\n }\n else {\n obj.connectionHops = [];\n }\n message.version !== undefined && (obj.version = message.version);\n message.portId !== undefined && (obj.portId = message.portId);\n message.channelId !== undefined && (obj.channelId = message.channelId);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseIdentifiedChannel);\n message.connectionHops = [];\n if (object.state !== undefined && object.state !== null) {\n message.state = object.state;\n }\n else {\n message.state = 0;\n }\n if (object.ordering !== undefined && object.ordering !== null) {\n message.ordering = object.ordering;\n }\n else {\n message.ordering = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromPartial(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.connectionHops !== undefined && object.connectionHops !== null) {\n for (const e of object.connectionHops) {\n message.connectionHops.push(e);\n }\n }\n if (object.version !== undefined && object.version !== null) {\n message.version = object.version;\n }\n else {\n message.version = \"\";\n }\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = object.channelId;\n }\n else {\n message.channelId = \"\";\n }\n return message;\n },\n};\nconst baseCounterparty = { portId: \"\", channelId: \"\" };\nexports.Counterparty = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(18).string(message.channelId);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCounterparty);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.channelId = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCounterparty);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = String(object.channelId);\n }\n else {\n message.channelId = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.channelId !== undefined && (obj.channelId = message.channelId);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCounterparty);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = object.channelId;\n }\n else {\n message.channelId = \"\";\n }\n return message;\n },\n};\nconst basePacket = {\n sequence: long_1.default.UZERO,\n sourcePort: \"\",\n sourceChannel: \"\",\n destinationPort: \"\",\n destinationChannel: \"\",\n timeoutTimestamp: long_1.default.UZERO,\n};\nexports.Packet = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.sequence.isZero()) {\n writer.uint32(8).uint64(message.sequence);\n }\n if (message.sourcePort !== \"\") {\n writer.uint32(18).string(message.sourcePort);\n }\n if (message.sourceChannel !== \"\") {\n writer.uint32(26).string(message.sourceChannel);\n }\n if (message.destinationPort !== \"\") {\n writer.uint32(34).string(message.destinationPort);\n }\n if (message.destinationChannel !== \"\") {\n writer.uint32(42).string(message.destinationChannel);\n }\n if (message.data.length !== 0) {\n writer.uint32(50).bytes(message.data);\n }\n if (message.timeoutHeight !== undefined) {\n client_1.Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim();\n }\n if (!message.timeoutTimestamp.isZero()) {\n writer.uint32(64).uint64(message.timeoutTimestamp);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePacket);\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.sequence = reader.uint64();\n break;\n case 2:\n message.sourcePort = reader.string();\n break;\n case 3:\n message.sourceChannel = reader.string();\n break;\n case 4:\n message.destinationPort = reader.string();\n break;\n case 5:\n message.destinationChannel = reader.string();\n break;\n case 6:\n message.data = reader.bytes();\n break;\n case 7:\n message.timeoutHeight = client_1.Height.decode(reader, reader.uint32());\n break;\n case 8:\n message.timeoutTimestamp = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePacket);\n message.data = new Uint8Array();\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = long_1.default.fromString(object.sequence);\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n if (object.sourcePort !== undefined && object.sourcePort !== null) {\n message.sourcePort = String(object.sourcePort);\n }\n else {\n message.sourcePort = \"\";\n }\n if (object.sourceChannel !== undefined && object.sourceChannel !== null) {\n message.sourceChannel = String(object.sourceChannel);\n }\n else {\n message.sourceChannel = \"\";\n }\n if (object.destinationPort !== undefined && object.destinationPort !== null) {\n message.destinationPort = String(object.destinationPort);\n }\n else {\n message.destinationPort = \"\";\n }\n if (object.destinationChannel !== undefined && object.destinationChannel !== null) {\n message.destinationChannel = String(object.destinationChannel);\n }\n else {\n message.destinationChannel = \"\";\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) {\n message.timeoutHeight = client_1.Height.fromJSON(object.timeoutHeight);\n }\n else {\n message.timeoutHeight = undefined;\n }\n if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) {\n message.timeoutTimestamp = long_1.default.fromString(object.timeoutTimestamp);\n }\n else {\n message.timeoutTimestamp = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.sequence !== undefined && (obj.sequence = (message.sequence || long_1.default.UZERO).toString());\n message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort);\n message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel);\n message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort);\n message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel);\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n message.timeoutHeight !== undefined &&\n (obj.timeoutHeight = message.timeoutHeight ? client_1.Height.toJSON(message.timeoutHeight) : undefined);\n message.timeoutTimestamp !== undefined &&\n (obj.timeoutTimestamp = (message.timeoutTimestamp || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePacket);\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = object.sequence;\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n if (object.sourcePort !== undefined && object.sourcePort !== null) {\n message.sourcePort = object.sourcePort;\n }\n else {\n message.sourcePort = \"\";\n }\n if (object.sourceChannel !== undefined && object.sourceChannel !== null) {\n message.sourceChannel = object.sourceChannel;\n }\n else {\n message.sourceChannel = \"\";\n }\n if (object.destinationPort !== undefined && object.destinationPort !== null) {\n message.destinationPort = object.destinationPort;\n }\n else {\n message.destinationPort = \"\";\n }\n if (object.destinationChannel !== undefined && object.destinationChannel !== null) {\n message.destinationChannel = object.destinationChannel;\n }\n else {\n message.destinationChannel = \"\";\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) {\n message.timeoutHeight = client_1.Height.fromPartial(object.timeoutHeight);\n }\n else {\n message.timeoutHeight = undefined;\n }\n if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) {\n message.timeoutTimestamp = object.timeoutTimestamp;\n }\n else {\n message.timeoutTimestamp = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst basePacketState = { portId: \"\", channelId: \"\", sequence: long_1.default.UZERO };\nexports.PacketState = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.portId !== \"\") {\n writer.uint32(10).string(message.portId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(18).string(message.channelId);\n }\n if (!message.sequence.isZero()) {\n writer.uint32(24).uint64(message.sequence);\n }\n if (message.data.length !== 0) {\n writer.uint32(34).bytes(message.data);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePacketState);\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.portId = reader.string();\n break;\n case 2:\n message.channelId = reader.string();\n break;\n case 3:\n message.sequence = reader.uint64();\n break;\n case 4:\n message.data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePacketState);\n message.data = new Uint8Array();\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = String(object.portId);\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = String(object.channelId);\n }\n else {\n message.channelId = \"\";\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = long_1.default.fromString(object.sequence);\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.portId !== undefined && (obj.portId = message.portId);\n message.channelId !== undefined && (obj.channelId = message.channelId);\n message.sequence !== undefined && (obj.sequence = (message.sequence || long_1.default.UZERO).toString());\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePacketState);\n if (object.portId !== undefined && object.portId !== null) {\n message.portId = object.portId;\n }\n else {\n message.portId = \"\";\n }\n if (object.channelId !== undefined && object.channelId !== null) {\n message.channelId = object.channelId;\n }\n else {\n message.channelId = \"\";\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = object.sequence;\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n return message;\n },\n};\nconst baseAcknowledgement = {};\nexports.Acknowledgement = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.result !== undefined) {\n writer.uint32(170).bytes(message.result);\n }\n if (message.error !== undefined) {\n writer.uint32(178).string(message.error);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseAcknowledgement);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 21:\n message.result = reader.bytes();\n break;\n case 22:\n message.error = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseAcknowledgement);\n if (object.result !== undefined && object.result !== null) {\n message.result = bytesFromBase64(object.result);\n }\n if (object.error !== undefined && object.error !== null) {\n message.error = String(object.error);\n }\n else {\n message.error = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.result !== undefined &&\n (obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined);\n message.error !== undefined && (obj.error = message.error);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseAcknowledgement);\n if (object.result !== undefined && object.result !== null) {\n message.result = object.result;\n }\n else {\n message.result = undefined;\n }\n if (object.error !== undefined && object.error !== null) {\n message.error = object.error;\n }\n else {\n message.error = undefined;\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=channel.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Packet = void 0;\nvar channel_1 = require(\"@terra-money/terra.proto/ibc/core/channel/v1/channel\");\nvar long_1 = __importDefault(require(\"long\"));\nvar json_1 = require(\"../../../../util/json\");\nvar Height_1 = require(\"../client/Height\");\n/** Packet defines a type that carries data across different chains through IBC */\nvar Packet = /** @class */ (function (_super) {\n __extends(Packet, _super);\n /**\n * @param port_id port on the counterparty chain which owns the other end of the channel.\n * @param channel_id channel end on the counterparty chain\n */\n function Packet(sequence, source_port, source_channel, destination_port, destination_channel, data, timeout_height, timeout_timestamp) {\n var _this = _super.call(this) || this;\n _this.sequence = sequence;\n _this.source_port = source_port;\n _this.source_channel = source_channel;\n _this.destination_port = destination_port;\n _this.destination_channel = destination_channel;\n _this.data = data;\n _this.timeout_height = timeout_height;\n _this.timeout_timestamp = timeout_timestamp;\n return _this;\n }\n Packet.fromAmino = function (_data) {\n var sequence = _data.sequence, source_port = _data.source_port, source_channel = _data.source_channel, destination_port = _data.destination_port, destination_channel = _data.destination_channel, data = _data.data, timeout_height = _data.timeout_height, timeout_timestamp = _data.timeout_timestamp;\n return new Packet(sequence, source_port, source_channel, destination_port, destination_channel, data, timeout_height ? Height_1.Height.fromAmino(timeout_height) : undefined, timeout_timestamp);\n };\n Packet.prototype.toAmino = function () {\n var _a = this, sequence = _a.sequence, source_port = _a.source_port, source_channel = _a.source_channel, destination_port = _a.destination_port, destination_channel = _a.destination_channel, data = _a.data, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp;\n var res = {\n sequence: sequence,\n source_port: source_port,\n source_channel: source_channel,\n destination_port: destination_port,\n destination_channel: destination_channel,\n data: data,\n timeout_height: timeout_height ? timeout_height.toAmino() : undefined,\n timeout_timestamp: timeout_timestamp,\n };\n return res;\n };\n Packet.fromData = function (_data) {\n var sequence = _data.sequence, source_port = _data.source_port, source_channel = _data.source_channel, destination_port = _data.destination_port, destination_channel = _data.destination_channel, data = _data.data, timeout_height = _data.timeout_height, timeout_timestamp = _data.timeout_timestamp;\n return new Packet(sequence, source_port, source_channel, destination_port, destination_channel, data, timeout_height ? Height_1.Height.fromData(timeout_height) : undefined, Number.parseInt(timeout_timestamp));\n };\n Packet.prototype.toData = function () {\n var _a = this, sequence = _a.sequence, source_port = _a.source_port, source_channel = _a.source_channel, destination_port = _a.destination_port, destination_channel = _a.destination_channel, data = _a.data, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp;\n var res = {\n sequence: sequence,\n source_port: source_port,\n source_channel: source_channel,\n destination_port: destination_port,\n destination_channel: destination_channel,\n data: data,\n timeout_height: timeout_height ? timeout_height.toData() : undefined,\n timeout_timestamp: timeout_timestamp.toFixed(),\n };\n return res;\n };\n Packet.fromProto = function (proto) {\n return new Packet(proto.sequence.toNumber(), proto.sourcePort, proto.sourceChannel, proto.destinationPort, proto.destinationChannel, Buffer.from(proto.data).toString('base64'), proto.timeoutHeight ? Height_1.Height.fromProto(proto.timeoutHeight) : undefined, proto.timeoutTimestamp.toNumber());\n };\n Packet.prototype.toProto = function () {\n var _a = this, sequence = _a.sequence, source_port = _a.source_port, source_channel = _a.source_channel, destination_port = _a.destination_port, destination_channel = _a.destination_channel, data = _a.data, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp;\n return channel_1.Packet.fromPartial({\n sequence: long_1.default.fromNumber(sequence),\n sourcePort: source_port,\n sourceChannel: source_channel,\n destinationPort: destination_port,\n destinationChannel: destination_channel,\n data: Buffer.from(data, 'base64'),\n timeoutHeight: timeout_height ? timeout_height.toProto() : undefined,\n timeoutTimestamp: long_1.default.fromNumber(timeout_timestamp),\n });\n };\n return Packet;\n}(json_1.JSONSerializable));\nexports.Packet = Packet;\n//# sourceMappingURL=Packet.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Fee = exports.ModeInfo_Multi = exports.ModeInfo_Single = exports.ModeInfo = exports.SignerInfo = exports.AuthInfo = exports.TxBody = exports.SignDoc = exports.TxRaw = exports.Tx = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst signing_1 = require(\"../../../cosmos/tx/signing/v1beta1/signing\");\nconst multisig_1 = require(\"../../../cosmos/crypto/multisig/v1beta1/multisig\");\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"cosmos.tx.v1beta1\";\nconst baseTx = {};\nexports.Tx = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.body !== undefined) {\n exports.TxBody.encode(message.body, writer.uint32(10).fork()).ldelim();\n }\n if (message.authInfo !== undefined) {\n exports.AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim();\n }\n for (const v of message.signatures) {\n writer.uint32(26).bytes(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTx);\n message.signatures = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.body = exports.TxBody.decode(reader, reader.uint32());\n break;\n case 2:\n message.authInfo = exports.AuthInfo.decode(reader, reader.uint32());\n break;\n case 3:\n message.signatures.push(reader.bytes());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTx);\n message.signatures = [];\n if (object.body !== undefined && object.body !== null) {\n message.body = exports.TxBody.fromJSON(object.body);\n }\n else {\n message.body = undefined;\n }\n if (object.authInfo !== undefined && object.authInfo !== null) {\n message.authInfo = exports.AuthInfo.fromJSON(object.authInfo);\n }\n else {\n message.authInfo = undefined;\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(bytesFromBase64(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.body !== undefined && (obj.body = message.body ? exports.TxBody.toJSON(message.body) : undefined);\n message.authInfo !== undefined &&\n (obj.authInfo = message.authInfo ? exports.AuthInfo.toJSON(message.authInfo) : undefined);\n if (message.signatures) {\n obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));\n }\n else {\n obj.signatures = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTx);\n message.signatures = [];\n if (object.body !== undefined && object.body !== null) {\n message.body = exports.TxBody.fromPartial(object.body);\n }\n else {\n message.body = undefined;\n }\n if (object.authInfo !== undefined && object.authInfo !== null) {\n message.authInfo = exports.AuthInfo.fromPartial(object.authInfo);\n }\n else {\n message.authInfo = undefined;\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(e);\n }\n }\n return message;\n },\n};\nconst baseTxRaw = {};\nexports.TxRaw = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.bodyBytes.length !== 0) {\n writer.uint32(10).bytes(message.bodyBytes);\n }\n if (message.authInfoBytes.length !== 0) {\n writer.uint32(18).bytes(message.authInfoBytes);\n }\n for (const v of message.signatures) {\n writer.uint32(26).bytes(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTxRaw);\n message.signatures = [];\n message.bodyBytes = new Uint8Array();\n message.authInfoBytes = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.bodyBytes = reader.bytes();\n break;\n case 2:\n message.authInfoBytes = reader.bytes();\n break;\n case 3:\n message.signatures.push(reader.bytes());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTxRaw);\n message.signatures = [];\n message.bodyBytes = new Uint8Array();\n message.authInfoBytes = new Uint8Array();\n if (object.bodyBytes !== undefined && object.bodyBytes !== null) {\n message.bodyBytes = bytesFromBase64(object.bodyBytes);\n }\n if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {\n message.authInfoBytes = bytesFromBase64(object.authInfoBytes);\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(bytesFromBase64(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.bodyBytes !== undefined &&\n (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array()));\n message.authInfoBytes !== undefined &&\n (obj.authInfoBytes = base64FromBytes(message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array()));\n if (message.signatures) {\n obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));\n }\n else {\n obj.signatures = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTxRaw);\n message.signatures = [];\n if (object.bodyBytes !== undefined && object.bodyBytes !== null) {\n message.bodyBytes = object.bodyBytes;\n }\n else {\n message.bodyBytes = new Uint8Array();\n }\n if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {\n message.authInfoBytes = object.authInfoBytes;\n }\n else {\n message.authInfoBytes = new Uint8Array();\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(e);\n }\n }\n return message;\n },\n};\nconst baseSignDoc = { chainId: \"\", accountNumber: long_1.default.UZERO };\nexports.SignDoc = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.bodyBytes.length !== 0) {\n writer.uint32(10).bytes(message.bodyBytes);\n }\n if (message.authInfoBytes.length !== 0) {\n writer.uint32(18).bytes(message.authInfoBytes);\n }\n if (message.chainId !== \"\") {\n writer.uint32(26).string(message.chainId);\n }\n if (!message.accountNumber.isZero()) {\n writer.uint32(32).uint64(message.accountNumber);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignDoc);\n message.bodyBytes = new Uint8Array();\n message.authInfoBytes = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.bodyBytes = reader.bytes();\n break;\n case 2:\n message.authInfoBytes = reader.bytes();\n break;\n case 3:\n message.chainId = reader.string();\n break;\n case 4:\n message.accountNumber = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignDoc);\n message.bodyBytes = new Uint8Array();\n message.authInfoBytes = new Uint8Array();\n if (object.bodyBytes !== undefined && object.bodyBytes !== null) {\n message.bodyBytes = bytesFromBase64(object.bodyBytes);\n }\n if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {\n message.authInfoBytes = bytesFromBase64(object.authInfoBytes);\n }\n if (object.chainId !== undefined && object.chainId !== null) {\n message.chainId = String(object.chainId);\n }\n else {\n message.chainId = \"\";\n }\n if (object.accountNumber !== undefined && object.accountNumber !== null) {\n message.accountNumber = long_1.default.fromString(object.accountNumber);\n }\n else {\n message.accountNumber = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.bodyBytes !== undefined &&\n (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array()));\n message.authInfoBytes !== undefined &&\n (obj.authInfoBytes = base64FromBytes(message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array()));\n message.chainId !== undefined && (obj.chainId = message.chainId);\n message.accountNumber !== undefined &&\n (obj.accountNumber = (message.accountNumber || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignDoc);\n if (object.bodyBytes !== undefined && object.bodyBytes !== null) {\n message.bodyBytes = object.bodyBytes;\n }\n else {\n message.bodyBytes = new Uint8Array();\n }\n if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {\n message.authInfoBytes = object.authInfoBytes;\n }\n else {\n message.authInfoBytes = new Uint8Array();\n }\n if (object.chainId !== undefined && object.chainId !== null) {\n message.chainId = object.chainId;\n }\n else {\n message.chainId = \"\";\n }\n if (object.accountNumber !== undefined && object.accountNumber !== null) {\n message.accountNumber = object.accountNumber;\n }\n else {\n message.accountNumber = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseTxBody = { memo: \"\", timeoutHeight: long_1.default.UZERO };\nexports.TxBody = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.messages) {\n any_1.Any.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (message.memo !== \"\") {\n writer.uint32(18).string(message.memo);\n }\n if (!message.timeoutHeight.isZero()) {\n writer.uint32(24).uint64(message.timeoutHeight);\n }\n for (const v of message.extensionOptions) {\n any_1.Any.encode(v, writer.uint32(8186).fork()).ldelim();\n }\n for (const v of message.nonCriticalExtensionOptions) {\n any_1.Any.encode(v, writer.uint32(16378).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTxBody);\n message.messages = [];\n message.extensionOptions = [];\n message.nonCriticalExtensionOptions = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.messages.push(any_1.Any.decode(reader, reader.uint32()));\n break;\n case 2:\n message.memo = reader.string();\n break;\n case 3:\n message.timeoutHeight = reader.uint64();\n break;\n case 1023:\n message.extensionOptions.push(any_1.Any.decode(reader, reader.uint32()));\n break;\n case 2047:\n message.nonCriticalExtensionOptions.push(any_1.Any.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTxBody);\n message.messages = [];\n message.extensionOptions = [];\n message.nonCriticalExtensionOptions = [];\n if (object.messages !== undefined && object.messages !== null) {\n for (const e of object.messages) {\n message.messages.push(any_1.Any.fromJSON(e));\n }\n }\n if (object.memo !== undefined && object.memo !== null) {\n message.memo = String(object.memo);\n }\n else {\n message.memo = \"\";\n }\n if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) {\n message.timeoutHeight = long_1.default.fromString(object.timeoutHeight);\n }\n else {\n message.timeoutHeight = long_1.default.UZERO;\n }\n if (object.extensionOptions !== undefined && object.extensionOptions !== null) {\n for (const e of object.extensionOptions) {\n message.extensionOptions.push(any_1.Any.fromJSON(e));\n }\n }\n if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) {\n for (const e of object.nonCriticalExtensionOptions) {\n message.nonCriticalExtensionOptions.push(any_1.Any.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.messages) {\n obj.messages = message.messages.map((e) => (e ? any_1.Any.toJSON(e) : undefined));\n }\n else {\n obj.messages = [];\n }\n message.memo !== undefined && (obj.memo = message.memo);\n message.timeoutHeight !== undefined &&\n (obj.timeoutHeight = (message.timeoutHeight || long_1.default.UZERO).toString());\n if (message.extensionOptions) {\n obj.extensionOptions = message.extensionOptions.map((e) => (e ? any_1.Any.toJSON(e) : undefined));\n }\n else {\n obj.extensionOptions = [];\n }\n if (message.nonCriticalExtensionOptions) {\n obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => e ? any_1.Any.toJSON(e) : undefined);\n }\n else {\n obj.nonCriticalExtensionOptions = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTxBody);\n message.messages = [];\n message.extensionOptions = [];\n message.nonCriticalExtensionOptions = [];\n if (object.messages !== undefined && object.messages !== null) {\n for (const e of object.messages) {\n message.messages.push(any_1.Any.fromPartial(e));\n }\n }\n if (object.memo !== undefined && object.memo !== null) {\n message.memo = object.memo;\n }\n else {\n message.memo = \"\";\n }\n if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) {\n message.timeoutHeight = object.timeoutHeight;\n }\n else {\n message.timeoutHeight = long_1.default.UZERO;\n }\n if (object.extensionOptions !== undefined && object.extensionOptions !== null) {\n for (const e of object.extensionOptions) {\n message.extensionOptions.push(any_1.Any.fromPartial(e));\n }\n }\n if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) {\n for (const e of object.nonCriticalExtensionOptions) {\n message.nonCriticalExtensionOptions.push(any_1.Any.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseAuthInfo = {};\nexports.AuthInfo = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.signerInfos) {\n exports.SignerInfo.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (message.fee !== undefined) {\n exports.Fee.encode(message.fee, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseAuthInfo);\n message.signerInfos = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.signerInfos.push(exports.SignerInfo.decode(reader, reader.uint32()));\n break;\n case 2:\n message.fee = exports.Fee.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseAuthInfo);\n message.signerInfos = [];\n if (object.signerInfos !== undefined && object.signerInfos !== null) {\n for (const e of object.signerInfos) {\n message.signerInfos.push(exports.SignerInfo.fromJSON(e));\n }\n }\n if (object.fee !== undefined && object.fee !== null) {\n message.fee = exports.Fee.fromJSON(object.fee);\n }\n else {\n message.fee = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.signerInfos) {\n obj.signerInfos = message.signerInfos.map((e) => (e ? exports.SignerInfo.toJSON(e) : undefined));\n }\n else {\n obj.signerInfos = [];\n }\n message.fee !== undefined && (obj.fee = message.fee ? exports.Fee.toJSON(message.fee) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseAuthInfo);\n message.signerInfos = [];\n if (object.signerInfos !== undefined && object.signerInfos !== null) {\n for (const e of object.signerInfos) {\n message.signerInfos.push(exports.SignerInfo.fromPartial(e));\n }\n }\n if (object.fee !== undefined && object.fee !== null) {\n message.fee = exports.Fee.fromPartial(object.fee);\n }\n else {\n message.fee = undefined;\n }\n return message;\n },\n};\nconst baseSignerInfo = { sequence: long_1.default.UZERO };\nexports.SignerInfo = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.publicKey !== undefined) {\n any_1.Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim();\n }\n if (message.modeInfo !== undefined) {\n exports.ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim();\n }\n if (!message.sequence.isZero()) {\n writer.uint32(24).uint64(message.sequence);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignerInfo);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.publicKey = any_1.Any.decode(reader, reader.uint32());\n break;\n case 2:\n message.modeInfo = exports.ModeInfo.decode(reader, reader.uint32());\n break;\n case 3:\n message.sequence = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignerInfo);\n if (object.publicKey !== undefined && object.publicKey !== null) {\n message.publicKey = any_1.Any.fromJSON(object.publicKey);\n }\n else {\n message.publicKey = undefined;\n }\n if (object.modeInfo !== undefined && object.modeInfo !== null) {\n message.modeInfo = exports.ModeInfo.fromJSON(object.modeInfo);\n }\n else {\n message.modeInfo = undefined;\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = long_1.default.fromString(object.sequence);\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.publicKey !== undefined &&\n (obj.publicKey = message.publicKey ? any_1.Any.toJSON(message.publicKey) : undefined);\n message.modeInfo !== undefined &&\n (obj.modeInfo = message.modeInfo ? exports.ModeInfo.toJSON(message.modeInfo) : undefined);\n message.sequence !== undefined && (obj.sequence = (message.sequence || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignerInfo);\n if (object.publicKey !== undefined && object.publicKey !== null) {\n message.publicKey = any_1.Any.fromPartial(object.publicKey);\n }\n else {\n message.publicKey = undefined;\n }\n if (object.modeInfo !== undefined && object.modeInfo !== null) {\n message.modeInfo = exports.ModeInfo.fromPartial(object.modeInfo);\n }\n else {\n message.modeInfo = undefined;\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = object.sequence;\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseModeInfo = {};\nexports.ModeInfo = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.single !== undefined) {\n exports.ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim();\n }\n if (message.multi !== undefined) {\n exports.ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseModeInfo);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.single = exports.ModeInfo_Single.decode(reader, reader.uint32());\n break;\n case 2:\n message.multi = exports.ModeInfo_Multi.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseModeInfo);\n if (object.single !== undefined && object.single !== null) {\n message.single = exports.ModeInfo_Single.fromJSON(object.single);\n }\n else {\n message.single = undefined;\n }\n if (object.multi !== undefined && object.multi !== null) {\n message.multi = exports.ModeInfo_Multi.fromJSON(object.multi);\n }\n else {\n message.multi = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.single !== undefined &&\n (obj.single = message.single ? exports.ModeInfo_Single.toJSON(message.single) : undefined);\n message.multi !== undefined &&\n (obj.multi = message.multi ? exports.ModeInfo_Multi.toJSON(message.multi) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseModeInfo);\n if (object.single !== undefined && object.single !== null) {\n message.single = exports.ModeInfo_Single.fromPartial(object.single);\n }\n else {\n message.single = undefined;\n }\n if (object.multi !== undefined && object.multi !== null) {\n message.multi = exports.ModeInfo_Multi.fromPartial(object.multi);\n }\n else {\n message.multi = undefined;\n }\n return message;\n },\n};\nconst baseModeInfo_Single = { mode: 0 };\nexports.ModeInfo_Single = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.mode !== 0) {\n writer.uint32(8).int32(message.mode);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseModeInfo_Single);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.mode = reader.int32();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseModeInfo_Single);\n if (object.mode !== undefined && object.mode !== null) {\n message.mode = signing_1.signModeFromJSON(object.mode);\n }\n else {\n message.mode = 0;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.mode !== undefined && (obj.mode = signing_1.signModeToJSON(message.mode));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseModeInfo_Single);\n if (object.mode !== undefined && object.mode !== null) {\n message.mode = object.mode;\n }\n else {\n message.mode = 0;\n }\n return message;\n },\n};\nconst baseModeInfo_Multi = {};\nexports.ModeInfo_Multi = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.bitarray !== undefined) {\n multisig_1.CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.modeInfos) {\n exports.ModeInfo.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseModeInfo_Multi);\n message.modeInfos = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.bitarray = multisig_1.CompactBitArray.decode(reader, reader.uint32());\n break;\n case 2:\n message.modeInfos.push(exports.ModeInfo.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseModeInfo_Multi);\n message.modeInfos = [];\n if (object.bitarray !== undefined && object.bitarray !== null) {\n message.bitarray = multisig_1.CompactBitArray.fromJSON(object.bitarray);\n }\n else {\n message.bitarray = undefined;\n }\n if (object.modeInfos !== undefined && object.modeInfos !== null) {\n for (const e of object.modeInfos) {\n message.modeInfos.push(exports.ModeInfo.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.bitarray !== undefined &&\n (obj.bitarray = message.bitarray ? multisig_1.CompactBitArray.toJSON(message.bitarray) : undefined);\n if (message.modeInfos) {\n obj.modeInfos = message.modeInfos.map((e) => (e ? exports.ModeInfo.toJSON(e) : undefined));\n }\n else {\n obj.modeInfos = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseModeInfo_Multi);\n message.modeInfos = [];\n if (object.bitarray !== undefined && object.bitarray !== null) {\n message.bitarray = multisig_1.CompactBitArray.fromPartial(object.bitarray);\n }\n else {\n message.bitarray = undefined;\n }\n if (object.modeInfos !== undefined && object.modeInfos !== null) {\n for (const e of object.modeInfos) {\n message.modeInfos.push(exports.ModeInfo.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseFee = { gasLimit: long_1.default.UZERO, payer: \"\", granter: \"\" };\nexports.Fee = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.amount) {\n coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (!message.gasLimit.isZero()) {\n writer.uint32(16).uint64(message.gasLimit);\n }\n if (message.payer !== \"\") {\n writer.uint32(26).string(message.payer);\n }\n if (message.granter !== \"\") {\n writer.uint32(34).string(message.granter);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseFee);\n message.amount = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 2:\n message.gasLimit = reader.uint64();\n break;\n case 3:\n message.payer = reader.string();\n break;\n case 4:\n message.granter = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseFee);\n message.amount = [];\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.gasLimit !== undefined && object.gasLimit !== null) {\n message.gasLimit = long_1.default.fromString(object.gasLimit);\n }\n else {\n message.gasLimit = long_1.default.UZERO;\n }\n if (object.payer !== undefined && object.payer !== null) {\n message.payer = String(object.payer);\n }\n else {\n message.payer = \"\";\n }\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = String(object.granter);\n }\n else {\n message.granter = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.amount) {\n obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.amount = [];\n }\n message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || long_1.default.UZERO).toString());\n message.payer !== undefined && (obj.payer = message.payer);\n message.granter !== undefined && (obj.granter = message.granter);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseFee);\n message.amount = [];\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.gasLimit !== undefined && object.gasLimit !== null) {\n message.gasLimit = object.gasLimit;\n }\n else {\n message.gasLimit = long_1.default.UZERO;\n }\n if (object.payer !== undefined && object.payer !== null) {\n message.payer = object.payer;\n }\n else {\n message.payer = \"\";\n }\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = object.granter;\n }\n else {\n message.granter = \"\";\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompactBitArray = exports.MultiSignature = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"cosmos.crypto.multisig.v1beta1\";\nconst baseMultiSignature = {};\nexports.MultiSignature = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.signatures) {\n writer.uint32(10).bytes(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMultiSignature);\n message.signatures = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.signatures.push(reader.bytes());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMultiSignature);\n message.signatures = [];\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(bytesFromBase64(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.signatures) {\n obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));\n }\n else {\n obj.signatures = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMultiSignature);\n message.signatures = [];\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(e);\n }\n }\n return message;\n },\n};\nconst baseCompactBitArray = { extraBitsStored: 0 };\nexports.CompactBitArray = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.extraBitsStored !== 0) {\n writer.uint32(8).uint32(message.extraBitsStored);\n }\n if (message.elems.length !== 0) {\n writer.uint32(18).bytes(message.elems);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCompactBitArray);\n message.elems = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.extraBitsStored = reader.uint32();\n break;\n case 2:\n message.elems = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCompactBitArray);\n message.elems = new Uint8Array();\n if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {\n message.extraBitsStored = Number(object.extraBitsStored);\n }\n else {\n message.extraBitsStored = 0;\n }\n if (object.elems !== undefined && object.elems !== null) {\n message.elems = bytesFromBase64(object.elems);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored);\n message.elems !== undefined &&\n (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCompactBitArray);\n if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {\n message.extraBitsStored = object.extraBitsStored;\n }\n else {\n message.extraBitsStored = 0;\n }\n if (object.elems !== undefined && object.elems !== null) {\n message.elems = object.elems;\n }\n else {\n message.elems = new Uint8Array();\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=multisig.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ModeInfo = exports.SignerInfo = exports.AuthInfo = exports.TxBody = exports.Tx = void 0;\nvar PublicKey_1 = require(\"./PublicKey\");\nvar signing_1 = require(\"@terra-money/terra.proto/cosmos/tx/signing/v1beta1/signing\");\nvar tx_1 = require(\"@terra-money/terra.proto/cosmos/tx/v1beta1/tx\");\nvar CompactBitArray_1 = require(\"./CompactBitArray\");\nvar Msg_1 = require(\"./Msg\");\nvar Fee_1 = require(\"./Fee\");\nvar Long = __importStar(require(\"long\"));\nvar SignatureV2_1 = require(\"./SignatureV2\");\nvar Tx = /** @class */ (function () {\n function Tx(body, auth_info, signatures) {\n this.body = body;\n this.auth_info = auth_info;\n this.signatures = signatures;\n }\n Tx.fromAmino = function (data) {\n var signatures = data.value.signatures.map(function (s) { return SignatureV2_1.SignatureV2.fromAmino(s); });\n return new Tx(new TxBody(data.value.msg.map(function (m) { return Msg_1.Msg.fromAmino(m); }), data.value.memo, Number.parseInt(data.value.timeout_height)), new AuthInfo([], Fee_1.Fee.fromAmino(data.value.fee)), signatures.map(function (s) { var _a; return ((_a = s.data.single) === null || _a === void 0 ? void 0 : _a.signature) || ''; }));\n };\n Tx.fromData = function (data) {\n return new Tx(TxBody.fromData(data.body), AuthInfo.fromData(data.auth_info), data.signatures);\n };\n Tx.prototype.toData = function () {\n return {\n body: this.body.toData(),\n auth_info: this.auth_info.toData(),\n signatures: this.signatures,\n };\n };\n Tx.unpackAny = function (anyProto) {\n return this.fromProto(tx_1.Tx.decode(anyProto.value));\n };\n Tx.fromProto = function (proto) {\n return new Tx(TxBody.fromProto(proto.body), AuthInfo.fromProto(proto.authInfo), proto.signatures.map(function (sig) { return Buffer.from(sig).toString('base64'); }));\n };\n Tx.prototype.toProto = function () {\n return tx_1.Tx.fromPartial({\n body: this.body.toProto(),\n authInfo: this.auth_info.toProto(),\n signatures: this.signatures.map(function (s) { return Buffer.from(s, 'base64'); }),\n });\n };\n Tx.prototype.toBytes = function () {\n return tx_1.Tx.encode(this.toProto()).finish();\n };\n Tx.prototype.appendEmptySignatures = function (signers) {\n var _this = this;\n signers.forEach(function (signer) {\n var signerInfo;\n if (signer.publicKey) {\n if (signer.publicKey instanceof PublicKey_1.LegacyAminoMultisigPublicKey) {\n signerInfo = new SignerInfo(signer.publicKey, signer.sequenceNumber, new ModeInfo(new ModeInfo.Multi(CompactBitArray_1.CompactBitArray.fromBits(signer.publicKey.pubkeys.length), [])));\n }\n else {\n signerInfo = new SignerInfo(signer.publicKey, signer.sequenceNumber, new ModeInfo(new ModeInfo.Single(ModeInfo.SignMode.SIGN_MODE_DIRECT)));\n }\n }\n else {\n signerInfo = new SignerInfo(new PublicKey_1.SimplePublicKey(''), signer.sequenceNumber, new ModeInfo(new ModeInfo.Single(ModeInfo.SignMode.SIGN_MODE_DIRECT)));\n }\n _this.auth_info.signer_infos.push(signerInfo);\n _this.signatures.push('');\n });\n };\n Tx.prototype.clearSignatures = function () {\n this.auth_info.signer_infos = [];\n this.signatures = [];\n };\n Tx.prototype.appendSignatures = function (signatures) {\n for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) {\n var signature = signatures_1[_i];\n var _a = signature.data.toModeInfoAndSignature(), modeInfo = _a[0], sigBytes = _a[1];\n this.signatures.push(Buffer.from(sigBytes).toString('base64'));\n this.auth_info.signer_infos.push(new SignerInfo(signature.public_key, signature.sequence, modeInfo));\n }\n };\n return Tx;\n}());\nexports.Tx = Tx;\nvar TxBody = /** @class */ (function () {\n function TxBody(messages, memo, timeout_height) {\n this.messages = messages;\n this.memo = memo;\n this.timeout_height = timeout_height;\n }\n TxBody.fromData = function (data) {\n return new TxBody(data.messages.map(function (m) { return Msg_1.Msg.fromData(m); }), data.memo, Number.parseInt(data.timeout_height));\n };\n TxBody.prototype.toData = function () {\n var _a, _b;\n return {\n memo: (_a = this.memo) !== null && _a !== void 0 ? _a : '',\n messages: this.messages.map(function (m) { return m.toData(); }),\n timeout_height: ((_b = this.timeout_height) !== null && _b !== void 0 ? _b : 0).toFixed(),\n };\n };\n TxBody.fromProto = function (proto) {\n return new TxBody(proto.messages.map(function (m) { return Msg_1.Msg.fromProto(m); }), proto.memo, proto.timeoutHeight.toNumber());\n };\n TxBody.prototype.toProto = function () {\n var _a;\n return tx_1.TxBody.fromPartial({\n memo: this.memo,\n messages: this.messages.map(function (m) { return m.packAny(); }),\n timeoutHeight: Long.fromNumber((_a = this.timeout_height) !== null && _a !== void 0 ? _a : 0),\n });\n };\n TxBody.prototype.toBytes = function () {\n return tx_1.TxBody.encode(this.toProto()).finish();\n };\n return TxBody;\n}());\nexports.TxBody = TxBody;\nvar AuthInfo = /** @class */ (function () {\n function AuthInfo(signer_infos, fee) {\n this.signer_infos = signer_infos;\n this.fee = fee;\n }\n AuthInfo.fromData = function (data) {\n return new AuthInfo(data.signer_infos.map(function (s) { return SignerInfo.fromData(s); }), Fee_1.Fee.fromData(data.fee));\n };\n AuthInfo.prototype.toData = function () {\n return {\n fee: this.fee.toData(),\n signer_infos: this.signer_infos.map(function (info) { return info.toData(); }),\n };\n };\n AuthInfo.fromProto = function (proto) {\n return new AuthInfo(proto.signerInfos.map(function (s) { return SignerInfo.fromProto(s); }), Fee_1.Fee.fromProto(proto.fee));\n };\n AuthInfo.prototype.toProto = function () {\n return tx_1.AuthInfo.fromPartial({\n fee: this.fee.toProto(),\n signerInfos: this.signer_infos.map(function (info) { return info.toProto(); }),\n });\n };\n AuthInfo.prototype.toBytes = function () {\n return tx_1.AuthInfo.encode(this.toProto()).finish();\n };\n return AuthInfo;\n}());\nexports.AuthInfo = AuthInfo;\nvar SignerInfo = /** @class */ (function () {\n function SignerInfo(public_key, sequence, mode_info) {\n this.public_key = public_key;\n this.sequence = sequence;\n this.mode_info = mode_info;\n }\n SignerInfo.fromData = function (data) {\n var _a;\n return new SignerInfo(PublicKey_1.PublicKey.fromData((_a = data.public_key) !== null && _a !== void 0 ? _a : new PublicKey_1.SimplePublicKey('').toData()), Number.parseInt(data.sequence), ModeInfo.fromData(data.mode_info));\n };\n SignerInfo.prototype.toData = function () {\n var _a = this, public_key = _a.public_key, sequence = _a.sequence, mode_info = _a.mode_info;\n return {\n mode_info: mode_info.toData(),\n public_key: (public_key === null || public_key === void 0 ? void 0 : public_key.toData()) || null,\n sequence: sequence.toFixed(),\n };\n };\n SignerInfo.fromProto = function (proto) {\n var _a;\n return new SignerInfo(PublicKey_1.PublicKey.fromProto((_a = proto.publicKey) !== null && _a !== void 0 ? _a : new PublicKey_1.SimplePublicKey('').packAny()), proto.sequence.toNumber(), ModeInfo.fromProto(proto.modeInfo));\n };\n SignerInfo.prototype.toProto = function () {\n var _a = this, public_key = _a.public_key, sequence = _a.sequence, mode_info = _a.mode_info;\n return tx_1.SignerInfo.fromPartial({\n modeInfo: mode_info.toProto(),\n publicKey: public_key === null || public_key === void 0 ? void 0 : public_key.packAny(),\n sequence: Long.fromNumber(sequence),\n });\n };\n return SignerInfo;\n}());\nexports.SignerInfo = SignerInfo;\nvar ModeInfo = /** @class */ (function () {\n function ModeInfo(mode_info) {\n if (mode_info instanceof ModeInfo.Single) {\n this.single = mode_info;\n }\n else {\n this.multi = mode_info;\n }\n }\n ModeInfo.fromData = function (data) {\n if (data.single) {\n return new ModeInfo(ModeInfo.Single.fromData(data.single));\n }\n if (data.multi) {\n return new ModeInfo(ModeInfo.Multi.fromData(data.multi));\n }\n throw new Error('must be one of single or multi');\n };\n ModeInfo.prototype.toData = function () {\n var _a, _b;\n return {\n single: (_a = this.single) === null || _a === void 0 ? void 0 : _a.toData(),\n multi: (_b = this.multi) === null || _b === void 0 ? void 0 : _b.toData(),\n };\n };\n ModeInfo.fromProto = function (proto) {\n var singleMode = proto.single;\n var multiMode = proto.multi;\n return new ModeInfo(singleMode\n ? ModeInfo.Single.fromProto(singleMode)\n : ModeInfo.Multi.fromProto(multiMode));\n };\n ModeInfo.prototype.toProto = function () {\n var _a, _b;\n return tx_1.ModeInfo.fromPartial({\n multi: (_a = this.multi) === null || _a === void 0 ? void 0 : _a.toProto(),\n single: (_b = this.single) === null || _b === void 0 ? void 0 : _b.toProto(),\n });\n };\n return ModeInfo;\n}());\nexports.ModeInfo = ModeInfo;\n(function (ModeInfo) {\n ModeInfo.SignMode = signing_1.SignMode;\n var Single = /** @class */ (function () {\n function Single(mode) {\n this.mode = mode;\n }\n Single.fromData = function (data) {\n return new Single((0, signing_1.signModeFromJSON)(data.mode));\n };\n Single.prototype.toData = function () {\n return {\n mode: (0, signing_1.signModeToJSON)(this.mode),\n };\n };\n Single.fromProto = function (proto) {\n return new Single(proto.mode);\n };\n Single.prototype.toProto = function () {\n return tx_1.ModeInfo_Single.fromPartial({\n mode: this.mode,\n });\n };\n return Single;\n }());\n ModeInfo.Single = Single;\n var Multi = /** @class */ (function () {\n function Multi(bitarray, modeInfos) {\n this.bitarray = bitarray;\n this.modeInfos = modeInfos;\n }\n Multi.fromData = function (proto) {\n return new Multi(CompactBitArray_1.CompactBitArray.fromData(proto.bitarray), proto.mode_infos.map(function (m) { return ModeInfo.fromData(m); }));\n };\n Multi.prototype.toData = function () {\n return {\n bitarray: this.bitarray.toData(),\n mode_infos: this.modeInfos.map(function (m) { return m.toData(); }),\n };\n };\n Multi.fromProto = function (proto) {\n return new Multi(CompactBitArray_1.CompactBitArray.fromProto(proto.bitarray), proto.modeInfos.map(function (m) { return ModeInfo.fromProto(m); }));\n };\n Multi.prototype.toProto = function () {\n return tx_1.ModeInfo_Multi.fromPartial({\n bitarray: this.bitarray.toProto(),\n modeInfos: this.modeInfos.map(function (m) { return m.toProto(); }),\n });\n };\n return Multi;\n }());\n ModeInfo.Multi = Multi;\n})(ModeInfo = exports.ModeInfo || (exports.ModeInfo = {}));\nexports.ModeInfo = ModeInfo;\n//# sourceMappingURL=Tx.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SignatureV2 = void 0;\nvar PublicKey_1 = require(\"./PublicKey\");\nvar Tx_1 = require(\"./Tx\");\nvar CompactBitArray_1 = require(\"./CompactBitArray\");\nvar signing_1 = require(\"@terra-money/terra.proto/cosmos/tx/signing/v1beta1/signing\");\nvar multisig_1 = require(\"@terra-money/terra.proto/cosmos/crypto/multisig/v1beta1/multisig\");\nvar SignatureV2 = /** @class */ (function () {\n function SignatureV2(public_key, data, sequence) {\n this.public_key = public_key;\n this.data = data;\n this.sequence = sequence;\n }\n SignatureV2.fromData = function (data) {\n return new SignatureV2(PublicKey_1.PublicKey.fromData(data.public_key), SignatureV2.Descriptor.fromData(data.data), Number.parseInt(data.sequence));\n };\n SignatureV2.fromAmino = function (data) {\n return new SignatureV2(PublicKey_1.PublicKey.fromAmino(data.pub_key), new SignatureV2.Descriptor(new SignatureV2.Descriptor.Single(SignatureV2.SignMode.SIGN_MODE_LEGACY_AMINO_JSON, data.signature)), 0);\n };\n return SignatureV2;\n}());\nexports.SignatureV2 = SignatureV2;\n(function (SignatureV2) {\n SignatureV2.SignMode = signing_1.SignMode;\n var Descriptor = /** @class */ (function () {\n function Descriptor(data) {\n data instanceof Descriptor.Single\n ? (this.single = data)\n : (this.multi = data);\n }\n Descriptor.fromData = function (data) {\n if (data.single) {\n return new Descriptor(Descriptor.Single.fromData(data.single));\n }\n if (data.multi) {\n return new Descriptor(Descriptor.Multi.fromData(data.multi));\n }\n throw new Error('must be one of single or multi');\n };\n Descriptor.prototype.toModeInfoAndSignature = function () {\n if (this.single) {\n var sigData = this.single;\n return [\n new Tx_1.ModeInfo(new Tx_1.ModeInfo.Single(sigData.mode)),\n Buffer.from(sigData.signature, 'base64'),\n ];\n }\n if (this.multi) {\n var sigData = this.multi;\n var modeInfos = [];\n var signatures = [];\n for (var _i = 0, _a = sigData.signatures; _i < _a.length; _i++) {\n var signature = _a[_i];\n var _b = signature.toModeInfoAndSignature(), modeInfo = _b[0], sigBytes = _b[1];\n modeInfos.push(modeInfo);\n signatures.push(sigBytes);\n }\n var multisigBytes = multisig_1.MultiSignature.encode(multisig_1.MultiSignature.fromPartial({\n signatures: signatures,\n })).finish();\n return [\n new Tx_1.ModeInfo(new Tx_1.ModeInfo.Multi(sigData.bitarray, modeInfos)),\n multisigBytes,\n ];\n }\n throw new Error('invalid signature descriptor');\n };\n return Descriptor;\n }());\n SignatureV2.Descriptor = Descriptor;\n (function (Descriptor) {\n var Single = /** @class */ (function () {\n function Single(mode, signature) {\n this.mode = mode;\n this.signature = signature;\n }\n Single.fromData = function (data) {\n return new Single((0, signing_1.signModeFromJSON)(data.mode), data.signature);\n };\n return Single;\n }());\n Descriptor.Single = Single;\n var Multi = /** @class */ (function () {\n function Multi(bitarray, signatures) {\n this.bitarray = bitarray;\n this.signatures = signatures;\n }\n Multi.fromData = function (data) {\n return new Multi(CompactBitArray_1.CompactBitArray.fromData(data.bitarray), data.signatures.map(function (v) { return Descriptor.fromData(v); }));\n };\n return Multi;\n }());\n Descriptor.Multi = Multi;\n })(Descriptor = SignatureV2.Descriptor || (SignatureV2.Descriptor = {}));\n})(SignatureV2 = exports.SignatureV2 || (exports.SignatureV2 = {}));\nexports.SignatureV2 = SignatureV2;\n//# sourceMappingURL=SignatureV2.js.map","'use strict';\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","export var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\n;\n//# sourceMappingURL=types.js.map","import { BigNumber } from \"@ethersproject/bignumber\";\nexport var METADATA_REPLACE = new RegExp(\"\\u0000\", \"g\");\n// note: actual first byte is message type\n// 0 [u8; 32] token_address\n// 32 u16 token_chain\n// 34 [u8; 32] symbol\n// 66 [u8; 32] name\n// 98 u256 tokenId\n// 130 u8 uri_len\n// 131 [u8;len] uri\n// ? [u8; 32] recipient\n// ? u16 recipient_chain\nexport var parseNFTPayload = function (arr) {\n var originAddress = arr.slice(1, 1 + 32).toString(\"hex\");\n var originChain = arr.readUInt16BE(33);\n var symbol = Buffer.from(arr.slice(35, 35 + 32))\n .toString(\"utf8\")\n .replace(METADATA_REPLACE, \"\");\n var name = Buffer.from(arr.slice(67, 67 + 32))\n .toString(\"utf8\")\n .replace(METADATA_REPLACE, \"\");\n var tokenId = BigNumber.from(arr.slice(99, 99 + 32));\n var uri_len = arr.readUInt8(131);\n var uri = Buffer.from(arr.slice(132, 132 + uri_len))\n .toString(\"utf8\")\n .replace(METADATA_REPLACE, \"\");\n var target_offset = 132 + uri_len;\n var targetAddress = arr\n .slice(target_offset, target_offset + 32)\n .toString(\"hex\");\n var targetChain = arr.readUInt16BE(target_offset + 32);\n return {\n originAddress: originAddress,\n originChain: originChain,\n symbol: symbol,\n name: name,\n tokenId: tokenId,\n uri: uri,\n targetAddress: targetAddress,\n targetChain: targetChain,\n };\n};\n// 0 u256 amount\n// 32 [u8; 32] token_address\n// 64 u16 token_chain\n// 66 [u8; 32] recipient\n// 98 u16 recipient_chain\n// 100 u256 fee\nexport var parseTransferPayload = function (arr) { return ({\n amount: BigNumber.from(arr.slice(1, 1 + 32)).toBigInt(),\n originAddress: arr.slice(33, 33 + 32).toString(\"hex\"),\n originChain: arr.readUInt16BE(65),\n targetAddress: arr.slice(67, 67 + 32).toString(\"hex\"),\n targetChain: arr.readUInt16BE(99),\n}); };\n//This returns a corrected amount, which accounts for the difference between the VAA\n//decimals, and the decimals of the asset.\n// const normalizeVaaAmount = (\n// amount: bigint,\n// assetDecimals: number\n// ): bigint => {\n// const MAX_VAA_DECIMALS = 8;\n// if (assetDecimals <= MAX_VAA_DECIMALS) {\n// return amount;\n// }\n// const decimalStringVaa = formatUnits(amount, MAX_VAA_DECIMALS);\n// const normalizedAmount = parseUnits(decimalStringVaa, assetDecimals);\n// const normalizedBigInt = BigInt(truncate(normalizedAmount.toString(), 0));\n// return normalizedBigInt;\n// };\n// function truncate(str: string, maxDecimalDigits: number) {\n// if (str.includes(\".\")) {\n// const parts = str.split(\".\");\n// return parts[0] + \".\" + parts[1].slice(0, maxDecimalDigits);\n// }\n// return str;\n// }\n","import { CHAIN_ID_BSC, CHAIN_ID_ETH, CHAIN_ID_SOLANA, CHAIN_ID_TERRA, CHAIN_ID_POLYGON, CHAIN_ID_ETHEREUM_ROPSTEN, CHAIN_ID_AVAX, CHAIN_ID_OASIS, } from \"./consts\";\nimport { humanAddress, canonicalAddress, isNativeDenom } from \"../terra\";\nimport { PublicKey } from \"@solana/web3.js\";\nimport { hexValue, hexZeroPad, stripZeros } from \"ethers/lib/utils\";\nimport { arrayify, zeroPad } from \"@ethersproject/bytes\";\nexport var isEVMChain = function (chainId) {\n return (chainId === CHAIN_ID_ETH ||\n chainId === CHAIN_ID_BSC ||\n chainId === CHAIN_ID_ETHEREUM_ROPSTEN ||\n chainId === CHAIN_ID_AVAX ||\n chainId === CHAIN_ID_POLYGON ||\n chainId === CHAIN_ID_OASIS);\n};\nexport var isHexNativeTerra = function (h) { return h.startsWith(\"01\"); };\nexport var nativeTerraHexToDenom = function (h) {\n return Buffer.from(stripZeros(hexToUint8Array(h.substr(2)))).toString(\"ascii\");\n};\nexport var uint8ArrayToHex = function (a) {\n return Buffer.from(a).toString(\"hex\");\n};\nexport var hexToUint8Array = function (h) {\n return new Uint8Array(Buffer.from(h, \"hex\"));\n};\nexport var hexToNativeString = function (h, c) {\n try {\n return !h\n ? undefined\n : c === CHAIN_ID_SOLANA\n ? new PublicKey(hexToUint8Array(h)).toString()\n : isEVMChain(c)\n ? hexZeroPad(hexValue(hexToUint8Array(h)), 20)\n : c === CHAIN_ID_TERRA\n ? isHexNativeTerra(h)\n ? nativeTerraHexToDenom(h)\n : humanAddress(hexToUint8Array(h.substr(24))) // terra expects 20 bytes, not 32\n : h;\n }\n catch (e) { }\n return undefined;\n};\nexport var nativeToHexString = function (address, chain) {\n if (!address || !chain) {\n return null;\n }\n if (isEVMChain(chain)) {\n return uint8ArrayToHex(zeroPad(arrayify(address), 32));\n }\n else if (chain === CHAIN_ID_SOLANA) {\n return uint8ArrayToHex(zeroPad(new PublicKey(address).toBytes(), 32));\n }\n else if (chain === CHAIN_ID_TERRA) {\n if (isNativeDenom(address)) {\n return (\"01\" +\n uint8ArrayToHex(zeroPad(new Uint8Array(Buffer.from(address, \"ascii\")), 31)));\n }\n else {\n return uint8ArrayToHex(zeroPad(canonicalAddress(address), 32));\n }\n }\n else {\n return null;\n }\n};\nexport var uint8ArrayToNative = function (a, chainId) {\n return hexToNativeString(uint8ArrayToHex(a), chainId);\n};\nexport function chunks(array, size) {\n return Array.apply(0, new Array(Math.ceil(array.length / size))).map(function (_, index) { return array.slice(index * size, (index + 1) * size); });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { PublicKey } from \"@solana/web3.js\";\nimport { Bridge__factory } from \"../ethers-contracts\";\nimport { importTokenWasm } from \"../solana/wasm\";\n/**\n * Returns whether or not an asset address on Ethereum is a wormhole wrapped asset\n * @param tokenBridgeAddress\n * @param provider\n * @param assetAddress\n * @returns\n */\nexport function getIsWrappedAssetEth(tokenBridgeAddress, provider, assetAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenBridge;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!assetAddress)\n return [2 /*return*/, false];\n tokenBridge = Bridge__factory.connect(tokenBridgeAddress, provider);\n return [4 /*yield*/, tokenBridge.isWrappedAsset(assetAddress)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexport function getIsWrappedAssetTerra(tokenBridgeAddress, wallet, assetAddress) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, false];\n });\n });\n}\n/**\n * Returns whether or not an asset on Solana is a wormhole wrapped asset\n * @param connection\n * @param tokenBridgeAddress\n * @param mintAddress\n * @returns\n */\nexport function getIsWrappedAssetSol(connection, tokenBridgeAddress, mintAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var wrapped_meta_address, wrappedMetaAddress, wrappedMetaAddressPK, wrappedMetaAccountInfo;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!mintAddress)\n return [2 /*return*/, false];\n return [4 /*yield*/, importTokenWasm()];\n case 1:\n wrapped_meta_address = (_a.sent()).wrapped_meta_address;\n wrappedMetaAddress = wrapped_meta_address(tokenBridgeAddress, new PublicKey(mintAddress).toBytes());\n wrappedMetaAddressPK = new PublicKey(wrappedMetaAddress);\n return [4 /*yield*/, connection.getAccountInfo(wrappedMetaAddressPK)];\n case 2:\n wrappedMetaAccountInfo = _a.sent();\n return [2 /*return*/, !!wrappedMetaAccountInfo];\n }\n });\n });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { PublicKey } from \"@solana/web3.js\";\nimport { Bridge__factory } from \"../ethers-contracts\";\nimport { importNftWasm } from \"../solana/wasm\";\n/**\n * Returns whether or not an asset address on Ethereum is a wormhole wrapped asset\n * @param tokenBridgeAddress\n * @param provider\n * @param assetAddress\n * @returns\n */\nexport function getIsWrappedAssetEth(tokenBridgeAddress, provider, assetAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenBridge;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!assetAddress)\n return [2 /*return*/, false];\n tokenBridge = Bridge__factory.connect(tokenBridgeAddress, provider);\n return [4 /*yield*/, tokenBridge.isWrappedAsset(assetAddress)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\n/**\n * Returns whether or not an asset on Solana is a wormhole wrapped asset\n * @param connection\n * @param tokenBridgeAddress\n * @param mintAddress\n * @returns\n */\nexport function getIsWrappedAssetSol(connection, tokenBridgeAddress, mintAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var wrapped_meta_address, wrappedMetaAddress, wrappedMetaAddressPK, wrappedMetaAccountInfo;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!mintAddress)\n return [2 /*return*/, false];\n return [4 /*yield*/, importNftWasm()];\n case 1:\n wrapped_meta_address = (_a.sent()).wrapped_meta_address;\n wrappedMetaAddress = wrapped_meta_address(tokenBridgeAddress, new PublicKey(mintAddress).toBytes());\n wrappedMetaAddressPK = new PublicKey(wrappedMetaAddress);\n return [4 /*yield*/, connection.getAccountInfo(wrappedMetaAddressPK)];\n case 2:\n wrappedMetaAccountInfo = _a.sent();\n return [2 /*return*/, !!wrappedMetaAccountInfo];\n }\n });\n });\n}\n","import * as React from 'react';\n/**\n * Private module reserved for @material-ui/x packages.\n */\n\nexport default function useId(idOverride) {\n var _React$useState = React.useState(idOverride),\n defaultId = _React$useState[0],\n setDefaultId = _React$useState[1];\n\n var id = idOverride || defaultId;\n React.useEffect(function () {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the random value for client-side rendering only.\n // We can't use it server-side.\n setDefaultId(\"mui-\".concat(Math.round(Math.random() * 1e5)));\n }\n }, [defaultId]);\n return id;\n}","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import React from 'react';\nvar ThemeContext = React.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\n\nexport default ThemeContext;","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nvar zIndex = {\n mobileStepper: 1000,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;","var hasSymbol = typeof Symbol === 'function' && Symbol.for;\nexport default hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","\"use strict\";\nimport { toUtf8CodePoints, _toUtf8String, UnicodeNormalizationForm } from \"./utf8\";\nfunction bytes2(data) {\n if ((data.length % 4) !== 0) {\n throw new Error(\"bad data\");\n }\n let result = [];\n for (let i = 0; i < data.length; i += 4) {\n result.push(parseInt(data.substring(i, i + 4), 16));\n }\n return result;\n}\nfunction createTable(data, func) {\n if (!func) {\n func = function (value) { return [parseInt(value, 16)]; };\n }\n let lo = 0;\n let result = {};\n data.split(\",\").forEach((pair) => {\n let comps = pair.split(\":\");\n lo += parseInt(comps[0], 16);\n result[lo] = func(comps[1]);\n });\n return result;\n}\nfunction createRangeTable(data) {\n let hi = 0;\n return data.split(\",\").map((v) => {\n let comps = v.split(\"-\");\n if (comps.length === 1) {\n comps[1] = \"0\";\n }\n else if (comps[1] === \"\") {\n comps[1] = \"1\";\n }\n let lo = hi + parseInt(comps[0], 16);\n hi = parseInt(comps[1], 16);\n return { l: lo, h: hi };\n });\n}\nfunction matchMap(value, ranges) {\n let lo = 0;\n for (let i = 0; i < ranges.length; i++) {\n let range = ranges[i];\n lo += range.l;\n if (value >= lo && value <= lo + range.h && ((value - lo) % (range.d || 1)) === 0) {\n if (range.e && range.e.indexOf(value - lo) !== -1) {\n continue;\n }\n return range;\n }\n }\n return null;\n}\nconst Table_A_1_ranges = createRangeTable(\"221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d\");\n// @TODO: Make this relative...\nconst Table_B_1_flags = \"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff\".split(\",\").map((v) => parseInt(v, 16));\nconst Table_B_2_ranges = [\n { h: 25, s: 32, l: 65 },\n { h: 30, s: 32, e: [23], l: 127 },\n { h: 54, s: 1, e: [48], l: 64, d: 2 },\n { h: 14, s: 1, l: 57, d: 2 },\n { h: 44, s: 1, l: 17, d: 2 },\n { h: 10, s: 1, e: [2, 6, 8], l: 61, d: 2 },\n { h: 16, s: 1, l: 68, d: 2 },\n { h: 84, s: 1, e: [18, 24, 66], l: 19, d: 2 },\n { h: 26, s: 32, e: [17], l: 435 },\n { h: 22, s: 1, l: 71, d: 2 },\n { h: 15, s: 80, l: 40 },\n { h: 31, s: 32, l: 16 },\n { h: 32, s: 1, l: 80, d: 2 },\n { h: 52, s: 1, l: 42, d: 2 },\n { h: 12, s: 1, l: 55, d: 2 },\n { h: 40, s: 1, e: [38], l: 15, d: 2 },\n { h: 14, s: 1, l: 48, d: 2 },\n { h: 37, s: 48, l: 49 },\n { h: 148, s: 1, l: 6351, d: 2 },\n { h: 88, s: 1, l: 160, d: 2 },\n { h: 15, s: 16, l: 704 },\n { h: 25, s: 26, l: 854 },\n { h: 25, s: 32, l: 55915 },\n { h: 37, s: 40, l: 1247 },\n { h: 25, s: -119711, l: 53248 },\n { h: 25, s: -119763, l: 52 },\n { h: 25, s: -119815, l: 52 },\n { h: 25, s: -119867, e: [1, 4, 5, 7, 8, 11, 12, 17], l: 52 },\n { h: 25, s: -119919, l: 52 },\n { h: 24, s: -119971, e: [2, 7, 8, 17], l: 52 },\n { h: 24, s: -120023, e: [2, 7, 13, 15, 16, 17], l: 52 },\n { h: 25, s: -120075, l: 52 },\n { h: 25, s: -120127, l: 52 },\n { h: 25, s: -120179, l: 52 },\n { h: 25, s: -120231, l: 52 },\n { h: 25, s: -120283, l: 52 },\n { h: 25, s: -120335, l: 52 },\n { h: 24, s: -119543, e: [17], l: 56 },\n { h: 24, s: -119601, e: [17], l: 58 },\n { h: 24, s: -119659, e: [17], l: 58 },\n { h: 24, s: -119717, e: [17], l: 58 },\n { h: 24, s: -119775, e: [17], l: 58 }\n];\nconst Table_B_2_lut_abs = createTable(\"b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3\");\nconst Table_B_2_lut_rel = createTable(\"179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7\");\nconst Table_B_2_complex = createTable(\"df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D\", bytes2);\nconst Table_C_ranges = createRangeTable(\"80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001\");\nfunction flatten(values) {\n return values.reduce((accum, value) => {\n value.forEach((value) => { accum.push(value); });\n return accum;\n }, []);\n}\nexport function _nameprepTableA1(codepoint) {\n return !!matchMap(codepoint, Table_A_1_ranges);\n}\nexport function _nameprepTableB2(codepoint) {\n let range = matchMap(codepoint, Table_B_2_ranges);\n if (range) {\n return [codepoint + range.s];\n }\n let codes = Table_B_2_lut_abs[codepoint];\n if (codes) {\n return codes;\n }\n let shift = Table_B_2_lut_rel[codepoint];\n if (shift) {\n return [codepoint + shift[0]];\n }\n let complex = Table_B_2_complex[codepoint];\n if (complex) {\n return complex;\n }\n return null;\n}\nexport function _nameprepTableC(codepoint) {\n return !!matchMap(codepoint, Table_C_ranges);\n}\nexport function nameprep(value) {\n // This allows platforms with incomplete normalize to bypass\n // it for very basic names which the built-in toLowerCase\n // will certainly handle correctly\n if (value.match(/^[a-z0-9-]*$/i) && value.length <= 59) {\n return value.toLowerCase();\n }\n // Get the code points (keeping the current normalization)\n let codes = toUtf8CodePoints(value);\n codes = flatten(codes.map((code) => {\n // Substitute Table B.1 (Maps to Nothing)\n if (Table_B_1_flags.indexOf(code) >= 0) {\n return [];\n }\n if (code >= 0xfe00 && code <= 0xfe0f) {\n return [];\n }\n // Substitute Table B.2 (Case Folding)\n let codesTableB2 = _nameprepTableB2(code);\n if (codesTableB2) {\n return codesTableB2;\n }\n // No Substitution\n return [code];\n }));\n // Normalize using form KC\n codes = toUtf8CodePoints(_toUtf8String(codes), UnicodeNormalizationForm.NFKC);\n // Prohibit Tables C.1.2, C.2.2, C.3, C.4, C.5, C.6, C.7, C.8, C.9\n codes.forEach((code) => {\n if (_nameprepTableC(code)) {\n throw new Error(\"STRINGPREP_CONTAINS_PROHIBITED\");\n }\n });\n // Prohibit Unassigned Code Points (Table A.1)\n codes.forEach((code) => {\n if (_nameprepTableA1(code)) {\n throw new Error(\"STRINGPREP_CONTAINS_UNASSIGNED\");\n }\n });\n // IDNA extras\n let name = _toUtf8String(codes);\n // IDNA: 4.2.3.1\n if (name.substring(0, 1) === \"-\" || name.substring(2, 4) === \"--\" || name.substring(name.length - 1) === \"-\") {\n throw new Error(\"invalid hyphen\");\n }\n // IDNA: 4.2.4\n if (name.length > 63) {\n throw new Error(\"too long\");\n }\n return name;\n}\n//# sourceMappingURL=idna.js.map","module.exports = require('./lib')(require('./lib/elliptic'))\n","module.exports = require('./lib/axios');","// A change of the browser zoom change the scrollbar size.\n// Credit https://github.com/twbs/bootstrap/blob/3ffe3a5d82f6f561b82ff78d82b32a7d14aed558/js/src/modal.js#L512-L519\nexport default function getScrollbarSize() {\n var scrollDiv = document.createElement('div');\n scrollDiv.style.width = '99px';\n scrollDiv.style.height = '99px';\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.top = '-9999px';\n scrollDiv.style.overflow = 'scroll';\n document.body.appendChild(scrollDiv);\n var scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarSize;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport * as ReactDOM from 'react-dom';\nimport debounce from '../utils/debounce';\nimport { Transition } from 'react-transition-group';\nimport { elementAcceptingRef } from '@material-ui/utils';\nimport useForkRef from '../utils/useForkRef';\nimport useTheme from '../styles/useTheme';\nimport { duration } from '../styles/transitions';\nimport { reflow, getTransitionProps } from '../transitions/utils'; // Translate the node so he can't be seen on the screen.\n// Later, we gonna translate back the node to his original location\n// with `none`.`\n\nfunction getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}\n\nexport function setTranslateValue(direction, node) {\n var transform = getTranslateValue(direction, node);\n\n if (transform) {\n node.style.webkitTransform = transform;\n node.style.transform = transform;\n }\n}\nvar defaultTimeout = {\n enter: duration.enteringScreen,\n exit: duration.leavingScreen\n};\n/**\n * The Slide transition is used by the [Drawer](/components/drawers/) component.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\n\nvar Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {\n var children = props.children,\n _props$direction = props.direction,\n direction = _props$direction === void 0 ? 'down' : _props$direction,\n inProp = props.in,\n onEnter = props.onEnter,\n onEntered = props.onEntered,\n onEntering = props.onEntering,\n onExit = props.onExit,\n onExited = props.onExited,\n onExiting = props.onExiting,\n style = props.style,\n _props$timeout = props.timeout,\n timeout = _props$timeout === void 0 ? defaultTimeout : _props$timeout,\n _props$TransitionComp = props.TransitionComponent,\n TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,\n other = _objectWithoutProperties(props, [\"children\", \"direction\", \"in\", \"onEnter\", \"onEntered\", \"onEntering\", \"onExit\", \"onExited\", \"onExiting\", \"style\", \"timeout\", \"TransitionComponent\"]);\n\n var theme = useTheme();\n var childrenRef = React.useRef(null);\n /**\n * used in cloneElement(children, { ref: handleRef })\n */\n\n var handleOwnRef = React.useCallback(function (instance) {\n // #StrictMode ready\n childrenRef.current = ReactDOM.findDOMNode(instance);\n }, []);\n var handleRefIntermediary = useForkRef(children.ref, handleOwnRef);\n var handleRef = useForkRef(handleRefIntermediary, ref);\n\n var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {\n return function (isAppearing) {\n if (callback) {\n // onEnterXxx and onExitXxx callbacks have a different arguments.length value.\n if (isAppearing === undefined) {\n callback(childrenRef.current);\n } else {\n callback(childrenRef.current, isAppearing);\n }\n }\n };\n };\n\n var handleEnter = normalizedTransitionCallback(function (node, isAppearing) {\n setTranslateValue(direction, node);\n reflow(node);\n\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n });\n var handleEntering = normalizedTransitionCallback(function (node, isAppearing) {\n var transitionProps = getTransitionProps({\n timeout: timeout,\n style: style\n }, {\n mode: 'enter'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.easeOut\n }));\n node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.easeOut\n }));\n node.style.webkitTransform = 'none';\n node.style.transform = 'none';\n\n if (onEntering) {\n onEntering(node, isAppearing);\n }\n });\n var handleEntered = normalizedTransitionCallback(onEntered);\n var handleExiting = normalizedTransitionCallback(onExiting);\n var handleExit = normalizedTransitionCallback(function (node) {\n var transitionProps = getTransitionProps({\n timeout: timeout,\n style: style\n }, {\n mode: 'exit'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.sharp\n }));\n node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.sharp\n }));\n setTranslateValue(direction, node);\n\n if (onExit) {\n onExit(node);\n }\n });\n var handleExited = normalizedTransitionCallback(function (node) {\n // No need for transitions when the component is hidden\n node.style.webkitTransition = '';\n node.style.transition = '';\n\n if (onExited) {\n onExited(node);\n }\n });\n var updatePosition = React.useCallback(function () {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current);\n }\n }, [direction]);\n React.useEffect(function () {\n // Skip configuration where the position is screen size invariant.\n if (inProp || direction === 'down' || direction === 'right') {\n return undefined;\n }\n\n var handleResize = debounce(function () {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current);\n }\n });\n window.addEventListener('resize', handleResize);\n return function () {\n handleResize.clear();\n window.removeEventListener('resize', handleResize);\n };\n }, [direction, inProp]);\n React.useEffect(function () {\n if (!inProp) {\n // We need to update the position of the drawer when the direction change and\n // when it's hidden.\n updatePosition();\n }\n }, [inProp, updatePosition]);\n return /*#__PURE__*/React.createElement(TransitionComponent, _extends({\n nodeRef: childrenRef,\n onEnter: handleEnter,\n onEntered: handleEntered,\n onEntering: handleEntering,\n onExit: handleExit,\n onExited: handleExited,\n onExiting: handleExiting,\n appear: true,\n in: inProp,\n timeout: timeout\n }, other), function (state, childProps) {\n return /*#__PURE__*/React.cloneElement(children, _extends({\n ref: handleRef,\n style: _extends({\n visibility: state === 'exited' && !inProp ? 'hidden' : undefined\n }, style, children.props.style)\n }, childProps));\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Slide.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * A single child content element.\n */\n children: elementAcceptingRef,\n\n /**\n * Direction the child node will enter from.\n */\n direction: PropTypes.oneOf(['down', 'left', 'right', 'up']),\n\n /**\n * If `true`, show the component; triggers the enter or exit animation.\n */\n in: PropTypes.bool,\n\n /**\n * @ignore\n */\n onEnter: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntered: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntering: PropTypes.func,\n\n /**\n * @ignore\n */\n onExit: PropTypes.func,\n\n /**\n * @ignore\n */\n onExited: PropTypes.func,\n\n /**\n * @ignore\n */\n onExiting: PropTypes.func,\n\n /**\n * @ignore\n */\n style: PropTypes.object,\n\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n */\n timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })])\n} : void 0;\nexport default Slide;","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport ownerDocument from '../utils/ownerDocument';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport { elementAcceptingRef, exactProp } from '@material-ui/utils';\n\nfunction mapEventPropToEvent(eventProp) {\n return eventProp.substring(2).toLowerCase();\n}\n\nfunction clickedRootScrollbar(event) {\n return document.documentElement.clientWidth < event.clientX || document.documentElement.clientHeight < event.clientY;\n}\n/**\n * Listen for click events that occur somewhere in the document, outside of the element itself.\n * For instance, if you need to hide a menu when people click anywhere else on your page.\n */\n\n\nfunction ClickAwayListener(props) {\n var children = props.children,\n _props$disableReactTr = props.disableReactTree,\n disableReactTree = _props$disableReactTr === void 0 ? false : _props$disableReactTr,\n _props$mouseEvent = props.mouseEvent,\n mouseEvent = _props$mouseEvent === void 0 ? 'onClick' : _props$mouseEvent,\n onClickAway = props.onClickAway,\n _props$touchEvent = props.touchEvent,\n touchEvent = _props$touchEvent === void 0 ? 'onTouchEnd' : _props$touchEvent;\n var movedRef = React.useRef(false);\n var nodeRef = React.useRef(null);\n var activatedRef = React.useRef(false);\n var syntheticEventRef = React.useRef(false);\n React.useEffect(function () {\n // Ensure that this component is not \"activated\" synchronously.\n // https://github.com/facebook/react/issues/20074\n setTimeout(function () {\n activatedRef.current = true;\n }, 0);\n return function () {\n activatedRef.current = false;\n };\n }, []); // can be removed once we drop support for non ref forwarding class components\n\n var handleOwnRef = React.useCallback(function (instance) {\n // #StrictMode ready\n nodeRef.current = ReactDOM.findDOMNode(instance);\n }, []);\n var handleRef = useForkRef(children.ref, handleOwnRef); // The handler doesn't take event.defaultPrevented into account:\n //\n // event.preventDefault() is meant to stop default behaviours like\n // clicking a checkbox to check it, hitting a button to submit a form,\n // and hitting left arrow to move the cursor in a text input etc.\n // Only special HTML elements have these default behaviors.\n\n var handleClickAway = useEventCallback(function (event) {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n var insideReactTree = syntheticEventRef.current;\n syntheticEventRef.current = false; // 1. IE 11 support, which trigger the handleClickAway even after the unbind\n // 2. The child might render null.\n // 3. Behave like a blur listener.\n\n if (!activatedRef.current || !nodeRef.current || clickedRootScrollbar(event)) {\n return;\n } // Do not act if user performed touchmove\n\n\n if (movedRef.current) {\n movedRef.current = false;\n return;\n }\n\n var insideDOM; // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js\n\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;\n } else {\n // TODO v6 remove dead logic https://caniuse.com/#search=composedPath.\n var doc = ownerDocument(nodeRef.current);\n insideDOM = !doc.documentElement.contains(event.target) || nodeRef.current.contains(event.target);\n }\n\n if (!insideDOM && (disableReactTree || !insideReactTree)) {\n onClickAway(event);\n }\n }); // Keep track of mouse/touch events that bubbled up through the portal.\n\n var createHandleSynthetic = function createHandleSynthetic(handlerName) {\n return function (event) {\n syntheticEventRef.current = true;\n var childrenPropsHandler = children.props[handlerName];\n\n if (childrenPropsHandler) {\n childrenPropsHandler(event);\n }\n };\n };\n\n var childrenProps = {\n ref: handleRef\n };\n\n if (touchEvent !== false) {\n childrenProps[touchEvent] = createHandleSynthetic(touchEvent);\n }\n\n React.useEffect(function () {\n if (touchEvent !== false) {\n var mappedTouchEvent = mapEventPropToEvent(touchEvent);\n var doc = ownerDocument(nodeRef.current);\n\n var handleTouchMove = function handleTouchMove() {\n movedRef.current = true;\n };\n\n doc.addEventListener(mappedTouchEvent, handleClickAway);\n doc.addEventListener('touchmove', handleTouchMove);\n return function () {\n doc.removeEventListener(mappedTouchEvent, handleClickAway);\n doc.removeEventListener('touchmove', handleTouchMove);\n };\n }\n\n return undefined;\n }, [handleClickAway, touchEvent]);\n\n if (mouseEvent !== false) {\n childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);\n }\n\n React.useEffect(function () {\n if (mouseEvent !== false) {\n var mappedMouseEvent = mapEventPropToEvent(mouseEvent);\n var doc = ownerDocument(nodeRef.current);\n doc.addEventListener(mappedMouseEvent, handleClickAway);\n return function () {\n doc.removeEventListener(mappedMouseEvent, handleClickAway);\n };\n }\n\n return undefined;\n }, [handleClickAway, mouseEvent]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.cloneElement(children, childrenProps));\n}\n\nprocess.env.NODE_ENV !== \"production\" ? ClickAwayListener.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The wrapped element.\n */\n children: elementAcceptingRef.isRequired,\n\n /**\n * If `true`, the React tree is ignored and only the DOM tree is considered.\n * This prop changes how portaled elements are handled.\n */\n disableReactTree: PropTypes.bool,\n\n /**\n * The mouse event to listen to. You can disable the listener by providing `false`.\n */\n mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', false]),\n\n /**\n * Callback fired when a \"click away\" event is detected.\n */\n onClickAway: PropTypes.func.isRequired,\n\n /**\n * The touch event to listen to. You can disable the listener by providing `false`.\n */\n touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false])\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n ClickAwayListener['propTypes' + ''] = exactProp(ClickAwayListener.propTypes);\n}\n\nexport default ClickAwayListener;","import React from 'react';\nimport { ProviderContext } from '.';\n\n// @ts-ignore\nexport default React.createContext();\n","import Slide from '@material-ui/core/Slide';\nimport { SnackbarClassKey } from '@material-ui/core/Snackbar';\nimport { CloseReason, ContainerClassKey, SnackbarProviderProps, VariantType, SnackbarOrigin, VariantClassKey } from '../index';\nimport { SnackbarItemProps } from '../SnackbarItem';\nimport { Snack } from '../SnackbarProvider';\n\nexport const allClasses: {\n mui: Record;\n container: Record;\n} = {\n mui: {\n root: {},\n anchorOriginTopCenter: {},\n anchorOriginBottomCenter: {},\n anchorOriginTopRight: {},\n anchorOriginBottomRight: {},\n anchorOriginTopLeft: {},\n anchorOriginBottomLeft: {},\n },\n container: {\n containerRoot: {},\n containerAnchorOriginTopCenter: {},\n containerAnchorOriginBottomCenter: {},\n containerAnchorOriginTopRight: {},\n containerAnchorOriginBottomRight: {},\n containerAnchorOriginTopLeft: {},\n containerAnchorOriginBottomLeft: {},\n },\n};\n\nexport const MESSAGES = {\n NO_PERSIST_ALL: 'WARNING - notistack: Reached maxSnack while all enqueued snackbars have \\'persist\\' flag. Notistack will dismiss the oldest snackbar anyway to allow other ones in the queue to be presented.',\n};\n\nexport const SNACKBAR_INDENTS = {\n view: { default: 20, dense: 4 },\n snackbar: { default: 6, dense: 2 },\n};\n\nexport const DEFAULTS = {\n maxSnack: 3,\n dense: false,\n hideIconVariant: false,\n variant: 'default' as VariantType,\n autoHideDuration: 5000,\n anchorOrigin: { vertical: 'bottom', horizontal: 'left' } as SnackbarOrigin,\n TransitionComponent: Slide,\n transitionDuration: {\n enter: 225,\n exit: 195,\n },\n};\n\nexport const capitalise = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);\n\nexport const originKeyExtractor = (anchor: Snack['anchorOrigin']): string => (\n `${capitalise(anchor.vertical)}${capitalise(anchor.horizontal)}`\n);\n\n/**\n * Omit SnackbarContainer class keys that are not needed for SnackbarItem\n */\nexport const omitContainerKeys = (classes: SnackbarProviderProps['classes']): SnackbarItemProps['classes'] => (\n // @ts-ignore\n Object.keys(classes).filter(key => !allClasses.container[key]).reduce((obj, key) => ({ ...obj, [key]: classes[key] }), {})\n);\n\nexport const REASONS: { [key: string]: CloseReason } = {\n TIMEOUT: 'timeout',\n CLICKAWAY: 'clickaway',\n MAXSNACK: 'maxsnack',\n INSTRUCTED: 'instructed',\n};\n\n/** Tranforms classes name */\nexport const transformer = {\n toContainerAnchorOrigin: (origin: string) => `containerAnchorOrigin${origin}` as ContainerClassKey,\n toAnchorOrigin: ({ vertical, horizontal }: SnackbarOrigin) => (\n `anchorOrigin${capitalise(vertical)}${capitalise(horizontal)}` as SnackbarClassKey\n ),\n toVariant: (variant: VariantType) => `variant${capitalise(variant)}` as VariantClassKey,\n};\n\nexport const isDefined = (value: string | null | undefined | number): boolean => (!!value || value === 0);\n\nconst numberOrNull = (numberish?: number | null) => (\n typeof numberish === 'number' || numberish === null\n);\n\n// @ts-ignore\nexport const merge = (options, props, defaults) => (name: keyof Snack): any => {\n if (name === 'autoHideDuration') {\n if (numberOrNull(options.autoHideDuration)) return options.autoHideDuration;\n if (numberOrNull(props.autoHideDuration)) return props.autoHideDuration;\n return DEFAULTS.autoHideDuration;\n }\n\n return options[name] || props[name] || defaults[name];\n};\n\nexport function objectMerge(options = {}, props = {}, defaults = {}) {\n return {\n ...defaults,\n ...props,\n ...options,\n };\n}\n","import React, { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles';\nimport { SnackbarContentProps } from '../index';\n\nconst styles = (theme: Theme) => createStyles({\n root: {\n display: 'flex',\n flexWrap: 'wrap',\n flexGrow: 1,\n [theme.breakpoints.up('sm')]: {\n flexGrow: 'initial',\n minWidth: 288,\n },\n }\n});\n\ninterface Props extends WithStyles, SnackbarContentProps { }\n\nconst SnackbarContent = forwardRef(({ classes, className, ...props }, ref) => (\n
\n))\n\nexport default withStyles(styles)(SnackbarContent);\n","import { Snack } from '../SnackbarProvider';\n\nconst DIRECTION = {\n right: 'left',\n left: 'right',\n bottom: 'up',\n top: 'down',\n} as const;\nexport type DirectionType = typeof DIRECTION[keyof typeof DIRECTION]\n\nexport const getTransitionDirection = (anchorOrigin: Snack['anchorOrigin']): DirectionType => {\n if (anchorOrigin.horizontal !== 'center') {\n return DIRECTION[anchorOrigin.horizontal];\n }\n return DIRECTION[anchorOrigin.vertical];\n};\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\nimport { IconVariant } from '../index';\n\ntype Icon = (props: SvgIconProps) => JSX.Element;\n\nconst CheckIcon: Icon = props => (\n \n \n \n);\n\nconst WarningIcon: Icon = props => (\n \n \n \n);\n\nconst ErrorIcon: Icon = props => (\n \n \n \n);\n\nconst InfoIcon: Icon = props => (\n \n \n \n);\n\nconst iconStyles = {\n fontSize: 20,\n marginInlineEnd: 8,\n};\n\nconst defaultIconVariants: IconVariant = {\n default: undefined,\n success: ,\n warning: ,\n error: ,\n info: ,\n};\n\nexport default defaultIconVariants;\n","/**\n * @link https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/utils/createChainedFunction.js\n */\nexport default function createChainedFunction(funcs, extraArg) {\n return funcs.reduce((acc, func) => {\n if (func == null) return acc;\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof func !== 'function') {\n // eslint-disable-next-line no-console\n console.error('Invalid Argument Type. must only provide functions, undefined, or null.');\n }\n }\n\n return function chainedFunction(...args) {\n const argums = [...args];\n if (extraArg && argums.indexOf(extraArg) === -1) {\n argums.push(extraArg);\n }\n acc.apply(this, argums);\n func.apply(this, argums);\n };\n }, () => { });\n}\n","/**\n * @link https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/utils/useEventCallback.js\n */\nimport * as React from 'react';\n\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nexport default function useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useCallback((...args) => (0, ref.current)(...args), []);\n}\n","/**\n * @link https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Snackbar/Snackbar.js\n */\nimport * as React from 'react';\nimport ClickAwayListener from '@material-ui/core/ClickAwayListener';\nimport { REASONS } from '../utils/constants';\nimport useEventCallback from '../utils/useEventCallback';\n\nconst Snackbar = React.forwardRef((props, ref) => {\n const {\n children,\n autoHideDuration,\n ClickAwayListenerProps,\n disableWindowBlurListener = false,\n onClose,\n onMouseEnter,\n onMouseLeave,\n open,\n resumeHideDuration,\n ...other\n } = props;\n\n const timerAutoHide = React.useRef();\n\n const handleClose = useEventCallback((...args) => {\n if (onClose) {\n onClose(...args);\n }\n });\n\n const setAutoHideTimer = useEventCallback((autoHideDurationParam) => {\n if (!onClose || autoHideDurationParam == null) {\n return;\n }\n\n clearTimeout(timerAutoHide.current);\n timerAutoHide.current = setTimeout(() => {\n handleClose(null, REASONS.TIMEOUT);\n }, autoHideDurationParam);\n });\n\n React.useEffect(() => {\n if (open) {\n setAutoHideTimer(autoHideDuration);\n }\n\n return () => {\n clearTimeout(timerAutoHide.current);\n };\n }, [open, autoHideDuration, setAutoHideTimer]);\n\n /**\n * Pause the timer when the user is interacting with the Snackbar\n * or when the user hide the window.\n */\n const handlePause = () => {\n clearTimeout(timerAutoHide.current);\n };\n\n /**\n * Restart the timer when the user is no longer interacting with the Snackbar\n * or when the window is shown back.\n */\n const handleResume = React.useCallback(() => {\n if (autoHideDuration != null) {\n setAutoHideTimer(resumeHideDuration != null ? resumeHideDuration : autoHideDuration * 0.5);\n }\n }, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);\n\n const handleMouseEnter = (event) => {\n if (onMouseEnter) {\n onMouseEnter(event);\n }\n handlePause();\n };\n\n const handleMouseLeave = (event) => {\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n handleResume();\n };\n\n const handleClickAway = (event) => {\n if (onClose) {\n onClose(event, REASONS.CLICKAWAY);\n }\n };\n\n React.useEffect(() => {\n if (!disableWindowBlurListener && open) {\n window.addEventListener('focus', handleResume);\n window.addEventListener('blur', handlePause);\n\n return () => {\n window.removeEventListener('focus', handleResume);\n window.removeEventListener('blur', handlePause);\n };\n }\n\n return undefined;\n }, [disableWindowBlurListener, handleResume, open]);\n\n return (\n \n
\n {children}\n
\n
\n );\n});\n\nexport default Snackbar;\n","import React, { useState, useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { withStyles, WithStyles, createStyles, Theme, emphasize } from '@material-ui/core/styles';\nimport Collapse from '@material-ui/core/Collapse';\nimport SnackbarContent from '../SnackbarContent';\nimport { getTransitionDirection } from './SnackbarItem.util';\nimport { allClasses, REASONS, objectMerge, DEFAULTS, transformer } from '../utils/constants';\nimport { SharedProps, RequiredBy, TransitionHandlerProps, SnackbarProviderProps as ProviderProps } from '../index';\nimport defaultIconVariants from '../utils/defaultIconVariants';\nimport createChainedFunction from '../utils/createChainedFunction';\nimport { Snack } from '../SnackbarProvider';\nimport Snackbar from './Snackbar';\n\nconst styles = (theme: Theme) => {\n // @ts-ignore\n const mode = theme.palette.mode || theme.palette.type;\n const backgroundColor = emphasize(theme.palette.background.default, mode === 'light' ? 0.8 : 0.98);\n return createStyles({\n ...allClasses.mui,\n contentRoot: {\n ...theme.typography.body2,\n backgroundColor,\n color: theme.palette.getContrastText(backgroundColor),\n alignItems: 'center',\n padding: '6px 16px',\n borderRadius: '4px',\n boxShadow: '0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)',\n },\n lessPadding: {\n paddingLeft: 8 * 2.5,\n },\n variantSuccess: {\n backgroundColor: '#43a047', // green\n color: '#fff',\n },\n variantError: {\n backgroundColor: '#d32f2f', // dark red\n color: '#fff',\n },\n variantInfo: {\n backgroundColor: '#2196f3', // nice blue\n color: '#fff',\n },\n variantWarning: {\n backgroundColor: '#ff9800', // amber\n color: '#fff',\n },\n message: {\n display: 'flex',\n alignItems: 'center',\n padding: '8px 0',\n },\n action: {\n display: 'flex',\n alignItems: 'center',\n marginLeft: 'auto',\n paddingLeft: 16,\n marginRight: -8,\n },\n wrappedRoot: {\n position: 'relative',\n transform: 'translateX(0)',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n });\n}\n\n\ntype RemovedProps =\n | 'variant' // the one received from Provider is processed and passed to snack prop \n | 'anchorOrigin' // same as above\n | 'autoHideDuration' // same as above\n | 'preventDuplicate' // the one recevied from enqueueSnackbar is processed in provider, therefore shouldn't be passed to SnackbarItem */\n\n\nexport interface SnackbarItemProps extends WithStyles, RequiredBy, 'onEntered' | 'onExited' | 'onClose'> {\n snack: Snack;\n dense: ProviderProps['dense'];\n iconVariant: ProviderProps['iconVariant'];\n hideIconVariant: ProviderProps['hideIconVariant'];\n}\n\nconst SnackbarItem: React.FC = ({ classes, ...props }) => {\n const timeout = useRef>();\n const [collapsed, setCollapsed] = useState(true);\n\n useEffect(() => (): void => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n }, []);\n\n const handleClose = createChainedFunction([props.snack.onClose, props.onClose], props.snack.key);\n\n const handleEntered: TransitionHandlerProps['onEntered'] = () => {\n if (props.snack.requestClose) {\n handleClose(null, REASONS.INSTRCUTED);\n }\n };\n\n const handleExitedScreen = (): void => {\n timeout.current = setTimeout(() => {\n setCollapsed(!collapsed);\n }, 125);\n };\n\n const {\n style,\n dense,\n ariaAttributes: otherAriaAttributes,\n className: otherClassName,\n hideIconVariant,\n iconVariant,\n snack,\n action: otherAction,\n content: otherContent,\n TransitionComponent: otherTranComponent,\n TransitionProps: otherTranProps,\n transitionDuration: otherTranDuration,\n onEnter: ignoredOnEnter,\n onEntered: ignoredOnEntered,\n onEntering: ignoredOnEntering,\n onExit: ignoredOnExit,\n onExited: ignoredOnExited,\n onExiting: ignoredOnExiting,\n ...other\n } = props;\n\n const {\n persist,\n key,\n open,\n entered,\n requestClose,\n className: singleClassName,\n variant,\n content: singleContent,\n action: singleAction,\n ariaAttributes: singleAriaAttributes,\n anchorOrigin,\n message: snackMessage,\n TransitionComponent: singleTranComponent,\n TransitionProps: singleTranProps,\n transitionDuration: singleTranDuration,\n onEnter,\n onEntered,\n onEntering,\n onExit,\n onExited,\n onExiting,\n ...singleSnackProps\n } = snack;\n\n const icon = {\n ...defaultIconVariants,\n ...iconVariant,\n }[variant];\n\n const ariaAttributes = {\n 'aria-describedby': 'notistack-snackbar',\n ...objectMerge(singleAriaAttributes, otherAriaAttributes),\n };\n\n const TransitionComponent = singleTranComponent || otherTranComponent || DEFAULTS.TransitionComponent;\n const transitionDuration = objectMerge(singleTranDuration, otherTranDuration, DEFAULTS.transitionDuration);\n const transitionProps = {\n direction: getTransitionDirection(anchorOrigin),\n ...objectMerge(singleTranProps, otherTranProps),\n };\n\n let action = singleAction || otherAction;\n if (typeof action === 'function') {\n action = action(key);\n }\n\n let content = singleContent || otherContent;\n if (typeof content === 'function') {\n content = content(key, snack.message);\n }\n\n const callbacks: { [key in keyof TransitionHandlerProps]?: any } =\n ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].reduce((acc, cbName) => ({\n ...acc,\n // @ts-ignore\n [cbName]: createChainedFunction([props.snack[cbName], props[cbName]], props.snack.key),\n }), {});\n\n return (\n \n {/* @ts-ignore */}\n \n {/* @ts-ignore */}\n \n {/* @ts-ignore */}\n {content || (\n \n
\n {!hideIconVariant ? icon : null}\n {snackMessage}\n
\n {action && (\n
{action}
\n )}\n \n )}\n \n \n \n );\n};\n\nexport default withStyles(styles)(SnackbarItem);\n","import React from 'react';\nimport clsx from 'clsx';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { SNACKBAR_INDENTS } from './utils/constants';\nimport { SnackbarProviderProps } from '.';\n\nconst collapse = {\n // Material-UI 4.12.x and above uses MuiCollapse-root; earlier versions use\n // Mui-Collapse-container. https://github.com/mui-org/material-ui/pull/24084\n container: '& > .MuiCollapse-container, & > .MuiCollapse-root',\n wrapper: '& > .MuiCollapse-container > .MuiCollapse-wrapper, & > .MuiCollapse-root > .MuiCollapse-wrapper',\n};\n\nconst xsWidthMargin = 16;\n\nconst useStyle = makeStyles((theme) => ({\n root: {\n boxSizing: 'border-box',\n display: 'flex',\n maxHeight: '100%',\n position: 'fixed',\n zIndex: theme.zIndex.snackbar,\n height: 'auto',\n width: 'auto',\n transition: 'top 300ms ease 0ms, right 300ms ease 0ms, bottom 300ms ease 0ms, left 300ms ease 0ms, margin 300ms ease 0ms, max-width 300ms ease 0ms',\n // container itself is invisible and should not block clicks, clicks should be passed to its children\n pointerEvents: 'none',\n [collapse.container]: {\n pointerEvents: 'all',\n },\n [collapse.wrapper]: {\n padding: `${SNACKBAR_INDENTS.snackbar.default}px 0px`,\n transition: 'padding 300ms ease 0ms',\n },\n maxWidth: `calc(100% - ${SNACKBAR_INDENTS.view.default * 2}px)`,\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n maxWidth: `calc(100% - ${xsWidthMargin * 2}px)`,\n },\n },\n rootDense: {\n [collapse.wrapper]: {\n padding: `${SNACKBAR_INDENTS.snackbar.dense}px 0px`,\n },\n },\n top: {\n top: SNACKBAR_INDENTS.view.default - SNACKBAR_INDENTS.snackbar.default,\n flexDirection: 'column',\n },\n bottom: {\n bottom: SNACKBAR_INDENTS.view.default - SNACKBAR_INDENTS.snackbar.default,\n flexDirection: 'column-reverse',\n },\n left: {\n left: SNACKBAR_INDENTS.view.default,\n [theme.breakpoints.up('sm')]: {\n alignItems: 'flex-start',\n },\n [theme.breakpoints.down('xs')]: {\n left: `${xsWidthMargin}px`,\n },\n },\n right: {\n right: SNACKBAR_INDENTS.view.default,\n [theme.breakpoints.up('sm')]: {\n alignItems: 'flex-end',\n },\n [theme.breakpoints.down('xs')]: {\n right: `${xsWidthMargin}px`,\n },\n },\n center: {\n left: '50%',\n transform: 'translateX(-50%)',\n [theme.breakpoints.up('sm')]: {\n alignItems: 'center',\n },\n },\n}));\n\ninterface SnackbarContainerProps {\n children: JSX.Element | JSX.Element[];\n className?: string;\n dense: SnackbarProviderProps['dense'];\n anchorOrigin: NonNullable;\n}\n\nconst SnackbarContainer: React.FC = (props) => {\n const classes = useStyle();\n const { className, anchorOrigin, dense, ...other } = props;\n\n const combinedClassname = clsx(\n classes[anchorOrigin.vertical],\n classes[anchorOrigin.horizontal],\n { [classes.rootDense]: dense },\n classes.root, // root should come after others to override maxWidth\n className,\n );\n\n return (\n
\n );\n};\n\nexport default React.memo(SnackbarContainer);\n","import React, { Component } from 'react';\nimport { createPortal } from 'react-dom';\nimport clsx from 'clsx';\nimport SnackbarContext from './SnackbarContext';\nimport { MESSAGES, REASONS, originKeyExtractor, omitContainerKeys, DEFAULTS, merge, transformer, isDefined } from './utils/constants';\nimport SnackbarItem from './SnackbarItem';\nimport SnackbarContainer from './SnackbarContainer';\nimport warning from './utils/warning';\nimport { SnackbarProviderProps, SnackbarKey, SnackbarMessage, OptionsObject, RequiredBy, ProviderContext, TransitionHandlerProps } from '.';\nimport createChainedFunction from './utils/createChainedFunction';\n\ntype Reducer = (state: State) => State;\ntype SnacksByPosition = { [key: string]: Snack[] };\n\nexport interface Snack extends RequiredBy {\n message: SnackbarMessage;\n open: boolean;\n entered: boolean;\n requestClose: boolean;\n}\n\ninterface State {\n snacks: Snack[];\n queue: Snack[];\n contextValue: ProviderContext;\n}\n\nclass SnackbarProvider extends Component {\n constructor(props: SnackbarProviderProps) {\n super(props);\n this.state = {\n snacks: [],\n queue: [], // eslint-disable-line react/no-unused-state\n contextValue: {\n enqueueSnackbar: this.enqueueSnackbar,\n closeSnackbar: this.closeSnackbar,\n },\n };\n }\n\n get maxSnack(): number {\n return this.props.maxSnack || DEFAULTS.maxSnack;\n }\n\n /**\n * Adds a new snackbar to the queue to be presented.\n * Returns generated or user defined key referencing the new snackbar or null\n */\n enqueueSnackbar = (message: SnackbarMessage, opts: OptionsObject = {}): SnackbarKey => {\n const {\n key,\n preventDuplicate,\n ...options\n } = opts;\n\n const hasSpecifiedKey = isDefined(key);\n const id = hasSpecifiedKey ? (key as SnackbarKey) : new Date().getTime() + Math.random();\n\n const merger = merge(options, this.props, DEFAULTS);\n const snack: Snack = {\n key: id,\n ...options,\n message,\n open: true,\n entered: false,\n requestClose: false,\n variant: merger('variant'),\n anchorOrigin: merger('anchorOrigin'),\n autoHideDuration: merger('autoHideDuration'),\n };\n\n if (options.persist) {\n snack.autoHideDuration = undefined;\n }\n\n this.setState((state) => {\n if ((preventDuplicate === undefined && this.props.preventDuplicate) || preventDuplicate) {\n const compareFunction = (item: Snack): boolean => (\n hasSpecifiedKey ? item.key === key : item.message === message\n );\n\n const inQueue = state.queue.findIndex(compareFunction) > -1;\n const inView = state.snacks.findIndex(compareFunction) > -1;\n if (inQueue || inView) {\n return state;\n }\n }\n\n return this.handleDisplaySnack({\n ...state,\n queue: [...state.queue, snack],\n });\n });\n\n return id;\n };\n\n /**\n * Reducer: Display snack if there's space for it. Otherwise, immediately\n * begin dismissing the oldest message to start showing the new one.\n */\n handleDisplaySnack: Reducer = (state) => {\n const { snacks } = state;\n if (snacks.length >= this.maxSnack) {\n return this.handleDismissOldest(state);\n }\n return this.processQueue(state);\n };\n\n /**\n * Reducer: Display items (notifications) in the queue if there's space for them.\n */\n processQueue: Reducer = (state) => {\n const { queue, snacks } = state;\n if (queue.length > 0) {\n return {\n ...state,\n snacks: [...snacks, queue[0]],\n queue: queue.slice(1, queue.length),\n };\n }\n return state;\n };\n\n /**\n * Reducer: Hide oldest snackbar on the screen because there exists a new one which we have to display.\n * (ignoring the one with 'persist' flag. i.e. explicitly told by user not to get dismissed).\n *\n * Note 1: If there is already a message leaving the screen, no new messages are dismissed.\n * Note 2: If the oldest message has not yet entered the screen, only a request to close the\n * snackbar is made. Once it entered the screen, it will be immediately dismissed.\n */\n handleDismissOldest: Reducer = (state) => {\n if (state.snacks.some(item => !item.open || item.requestClose)) {\n return state;\n }\n\n let popped = false;\n let ignore = false;\n\n const persistentCount = state.snacks.reduce((acc, current) => (\n acc + (current.open && current.persist ? 1 : 0)\n ), 0);\n\n if (persistentCount === this.maxSnack) {\n warning(MESSAGES.NO_PERSIST_ALL);\n ignore = true;\n }\n\n const snacks = state.snacks.map((item) => {\n if (!popped && (!item.persist || ignore)) {\n popped = true;\n\n if (!item.entered) {\n return {\n ...item,\n requestClose: true,\n };\n }\n\n if (item.onClose) item.onClose(null, REASONS.MAXSNACK, item.key);\n if (this.props.onClose) this.props.onClose(null, REASONS.MAXSNACK, item.key);\n\n return {\n ...item,\n open: false,\n };\n }\n\n return { ...item };\n });\n\n return { ...state, snacks };\n };\n\n /**\n * Set the entered state of the snackbar with the given key.\n */\n handleEnteredSnack: TransitionHandlerProps['onEntered'] = (node, isAppearing, key) => {\n if (!isDefined(key)) {\n throw new Error('handleEnteredSnack Cannot be called with undefined key');\n }\n\n this.setState(({ snacks }) => ({\n snacks: snacks.map(item => (\n item.key === key ? { ...item, entered: true } : { ...item }\n )),\n }));\n }\n\n /**\n * Hide a snackbar after its timeout.\n */\n handleCloseSnack: TransitionHandlerProps['onClose'] = (event, reason, key) => {\n // should not use createChainedFunction for onClose.\n // because this.closeSnackbar called this function\n if (this.props.onClose) {\n this.props.onClose(event, reason, key);\n }\n\n if (reason === REASONS.CLICKAWAY) return;\n const shouldCloseAll = key === undefined;\n\n this.setState(({ snacks, queue }) => ({\n snacks: snacks.map((item) => {\n if (!shouldCloseAll && item.key !== key) {\n return { ...item };\n }\n\n return item.entered\n ? { ...item, open: false }\n : { ...item, requestClose: true };\n }),\n queue: queue.filter(item => item.key !== key), // eslint-disable-line react/no-unused-state\n }));\n };\n\n /**\n * Close snackbar with the given key\n */\n closeSnackbar: ProviderContext['closeSnackbar'] = (key) => {\n // call individual snackbar onClose callback passed through options parameter\n const toBeClosed = this.state.snacks.find(item => item.key === key);\n if (isDefined(key) && toBeClosed && toBeClosed.onClose) {\n toBeClosed.onClose(null, REASONS.INSTRUCTED, key);\n }\n\n this.handleCloseSnack(null, REASONS.INSTRUCTED, key);\n }\n\n /**\n * When we set open attribute of a snackbar to false (i.e. after we hide a snackbar),\n * it leaves the screen and immediately after leaving animation is done, this method\n * gets called. We remove the hidden snackbar from state and then display notifications\n * waiting in the queue (if any). If after this process the queue is not empty, the\n * oldest message is dismissed.\n */\n // @ts-ignore\n handleExitedSnack: TransitionHandlerProps['onExited'] = (event, key1, key2) => {\n const key = key1 || key2;\n if (!isDefined(key)) {\n throw new Error('handleExitedSnack Cannot be called with undefined key');\n }\n\n this.setState((state) => {\n const newState = this.processQueue({\n ...state,\n snacks: state.snacks.filter(item => item.key !== key),\n });\n\n if (newState.queue.length === 0) {\n return newState;\n }\n\n return this.handleDismissOldest(newState);\n });\n };\n\n render(): JSX.Element {\n const { contextValue } = this.state;\n const {\n maxSnack: dontspread1,\n preventDuplicate: dontspread2,\n variant: dontspread3,\n anchorOrigin: dontspread4,\n iconVariant,\n dense = DEFAULTS.dense,\n hideIconVariant = DEFAULTS.hideIconVariant,\n domRoot,\n children,\n classes = {},\n ...props\n } = this.props;\n\n const categ = this.state.snacks.reduce((acc, current) => {\n const category = originKeyExtractor(current.anchorOrigin);\n const existingOfCategory = acc[category] || [];\n return {\n ...acc,\n [category]: [...existingOfCategory, current],\n };\n }, {});\n\n const snackbars = Object.keys(categ).map((origin) => {\n const snacks = categ[origin];\n return (\n \n {snacks.map(snack => (\n \n ))}\n \n );\n });\n\n return (\n \n {children}\n {domRoot ? createPortal(snackbars, domRoot) : snackbars}\n \n );\n }\n}\n\nexport default SnackbarProvider;\n","import { useContext } from 'react';\nimport SnackbarContext from './SnackbarContext';\nimport { ProviderContext } from '.';\n\nexport default (): ProviderContext => useContext(SnackbarContext);\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","\"use strict\";\n\n(function(root) {\n const MAX_VALUE = 0x7fffffff;\n\n // The SHA256 and PBKDF2 implementation are from scrypt-async-js:\n // See: https://github.com/dchest/scrypt-async-js\n function SHA256(m) {\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n\n let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const w = new Uint32Array(64);\n\n function blocks(p) {\n let off = 0, len = p.length;\n while (len >= 64) {\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n let i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi >>> 24) & 0xff);\n p.push((bitLenHi >>> 16) & 0xff);\n p.push((bitLenHi >>> 8) & 0xff);\n p.push((bitLenHi >>> 0) & 0xff);\n p.push((bitLenLo >>> 24) & 0xff);\n p.push((bitLenLo >>> 16) & 0xff);\n p.push((bitLenLo >>> 8) & 0xff);\n p.push((bitLenLo >>> 0) & 0xff);\n\n blocks(p);\n\n return [\n (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n ];\n }\n\n function PBKDF2_HMAC_SHA256_OneIter(password, salt, dkLen) {\n // compress password if it's longer than hash block length\n password = (password.length <= 64) ? password : SHA256(password);\n\n const innerLen = 64 + salt.length + 4;\n const inner = new Array(innerLen);\n const outerKey = new Array(64);\n\n let i;\n let dk = [];\n\n // inner = (password ^ ipad) || salt || counter\n for (i = 0; i < 64; i++) { inner[i] = 0x36; }\n for (i = 0; i < password.length; i++) { inner[i] ^= password[i]; }\n for (i = 0; i < salt.length; i++) { inner[64 + i] = salt[i]; }\n for (i = innerLen - 4; i < innerLen; i++) { inner[i] = 0; }\n\n // outerKey = password ^ opad\n for (i = 0; i < 64; i++) outerKey[i] = 0x5c;\n for (i = 0; i < password.length; i++) outerKey[i] ^= password[i];\n\n // increments counter inside inner\n function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }\n\n // output blocks = SHA256(outerKey || SHA256(inner)) ...\n while (dkLen >= 32) {\n incrementCounter();\n dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))));\n dkLen -= 32;\n }\n if (dkLen > 0) {\n incrementCounter();\n dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen));\n }\n\n return dk;\n }\n\n // The following is an adaptation of scryptsy\n // See: https://www.npmjs.com/package/scryptsy\n function blockmix_salsa8(BY, Yi, r, x, _X) {\n let i;\n\n arraycopy(BY, (2 * r - 1) * 16, _X, 0, 16);\n for (i = 0; i < 2 * r; i++) {\n blockxor(BY, i * 16, _X, 16);\n salsa20_8(_X, x);\n arraycopy(_X, 0, BY, Yi + (i * 16), 16);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy(BY, Yi + (i * 2) * 16, BY, (i * 16), 16);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy(BY, Yi + (i * 2 + 1) * 16, BY, (i + r) * 16, 16);\n }\n }\n\n function R(a, b) {\n return (a << b) | (a >>> (32 - b));\n }\n\n function salsa20_8(B, x) {\n arraycopy(B, 0, x, 0, 16);\n\n for (let i = 8; i > 0; i -= 2) {\n x[ 4] ^= R(x[ 0] + x[12], 7);\n x[ 8] ^= R(x[ 4] + x[ 0], 9);\n x[12] ^= R(x[ 8] + x[ 4], 13);\n x[ 0] ^= R(x[12] + x[ 8], 18);\n x[ 9] ^= R(x[ 5] + x[ 1], 7);\n x[13] ^= R(x[ 9] + x[ 5], 9);\n x[ 1] ^= R(x[13] + x[ 9], 13);\n x[ 5] ^= R(x[ 1] + x[13], 18);\n x[14] ^= R(x[10] + x[ 6], 7);\n x[ 2] ^= R(x[14] + x[10], 9);\n x[ 6] ^= R(x[ 2] + x[14], 13);\n x[10] ^= R(x[ 6] + x[ 2], 18);\n x[ 3] ^= R(x[15] + x[11], 7);\n x[ 7] ^= R(x[ 3] + x[15], 9);\n x[11] ^= R(x[ 7] + x[ 3], 13);\n x[15] ^= R(x[11] + x[ 7], 18);\n x[ 1] ^= R(x[ 0] + x[ 3], 7);\n x[ 2] ^= R(x[ 1] + x[ 0], 9);\n x[ 3] ^= R(x[ 2] + x[ 1], 13);\n x[ 0] ^= R(x[ 3] + x[ 2], 18);\n x[ 6] ^= R(x[ 5] + x[ 4], 7);\n x[ 7] ^= R(x[ 6] + x[ 5], 9);\n x[ 4] ^= R(x[ 7] + x[ 6], 13);\n x[ 5] ^= R(x[ 4] + x[ 7], 18);\n x[11] ^= R(x[10] + x[ 9], 7);\n x[ 8] ^= R(x[11] + x[10], 9);\n x[ 9] ^= R(x[ 8] + x[11], 13);\n x[10] ^= R(x[ 9] + x[ 8], 18);\n x[12] ^= R(x[15] + x[14], 7);\n x[13] ^= R(x[12] + x[15], 9);\n x[14] ^= R(x[13] + x[12], 13);\n x[15] ^= R(x[14] + x[13], 18);\n }\n\n for (let i = 0; i < 16; ++i) {\n B[i] += x[i];\n }\n }\n\n // naive approach... going back to loop unrolling may yield additional performance\n function blockxor(S, Si, D, len) {\n for (let i = 0; i < len; i++) {\n D[i] ^= S[Si + i]\n }\n }\n\n function arraycopy(src, srcPos, dest, destPos, length) {\n while (length--) {\n dest[destPos++] = src[srcPos++];\n }\n }\n\n function checkBufferish(o) {\n if (!o || typeof(o.length) !== 'number') { return false; }\n\n for (let i = 0; i < o.length; i++) {\n const v = o[i];\n if (typeof(v) !== 'number' || v % 1 || v < 0 || v >= 256) {\n return false;\n }\n }\n\n return true;\n }\n\n function ensureInteger(value, name) {\n if (typeof(value) !== \"number\" || (value % 1)) { throw new Error('invalid ' + name); }\n return value;\n }\n\n // N = Cpu cost, r = Memory cost, p = parallelization cost\n // callback(error, progress, key)\n function _scrypt(password, salt, N, r, p, dkLen, callback) {\n\n N = ensureInteger(N, 'N');\n r = ensureInteger(r, 'r');\n p = ensureInteger(p, 'p');\n\n dkLen = ensureInteger(dkLen, 'dkLen');\n\n if (N === 0 || (N & (N - 1)) !== 0) { throw new Error('N must be power of 2'); }\n\n if (N > MAX_VALUE / 128 / r) { throw new Error('N too large'); }\n if (r > MAX_VALUE / 128 / p) { throw new Error('r too large'); }\n\n if (!checkBufferish(password)) {\n throw new Error('password must be an array or buffer');\n }\n password = Array.prototype.slice.call(password);\n\n if (!checkBufferish(salt)) {\n throw new Error('salt must be an array or buffer');\n }\n salt = Array.prototype.slice.call(salt);\n\n let b = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r);\n const B = new Uint32Array(p * 32 * r)\n for (let i = 0; i < B.length; i++) {\n const j = i * 4;\n B[i] = ((b[j + 3] & 0xff) << 24) |\n ((b[j + 2] & 0xff) << 16) |\n ((b[j + 1] & 0xff) << 8) |\n ((b[j + 0] & 0xff) << 0);\n }\n\n const XY = new Uint32Array(64 * r);\n const V = new Uint32Array(32 * r * N);\n\n const Yi = 32 * r;\n\n // scratch space\n const x = new Uint32Array(16); // salsa20_8\n const _X = new Uint32Array(16); // blockmix_salsa8\n\n const totalOps = p * N * 2;\n let currentOp = 0;\n let lastPercent10 = null;\n\n // Set this to true to abandon the scrypt on the next step\n let stop = false;\n\n // State information\n let state = 0;\n let i0 = 0, i1;\n let Bi;\n\n // How many blockmix_salsa8 can we do per step?\n const limit = callback ? parseInt(1000 / r): 0xffffffff;\n\n // Trick from scrypt-async; if there is a setImmediate shim in place, use it\n const nextTick = (typeof(setImmediate) !== 'undefined') ? setImmediate : setTimeout;\n\n // This is really all I changed; making scryptsy a state machine so we occasionally\n // stop and give other evnts on the evnt loop a chance to run. ~RicMoo\n const incrementalSMix = function() {\n if (stop) {\n return callback(new Error('cancelled'), currentOp / totalOps);\n }\n\n let steps;\n\n switch (state) {\n case 0:\n // for (var i = 0; i < p; i++)...\n Bi = i0 * 32 * r;\n\n arraycopy(B, Bi, XY, 0, Yi); // ROMix - 1\n\n state = 1; // Move to ROMix 2\n i1 = 0;\n\n // Fall through\n\n case 1:\n\n // Run up to 1000 steps of the first inner smix loop\n steps = N - i1;\n if (steps > limit) { steps = limit; }\n for (let i = 0; i < steps; i++) { // ROMix - 2\n arraycopy(XY, 0, V, (i1 + i) * Yi, Yi) // ROMix - 3\n blockmix_salsa8(XY, Yi, r, x, _X); // ROMix - 4\n }\n\n // for (var i = 0; i < N; i++)\n i1 += steps;\n currentOp += steps;\n\n if (callback) {\n // Call the callback with the progress (optionally stopping us)\n const percent10 = parseInt(1000 * currentOp / totalOps);\n if (percent10 !== lastPercent10) {\n stop = callback(null, currentOp / totalOps);\n if (stop) { break; }\n lastPercent10 = percent10;\n }\n }\n\n if (i1 < N) { break; }\n\n i1 = 0; // Move to ROMix 6\n state = 2;\n\n // Fall through\n\n case 2:\n\n // Run up to 1000 steps of the second inner smix loop\n steps = N - i1;\n if (steps > limit) { steps = limit; }\n for (let i = 0; i < steps; i++) { // ROMix - 6\n const offset = (2 * r - 1) * 16; // ROMix - 7\n const j = XY[offset] & (N - 1);\n blockxor(V, j * Yi, XY, Yi); // ROMix - 8 (inner)\n blockmix_salsa8(XY, Yi, r, x, _X); // ROMix - 9 (outer)\n }\n\n // for (var i = 0; i < N; i++)...\n i1 += steps;\n currentOp += steps;\n\n // Call the callback with the progress (optionally stopping us)\n if (callback) {\n const percent10 = parseInt(1000 * currentOp / totalOps);\n if (percent10 !== lastPercent10) {\n stop = callback(null, currentOp / totalOps);\n if (stop) { break; }\n lastPercent10 = percent10;\n }\n }\n\n if (i1 < N) { break; }\n\n arraycopy(XY, 0, B, Bi, Yi); // ROMix - 10\n\n // for (var i = 0; i < p; i++)...\n i0++;\n if (i0 < p) {\n state = 0;\n break;\n }\n\n b = [];\n for (let i = 0; i < B.length; i++) {\n b.push((B[i] >> 0) & 0xff);\n b.push((B[i] >> 8) & 0xff);\n b.push((B[i] >> 16) & 0xff);\n b.push((B[i] >> 24) & 0xff);\n }\n\n const derivedKey = PBKDF2_HMAC_SHA256_OneIter(password, b, dkLen);\n\n // Send the result to the callback\n if (callback) { callback(null, 1.0, derivedKey); }\n\n // Done; don't break (which would reschedule)\n return derivedKey;\n }\n\n // Schedule the next steps\n if (callback) { nextTick(incrementalSMix); }\n }\n\n // Run the smix state machine until completion\n if (!callback) {\n while (true) {\n const derivedKey = incrementalSMix();\n if (derivedKey != undefined) { return derivedKey; }\n }\n }\n\n // Bootstrap the async incremental smix\n incrementalSMix();\n }\n\n const lib = {\n scrypt: function(password, salt, N, r, p, dkLen, progressCallback) {\n return new Promise(function(resolve, reject) {\n let lastProgress = 0;\n if (progressCallback) { progressCallback(0); }\n _scrypt(password, salt, N, r, p, dkLen, function(error, progress, key) {\n if (error) {\n reject(error);\n } else if (key) {\n if (progressCallback && lastProgress !== 1) {\n progressCallback(1);\n }\n resolve(new Uint8Array(key));\n } else if (progressCallback && progress !== lastProgress) {\n lastProgress = progress;\n return progressCallback(progress);\n }\n });\n });\n },\n syncScrypt: function(password, salt, N, r, p, dkLen) {\n return new Uint8Array(_scrypt(password, salt, N, r, p, dkLen));\n }\n };\n\n // node.js\n if (typeof(exports) !== 'undefined') {\n module.exports = lib;\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define(lib);\n\n // Web Browsers\n } else if (root) {\n\n // If there was an existing library \"scrypt\", make sure it is still available\n if (root.scrypt) {\n root._scrypt = root.scrypt;\n }\n\n root.scrypt = lib;\n }\n\n})(this);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deserializeUnchecked = exports.deserialize = exports.serialize = exports.BinaryReader = exports.BinaryWriter = exports.BorshError = exports.baseDecode = exports.baseEncode = void 0;\nconst bn_js_1 = __importDefault(require(\"bn.js\"));\nconst bs58_1 = __importDefault(require(\"bs58\"));\n// TODO: Make sure this polyfill not included when not required\nconst encoding = __importStar(require(\"text-encoding-utf-8\"));\nconst TextDecoder = (typeof global.TextDecoder !== 'function') ? encoding.TextDecoder : global.TextDecoder;\nconst textDecoder = new TextDecoder('utf-8', { fatal: true });\nfunction baseEncode(value) {\n if (typeof (value) === 'string') {\n value = Buffer.from(value, 'utf8');\n }\n return bs58_1.default.encode(Buffer.from(value));\n}\nexports.baseEncode = baseEncode;\nfunction baseDecode(value) {\n return Buffer.from(bs58_1.default.decode(value));\n}\nexports.baseDecode = baseDecode;\nconst INITIAL_LENGTH = 1024;\nclass BorshError extends Error {\n constructor(message) {\n super(message);\n this.fieldPath = [];\n this.originalMessage = message;\n }\n addToFieldPath(fieldName) {\n this.fieldPath.splice(0, 0, fieldName);\n // NOTE: Modifying message directly as jest doesn't use .toString()\n this.message = this.originalMessage + ': ' + this.fieldPath.join('.');\n }\n}\nexports.BorshError = BorshError;\n/// Binary encoder.\nclass BinaryWriter {\n constructor() {\n this.buf = Buffer.alloc(INITIAL_LENGTH);\n this.length = 0;\n }\n maybeResize() {\n if (this.buf.length < 16 + this.length) {\n this.buf = Buffer.concat([this.buf, Buffer.alloc(INITIAL_LENGTH)]);\n }\n }\n writeU8(value) {\n this.maybeResize();\n this.buf.writeUInt8(value, this.length);\n this.length += 1;\n }\n writeU16(value) {\n this.maybeResize();\n this.buf.writeUInt16LE(value, this.length);\n this.length += 2;\n }\n writeU32(value) {\n this.maybeResize();\n this.buf.writeUInt32LE(value, this.length);\n this.length += 4;\n }\n writeU64(value) {\n this.maybeResize();\n this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray('le', 8)));\n }\n writeU128(value) {\n this.maybeResize();\n this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray('le', 16)));\n }\n writeU256(value) {\n this.maybeResize();\n this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray('le', 32)));\n }\n writeU512(value) {\n this.maybeResize();\n this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray('le', 64)));\n }\n writeBuffer(buffer) {\n // Buffer.from is needed as this.buf.subarray can return plain Uint8Array in browser\n this.buf = Buffer.concat([Buffer.from(this.buf.subarray(0, this.length)), buffer, Buffer.alloc(INITIAL_LENGTH)]);\n this.length += buffer.length;\n }\n writeString(str) {\n this.maybeResize();\n const b = Buffer.from(str, 'utf8');\n this.writeU32(b.length);\n this.writeBuffer(b);\n }\n writeFixedArray(array) {\n this.writeBuffer(Buffer.from(array));\n }\n writeArray(array, fn) {\n this.maybeResize();\n this.writeU32(array.length);\n for (const elem of array) {\n this.maybeResize();\n fn(elem);\n }\n }\n toArray() {\n return this.buf.subarray(0, this.length);\n }\n}\nexports.BinaryWriter = BinaryWriter;\nfunction handlingRangeError(target, propertyKey, propertyDescriptor) {\n const originalMethod = propertyDescriptor.value;\n propertyDescriptor.value = function (...args) {\n try {\n return originalMethod.apply(this, args);\n }\n catch (e) {\n if (e instanceof RangeError) {\n const code = e.code;\n if (['ERR_BUFFER_OUT_OF_BOUNDS', 'ERR_OUT_OF_RANGE'].indexOf(code) >= 0) {\n throw new BorshError('Reached the end of buffer when deserializing');\n }\n }\n throw e;\n }\n };\n}\nclass BinaryReader {\n constructor(buf) {\n this.buf = buf;\n this.offset = 0;\n }\n readU8() {\n const value = this.buf.readUInt8(this.offset);\n this.offset += 1;\n return value;\n }\n readU16() {\n const value = this.buf.readUInt16LE(this.offset);\n this.offset += 2;\n return value;\n }\n readU32() {\n const value = this.buf.readUInt32LE(this.offset);\n this.offset += 4;\n return value;\n }\n readU64() {\n const buf = this.readBuffer(8);\n return new bn_js_1.default(buf, 'le');\n }\n readU128() {\n const buf = this.readBuffer(16);\n return new bn_js_1.default(buf, 'le');\n }\n readU256() {\n const buf = this.readBuffer(32);\n return new bn_js_1.default(buf, 'le');\n }\n readU512() {\n const buf = this.readBuffer(64);\n return new bn_js_1.default(buf, 'le');\n }\n readBuffer(len) {\n if ((this.offset + len) > this.buf.length) {\n throw new BorshError(`Expected buffer length ${len} isn't within bounds`);\n }\n const result = this.buf.slice(this.offset, this.offset + len);\n this.offset += len;\n return result;\n }\n readString() {\n const len = this.readU32();\n const buf = this.readBuffer(len);\n try {\n // NOTE: Using TextDecoder to fail on invalid UTF-8\n return textDecoder.decode(buf);\n }\n catch (e) {\n throw new BorshError(`Error decoding UTF-8 string: ${e}`);\n }\n }\n readFixedArray(len) {\n return new Uint8Array(this.readBuffer(len));\n }\n readArray(fn) {\n const len = this.readU32();\n const result = Array();\n for (let i = 0; i < len; ++i) {\n result.push(fn());\n }\n return result;\n }\n}\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readU8\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readU16\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readU32\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readU64\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readU128\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readU256\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readU512\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readString\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readFixedArray\", null);\n__decorate([\n handlingRangeError\n], BinaryReader.prototype, \"readArray\", null);\nexports.BinaryReader = BinaryReader;\nfunction capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\nfunction serializeField(schema, fieldName, value, fieldType, writer) {\n try {\n // TODO: Handle missing values properly (make sure they never result in just skipped write)\n if (typeof fieldType === 'string') {\n writer[`write${capitalizeFirstLetter(fieldType)}`](value);\n }\n else if (fieldType instanceof Array) {\n if (typeof fieldType[0] === 'number') {\n if (value.length !== fieldType[0]) {\n throw new BorshError(`Expecting byte array of length ${fieldType[0]}, but got ${value.length} bytes`);\n }\n writer.writeFixedArray(value);\n }\n else {\n writer.writeArray(value, (item) => { serializeField(schema, fieldName, item, fieldType[0], writer); });\n }\n }\n else if (fieldType.kind !== undefined) {\n switch (fieldType.kind) {\n case 'option': {\n if (value === null || value === undefined) {\n writer.writeU8(0);\n }\n else {\n writer.writeU8(1);\n serializeField(schema, fieldName, value, fieldType.type, writer);\n }\n break;\n }\n default: throw new BorshError(`FieldType ${fieldType} unrecognized`);\n }\n }\n else {\n serializeStruct(schema, value, writer);\n }\n }\n catch (error) {\n if (error instanceof BorshError) {\n error.addToFieldPath(fieldName);\n }\n throw error;\n }\n}\nfunction serializeStruct(schema, obj, writer) {\n const structSchema = schema.get(obj.constructor);\n if (!structSchema) {\n throw new BorshError(`Class ${obj.constructor.name} is missing in schema`);\n }\n if (structSchema.kind === 'struct') {\n structSchema.fields.map(([fieldName, fieldType]) => {\n serializeField(schema, fieldName, obj[fieldName], fieldType, writer);\n });\n }\n else if (structSchema.kind === 'enum') {\n const name = obj[structSchema.field];\n for (let idx = 0; idx < structSchema.values.length; ++idx) {\n const [fieldName, fieldType] = structSchema.values[idx];\n if (fieldName === name) {\n writer.writeU8(idx);\n serializeField(schema, fieldName, obj[fieldName], fieldType, writer);\n break;\n }\n }\n }\n else {\n throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${obj.constructor.name}`);\n }\n}\n/// Serialize given object using schema of the form:\n/// { class_name -> [ [field_name, field_type], .. ], .. }\nfunction serialize(schema, obj) {\n const writer = new BinaryWriter();\n serializeStruct(schema, obj, writer);\n return writer.toArray();\n}\nexports.serialize = serialize;\nfunction deserializeField(schema, fieldName, fieldType, reader) {\n try {\n if (typeof fieldType === 'string') {\n return reader[`read${capitalizeFirstLetter(fieldType)}`]();\n }\n if (fieldType instanceof Array) {\n if (typeof fieldType[0] === 'number') {\n return reader.readFixedArray(fieldType[0]);\n }\n return reader.readArray(() => deserializeField(schema, fieldName, fieldType[0], reader));\n }\n if (fieldType.kind === 'option') {\n const option = reader.readU8();\n if (option) {\n return deserializeField(schema, fieldName, fieldType.type, reader);\n }\n return undefined;\n }\n return deserializeStruct(schema, fieldType, reader);\n }\n catch (error) {\n if (error instanceof BorshError) {\n error.addToFieldPath(fieldName);\n }\n throw error;\n }\n}\nfunction deserializeStruct(schema, classType, reader) {\n const structSchema = schema.get(classType);\n if (!structSchema) {\n throw new BorshError(`Class ${classType.name} is missing in schema`);\n }\n if (structSchema.kind === 'struct') {\n const result = {};\n for (const [fieldName, fieldType] of schema.get(classType).fields) {\n result[fieldName] = deserializeField(schema, fieldName, fieldType, reader);\n }\n return new classType(result);\n }\n if (structSchema.kind === 'enum') {\n const idx = reader.readU8();\n if (idx >= structSchema.values.length) {\n throw new BorshError(`Enum index: ${idx} is out of range`);\n }\n const [fieldName, fieldType] = structSchema.values[idx];\n const fieldValue = deserializeField(schema, fieldName, fieldType, reader);\n return new classType({ [fieldName]: fieldValue });\n }\n throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${classType.constructor.name}`);\n}\n/// Deserializes object from bytes using schema.\nfunction deserialize(schema, classType, buffer) {\n const reader = new BinaryReader(buffer);\n const result = deserializeStruct(schema, classType, reader);\n if (reader.offset < buffer.length) {\n throw new BorshError(`Unexpected ${buffer.length - reader.offset} bytes after deserialized data`);\n }\n return result;\n}\nexports.deserialize = deserialize;\n/// Deserializes object from bytes using schema, without checking the length read\nfunction deserializeUnchecked(schema, classType, buffer) {\n const reader = new BinaryReader(buffer);\n return deserializeStruct(schema, classType, reader);\n}\nexports.deserializeUnchecked = deserializeUnchecked;\n","/*\r\n * toFormat v2.0.0\r\n * Adds a toFormat instance method to big.js or decimal.js\r\n * Copyright (c) 2017 Michael Mclaughlin\r\n * MIT Licence\r\n */\r\n\r\n /*\r\n * Adds a `toFormat` method to `Ctor.prototype` and a `format` object to `Ctor`, where `Ctor` is\r\n * a big number constructor such as `Decimal` (decimal.js) or `Big` (big.js).\r\n */\r\nfunction toFormat(Ctor) {\r\n 'use strict';\r\n\r\n /*\r\n * Returns a string representing the value of this big number in fixed-point notation to `dp`\r\n * decimal places using rounding mode `rm`, and formatted according to the properties of the\r\n * `fmt`, `this.format` and `this.constructor.format` objects, in that order of precedence.\r\n *\r\n * Example:\r\n *\r\n * x = new Decimal('123456789.987654321')\r\n *\r\n * // Add a format object to the constructor...\r\n * Decimal.format = {\r\n * decimalSeparator: '.',\r\n * groupSeparator: ',',\r\n * groupSize: 3,\r\n * secondaryGroupSize: 0,\r\n * fractionGroupSeparator: '', // '\\xA0' non-breaking space\r\n * fractionGroupSize : 0\r\n * }\r\n *\r\n * x.toFormat(); // 123,456,789.987654321\r\n * x.toFormat(2, 1); // 123,456,789.98\r\n *\r\n * // And/or add a format object to the big number itself...\r\n * x.format = {\r\n * decimalSeparator: ',',\r\n * groupSeparator: '',\r\n * }\r\n *\r\n * x.toFormat(); // 123456789,987654321\r\n *\r\n * format = {\r\n * decimalSeparator: '.',\r\n * groupSeparator: ' ',\r\n * groupSize: 3,\r\n * fractionGroupSeparator: ' ', // '\\xA0' non-breaking space\r\n * fractionGroupSize : 5\r\n * }\r\n\r\n * // And/or pass a format object to the method call.\r\n * x.toFormat(format); // 123 456 789.98765 4321\r\n * x.toFormat(4, format); // 123 456 789.9877\r\n * x.toFormat(2, 1, format); // 123 456 789.98\r\n *\r\n * [dp] {number} Decimal places. Integer.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8. (Ignored if using big.js.)\r\n * [fmt] {Object} A format object.\r\n *\r\n */\r\n Ctor.prototype.toFormat = function toFormat(dp, rm, fmt) {\r\n\r\n if (!this.e && this.e !== 0) return this.toString(); // Infinity/NaN\r\n\r\n var arr, g1, g2, i,\r\n u, // undefined\r\n nd, // number of integer digits\r\n intd, // integer digits\r\n intp, // integer part\r\n fracp, // fraction part\r\n dsep, // decimalSeparator\r\n gsep, // groupSeparator\r\n gsize, // groupSize\r\n sgsize, // secondaryGroupSize\r\n fgsep, // fractionGroupSeparator\r\n fgsize, // fractionGroupSize\r\n tfmt = this.format || {},\r\n cfmt = this.constructor.format || {};\r\n\r\n if (dp != u) {\r\n if (typeof dp == 'object') {\r\n fmt = dp;\r\n dp = u;\r\n } else if (rm != u) {\r\n if (typeof rm == 'object') {\r\n fmt = rm;\r\n rm = u;\r\n } else if (typeof fmt != 'object') {\r\n fmt = {};\r\n }\r\n } else {\r\n fmt = {};\r\n }\r\n } else {\r\n fmt = {};\r\n }\r\n\r\n arr = this.toFixed(dp, rm).split('.');\r\n intp = arr[0];\r\n fracp = arr[1];\r\n intd = this.s < 0 ? intp.slice(1) : intp;\r\n nd = intd.length;\r\n\r\n dsep = fmt.decimalSeparator;\r\n if (dsep == u) {\r\n dsep = tfmt.decimalSeparator;\r\n if (dsep == u) {\r\n dsep = cfmt.decimalSeparator;\r\n if (dsep == u) dsep = '.';\r\n }\r\n }\r\n\r\n gsep = fmt.groupSeparator;\r\n if (gsep == u) {\r\n gsep = tfmt.groupSeparator;\r\n if (gsep == u) gsep = cfmt.groupSeparator;\r\n }\r\n\r\n if (gsep) {\r\n gsize = fmt.groupSize;\r\n if (gsize == u) {\r\n gsize = tfmt.groupSize;\r\n if (gsize == u) {\r\n gsize = cfmt.groupSize;\r\n if (gsize == u) gsize = 0;\r\n }\r\n }\r\n\r\n sgsize = fmt.secondaryGroupSize;\r\n if (sgsize == u) {\r\n sgsize = tfmt.secondaryGroupSize;\r\n if (sgsize == u) {\r\n sgsize = cfmt.secondaryGroupSize;\r\n if (sgsize == u) sgsize = 0;\r\n }\r\n }\r\n\r\n if (sgsize) {\r\n g1 = +sgsize;\r\n g2 = +gsize;\r\n nd -= g2;\r\n } else {\r\n g1 = +gsize;\r\n g2 = +sgsize;\r\n }\r\n\r\n if (g1 > 0 && nd > 0) {\r\n i = nd % g1 || g1;\r\n intp = intd.substr(0, i);\r\n for (; i < nd; i += g1) intp += gsep + intd.substr(i, g1);\r\n if (g2 > 0) intp += gsep + intd.slice(i);\r\n if (this.s < 0) intp = '-' + intp;\r\n }\r\n }\r\n\r\n if (fracp) {\r\n fgsep = fmt.fractionGroupSeparator;\r\n if (fgsep == u) {\r\n fgsep = tfmt.fractionGroupSeparator;\r\n if (fgsep == u) fgsep = cfmt.fractionGroupSeparator;\r\n }\r\n\r\n if (fgsep) {\r\n fgsize = fmt.fractionGroupSize;\r\n if (fgsize == u) {\r\n fgsize = tfmt.fractionGroupSize;\r\n if (fgsize == u) {\r\n fgsize = cfmt.fractionGroupSize;\r\n if (fgsize == u) fgsize = 0;\r\n }\r\n }\r\n\r\n fgsize = +fgsize;\r\n\r\n if (fgsize) {\r\n fracp = fracp.replace(new RegExp('\\\\d{' + fgsize + '}\\\\B', 'g'), '$&' + fgsep);\r\n }\r\n }\r\n\r\n return intp + dsep + fracp;\r\n } else {\r\n\r\n return intp;\r\n }\r\n };\r\n\r\n Ctor.format = {\r\n decimalSeparator: '.',\r\n groupSeparator: ',',\r\n groupSize: 3,\r\n secondaryGroupSize: 0,\r\n fractionGroupSeparator: '',\r\n fractionGroupSize: 0\r\n };\r\n\r\n return Ctor;\r\n}\r\n\r\nif (typeof module !== 'undefined' && module.exports) module.exports = toFormat;\r\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","import { concat } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nexport const messagePrefix = \"\\x19Ethereum Signed Message:\\n\";\nexport function hashMessage(message) {\n if (typeof (message) === \"string\") {\n message = toUtf8Bytes(message);\n }\n return keccak256(concat([\n toUtf8Bytes(messagePrefix),\n toUtf8Bytes(String(message.length)),\n message\n ]));\n}\n//# sourceMappingURL=message.js.map","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nexport function decode(textData) {\n textData = atob(textData);\n const data = [];\n for (let i = 0; i < textData.length; i++) {\n data.push(textData.charCodeAt(i));\n }\n return arrayify(data);\n}\nexport function encode(data) {\n data = arrayify(data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64.js.map","import { concat, hexlify } from \"@ethersproject/bytes\";\nimport { nameprep, toUtf8Bytes } from \"@ethersproject/strings\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst Zeros = new Uint8Array(32);\nZeros.fill(0);\nconst Partition = new RegExp(\"^((.*)\\\\.)?([^.]+)$\");\nexport function isValidName(name) {\n try {\n const comps = name.split(\".\");\n for (let i = 0; i < comps.length; i++) {\n if (nameprep(comps[i]).length === 0) {\n throw new Error(\"empty\");\n }\n }\n return true;\n }\n catch (error) { }\n return false;\n}\nexport function namehash(name) {\n /* istanbul ignore if */\n if (typeof (name) !== \"string\") {\n logger.throwArgumentError(\"invalid ENS name; not a string\", \"name\", name);\n }\n let current = name;\n let result = Zeros;\n while (current.length) {\n const partition = current.match(Partition);\n if (partition == null || partition[2] === \"\") {\n logger.throwArgumentError(\"invalid ENS address; missing component\", \"name\", name);\n }\n const label = toUtf8Bytes(nameprep(partition[3]));\n result = keccak256(concat([result, keccak256(label)]));\n current = partition[2] || \"\";\n }\n return hexlify(result);\n}\n//# sourceMappingURL=namehash.js.map","\"use strict\";\nimport { HashZero } from \"@ethersproject/constants\";\nimport { arrayify, concat, hexlify } from \"@ethersproject/bytes\";\nimport { toUtf8Bytes, toUtf8String } from \"./utf8\";\nexport function formatBytes32String(text) {\n // Get the bytes\n const bytes = toUtf8Bytes(text);\n // Check we have room for null-termination\n if (bytes.length > 31) {\n throw new Error(\"bytes32 string must be less than 32 bytes\");\n }\n // Zero-pad (implicitly null-terminates)\n return hexlify(concat([bytes, HashZero]).slice(0, 32));\n}\nexport function parseBytes32String(bytes) {\n const data = arrayify(bytes);\n // Must be 32 bytes with a null-termination\n if (data.length !== 32) {\n throw new Error(\"invalid bytes32 - not 32 bytes long\");\n }\n if (data[31] !== 0) {\n throw new Error(\"invalid bytes32 string - no null terminator\");\n }\n // Find the null termination\n let length = 31;\n while (data[length - 1] === 0) {\n length--;\n }\n // Determine the string value\n return toUtf8String(data.slice(0, length));\n}\n//# sourceMappingURL=bytes32.js.map","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\n\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","'use strict';\n\nvar curves = exports;\n\nvar hash = require('hash.js');\nvar curve = require('./curve');\nvar utils = require('./utils');\n\nvar assert = utils.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new curve.short(options);\n else if (options.type === 'edwards')\n this.curve = new curve.edwards(options);\n else\n this.curve = new curve.mont(options);\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve,\n });\n return curve;\n },\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: hash.sha256,\n gRed: false,\n g: [\n '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811',\n ],\n});\n\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: hash.sha256,\n gRed: false,\n g: [\n 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34',\n ],\n});\n\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: hash.sha256,\n gRed: false,\n g: [\n '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5',\n ],\n});\n\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: hash.sha384,\n gRed: false,\n g: [\n 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n '5502f25d bf55296c 3a545e38 72760ab7',\n '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f',\n ],\n});\n\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: hash.sha512,\n gRed: false,\n g: [\n '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n '3fad0761 353c7086 a272c240 88be9476 9fd16650',\n ],\n});\n\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '9',\n ],\n});\n\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658',\n ],\n});\n\nvar pre;\ntry {\n pre = require('./precomputed/secp256k1');\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: hash.sha256,\n\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3',\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15',\n },\n ],\n\n gRed: false,\n g: [\n '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n pre,\n ],\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Msg = void 0;\nvar msgs_1 = require(\"./bank/msgs\");\nvar msgs_2 = require(\"./distribution/msgs\");\nvar msgs_3 = require(\"./feegrant/msgs\");\nvar msgs_4 = require(\"./gov/msgs\");\nvar msgs_5 = require(\"./market/msgs\");\nvar msgs_6 = require(\"./authz/msgs\");\nvar msgs_7 = require(\"./oracle/msgs\");\nvar msgs_8 = require(\"./slashing/msgs\");\nvar msgs_9 = require(\"./staking/msgs\");\nvar msgs_10 = require(\"./wasm/msgs\");\nvar msgs_11 = require(\"./ibc-transfer/msgs\");\nvar client_1 = require(\"./ibc/msgs/client\");\nvar connection_1 = require(\"./ibc/msgs/connection\");\nvar channel_1 = require(\"./ibc/msgs/channel\");\nvar Msg;\n(function (Msg) {\n function fromAmino(data) {\n switch (data.type) {\n // bank\n case 'bank/MsgSend':\n return msgs_1.MsgSend.fromAmino(data);\n case 'bank/MsgMultiSend':\n return msgs_1.MsgMultiSend.fromAmino(data);\n // distribution\n case 'distribution/MsgModifyWithdrawAddress':\n return msgs_2.MsgSetWithdrawAddress.fromAmino(data);\n case 'distribution/MsgWithdrawDelegationReward':\n return msgs_2.MsgWithdrawDelegatorReward.fromAmino(data);\n case 'distribution/MsgWithdrawValidatorCommission':\n return msgs_2.MsgWithdrawValidatorCommission.fromAmino(data);\n case 'distribution/MsgFundCommunityPool':\n return msgs_2.MsgFundCommunityPool.fromAmino(data);\n // feegrant\n case 'feegrant/MsgGrantAllowance':\n return msgs_3.MsgGrantAllowance.fromAmino(data);\n case 'feegrant/MsgRevokeAllowance':\n return msgs_3.MsgRevokeAllowance.fromAmino(data);\n // gov\n case 'gov/MsgDeposit':\n return msgs_4.MsgDeposit.fromAmino(data);\n case 'gov/MsgSubmitProposal':\n return msgs_4.MsgSubmitProposal.fromAmino(data);\n case 'gov/MsgVote':\n return msgs_4.MsgVote.fromAmino(data);\n case 'gov/MsgVoteWeighted':\n return msgs_4.MsgVoteWeighted.fromAmino(data);\n // market\n case 'market/MsgSwap':\n return msgs_5.MsgSwap.fromAmino(data);\n case 'market/MsgSwapSend':\n return msgs_5.MsgSwapSend.fromAmino(data);\n // msgauth\n case 'msgauth/MsgGrantAuthorization':\n return msgs_6.MsgGrantAuthorization.fromAmino(data);\n case 'msgauth/MsgRevokeAuthorization':\n return msgs_6.MsgRevokeAuthorization.fromAmino(data);\n case 'msgauth/MsgExecAuthorized':\n return msgs_6.MsgExecAuthorized.fromAmino(data);\n // oracle\n case 'oracle/MsgDelegateFeedConsent':\n return msgs_7.MsgDelegateFeedConsent.fromAmino(data);\n case 'oracle/MsgAggregateExchangeRatePrevote':\n return msgs_7.MsgAggregateExchangeRatePrevote.fromAmino(data);\n case 'oracle/MsgAggregateExchangeRateVote':\n return msgs_7.MsgAggregateExchangeRateVote.fromAmino(data);\n // slashing\n case 'slashing/MsgUnjail':\n return msgs_8.MsgUnjail.fromAmino(data);\n // staking\n case 'staking/MsgDelegate':\n return msgs_9.MsgDelegate.fromAmino(data);\n case 'staking/MsgUndelegate':\n return msgs_9.MsgUndelegate.fromAmino(data);\n case 'staking/MsgBeginRedelegate':\n return msgs_9.MsgBeginRedelegate.fromAmino(data);\n case 'staking/MsgCreateValidator':\n return msgs_9.MsgCreateValidator.fromAmino(data);\n case 'staking/MsgEditValidator':\n return msgs_9.MsgEditValidator.fromAmino(data);\n // wasm\n case 'wasm/MsgStoreCode':\n return msgs_10.MsgStoreCode.fromAmino(data);\n case 'wasm/MsgMigrateCode':\n return msgs_10.MsgMigrateCode.fromAmino(data);\n case 'wasm/MsgInstantiateContract':\n return msgs_10.MsgInstantiateContract.fromAmino(data);\n case 'wasm/MsgExecuteContract':\n return msgs_10.MsgExecuteContract.fromAmino(data);\n case 'wasm/MsgMigrateContract':\n return msgs_10.MsgMigrateContract.fromAmino(data);\n case 'wasm/MsgUpdateContractAdmin':\n return msgs_10.MsgUpdateContractAdmin.fromAmino(data);\n case 'wasm/MsgClearContractAdmin':\n return msgs_10.MsgClearContractAdmin.fromAmino(data);\n // ibc-transfer\n case 'cosmos-sdk/MsgTransfer':\n return msgs_11.MsgTransfer.fromAmino(data);\n }\n }\n Msg.fromAmino = fromAmino;\n function fromData(data) {\n switch (data['@type']) {\n // bank\n case '/cosmos.bank.v1beta1.MsgSend':\n return msgs_1.MsgSend.fromData(data);\n case '/cosmos.bank.v1beta1.MsgMultiSend':\n return msgs_1.MsgMultiSend.fromData(data);\n // distribution\n case '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress':\n return msgs_2.MsgSetWithdrawAddress.fromData(data);\n case '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward':\n return msgs_2.MsgWithdrawDelegatorReward.fromData(data);\n case '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission':\n return msgs_2.MsgWithdrawValidatorCommission.fromData(data);\n case '/cosmos.distribution.v1beta1.MsgFundCommunityPool':\n return msgs_2.MsgFundCommunityPool.fromData(data);\n // feegrant\n case '/cosmos.feegrant.v1beta1.MsgGrantAllowance':\n return msgs_3.MsgGrantAllowance.fromData(data);\n case '/cosmos.feegrant.v1beta1.MsgRevokeAllowance':\n return msgs_3.MsgRevokeAllowance.fromData(data);\n // gov\n case '/cosmos.gov.v1beta1.MsgDeposit':\n return msgs_4.MsgDeposit.fromData(data);\n case '/cosmos.gov.v1beta1.MsgSubmitProposal':\n return msgs_4.MsgSubmitProposal.fromData(data);\n case '/cosmos.gov.v1beta1.MsgVote':\n return msgs_4.MsgVote.fromData(data);\n case '/cosmos.gov.v1beta1.MsgVoteWeighted':\n return msgs_4.MsgVoteWeighted.fromData(data);\n // market\n case '/terra.market.v1beta1.MsgSwap':\n return msgs_5.MsgSwap.fromData(data);\n case '/terra.market.v1beta1.MsgSwapSend':\n return msgs_5.MsgSwapSend.fromData(data);\n // authz\n case '/cosmos.authz.v1beta1.MsgGrant':\n return msgs_6.MsgGrantAuthorization.fromData(data);\n case '/cosmos.authz.v1beta1.MsgRevoke':\n return msgs_6.MsgRevokeAuthorization.fromData(data);\n case '/cosmos.authz.v1beta1.MsgExec':\n return msgs_6.MsgExecAuthorized.fromData(data);\n // oracle\n case '/terra.oracle.v1beta1.MsgDelegateFeedConsent':\n return msgs_7.MsgDelegateFeedConsent.fromData(data);\n case '/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote':\n return msgs_7.MsgAggregateExchangeRatePrevote.fromData(data);\n case '/terra.oracle.v1beta1.MsgAggregateExchangeRateVote':\n return msgs_7.MsgAggregateExchangeRateVote.fromData(data);\n // slashing\n case '/cosmos.slashing.v1beta1.MsgUnjail':\n return msgs_8.MsgUnjail.fromData(data);\n // staking\n case '/cosmos.staking.v1beta1.MsgDelegate':\n return msgs_9.MsgDelegate.fromData(data);\n case '/cosmos.staking.v1beta1.MsgUndelegate':\n return msgs_9.MsgUndelegate.fromData(data);\n case '/cosmos.staking.v1beta1.MsgBeginRedelegate':\n return msgs_9.MsgBeginRedelegate.fromData(data);\n case '/cosmos.staking.v1beta1.MsgCreateValidator':\n return msgs_9.MsgCreateValidator.fromData(data);\n case '/cosmos.staking.v1beta1.MsgEditValidator':\n return msgs_9.MsgEditValidator.fromData(data);\n // wasm\n case '/terra.wasm.v1beta1.MsgStoreCode':\n return msgs_10.MsgStoreCode.fromData(data);\n case '/terra.wasm.v1beta1.MsgMigrateCode':\n return msgs_10.MsgMigrateCode.fromData(data);\n case '/terra.wasm.v1beta1.MsgInstantiateContract':\n return msgs_10.MsgInstantiateContract.fromData(data);\n case '/terra.wasm.v1beta1.MsgExecuteContract':\n return msgs_10.MsgExecuteContract.fromData(data);\n case '/terra.wasm.v1beta1.MsgMigrateContract':\n return msgs_10.MsgMigrateContract.fromData(data);\n case '/terra.wasm.v1beta1.MsgUpdateContractAdmin':\n return msgs_10.MsgUpdateContractAdmin.fromData(data);\n case '/terra.wasm.v1beta1.MsgClearContractAdmin':\n return msgs_10.MsgClearContractAdmin.fromData(data);\n // ibc-transfer\n case '/ibc.applications.transfer.v1.MsgTransfer':\n return msgs_11.MsgTransfer.fromData(data);\n // ibc-client\n case '/ibc.core.client.v1.MsgCreateClient':\n return client_1.MsgCreateClient.fromData(data);\n case '/ibc.core.client.v1.MsgUpdateClient':\n return client_1.MsgUpdateClient.fromData(data);\n case '/ibc.core.client.v1.MsgUpgradeClient':\n return client_1.MsgUpgradeClient.fromData(data);\n case '/ibc.core.client.v1.MsgSubmitMisbehaviour':\n return client_1.MsgSubmitMisbehaviour.fromData(data);\n // ibc-connection\n case '/ibc.core.connection.v1.MsgConnectionOpenInit':\n return connection_1.MsgConnectionOpenInit.fromData(data);\n case '/ibc.core.connection.v1.MsgConnectionOpenTry':\n return connection_1.MsgConnectionOpenTry.fromData(data);\n case '/ibc.core.connection.v1.MsgConnectionOpenConfirm':\n return connection_1.MsgConnectionOpenConfirm.fromData(data);\n case '/ibc.core.connection.v1.MsgConnectionOpenAck':\n return connection_1.MsgConnectionOpenAck.fromData(data);\n // ibc-channel\n case '/ibc.core.channel.v1.MsgChannelOpenInit':\n return channel_1.MsgChannelOpenInit.fromData(data);\n case '/ibc.core.channel.v1.MsgChannelOpenTry':\n return channel_1.MsgChannelOpenTry.fromData(data);\n case '/ibc.core.channel.v1.MsgChannelOpenConfirm':\n return channel_1.MsgChannelOpenConfirm.fromData(data);\n case '/ibc.core.channel.v1.MsgChannelOpenAck':\n return channel_1.MsgChannelOpenAck.fromData(data);\n case '/ibc.core.channel.v1.MsgChannelCloseInit':\n return channel_1.MsgChannelCloseInit.fromData(data);\n case '/ibc.core.channel.v1.MsgChannelCloseConfirm':\n return channel_1.MsgChannelCloseConfirm.fromData(data);\n case '/ibc.core.channel.v1.MsgRecvPacket':\n return channel_1.MsgRecvPacket.fromData(data);\n case '/ibc.core.channel.v1.MsgAcknowledgement':\n return channel_1.MsgAcknowledgement.fromData(data);\n case '/ibc.core.channel.v1.MsgTimeout':\n return channel_1.MsgTimeout.fromData(data);\n case '/ibc.core.channel.v1.MsgTimeoutOnClose':\n return channel_1.MsgTimeoutOnClose.fromData(data);\n }\n }\n Msg.fromData = fromData;\n function fromProto(proto) {\n switch (proto.typeUrl) {\n // bank\n case '/cosmos.bank.v1beta1.MsgSend':\n return msgs_1.MsgSend.unpackAny(proto);\n case '/cosmos.bank.v1beta1.MsgMultiSend':\n return msgs_1.MsgMultiSend.unpackAny(proto);\n // distribution\n case '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress':\n return msgs_2.MsgSetWithdrawAddress.unpackAny(proto);\n case '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward':\n return msgs_2.MsgWithdrawDelegatorReward.unpackAny(proto);\n case '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission':\n return msgs_2.MsgWithdrawValidatorCommission.unpackAny(proto);\n case '/cosmos.distribution.v1beta1.MsgFundCommunityPool':\n return msgs_2.MsgFundCommunityPool.unpackAny(proto);\n // feegrant\n case '/cosmos.feegrant.v1beta1.MsgGrantAllowance':\n return msgs_3.MsgGrantAllowance.unpackAny(proto);\n case '/cosmos.feegrant.v1beta1.MsgRevokeAllowance':\n return msgs_3.MsgRevokeAllowance.unpackAny(proto);\n // gov\n case '/cosmos.gov.v1beta1.MsgDeposit':\n return msgs_4.MsgDeposit.unpackAny(proto);\n case '/cosmos.gov.v1beta1.MsgSubmitProposal':\n return msgs_4.MsgSubmitProposal.unpackAny(proto);\n case '/cosmos.gov.v1beta1.MsgVote':\n return msgs_4.MsgVote.unpackAny(proto);\n // market\n case '/terra.market.v1beta1.MsgSwap':\n return msgs_5.MsgSwap.unpackAny(proto);\n case '/terra.market.v1beta1.MsgSwapSend':\n return msgs_5.MsgSwapSend.unpackAny(proto);\n // authz\n case '/cosmos.authz.v1beta1.MsgGrant':\n return msgs_6.MsgGrantAuthorization.unpackAny(proto);\n case '/cosmos.authz.v1beta1.MsgRevoke':\n return msgs_6.MsgRevokeAuthorization.unpackAny(proto);\n case '/cosmos.authz.v1beta1.MsgExec':\n return msgs_6.MsgExecAuthorized.unpackAny(proto);\n // oracle\n case '/terra.oracle.v1beta1.MsgDelegateFeedConsent':\n return msgs_7.MsgDelegateFeedConsent.unpackAny(proto);\n case '/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote':\n return msgs_7.MsgAggregateExchangeRatePrevote.unpackAny(proto);\n case '/terra.oracle.v1beta1.MsgAggregateExchangeRateVote':\n return msgs_7.MsgAggregateExchangeRateVote.unpackAny(proto);\n // slashing\n case '/cosmos.slashing.v1beta1.MsgUnjail':\n return msgs_8.MsgUnjail.unpackAny(proto);\n // staking\n case '/cosmos.staking.v1beta1.MsgDelegate':\n return msgs_9.MsgDelegate.unpackAny(proto);\n case '/cosmos.staking.v1beta1.MsgUndelegate':\n return msgs_9.MsgUndelegate.unpackAny(proto);\n case '/cosmos.staking.v1beta1.MsgBeginRedelegate':\n return msgs_9.MsgBeginRedelegate.unpackAny(proto);\n case '/cosmos.staking.v1beta1.MsgCreateValidator':\n return msgs_9.MsgCreateValidator.unpackAny(proto);\n case '/cosmos.staking.v1beta1.MsgEditValidator':\n return msgs_9.MsgEditValidator.unpackAny(proto);\n // wasm\n case '/terra.wasm.v1beta1.MsgStoreCode':\n return msgs_10.MsgStoreCode.unpackAny(proto);\n case '/terra.wasm.v1beta1.MsgMigrateCode':\n return msgs_10.MsgMigrateCode.unpackAny(proto);\n case '/terra.wasm.v1beta1.MsgInstantiateContract':\n return msgs_10.MsgInstantiateContract.unpackAny(proto);\n case '/terra.wasm.v1beta1.MsgExecuteContract':\n return msgs_10.MsgExecuteContract.unpackAny(proto);\n case '/terra.wasm.v1beta1.MsgMigrateContract':\n return msgs_10.MsgMigrateContract.unpackAny(proto);\n case '/terra.wasm.v1beta1.MsgUpdateContractAdmin':\n return msgs_10.MsgUpdateContractAdmin.unpackAny(proto);\n case '/terra.wasm.v1beta1.MsgClearContractAdmin':\n return msgs_10.MsgClearContractAdmin.unpackAny(proto);\n // ibc-transfer\n case '/ibc.applications.transfer.v1.MsgTransfer':\n return msgs_11.MsgTransfer.unpackAny(proto);\n // ibc-client\n case '/ibc.core.client.v1.MsgCreateClient':\n return client_1.MsgCreateClient.unpackAny(proto);\n case '/ibc.core.client.v1.MsgUpdateClient':\n return client_1.MsgUpdateClient.unpackAny(proto);\n case '/ibc.core.client.v1.MsgUpgradeClient':\n return client_1.MsgUpgradeClient.unpackAny(proto);\n case '/ibc.core.client.v1.MsgSubmitMisbehaviour':\n return client_1.MsgSubmitMisbehaviour.unpackAny(proto);\n // ibc-connection\n case '/ibc.core.connection.v1.MsgConnectionOpenInit':\n return connection_1.MsgConnectionOpenInit.unpackAny(proto);\n case '/ibc.core.connection.v1.MsgConnectionOpenTry':\n return connection_1.MsgConnectionOpenTry.unpackAny(proto);\n case '/ibc.core.connection.v1.MsgConnectionOpenConfirm':\n return connection_1.MsgConnectionOpenConfirm.unpackAny(proto);\n case '/ibc.core.connection.v1.MsgConnectionOpenAck':\n return connection_1.MsgConnectionOpenAck.unpackAny(proto);\n // ibc-channel\n case '/ibc.core.channel.v1.MsgChannelOpenInit':\n return channel_1.MsgChannelOpenInit.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgChannelOpenTry':\n return channel_1.MsgChannelOpenTry.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgChannelOpenConfirm':\n return channel_1.MsgChannelOpenConfirm.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgChannelOpenAck':\n return channel_1.MsgChannelOpenAck.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgChannelCloseInit':\n return channel_1.MsgChannelCloseInit.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgChannelCloseConfirm':\n return channel_1.MsgChannelCloseConfirm.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgRecvPacket':\n return channel_1.MsgRecvPacket.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgAcknowledgement':\n return channel_1.MsgAcknowledgement.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgTimeout':\n return channel_1.MsgTimeout.unpackAny(proto);\n case '/ibc.core.channel.v1.MsgTimeoutOnClose':\n return channel_1.MsgTimeoutOnClose.unpackAny(proto);\n default:\n throw Error(\"not supported msg \" + proto.typeUrl);\n }\n }\n Msg.fromProto = fromProto;\n})(Msg = exports.Msg || (exports.Msg = {}));\n//# sourceMappingURL=Msg.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Grant = exports.AllowedMsgAllowance = exports.PeriodicAllowance = exports.BasicAllowance = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst duration_1 = require(\"../../../google/protobuf/duration\");\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst timestamp_1 = require(\"../../../google/protobuf/timestamp\");\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"cosmos.feegrant.v1beta1\";\nconst baseBasicAllowance = {};\nexports.BasicAllowance = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.spendLimit) {\n coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (message.expiration !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseBasicAllowance);\n message.spendLimit = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.spendLimit.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 2:\n message.expiration = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseBasicAllowance);\n message.spendLimit = [];\n if (object.spendLimit !== undefined && object.spendLimit !== null) {\n for (const e of object.spendLimit) {\n message.spendLimit.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.expiration !== undefined && object.expiration !== null) {\n message.expiration = fromJsonTimestamp(object.expiration);\n }\n else {\n message.expiration = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.spendLimit) {\n obj.spendLimit = message.spendLimit.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.spendLimit = [];\n }\n message.expiration !== undefined && (obj.expiration = message.expiration.toISOString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseBasicAllowance);\n message.spendLimit = [];\n if (object.spendLimit !== undefined && object.spendLimit !== null) {\n for (const e of object.spendLimit) {\n message.spendLimit.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.expiration !== undefined && object.expiration !== null) {\n message.expiration = object.expiration;\n }\n else {\n message.expiration = undefined;\n }\n return message;\n },\n};\nconst basePeriodicAllowance = {};\nexports.PeriodicAllowance = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.basic !== undefined) {\n exports.BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim();\n }\n if (message.period !== undefined) {\n duration_1.Duration.encode(message.period, writer.uint32(18).fork()).ldelim();\n }\n for (const v of message.periodSpendLimit) {\n coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();\n }\n for (const v of message.periodCanSpend) {\n coin_1.Coin.encode(v, writer.uint32(34).fork()).ldelim();\n }\n if (message.periodReset !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.periodReset), writer.uint32(42).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePeriodicAllowance);\n message.periodSpendLimit = [];\n message.periodCanSpend = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.basic = exports.BasicAllowance.decode(reader, reader.uint32());\n break;\n case 2:\n message.period = duration_1.Duration.decode(reader, reader.uint32());\n break;\n case 3:\n message.periodSpendLimit.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 4:\n message.periodCanSpend.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 5:\n message.periodReset = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePeriodicAllowance);\n message.periodSpendLimit = [];\n message.periodCanSpend = [];\n if (object.basic !== undefined && object.basic !== null) {\n message.basic = exports.BasicAllowance.fromJSON(object.basic);\n }\n else {\n message.basic = undefined;\n }\n if (object.period !== undefined && object.period !== null) {\n message.period = duration_1.Duration.fromJSON(object.period);\n }\n else {\n message.period = undefined;\n }\n if (object.periodSpendLimit !== undefined && object.periodSpendLimit !== null) {\n for (const e of object.periodSpendLimit) {\n message.periodSpendLimit.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.periodCanSpend !== undefined && object.periodCanSpend !== null) {\n for (const e of object.periodCanSpend) {\n message.periodCanSpend.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.periodReset !== undefined && object.periodReset !== null) {\n message.periodReset = fromJsonTimestamp(object.periodReset);\n }\n else {\n message.periodReset = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.basic !== undefined &&\n (obj.basic = message.basic ? exports.BasicAllowance.toJSON(message.basic) : undefined);\n message.period !== undefined &&\n (obj.period = message.period ? duration_1.Duration.toJSON(message.period) : undefined);\n if (message.periodSpendLimit) {\n obj.periodSpendLimit = message.periodSpendLimit.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.periodSpendLimit = [];\n }\n if (message.periodCanSpend) {\n obj.periodCanSpend = message.periodCanSpend.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.periodCanSpend = [];\n }\n message.periodReset !== undefined && (obj.periodReset = message.periodReset.toISOString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePeriodicAllowance);\n message.periodSpendLimit = [];\n message.periodCanSpend = [];\n if (object.basic !== undefined && object.basic !== null) {\n message.basic = exports.BasicAllowance.fromPartial(object.basic);\n }\n else {\n message.basic = undefined;\n }\n if (object.period !== undefined && object.period !== null) {\n message.period = duration_1.Duration.fromPartial(object.period);\n }\n else {\n message.period = undefined;\n }\n if (object.periodSpendLimit !== undefined && object.periodSpendLimit !== null) {\n for (const e of object.periodSpendLimit) {\n message.periodSpendLimit.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.periodCanSpend !== undefined && object.periodCanSpend !== null) {\n for (const e of object.periodCanSpend) {\n message.periodCanSpend.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.periodReset !== undefined && object.periodReset !== null) {\n message.periodReset = object.periodReset;\n }\n else {\n message.periodReset = undefined;\n }\n return message;\n },\n};\nconst baseAllowedMsgAllowance = { allowedMessages: \"\" };\nexports.AllowedMsgAllowance = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.allowance !== undefined) {\n any_1.Any.encode(message.allowance, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.allowedMessages) {\n writer.uint32(18).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseAllowedMsgAllowance);\n message.allowedMessages = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.allowance = any_1.Any.decode(reader, reader.uint32());\n break;\n case 2:\n message.allowedMessages.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseAllowedMsgAllowance);\n message.allowedMessages = [];\n if (object.allowance !== undefined && object.allowance !== null) {\n message.allowance = any_1.Any.fromJSON(object.allowance);\n }\n else {\n message.allowance = undefined;\n }\n if (object.allowedMessages !== undefined && object.allowedMessages !== null) {\n for (const e of object.allowedMessages) {\n message.allowedMessages.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.allowance !== undefined &&\n (obj.allowance = message.allowance ? any_1.Any.toJSON(message.allowance) : undefined);\n if (message.allowedMessages) {\n obj.allowedMessages = message.allowedMessages.map((e) => e);\n }\n else {\n obj.allowedMessages = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseAllowedMsgAllowance);\n message.allowedMessages = [];\n if (object.allowance !== undefined && object.allowance !== null) {\n message.allowance = any_1.Any.fromPartial(object.allowance);\n }\n else {\n message.allowance = undefined;\n }\n if (object.allowedMessages !== undefined && object.allowedMessages !== null) {\n for (const e of object.allowedMessages) {\n message.allowedMessages.push(e);\n }\n }\n return message;\n },\n};\nconst baseGrant = { granter: \"\", grantee: \"\" };\nexports.Grant = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.granter !== \"\") {\n writer.uint32(10).string(message.granter);\n }\n if (message.grantee !== \"\") {\n writer.uint32(18).string(message.grantee);\n }\n if (message.allowance !== undefined) {\n any_1.Any.encode(message.allowance, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseGrant);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.granter = reader.string();\n break;\n case 2:\n message.grantee = reader.string();\n break;\n case 3:\n message.allowance = any_1.Any.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseGrant);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = String(object.granter);\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = String(object.grantee);\n }\n else {\n message.grantee = \"\";\n }\n if (object.allowance !== undefined && object.allowance !== null) {\n message.allowance = any_1.Any.fromJSON(object.allowance);\n }\n else {\n message.allowance = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.granter !== undefined && (obj.granter = message.granter);\n message.grantee !== undefined && (obj.grantee = message.grantee);\n message.allowance !== undefined &&\n (obj.allowance = message.allowance ? any_1.Any.toJSON(message.allowance) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseGrant);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = object.granter;\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = object.grantee;\n }\n else {\n message.grantee = \"\";\n }\n if (object.allowance !== undefined && object.allowance !== null) {\n message.allowance = any_1.Any.fromPartial(object.allowance);\n }\n else {\n message.allowance = undefined;\n }\n return message;\n },\n};\nfunction toTimestamp(date) {\n const seconds = numberToLong(date.getTime() / 1000);\n const nanos = (date.getTime() % 1000) * 1000000;\n return { seconds, nanos };\n}\nfunction fromTimestamp(t) {\n let millis = t.seconds.toNumber() * 1000;\n millis += t.nanos / 1000000;\n return new Date(millis);\n}\nfunction fromJsonTimestamp(o) {\n if (o instanceof Date) {\n return o;\n }\n else if (typeof o === \"string\") {\n return new Date(o);\n }\n else {\n return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));\n }\n}\nfunction numberToLong(number) {\n return long_1.default.fromNumber(number);\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=feegrant.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PeriodicAllowance = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\nvar BasicAllowance_1 = require(\"./BasicAllowance\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar feegrant_1 = require(\"@terra-money/terra.proto/cosmos/feegrant/v1beta1/feegrant\");\nvar Long = __importStar(require(\"long\"));\n/**\n * PeriodicAllowance extends Allowance to allow for both a maximum cap,\n * as well as a limit per time period.\n */\nvar PeriodicAllowance = /** @class */ (function (_super) {\n __extends(PeriodicAllowance, _super);\n /**\n * @param basic basic allowance given per period\n * @param period the time duration in which period_spend_limit coins can be spent before that allowance is reset\n * @param period_spend_limit the maximum number of coins that can be spent in the period\n * @param period_can_spend the number of coins left to be spent before the period_reset time\n * @param period_reset the time at which this period resets and a new one begins\n */\n function PeriodicAllowance(basic, period, period_spend_limit, period_can_spend, period_reset) {\n var _this = _super.call(this) || this;\n _this.basic = basic;\n _this.period = period;\n _this.period_reset = period_reset;\n _this.period_spend_limit = new Coins_1.Coins(period_spend_limit);\n _this.period_can_spend = new Coins_1.Coins(period_can_spend);\n return _this;\n }\n PeriodicAllowance.fromAmino = function (data) {\n var _a = data.value, basic = _a.basic, period = _a.period, period_spend_limit = _a.period_spend_limit, period_can_spend = _a.period_can_spend, period_reset = _a.period_reset;\n return new PeriodicAllowance(BasicAllowance_1.BasicAllowance.fromAmino(basic), Number.parseInt(period), Coins_1.Coins.fromAmino(period_spend_limit), Coins_1.Coins.fromAmino(period_can_spend), new Date(period_reset));\n };\n PeriodicAllowance.prototype.toAmino = function () {\n var _a = this, basic = _a.basic, period = _a.period, period_spend_limit = _a.period_spend_limit, period_can_spend = _a.period_can_spend, period_reset = _a.period_reset;\n return {\n type: 'feegrant/PeriodicAllowance',\n value: {\n basic: basic.toAmino(),\n period: period.toString(),\n period_spend_limit: period_spend_limit.toAmino(),\n period_can_spend: period_can_spend.toAmino(),\n period_reset: period_reset.toISOString().replace(/\\.000Z$/, 'Z'),\n },\n };\n };\n PeriodicAllowance.fromData = function (proto) {\n var basic = proto.basic, period = proto.period, period_spend_limit = proto.period_spend_limit, period_can_spend = proto.period_can_spend, period_reset = proto.period_reset;\n return new PeriodicAllowance(BasicAllowance_1.BasicAllowance.fromData(basic), Number.parseInt(period), Coins_1.Coins.fromData(period_spend_limit), Coins_1.Coins.fromData(period_can_spend), new Date(period_reset));\n };\n PeriodicAllowance.prototype.toData = function () {\n var _a = this, basic = _a.basic, period = _a.period, period_spend_limit = _a.period_spend_limit, period_can_spend = _a.period_can_spend, period_reset = _a.period_reset;\n return {\n '@type': '/cosmos.feegrant.v1beta1.PeriodicAllowance',\n basic: basic.toData(),\n period: period.toString(),\n period_spend_limit: period_spend_limit.toData(),\n period_can_spend: period_can_spend.toData(),\n period_reset: period_reset.toISOString().replace(/\\.000Z$/, 'Z'),\n };\n };\n PeriodicAllowance.fromProto = function (proto) {\n var _a;\n return new PeriodicAllowance(BasicAllowance_1.BasicAllowance.fromProto(proto.basic), (_a = proto.period) === null || _a === void 0 ? void 0 : _a.seconds.toNumber(), Coins_1.Coins.fromProto(proto.periodSpendLimit), Coins_1.Coins.fromProto(proto.periodCanSpend), proto.periodReset);\n };\n PeriodicAllowance.prototype.toProto = function () {\n var _a = this, basic = _a.basic, period = _a.period, period_spend_limit = _a.period_spend_limit, period_can_spend = _a.period_can_spend, period_reset = _a.period_reset;\n return feegrant_1.PeriodicAllowance.fromPartial({\n basic: basic,\n period: { seconds: Long.fromNumber(period) },\n periodCanSpend: period_can_spend.toProto(),\n periodReset: period_reset,\n periodSpendLimit: period_spend_limit.toProto(),\n });\n };\n PeriodicAllowance.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.feegrant.v1beta1.PeriodicAllowance',\n value: feegrant_1.PeriodicAllowance.encode(this.toProto()).finish(),\n });\n };\n PeriodicAllowance.unpackAny = function (msgAny) {\n return PeriodicAllowance.fromProto(feegrant_1.PeriodicAllowance.decode(msgAny.value));\n };\n return PeriodicAllowance;\n}(json_1.JSONSerializable));\nexports.PeriodicAllowance = PeriodicAllowance;\n//# sourceMappingURL=PeriodicAllowance.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./StakeAuthorization\"), exports);\n__exportStar(require(\"./SendAuthorization\"), exports);\n__exportStar(require(\"./GenericAuthorization\"), exports);\n__exportStar(require(\"./Authorization\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Grant = exports.GenericAuthorization = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../google/protobuf/any\");\nconst timestamp_1 = require(\"../../../google/protobuf/timestamp\");\nexports.protobufPackage = \"cosmos.authz.v1beta1\";\nconst baseGenericAuthorization = { msg: \"\" };\nexports.GenericAuthorization = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.msg !== \"\") {\n writer.uint32(10).string(message.msg);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseGenericAuthorization);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.msg = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseGenericAuthorization);\n if (object.msg !== undefined && object.msg !== null) {\n message.msg = String(object.msg);\n }\n else {\n message.msg = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.msg !== undefined && (obj.msg = message.msg);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseGenericAuthorization);\n if (object.msg !== undefined && object.msg !== null) {\n message.msg = object.msg;\n }\n else {\n message.msg = \"\";\n }\n return message;\n },\n};\nconst baseGrant = {};\nexports.Grant = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.authorization !== undefined) {\n any_1.Any.encode(message.authorization, writer.uint32(10).fork()).ldelim();\n }\n if (message.expiration !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseGrant);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.authorization = any_1.Any.decode(reader, reader.uint32());\n break;\n case 2:\n message.expiration = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseGrant);\n if (object.authorization !== undefined && object.authorization !== null) {\n message.authorization = any_1.Any.fromJSON(object.authorization);\n }\n else {\n message.authorization = undefined;\n }\n if (object.expiration !== undefined && object.expiration !== null) {\n message.expiration = fromJsonTimestamp(object.expiration);\n }\n else {\n message.expiration = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.authorization !== undefined &&\n (obj.authorization = message.authorization ? any_1.Any.toJSON(message.authorization) : undefined);\n message.expiration !== undefined && (obj.expiration = message.expiration.toISOString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseGrant);\n if (object.authorization !== undefined && object.authorization !== null) {\n message.authorization = any_1.Any.fromPartial(object.authorization);\n }\n else {\n message.authorization = undefined;\n }\n if (object.expiration !== undefined && object.expiration !== null) {\n message.expiration = object.expiration;\n }\n else {\n message.expiration = undefined;\n }\n return message;\n },\n};\nfunction toTimestamp(date) {\n const seconds = numberToLong(date.getTime() / 1000);\n const nanos = (date.getTime() % 1000) * 1000000;\n return { seconds, nanos };\n}\nfunction fromTimestamp(t) {\n let millis = t.seconds.toNumber() * 1000;\n millis += t.nanos / 1000000;\n return new Date(millis);\n}\nfunction fromJsonTimestamp(o) {\n if (o instanceof Date) {\n return o;\n }\n else if (typeof o === \"string\") {\n return new Date(o);\n }\n else {\n return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));\n }\n}\nfunction numberToLong(number) {\n return long_1.default.fromNumber(number);\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=authz.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgRevokeResponse = exports.MsgRevoke = exports.MsgGrantResponse = exports.MsgExec = exports.MsgExecResponse = exports.MsgGrant = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst authz_1 = require(\"../../../cosmos/authz/v1beta1/authz\");\nconst any_1 = require(\"../../../google/protobuf/any\");\nexports.protobufPackage = \"cosmos.authz.v1beta1\";\nconst baseMsgGrant = { granter: \"\", grantee: \"\" };\nexports.MsgGrant = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.granter !== \"\") {\n writer.uint32(10).string(message.granter);\n }\n if (message.grantee !== \"\") {\n writer.uint32(18).string(message.grantee);\n }\n if (message.grant !== undefined) {\n authz_1.Grant.encode(message.grant, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgGrant);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.granter = reader.string();\n break;\n case 2:\n message.grantee = reader.string();\n break;\n case 3:\n message.grant = authz_1.Grant.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgGrant);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = String(object.granter);\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = String(object.grantee);\n }\n else {\n message.grantee = \"\";\n }\n if (object.grant !== undefined && object.grant !== null) {\n message.grant = authz_1.Grant.fromJSON(object.grant);\n }\n else {\n message.grant = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.granter !== undefined && (obj.granter = message.granter);\n message.grantee !== undefined && (obj.grantee = message.grantee);\n message.grant !== undefined && (obj.grant = message.grant ? authz_1.Grant.toJSON(message.grant) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgGrant);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = object.granter;\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = object.grantee;\n }\n else {\n message.grantee = \"\";\n }\n if (object.grant !== undefined && object.grant !== null) {\n message.grant = authz_1.Grant.fromPartial(object.grant);\n }\n else {\n message.grant = undefined;\n }\n return message;\n },\n};\nconst baseMsgExecResponse = {};\nexports.MsgExecResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.results) {\n writer.uint32(10).bytes(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgExecResponse);\n message.results = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.results.push(reader.bytes());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgExecResponse);\n message.results = [];\n if (object.results !== undefined && object.results !== null) {\n for (const e of object.results) {\n message.results.push(bytesFromBase64(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.results) {\n obj.results = message.results.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));\n }\n else {\n obj.results = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgExecResponse);\n message.results = [];\n if (object.results !== undefined && object.results !== null) {\n for (const e of object.results) {\n message.results.push(e);\n }\n }\n return message;\n },\n};\nconst baseMsgExec = { grantee: \"\" };\nexports.MsgExec = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.grantee !== \"\") {\n writer.uint32(10).string(message.grantee);\n }\n for (const v of message.msgs) {\n any_1.Any.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgExec);\n message.msgs = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.grantee = reader.string();\n break;\n case 2:\n message.msgs.push(any_1.Any.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgExec);\n message.msgs = [];\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = String(object.grantee);\n }\n else {\n message.grantee = \"\";\n }\n if (object.msgs !== undefined && object.msgs !== null) {\n for (const e of object.msgs) {\n message.msgs.push(any_1.Any.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.grantee !== undefined && (obj.grantee = message.grantee);\n if (message.msgs) {\n obj.msgs = message.msgs.map((e) => (e ? any_1.Any.toJSON(e) : undefined));\n }\n else {\n obj.msgs = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgExec);\n message.msgs = [];\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = object.grantee;\n }\n else {\n message.grantee = \"\";\n }\n if (object.msgs !== undefined && object.msgs !== null) {\n for (const e of object.msgs) {\n message.msgs.push(any_1.Any.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseMsgGrantResponse = {};\nexports.MsgGrantResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgGrantResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgGrantResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgGrantResponse);\n return message;\n },\n};\nconst baseMsgRevoke = { granter: \"\", grantee: \"\", msgTypeUrl: \"\" };\nexports.MsgRevoke = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.granter !== \"\") {\n writer.uint32(10).string(message.granter);\n }\n if (message.grantee !== \"\") {\n writer.uint32(18).string(message.grantee);\n }\n if (message.msgTypeUrl !== \"\") {\n writer.uint32(26).string(message.msgTypeUrl);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgRevoke);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.granter = reader.string();\n break;\n case 2:\n message.grantee = reader.string();\n break;\n case 3:\n message.msgTypeUrl = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgRevoke);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = String(object.granter);\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = String(object.grantee);\n }\n else {\n message.grantee = \"\";\n }\n if (object.msgTypeUrl !== undefined && object.msgTypeUrl !== null) {\n message.msgTypeUrl = String(object.msgTypeUrl);\n }\n else {\n message.msgTypeUrl = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.granter !== undefined && (obj.granter = message.granter);\n message.grantee !== undefined && (obj.grantee = message.grantee);\n message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgRevoke);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = object.granter;\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = object.grantee;\n }\n else {\n message.grantee = \"\";\n }\n if (object.msgTypeUrl !== undefined && object.msgTypeUrl !== null) {\n message.msgTypeUrl = object.msgTypeUrl;\n }\n else {\n message.msgTypeUrl = \"\";\n }\n return message;\n },\n};\nconst baseMsgRevokeResponse = {};\nexports.MsgRevokeResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgRevokeResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgRevokeResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgRevokeResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.Grant = this.Grant.bind(this);\n this.Exec = this.Exec.bind(this);\n this.Revoke = this.Revoke.bind(this);\n }\n Grant(request) {\n const data = exports.MsgGrant.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.authz.v1beta1.Msg\", \"Grant\", data);\n return promise.then((data) => exports.MsgGrantResponse.decode(new minimal_1.default.Reader(data)));\n }\n Exec(request) {\n const data = exports.MsgExec.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.authz.v1beta1.Msg\", \"Exec\", data);\n return promise.then((data) => exports.MsgExecResponse.decode(new minimal_1.default.Reader(data)));\n }\n Revoke(request) {\n const data = exports.MsgRevoke.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.authz.v1beta1.Msg\", \"Revoke\", data);\n return promise.then((data) => exports.MsgRevokeResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgDelegateFeedConsentResponse = exports.MsgDelegateFeedConsent = exports.MsgAggregateExchangeRateVoteResponse = exports.MsgAggregateExchangeRateVote = exports.MsgAggregateExchangeRatePrevoteResponse = exports.MsgAggregateExchangeRatePrevote = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"terra.oracle.v1beta1\";\nconst baseMsgAggregateExchangeRatePrevote = { hash: \"\", feeder: \"\", validator: \"\" };\nexports.MsgAggregateExchangeRatePrevote = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.hash !== \"\") {\n writer.uint32(10).string(message.hash);\n }\n if (message.feeder !== \"\") {\n writer.uint32(18).string(message.feeder);\n }\n if (message.validator !== \"\") {\n writer.uint32(26).string(message.validator);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgAggregateExchangeRatePrevote);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.hash = reader.string();\n break;\n case 2:\n message.feeder = reader.string();\n break;\n case 3:\n message.validator = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgAggregateExchangeRatePrevote);\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = String(object.hash);\n }\n else {\n message.hash = \"\";\n }\n if (object.feeder !== undefined && object.feeder !== null) {\n message.feeder = String(object.feeder);\n }\n else {\n message.feeder = \"\";\n }\n if (object.validator !== undefined && object.validator !== null) {\n message.validator = String(object.validator);\n }\n else {\n message.validator = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.hash !== undefined && (obj.hash = message.hash);\n message.feeder !== undefined && (obj.feeder = message.feeder);\n message.validator !== undefined && (obj.validator = message.validator);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgAggregateExchangeRatePrevote);\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = object.hash;\n }\n else {\n message.hash = \"\";\n }\n if (object.feeder !== undefined && object.feeder !== null) {\n message.feeder = object.feeder;\n }\n else {\n message.feeder = \"\";\n }\n if (object.validator !== undefined && object.validator !== null) {\n message.validator = object.validator;\n }\n else {\n message.validator = \"\";\n }\n return message;\n },\n};\nconst baseMsgAggregateExchangeRatePrevoteResponse = {};\nexports.MsgAggregateExchangeRatePrevoteResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgAggregateExchangeRatePrevoteResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgAggregateExchangeRatePrevoteResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgAggregateExchangeRatePrevoteResponse);\n return message;\n },\n};\nconst baseMsgAggregateExchangeRateVote = { salt: \"\", exchangeRates: \"\", feeder: \"\", validator: \"\" };\nexports.MsgAggregateExchangeRateVote = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.salt !== \"\") {\n writer.uint32(10).string(message.salt);\n }\n if (message.exchangeRates !== \"\") {\n writer.uint32(18).string(message.exchangeRates);\n }\n if (message.feeder !== \"\") {\n writer.uint32(26).string(message.feeder);\n }\n if (message.validator !== \"\") {\n writer.uint32(34).string(message.validator);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgAggregateExchangeRateVote);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.salt = reader.string();\n break;\n case 2:\n message.exchangeRates = reader.string();\n break;\n case 3:\n message.feeder = reader.string();\n break;\n case 4:\n message.validator = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgAggregateExchangeRateVote);\n if (object.salt !== undefined && object.salt !== null) {\n message.salt = String(object.salt);\n }\n else {\n message.salt = \"\";\n }\n if (object.exchangeRates !== undefined && object.exchangeRates !== null) {\n message.exchangeRates = String(object.exchangeRates);\n }\n else {\n message.exchangeRates = \"\";\n }\n if (object.feeder !== undefined && object.feeder !== null) {\n message.feeder = String(object.feeder);\n }\n else {\n message.feeder = \"\";\n }\n if (object.validator !== undefined && object.validator !== null) {\n message.validator = String(object.validator);\n }\n else {\n message.validator = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.salt !== undefined && (obj.salt = message.salt);\n message.exchangeRates !== undefined && (obj.exchangeRates = message.exchangeRates);\n message.feeder !== undefined && (obj.feeder = message.feeder);\n message.validator !== undefined && (obj.validator = message.validator);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgAggregateExchangeRateVote);\n if (object.salt !== undefined && object.salt !== null) {\n message.salt = object.salt;\n }\n else {\n message.salt = \"\";\n }\n if (object.exchangeRates !== undefined && object.exchangeRates !== null) {\n message.exchangeRates = object.exchangeRates;\n }\n else {\n message.exchangeRates = \"\";\n }\n if (object.feeder !== undefined && object.feeder !== null) {\n message.feeder = object.feeder;\n }\n else {\n message.feeder = \"\";\n }\n if (object.validator !== undefined && object.validator !== null) {\n message.validator = object.validator;\n }\n else {\n message.validator = \"\";\n }\n return message;\n },\n};\nconst baseMsgAggregateExchangeRateVoteResponse = {};\nexports.MsgAggregateExchangeRateVoteResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgAggregateExchangeRateVoteResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgAggregateExchangeRateVoteResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgAggregateExchangeRateVoteResponse);\n return message;\n },\n};\nconst baseMsgDelegateFeedConsent = { operator: \"\", delegate: \"\" };\nexports.MsgDelegateFeedConsent = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.operator !== \"\") {\n writer.uint32(10).string(message.operator);\n }\n if (message.delegate !== \"\") {\n writer.uint32(18).string(message.delegate);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgDelegateFeedConsent);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.operator = reader.string();\n break;\n case 2:\n message.delegate = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgDelegateFeedConsent);\n if (object.operator !== undefined && object.operator !== null) {\n message.operator = String(object.operator);\n }\n else {\n message.operator = \"\";\n }\n if (object.delegate !== undefined && object.delegate !== null) {\n message.delegate = String(object.delegate);\n }\n else {\n message.delegate = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.operator !== undefined && (obj.operator = message.operator);\n message.delegate !== undefined && (obj.delegate = message.delegate);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgDelegateFeedConsent);\n if (object.operator !== undefined && object.operator !== null) {\n message.operator = object.operator;\n }\n else {\n message.operator = \"\";\n }\n if (object.delegate !== undefined && object.delegate !== null) {\n message.delegate = object.delegate;\n }\n else {\n message.delegate = \"\";\n }\n return message;\n },\n};\nconst baseMsgDelegateFeedConsentResponse = {};\nexports.MsgDelegateFeedConsentResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgDelegateFeedConsentResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgDelegateFeedConsentResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgDelegateFeedConsentResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.AggregateExchangeRatePrevote = this.AggregateExchangeRatePrevote.bind(this);\n this.AggregateExchangeRateVote = this.AggregateExchangeRateVote.bind(this);\n this.DelegateFeedConsent = this.DelegateFeedConsent.bind(this);\n }\n AggregateExchangeRatePrevote(request) {\n const data = exports.MsgAggregateExchangeRatePrevote.encode(request).finish();\n const promise = this.rpc.request(\"terra.oracle.v1beta1.Msg\", \"AggregateExchangeRatePrevote\", data);\n return promise.then((data) => exports.MsgAggregateExchangeRatePrevoteResponse.decode(new minimal_1.default.Reader(data)));\n }\n AggregateExchangeRateVote(request) {\n const data = exports.MsgAggregateExchangeRateVote.encode(request).finish();\n const promise = this.rpc.request(\"terra.oracle.v1beta1.Msg\", \"AggregateExchangeRateVote\", data);\n return promise.then((data) => exports.MsgAggregateExchangeRateVoteResponse.decode(new minimal_1.default.Reader(data)));\n }\n DelegateFeedConsent(request) {\n const data = exports.MsgDelegateFeedConsent.encode(request).finish();\n const promise = this.rpc.request(\"terra.oracle.v1beta1.Msg\", \"DelegateFeedConsent\", data);\n return promise.then((data) => exports.MsgDelegateFeedConsentResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Params = exports.Version = exports.ConnectionPaths = exports.ClientPaths = exports.Counterparty = exports.IdentifiedConnection = exports.ConnectionEnd = exports.stateToJSON = exports.stateFromJSON = exports.State = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst commitment_1 = require(\"../../../../ibc/core/commitment/v1/commitment\");\nexports.protobufPackage = \"ibc.core.connection.v1\";\n/**\n * State defines if a connection is in one of the following states:\n * INIT, TRYOPEN, OPEN or UNINITIALIZED.\n */\nvar State;\n(function (State) {\n /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */\n State[State[\"STATE_UNINITIALIZED_UNSPECIFIED\"] = 0] = \"STATE_UNINITIALIZED_UNSPECIFIED\";\n /** STATE_INIT - A connection end has just started the opening handshake. */\n State[State[\"STATE_INIT\"] = 1] = \"STATE_INIT\";\n /**\n * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty\n * chain.\n */\n State[State[\"STATE_TRYOPEN\"] = 2] = \"STATE_TRYOPEN\";\n /** STATE_OPEN - A connection end has completed the handshake. */\n State[State[\"STATE_OPEN\"] = 3] = \"STATE_OPEN\";\n State[State[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(State = exports.State || (exports.State = {}));\nfunction stateFromJSON(object) {\n switch (object) {\n case 0:\n case \"STATE_UNINITIALIZED_UNSPECIFIED\":\n return State.STATE_UNINITIALIZED_UNSPECIFIED;\n case 1:\n case \"STATE_INIT\":\n return State.STATE_INIT;\n case 2:\n case \"STATE_TRYOPEN\":\n return State.STATE_TRYOPEN;\n case 3:\n case \"STATE_OPEN\":\n return State.STATE_OPEN;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return State.UNRECOGNIZED;\n }\n}\nexports.stateFromJSON = stateFromJSON;\nfunction stateToJSON(object) {\n switch (object) {\n case State.STATE_UNINITIALIZED_UNSPECIFIED:\n return \"STATE_UNINITIALIZED_UNSPECIFIED\";\n case State.STATE_INIT:\n return \"STATE_INIT\";\n case State.STATE_TRYOPEN:\n return \"STATE_TRYOPEN\";\n case State.STATE_OPEN:\n return \"STATE_OPEN\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.stateToJSON = stateToJSON;\nconst baseConnectionEnd = { clientId: \"\", state: 0, delayPeriod: long_1.default.UZERO };\nexports.ConnectionEnd = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n for (const v of message.versions) {\n exports.Version.encode(v, writer.uint32(18).fork()).ldelim();\n }\n if (message.state !== 0) {\n writer.uint32(24).int32(message.state);\n }\n if (message.counterparty !== undefined) {\n exports.Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim();\n }\n if (!message.delayPeriod.isZero()) {\n writer.uint32(40).uint64(message.delayPeriod);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseConnectionEnd);\n message.versions = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.versions.push(exports.Version.decode(reader, reader.uint32()));\n break;\n case 3:\n message.state = reader.int32();\n break;\n case 4:\n message.counterparty = exports.Counterparty.decode(reader, reader.uint32());\n break;\n case 5:\n message.delayPeriod = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseConnectionEnd);\n message.versions = [];\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.versions !== undefined && object.versions !== null) {\n for (const e of object.versions) {\n message.versions.push(exports.Version.fromJSON(e));\n }\n }\n if (object.state !== undefined && object.state !== null) {\n message.state = stateFromJSON(object.state);\n }\n else {\n message.state = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromJSON(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = long_1.default.fromString(object.delayPeriod);\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n if (message.versions) {\n obj.versions = message.versions.map((e) => (e ? exports.Version.toJSON(e) : undefined));\n }\n else {\n obj.versions = [];\n }\n message.state !== undefined && (obj.state = stateToJSON(message.state));\n message.counterparty !== undefined &&\n (obj.counterparty = message.counterparty ? exports.Counterparty.toJSON(message.counterparty) : undefined);\n message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseConnectionEnd);\n message.versions = [];\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.versions !== undefined && object.versions !== null) {\n for (const e of object.versions) {\n message.versions.push(exports.Version.fromPartial(e));\n }\n }\n if (object.state !== undefined && object.state !== null) {\n message.state = object.state;\n }\n else {\n message.state = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromPartial(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = object.delayPeriod;\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseIdentifiedConnection = { id: \"\", clientId: \"\", state: 0, delayPeriod: long_1.default.UZERO };\nexports.IdentifiedConnection = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.id !== \"\") {\n writer.uint32(10).string(message.id);\n }\n if (message.clientId !== \"\") {\n writer.uint32(18).string(message.clientId);\n }\n for (const v of message.versions) {\n exports.Version.encode(v, writer.uint32(26).fork()).ldelim();\n }\n if (message.state !== 0) {\n writer.uint32(32).int32(message.state);\n }\n if (message.counterparty !== undefined) {\n exports.Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim();\n }\n if (!message.delayPeriod.isZero()) {\n writer.uint32(48).uint64(message.delayPeriod);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseIdentifiedConnection);\n message.versions = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.id = reader.string();\n break;\n case 2:\n message.clientId = reader.string();\n break;\n case 3:\n message.versions.push(exports.Version.decode(reader, reader.uint32()));\n break;\n case 4:\n message.state = reader.int32();\n break;\n case 5:\n message.counterparty = exports.Counterparty.decode(reader, reader.uint32());\n break;\n case 6:\n message.delayPeriod = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseIdentifiedConnection);\n message.versions = [];\n if (object.id !== undefined && object.id !== null) {\n message.id = String(object.id);\n }\n else {\n message.id = \"\";\n }\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.versions !== undefined && object.versions !== null) {\n for (const e of object.versions) {\n message.versions.push(exports.Version.fromJSON(e));\n }\n }\n if (object.state !== undefined && object.state !== null) {\n message.state = stateFromJSON(object.state);\n }\n else {\n message.state = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromJSON(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = long_1.default.fromString(object.delayPeriod);\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.id !== undefined && (obj.id = message.id);\n message.clientId !== undefined && (obj.clientId = message.clientId);\n if (message.versions) {\n obj.versions = message.versions.map((e) => (e ? exports.Version.toJSON(e) : undefined));\n }\n else {\n obj.versions = [];\n }\n message.state !== undefined && (obj.state = stateToJSON(message.state));\n message.counterparty !== undefined &&\n (obj.counterparty = message.counterparty ? exports.Counterparty.toJSON(message.counterparty) : undefined);\n message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseIdentifiedConnection);\n message.versions = [];\n if (object.id !== undefined && object.id !== null) {\n message.id = object.id;\n }\n else {\n message.id = \"\";\n }\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.versions !== undefined && object.versions !== null) {\n for (const e of object.versions) {\n message.versions.push(exports.Version.fromPartial(e));\n }\n }\n if (object.state !== undefined && object.state !== null) {\n message.state = object.state;\n }\n else {\n message.state = 0;\n }\n if (object.counterparty !== undefined && object.counterparty !== null) {\n message.counterparty = exports.Counterparty.fromPartial(object.counterparty);\n }\n else {\n message.counterparty = undefined;\n }\n if (object.delayPeriod !== undefined && object.delayPeriod !== null) {\n message.delayPeriod = object.delayPeriod;\n }\n else {\n message.delayPeriod = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseCounterparty = { clientId: \"\", connectionId: \"\" };\nexports.Counterparty = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n if (message.connectionId !== \"\") {\n writer.uint32(18).string(message.connectionId);\n }\n if (message.prefix !== undefined) {\n commitment_1.MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCounterparty);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.connectionId = reader.string();\n break;\n case 3:\n message.prefix = commitment_1.MerklePrefix.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCounterparty);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.connectionId !== undefined && object.connectionId !== null) {\n message.connectionId = String(object.connectionId);\n }\n else {\n message.connectionId = \"\";\n }\n if (object.prefix !== undefined && object.prefix !== null) {\n message.prefix = commitment_1.MerklePrefix.fromJSON(object.prefix);\n }\n else {\n message.prefix = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n message.connectionId !== undefined && (obj.connectionId = message.connectionId);\n message.prefix !== undefined &&\n (obj.prefix = message.prefix ? commitment_1.MerklePrefix.toJSON(message.prefix) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCounterparty);\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.connectionId !== undefined && object.connectionId !== null) {\n message.connectionId = object.connectionId;\n }\n else {\n message.connectionId = \"\";\n }\n if (object.prefix !== undefined && object.prefix !== null) {\n message.prefix = commitment_1.MerklePrefix.fromPartial(object.prefix);\n }\n else {\n message.prefix = undefined;\n }\n return message;\n },\n};\nconst baseClientPaths = { paths: \"\" };\nexports.ClientPaths = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.paths) {\n writer.uint32(10).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseClientPaths);\n message.paths = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.paths.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseClientPaths);\n message.paths = [];\n if (object.paths !== undefined && object.paths !== null) {\n for (const e of object.paths) {\n message.paths.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.paths) {\n obj.paths = message.paths.map((e) => e);\n }\n else {\n obj.paths = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseClientPaths);\n message.paths = [];\n if (object.paths !== undefined && object.paths !== null) {\n for (const e of object.paths) {\n message.paths.push(e);\n }\n }\n return message;\n },\n};\nconst baseConnectionPaths = { clientId: \"\", paths: \"\" };\nexports.ConnectionPaths = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.clientId !== \"\") {\n writer.uint32(10).string(message.clientId);\n }\n for (const v of message.paths) {\n writer.uint32(18).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseConnectionPaths);\n message.paths = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.clientId = reader.string();\n break;\n case 2:\n message.paths.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseConnectionPaths);\n message.paths = [];\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = String(object.clientId);\n }\n else {\n message.clientId = \"\";\n }\n if (object.paths !== undefined && object.paths !== null) {\n for (const e of object.paths) {\n message.paths.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.clientId !== undefined && (obj.clientId = message.clientId);\n if (message.paths) {\n obj.paths = message.paths.map((e) => e);\n }\n else {\n obj.paths = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseConnectionPaths);\n message.paths = [];\n if (object.clientId !== undefined && object.clientId !== null) {\n message.clientId = object.clientId;\n }\n else {\n message.clientId = \"\";\n }\n if (object.paths !== undefined && object.paths !== null) {\n for (const e of object.paths) {\n message.paths.push(e);\n }\n }\n return message;\n },\n};\nconst baseVersion = { identifier: \"\", features: \"\" };\nexports.Version = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.identifier !== \"\") {\n writer.uint32(10).string(message.identifier);\n }\n for (const v of message.features) {\n writer.uint32(18).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseVersion);\n message.features = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.identifier = reader.string();\n break;\n case 2:\n message.features.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseVersion);\n message.features = [];\n if (object.identifier !== undefined && object.identifier !== null) {\n message.identifier = String(object.identifier);\n }\n else {\n message.identifier = \"\";\n }\n if (object.features !== undefined && object.features !== null) {\n for (const e of object.features) {\n message.features.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.identifier !== undefined && (obj.identifier = message.identifier);\n if (message.features) {\n obj.features = message.features.map((e) => e);\n }\n else {\n obj.features = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseVersion);\n message.features = [];\n if (object.identifier !== undefined && object.identifier !== null) {\n message.identifier = object.identifier;\n }\n else {\n message.identifier = \"\";\n }\n if (object.features !== undefined && object.features !== null) {\n for (const e of object.features) {\n message.features.push(e);\n }\n }\n return message;\n },\n};\nconst baseParams = { maxExpectedTimePerBlock: long_1.default.UZERO };\nexports.Params = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.maxExpectedTimePerBlock.isZero()) {\n writer.uint32(8).uint64(message.maxExpectedTimePerBlock);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParams);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.maxExpectedTimePerBlock = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParams);\n if (object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null) {\n message.maxExpectedTimePerBlock = long_1.default.fromString(object.maxExpectedTimePerBlock);\n }\n else {\n message.maxExpectedTimePerBlock = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.maxExpectedTimePerBlock !== undefined &&\n (obj.maxExpectedTimePerBlock = (message.maxExpectedTimePerBlock || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParams);\n if (object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null) {\n message.maxExpectedTimePerBlock = object.maxExpectedTimePerBlock;\n }\n else {\n message.maxExpectedTimePerBlock = long_1.default.UZERO;\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=connection.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Version = void 0;\nvar connection_1 = require(\"@terra-money/terra.proto/ibc/core/connection/v1/connection\");\nvar json_1 = require(\"../../../../util/json\");\n/*\n * Version defines the versioning scheme used to negotiate the IBC verison in the connection handshake.\n */\nvar Version = /** @class */ (function (_super) {\n __extends(Version, _super);\n /**\n * @param identifier unique version identifier\n * @param features list of features compatible with the specified identifier\n */\n function Version(identifier, features) {\n var _this = _super.call(this) || this;\n _this.identifier = identifier;\n _this.features = features;\n return _this;\n }\n Version.fromAmino = function (data) {\n var identifier = data.identifier, features = data.features;\n return new Version(identifier, features);\n };\n Version.prototype.toAmino = function () {\n var _a = this, identifier = _a.identifier, features = _a.features;\n var res = {\n identifier: identifier,\n features: features,\n };\n return res;\n };\n Version.fromData = function (data) {\n var identifier = data.identifier, features = data.features;\n return new Version(identifier, features);\n };\n Version.prototype.toData = function () {\n var _a = this, identifier = _a.identifier, features = _a.features;\n var res = {\n identifier: identifier,\n features: features,\n };\n return res;\n };\n Version.fromProto = function (proto) {\n return new Version(proto.identifier, proto.features);\n };\n Version.prototype.toProto = function () {\n var _a = this, identifier = _a.identifier, features = _a.features;\n return connection_1.Version.fromPartial({ identifier: identifier, features: features });\n };\n return Version;\n}(json_1.JSONSerializable));\nexports.Version = Version;\n//# sourceMappingURL=Version.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompactBitArray = void 0;\nvar multisig_1 = require(\"@terra-money/terra.proto/cosmos/crypto/multisig/v1beta1/multisig\");\nvar CompactBitArray = /** @class */ (function () {\n function CompactBitArray(extra_bits_stored, elems) {\n this.extra_bits_stored = extra_bits_stored;\n this.elems = elems;\n }\n CompactBitArray.fromBits = function (bits) {\n if (bits <= 0) {\n throw new Error('CompactBitArray bits must be bigger than 0');\n }\n var num_elems = (bits + 7) / 8;\n if (num_elems <= 0 || num_elems > Math.pow(2, 32) - 1) {\n // We encountered an overflow here, and shouldn't pass negatives\n // to make, nor should we allow unreasonable limits > maxint32.\n // See https://github.com/cosmos/cosmos-sdk/issues/9162\n throw new Error('CompactBitArray overflow');\n }\n return new CompactBitArray(bits % 8, Buffer.alloc(num_elems));\n };\n // returns the number of bits in the bitarray\n CompactBitArray.prototype.count = function () {\n if (this.extra_bits_stored == 0) {\n return this.elems.length * 8;\n }\n return (this.elems.length - 1) * 8 + this.extra_bits_stored;\n };\n // returns true if the bit at index i is set; returns false otherwise.\n // The behavior is undefined if i >= bA.Count()\n CompactBitArray.prototype.getIndex = function (i) {\n if (i < 0 || i >= this.count()) {\n return false;\n }\n return (this.elems.readUInt8(i >> 3) & (1 << (7 - (i % 8)))) > 0;\n };\n // sets the bit at index i within the bit array. Returns true if and only if the\n // operation succeeded. The behavior is undefined if i >= bA.Count()\n CompactBitArray.prototype.setIndex = function (i, v) {\n if (i < 0 || i >= this.count()) {\n return false;\n }\n if (v) {\n this.elems[i >> 3] |= 1 << (7 - (i % 8));\n }\n else {\n this.elems[i >> 3] &= ~(1 << (7 - (i % 8)));\n }\n return true;\n };\n // returns the number of bits set to true before the\n // given index. e.g. if bA = _XX__XX, NumOfTrueBitsBefore(4) = 2, since\n // there are two bits set to true before index 4.\n CompactBitArray.prototype.numTrueBitsBefore = function (index) {\n var countOneBits = function (n) {\n return n.toString(2).split('0').join('').length;\n };\n var ones_count = 0;\n var max = this.count();\n if (index > max) {\n index = max;\n }\n // below we iterate over the bytes then over bits (in low endian) and count bits set to 1\n for (var elem = 0;; elem++) {\n if (elem * 8 + 7 >= index) {\n ones_count += countOneBits(this.elems[elem] >> (7 - (index % 8) + 1));\n return ones_count;\n }\n ones_count += countOneBits(this.elems[elem]);\n }\n };\n CompactBitArray.fromData = function (data) {\n return new CompactBitArray(data.extra_bits_stored, Buffer.from(data.elems, 'base64'));\n };\n CompactBitArray.prototype.toData = function () {\n return {\n elems: this.elems.toString('base64'),\n extra_bits_stored: this.extra_bits_stored,\n };\n };\n CompactBitArray.fromProto = function (proto) {\n return new CompactBitArray(proto.extraBitsStored, Buffer.from(proto.elems));\n };\n CompactBitArray.prototype.toProto = function () {\n return multisig_1.CompactBitArray.fromPartial({\n elems: this.elems,\n extraBitsStored: this.extra_bits_stored,\n });\n };\n return CompactBitArray;\n}());\nexports.CompactBitArray = CompactBitArray;\n//# sourceMappingURL=CompactBitArray.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseAccount = void 0;\nvar PublicKey_1 = require(\"../PublicKey\");\nvar json_1 = require(\"../../util/json\");\nvar auth_1 = require(\"@terra-money/terra.proto/cosmos/auth/v1beta1/auth\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar Long = __importStar(require(\"long\"));\n/**\n * Stores information about an account fetched from the blockchain.\n */\nvar BaseAccount = /** @class */ (function (_super) {\n __extends(BaseAccount, _super);\n /**\n * Creates a new Account object, holding information about a basic account.\n *\n * @param address account address\n * @param coins account's balance\n * @param public_key account's public key information\n * @param account_number account number on the blockchain\n * @param sequence sequence number, or number of transactions that have been posted\n */\n function BaseAccount(address, public_key, account_number, sequence) {\n var _this = _super.call(this) || this;\n _this.address = address;\n _this.public_key = public_key;\n _this.account_number = account_number;\n _this.sequence = sequence;\n return _this;\n }\n BaseAccount.prototype.getAccountNumber = function () {\n return this.account_number;\n };\n BaseAccount.prototype.getSequenceNumber = function () {\n return this.sequence;\n };\n BaseAccount.prototype.getPublicKey = function () {\n return this.public_key;\n };\n BaseAccount.prototype.toAmino = function () {\n var _a = this, address = _a.address, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence;\n return {\n type: 'core/Account',\n value: {\n address: address,\n public_key: public_key ? public_key.toAmino() : null,\n account_number: account_number.toFixed(),\n sequence: sequence.toFixed(),\n },\n };\n };\n BaseAccount.fromAmino = function (data) {\n var _a = data.value, address = _a.address, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence;\n return new BaseAccount(address || '', public_key ? PublicKey_1.PublicKey.fromAmino(public_key) : null, Number.parseInt(account_number) || 0, Number.parseInt(sequence) || 0);\n };\n BaseAccount.fromData = function (data) {\n var address = data.address, pub_key = data.pub_key, account_number = data.account_number, sequence = data.sequence;\n return new BaseAccount(address || '', pub_key ? PublicKey_1.PublicKey.fromData(pub_key) : null, Number.parseInt(account_number) || 0, Number.parseInt(sequence) || 0);\n };\n BaseAccount.prototype.toData = function () {\n var _a = this, address = _a.address, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence;\n return {\n '@type': '/cosmos.auth.v1beta1.BaseAccount',\n address: address,\n pub_key: public_key ? public_key.toData() : null,\n account_number: account_number.toFixed(),\n sequence: sequence.toFixed(),\n };\n };\n BaseAccount.prototype.toProto = function () {\n var _a = this, address = _a.address, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence;\n return auth_1.BaseAccount.fromPartial({\n address: address,\n pubKey: public_key === null || public_key === void 0 ? void 0 : public_key.packAny(),\n accountNumber: Long.fromNumber(account_number),\n sequence: Long.fromNumber(sequence),\n });\n };\n BaseAccount.fromProto = function (baseAccountProto) {\n var pubkey = baseAccountProto.pubKey;\n return new BaseAccount(baseAccountProto.address, pubkey ? PublicKey_1.PublicKey.fromProto(pubkey) : null, baseAccountProto.accountNumber.toNumber(), baseAccountProto.sequence.toNumber());\n };\n BaseAccount.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.auth.v1beta1.BaseAccount',\n value: auth_1.BaseAccount.encode(this.toProto()).finish(),\n });\n };\n BaseAccount.unpackAny = function (pubkeyAny) {\n return BaseAccount.fromProto(auth_1.BaseAccount.decode(pubkeyAny.value));\n };\n return BaseAccount;\n}(json_1.JSONSerializable));\nexports.BaseAccount = BaseAccount;\n//# sourceMappingURL=BaseAccount.js.map","'use strict'\nvar inherits = require('inherits')\nvar MD5 = require('md5.js')\nvar RIPEMD160 = require('ripemd160')\nvar sha = require('sha.js')\nvar Base = require('cipher-base')\n\nfunction Hash (hash) {\n Base.call(this, 'digest')\n\n this._hash = hash\n}\n\ninherits(Hash, Base)\n\nHash.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHash.prototype._final = function () {\n return this._hash.digest()\n}\n\nmodule.exports = function createHash (alg) {\n alg = alg.toLowerCase()\n if (alg === 'md5') return new MD5()\n if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()\n\n return new Hash(sha(alg))\n}\n","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n'use strict';\n\nvar ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;\n\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n callback.apply(this, args);\n };\n}\n\nfunction noop() {}\n\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\n\nfunction eos(stream, opts, callback) {\n if (typeof opts === 'function') return eos(stream, null, opts);\n if (!opts) opts = {};\n callback = once(callback || noop);\n var readable = opts.readable || opts.readable !== false && stream.readable;\n var writable = opts.writable || opts.writable !== false && stream.writable;\n\n var onlegacyfinish = function onlegacyfinish() {\n if (!stream.writable) onfinish();\n };\n\n var writableEnded = stream._writableState && stream._writableState.finished;\n\n var onfinish = function onfinish() {\n writable = false;\n writableEnded = true;\n if (!readable) callback.call(stream);\n };\n\n var readableEnded = stream._readableState && stream._readableState.endEmitted;\n\n var onend = function onend() {\n readable = false;\n readableEnded = true;\n if (!writable) callback.call(stream);\n };\n\n var onerror = function onerror(err) {\n callback.call(stream, err);\n };\n\n var onclose = function onclose() {\n var err;\n\n if (readable && !readableEnded) {\n if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n\n if (writable && !writableEnded) {\n if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n };\n\n var onrequest = function onrequest() {\n stream.req.on('finish', onfinish);\n };\n\n if (isRequest(stream)) {\n stream.on('complete', onfinish);\n stream.on('abort', onclose);\n if (stream.req) onrequest();else stream.on('request', onrequest);\n } else if (writable && !stream._writableState) {\n // legacy streams\n stream.on('end', onlegacyfinish);\n stream.on('close', onlegacyfinish);\n }\n\n stream.on('end', onend);\n stream.on('finish', onfinish);\n if (opts.error !== false) stream.on('error', onerror);\n stream.on('close', onclose);\n return function () {\n stream.removeListener('complete', onfinish);\n stream.removeListener('abort', onclose);\n stream.removeListener('request', onrequest);\n if (stream.req) stream.req.removeListener('finish', onfinish);\n stream.removeListener('end', onlegacyfinish);\n stream.removeListener('close', onlegacyfinish);\n stream.removeListener('finish', onfinish);\n stream.removeListener('end', onend);\n stream.removeListener('error', onerror);\n stream.removeListener('close', onclose);\n };\n}\n\nmodule.exports = eos;","'use strict'\nvar Buffer = require('buffer').Buffer\nvar inherits = require('inherits')\nvar HashBase = require('hash-base')\n\nvar ARRAY16 = new Array(16)\n\nvar zl = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n]\n\nvar zr = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n]\n\nvar sl = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n]\n\nvar sr = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n]\n\nvar hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]\nvar hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]\n\nfunction RIPEMD160 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n}\n\ninherits(RIPEMD160, HashBase)\n\nRIPEMD160.prototype._update = function () {\n var words = ARRAY16\n for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)\n\n var al = this._a | 0\n var bl = this._b | 0\n var cl = this._c | 0\n var dl = this._d | 0\n var el = this._e | 0\n\n var ar = this._a | 0\n var br = this._b | 0\n var cr = this._c | 0\n var dr = this._d | 0\n var er = this._e | 0\n\n // computation\n for (var i = 0; i < 80; i += 1) {\n var tl\n var tr\n if (i < 16) {\n tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])\n tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])\n } else if (i < 32) {\n tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])\n tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])\n } else if (i < 48) {\n tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])\n tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])\n } else if (i < 64) {\n tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])\n tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])\n } else { // if (i<80) {\n tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])\n tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])\n }\n\n al = el\n el = dl\n dl = rotl(cl, 10)\n cl = bl\n bl = tl\n\n ar = er\n er = dr\n dr = rotl(cr, 10)\n cr = br\n br = tr\n }\n\n // update state\n var t = (this._b + cl + dr) | 0\n this._b = (this._c + dl + er) | 0\n this._c = (this._d + el + ar) | 0\n this._d = (this._e + al + br) | 0\n this._e = (this._a + bl + cr) | 0\n this._a = t\n}\n\nRIPEMD160.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n buffer.writeInt32LE(this._e, 16)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fn1 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn2 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn3 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn4 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn5 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0\n}\n\nmodule.exports = RIPEMD160\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","var Buffer = require('safe-buffer').Buffer\nvar Transform = require('stream').Transform\nvar StringDecoder = require('string_decoder').StringDecoder\nvar inherits = require('inherits')\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Writable;\n\n/* */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /**/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /**/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","var types = {\n Array: function (value) { return value !== null && value !== undefined && value.constructor === Array },\n Boolean: function (value) { return typeof value === 'boolean' },\n Function: function (value) { return typeof value === 'function' },\n Nil: function (value) { return value === undefined || value === null },\n Number: function (value) { return typeof value === 'number' },\n Object: function (value) { return typeof value === 'object' },\n String: function (value) { return typeof value === 'string' },\n '': function () { return true }\n}\n\n// TODO: deprecate\ntypes.Null = types.Nil\n\nfor (var typeName in types) {\n types[typeName].toJSON = function (t) {\n return t\n }.bind(null, typeName)\n}\n\nmodule.exports = types\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","export const HashZero = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","'use strict'\nvar ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'\n\n// pre-compute lookup table\nvar ALPHABET_MAP = {}\nfor (var z = 0; z < ALPHABET.length; z++) {\n var x = ALPHABET.charAt(z)\n\n if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n ALPHABET_MAP[x] = z\n}\n\nfunction polymodStep (pre) {\n var b = pre >> 25\n return ((pre & 0x1FFFFFF) << 5) ^\n (-((b >> 0) & 1) & 0x3b6a57b2) ^\n (-((b >> 1) & 1) & 0x26508e6d) ^\n (-((b >> 2) & 1) & 0x1ea119fa) ^\n (-((b >> 3) & 1) & 0x3d4233dd) ^\n (-((b >> 4) & 1) & 0x2a1462b3)\n}\n\nfunction prefixChk (prefix) {\n var chk = 1\n for (var i = 0; i < prefix.length; ++i) {\n var c = prefix.charCodeAt(i)\n if (c < 33 || c > 126) return 'Invalid prefix (' + prefix + ')'\n\n chk = polymodStep(chk) ^ (c >> 5)\n }\n chk = polymodStep(chk)\n\n for (i = 0; i < prefix.length; ++i) {\n var v = prefix.charCodeAt(i)\n chk = polymodStep(chk) ^ (v & 0x1f)\n }\n return chk\n}\n\nfunction encode (prefix, words, LIMIT) {\n LIMIT = LIMIT || 90\n if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')\n\n prefix = prefix.toLowerCase()\n\n // determine chk mod\n var chk = prefixChk(prefix)\n if (typeof chk === 'string') throw new Error(chk)\n\n var result = prefix + '1'\n for (var i = 0; i < words.length; ++i) {\n var x = words[i]\n if ((x >> 5) !== 0) throw new Error('Non 5-bit word')\n\n chk = polymodStep(chk) ^ x\n result += ALPHABET.charAt(x)\n }\n\n for (i = 0; i < 6; ++i) {\n chk = polymodStep(chk)\n }\n chk ^= 1\n\n for (i = 0; i < 6; ++i) {\n var v = (chk >> ((5 - i) * 5)) & 0x1f\n result += ALPHABET.charAt(v)\n }\n\n return result\n}\n\nfunction __decode (str, LIMIT) {\n LIMIT = LIMIT || 90\n if (str.length < 8) return str + ' too short'\n if (str.length > LIMIT) return 'Exceeds length limit'\n\n // don't allow mixed case\n var lowered = str.toLowerCase()\n var uppered = str.toUpperCase()\n if (str !== lowered && str !== uppered) return 'Mixed-case string ' + str\n str = lowered\n\n var split = str.lastIndexOf('1')\n if (split === -1) return 'No separator character for ' + str\n if (split === 0) return 'Missing prefix for ' + str\n\n var prefix = str.slice(0, split)\n var wordChars = str.slice(split + 1)\n if (wordChars.length < 6) return 'Data too short'\n\n var chk = prefixChk(prefix)\n if (typeof chk === 'string') return chk\n\n var words = []\n for (var i = 0; i < wordChars.length; ++i) {\n var c = wordChars.charAt(i)\n var v = ALPHABET_MAP[c]\n if (v === undefined) return 'Unknown character ' + c\n chk = polymodStep(chk) ^ v\n\n // not in the checksum?\n if (i + 6 >= wordChars.length) continue\n words.push(v)\n }\n\n if (chk !== 1) return 'Invalid checksum for ' + str\n return { prefix: prefix, words: words }\n}\n\nfunction decodeUnsafe () {\n var res = __decode.apply(null, arguments)\n if (typeof res === 'object') return res\n}\n\nfunction decode (str) {\n var res = __decode.apply(null, arguments)\n if (typeof res === 'object') return res\n\n throw new Error(res)\n}\n\nfunction convert (data, inBits, outBits, pad) {\n var value = 0\n var bits = 0\n var maxV = (1 << outBits) - 1\n\n var result = []\n for (var i = 0; i < data.length; ++i) {\n value = (value << inBits) | data[i]\n bits += inBits\n\n while (bits >= outBits) {\n bits -= outBits\n result.push((value >> bits) & maxV)\n }\n }\n\n if (pad) {\n if (bits > 0) {\n result.push((value << (outBits - bits)) & maxV)\n }\n } else {\n if (bits >= inBits) return 'Excess padding'\n if ((value << (outBits - bits)) & maxV) return 'Non-zero padding'\n }\n\n return result\n}\n\nfunction toWordsUnsafe (bytes) {\n var res = convert(bytes, 8, 5, true)\n if (Array.isArray(res)) return res\n}\n\nfunction toWords (bytes) {\n var res = convert(bytes, 8, 5, true)\n if (Array.isArray(res)) return res\n\n throw new Error(res)\n}\n\nfunction fromWordsUnsafe (words) {\n var res = convert(words, 5, 8, false)\n if (Array.isArray(res)) return res\n}\n\nfunction fromWords (words) {\n var res = convert(words, 5, 8, false)\n if (Array.isArray(res)) return res\n\n throw new Error(res)\n}\n\nmodule.exports = {\n decodeUnsafe: decodeUnsafe,\n decode: decode,\n encode: encode,\n toWordsUnsafe: toWordsUnsafe,\n toWords: toWords,\n fromWordsUnsafe: fromWordsUnsafe,\n fromWords: fromWords\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\n/* eslint-disable */\nimport Long from \"long\";\nimport { grpc } from \"@improbable-eng/grpc-web\";\nimport _m0 from \"protobufjs/minimal\";\nimport { BrowserHeaders } from \"browser-headers\";\nimport { Heartbeat } from \"../../gossip/v1/gossip\";\nexport var protobufPackage = \"publicrpc.v1\";\nexport var ChainID;\n(function (ChainID) {\n ChainID[ChainID[\"CHAIN_ID_UNSPECIFIED\"] = 0] = \"CHAIN_ID_UNSPECIFIED\";\n ChainID[ChainID[\"CHAIN_ID_SOLANA\"] = 1] = \"CHAIN_ID_SOLANA\";\n ChainID[ChainID[\"CHAIN_ID_ETHEREUM\"] = 2] = \"CHAIN_ID_ETHEREUM\";\n ChainID[ChainID[\"CHAIN_ID_TERRA\"] = 3] = \"CHAIN_ID_TERRA\";\n ChainID[ChainID[\"CHAIN_ID_BSC\"] = 4] = \"CHAIN_ID_BSC\";\n ChainID[ChainID[\"CHAIN_ID_POLYGON\"] = 5] = \"CHAIN_ID_POLYGON\";\n ChainID[ChainID[\"CHAIN_ID_AVALANCHE\"] = 6] = \"CHAIN_ID_AVALANCHE\";\n ChainID[ChainID[\"CHAIN_ID_OASIS\"] = 7] = \"CHAIN_ID_OASIS\";\n ChainID[ChainID[\"CHAIN_ID_ALGORAND\"] = 8] = \"CHAIN_ID_ALGORAND\";\n /**\n * CHAIN_ID_ETHEREUM_ROPSTEN - Special case - Eth has two testnets. CHAIN_ID_ETHEREUM is Goerli,\n * but we also want to connect to Ropsten, so we add a separate chain.\n */\n ChainID[ChainID[\"CHAIN_ID_ETHEREUM_ROPSTEN\"] = 10001] = \"CHAIN_ID_ETHEREUM_ROPSTEN\";\n ChainID[ChainID[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(ChainID || (ChainID = {}));\nexport function chainIDFromJSON(object) {\n switch (object) {\n case 0:\n case \"CHAIN_ID_UNSPECIFIED\":\n return ChainID.CHAIN_ID_UNSPECIFIED;\n case 1:\n case \"CHAIN_ID_SOLANA\":\n return ChainID.CHAIN_ID_SOLANA;\n case 2:\n case \"CHAIN_ID_ETHEREUM\":\n return ChainID.CHAIN_ID_ETHEREUM;\n case 3:\n case \"CHAIN_ID_TERRA\":\n return ChainID.CHAIN_ID_TERRA;\n case 4:\n case \"CHAIN_ID_BSC\":\n return ChainID.CHAIN_ID_BSC;\n case 5:\n case \"CHAIN_ID_POLYGON\":\n return ChainID.CHAIN_ID_POLYGON;\n case 6:\n case \"CHAIN_ID_AVALANCHE\":\n return ChainID.CHAIN_ID_AVALANCHE;\n case 7:\n case \"CHAIN_ID_OASIS\":\n return ChainID.CHAIN_ID_OASIS;\n case 8:\n case \"CHAIN_ID_ALGORAND\":\n return ChainID.CHAIN_ID_ALGORAND;\n case 10001:\n case \"CHAIN_ID_ETHEREUM_ROPSTEN\":\n return ChainID.CHAIN_ID_ETHEREUM_ROPSTEN;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return ChainID.UNRECOGNIZED;\n }\n}\nexport function chainIDToJSON(object) {\n switch (object) {\n case ChainID.CHAIN_ID_UNSPECIFIED:\n return \"CHAIN_ID_UNSPECIFIED\";\n case ChainID.CHAIN_ID_SOLANA:\n return \"CHAIN_ID_SOLANA\";\n case ChainID.CHAIN_ID_ETHEREUM:\n return \"CHAIN_ID_ETHEREUM\";\n case ChainID.CHAIN_ID_TERRA:\n return \"CHAIN_ID_TERRA\";\n case ChainID.CHAIN_ID_BSC:\n return \"CHAIN_ID_BSC\";\n case ChainID.CHAIN_ID_POLYGON:\n return \"CHAIN_ID_POLYGON\";\n case ChainID.CHAIN_ID_AVALANCHE:\n return \"CHAIN_ID_AVALANCHE\";\n case ChainID.CHAIN_ID_OASIS:\n return \"CHAIN_ID_OASIS\";\n case ChainID.CHAIN_ID_ALGORAND:\n return \"CHAIN_ID_ALGORAND\";\n case ChainID.CHAIN_ID_ETHEREUM_ROPSTEN:\n return \"CHAIN_ID_ETHEREUM_ROPSTEN\";\n default:\n return \"UNKNOWN\";\n }\n}\nvar baseMessageID = {\n emitterChain: 0,\n emitterAddress: \"\",\n sequence: \"0\",\n};\nexport var MessageID = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.emitterChain !== 0) {\n writer.uint32(8).int32(message.emitterChain);\n }\n if (message.emitterAddress !== \"\") {\n writer.uint32(18).string(message.emitterAddress);\n }\n if (message.sequence !== \"0\") {\n writer.uint32(24).uint64(message.sequence);\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseMessageID);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.emitterChain = reader.int32();\n break;\n case 2:\n message.emitterAddress = reader.string();\n break;\n case 3:\n message.sequence = longToString(reader.uint64());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseMessageID);\n if (object.emitterChain !== undefined && object.emitterChain !== null) {\n message.emitterChain = chainIDFromJSON(object.emitterChain);\n }\n else {\n message.emitterChain = 0;\n }\n if (object.emitterAddress !== undefined && object.emitterAddress !== null) {\n message.emitterAddress = String(object.emitterAddress);\n }\n else {\n message.emitterAddress = \"\";\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = String(object.sequence);\n }\n else {\n message.sequence = \"0\";\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.emitterChain !== undefined &&\n (obj.emitterChain = chainIDToJSON(message.emitterChain));\n message.emitterAddress !== undefined &&\n (obj.emitterAddress = message.emitterAddress);\n message.sequence !== undefined && (obj.sequence = message.sequence);\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseMessageID);\n if (object.emitterChain !== undefined && object.emitterChain !== null) {\n message.emitterChain = object.emitterChain;\n }\n else {\n message.emitterChain = 0;\n }\n if (object.emitterAddress !== undefined && object.emitterAddress !== null) {\n message.emitterAddress = object.emitterAddress;\n }\n else {\n message.emitterAddress = \"\";\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = object.sequence;\n }\n else {\n message.sequence = \"0\";\n }\n return message;\n },\n};\nvar baseGetSignedVAARequest = {};\nexport var GetSignedVAARequest = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.messageId !== undefined) {\n MessageID.encode(message.messageId, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGetSignedVAARequest);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.messageId = MessageID.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseGetSignedVAARequest);\n if (object.messageId !== undefined && object.messageId !== null) {\n message.messageId = MessageID.fromJSON(object.messageId);\n }\n else {\n message.messageId = undefined;\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.messageId !== undefined &&\n (obj.messageId = message.messageId\n ? MessageID.toJSON(message.messageId)\n : undefined);\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseGetSignedVAARequest);\n if (object.messageId !== undefined && object.messageId !== null) {\n message.messageId = MessageID.fromPartial(object.messageId);\n }\n else {\n message.messageId = undefined;\n }\n return message;\n },\n};\nvar baseGetSignedVAAResponse = {};\nexport var GetSignedVAAResponse = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.vaaBytes.length !== 0) {\n writer.uint32(10).bytes(message.vaaBytes);\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGetSignedVAAResponse);\n message.vaaBytes = new Uint8Array();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.vaaBytes = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseGetSignedVAAResponse);\n message.vaaBytes = new Uint8Array();\n if (object.vaaBytes !== undefined && object.vaaBytes !== null) {\n message.vaaBytes = bytesFromBase64(object.vaaBytes);\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.vaaBytes !== undefined &&\n (obj.vaaBytes = base64FromBytes(message.vaaBytes !== undefined ? message.vaaBytes : new Uint8Array()));\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseGetSignedVAAResponse);\n if (object.vaaBytes !== undefined && object.vaaBytes !== null) {\n message.vaaBytes = object.vaaBytes;\n }\n else {\n message.vaaBytes = new Uint8Array();\n }\n return message;\n },\n};\nvar baseGetLastHeartbeatsRequest = {};\nexport var GetLastHeartbeatsRequest = {\n encode: function (_, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGetLastHeartbeatsRequest);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (_) {\n var message = __assign({}, baseGetLastHeartbeatsRequest);\n return message;\n },\n toJSON: function (_) {\n var obj = {};\n return obj;\n },\n fromPartial: function (_) {\n var message = __assign({}, baseGetLastHeartbeatsRequest);\n return message;\n },\n};\nvar baseGetLastHeartbeatsResponse = {};\nexport var GetLastHeartbeatsResponse = {\n encode: function (message, writer) {\n var e_1, _a;\n if (writer === void 0) { writer = _m0.Writer.create(); }\n try {\n for (var _b = __values(message.entries), _c = _b.next(); !_c.done; _c = _b.next()) {\n var v = _c.value;\n GetLastHeartbeatsResponse_Entry.encode(v, writer.uint32(10).fork()).ldelim();\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGetLastHeartbeatsResponse);\n message.entries = [];\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.entries.push(GetLastHeartbeatsResponse_Entry.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var e_2, _a;\n var message = __assign({}, baseGetLastHeartbeatsResponse);\n message.entries = [];\n if (object.entries !== undefined && object.entries !== null) {\n try {\n for (var _b = __values(object.entries), _c = _b.next(); !_c.done; _c = _b.next()) {\n var e = _c.value;\n message.entries.push(GetLastHeartbeatsResponse_Entry.fromJSON(e));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n if (message.entries) {\n obj.entries = message.entries.map(function (e) {\n return e ? GetLastHeartbeatsResponse_Entry.toJSON(e) : undefined;\n });\n }\n else {\n obj.entries = [];\n }\n return obj;\n },\n fromPartial: function (object) {\n var e_3, _a;\n var message = __assign({}, baseGetLastHeartbeatsResponse);\n message.entries = [];\n if (object.entries !== undefined && object.entries !== null) {\n try {\n for (var _b = __values(object.entries), _c = _b.next(); !_c.done; _c = _b.next()) {\n var e = _c.value;\n message.entries.push(GetLastHeartbeatsResponse_Entry.fromPartial(e));\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_3) throw e_3.error; }\n }\n }\n return message;\n },\n};\nvar baseGetLastHeartbeatsResponse_Entry = {\n verifiedGuardianAddr: \"\",\n p2pNodeAddr: \"\",\n};\nexport var GetLastHeartbeatsResponse_Entry = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.verifiedGuardianAddr !== \"\") {\n writer.uint32(10).string(message.verifiedGuardianAddr);\n }\n if (message.p2pNodeAddr !== \"\") {\n writer.uint32(18).string(message.p2pNodeAddr);\n }\n if (message.rawHeartbeat !== undefined) {\n Heartbeat.encode(message.rawHeartbeat, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGetLastHeartbeatsResponse_Entry);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.verifiedGuardianAddr = reader.string();\n break;\n case 2:\n message.p2pNodeAddr = reader.string();\n break;\n case 3:\n message.rawHeartbeat = Heartbeat.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseGetLastHeartbeatsResponse_Entry);\n if (object.verifiedGuardianAddr !== undefined &&\n object.verifiedGuardianAddr !== null) {\n message.verifiedGuardianAddr = String(object.verifiedGuardianAddr);\n }\n else {\n message.verifiedGuardianAddr = \"\";\n }\n if (object.p2pNodeAddr !== undefined && object.p2pNodeAddr !== null) {\n message.p2pNodeAddr = String(object.p2pNodeAddr);\n }\n else {\n message.p2pNodeAddr = \"\";\n }\n if (object.rawHeartbeat !== undefined && object.rawHeartbeat !== null) {\n message.rawHeartbeat = Heartbeat.fromJSON(object.rawHeartbeat);\n }\n else {\n message.rawHeartbeat = undefined;\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.verifiedGuardianAddr !== undefined &&\n (obj.verifiedGuardianAddr = message.verifiedGuardianAddr);\n message.p2pNodeAddr !== undefined &&\n (obj.p2pNodeAddr = message.p2pNodeAddr);\n message.rawHeartbeat !== undefined &&\n (obj.rawHeartbeat = message.rawHeartbeat\n ? Heartbeat.toJSON(message.rawHeartbeat)\n : undefined);\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseGetLastHeartbeatsResponse_Entry);\n if (object.verifiedGuardianAddr !== undefined &&\n object.verifiedGuardianAddr !== null) {\n message.verifiedGuardianAddr = object.verifiedGuardianAddr;\n }\n else {\n message.verifiedGuardianAddr = \"\";\n }\n if (object.p2pNodeAddr !== undefined && object.p2pNodeAddr !== null) {\n message.p2pNodeAddr = object.p2pNodeAddr;\n }\n else {\n message.p2pNodeAddr = \"\";\n }\n if (object.rawHeartbeat !== undefined && object.rawHeartbeat !== null) {\n message.rawHeartbeat = Heartbeat.fromPartial(object.rawHeartbeat);\n }\n else {\n message.rawHeartbeat = undefined;\n }\n return message;\n },\n};\nvar baseGetCurrentGuardianSetRequest = {};\nexport var GetCurrentGuardianSetRequest = {\n encode: function (_, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGetCurrentGuardianSetRequest);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (_) {\n var message = __assign({}, baseGetCurrentGuardianSetRequest);\n return message;\n },\n toJSON: function (_) {\n var obj = {};\n return obj;\n },\n fromPartial: function (_) {\n var message = __assign({}, baseGetCurrentGuardianSetRequest);\n return message;\n },\n};\nvar baseGetCurrentGuardianSetResponse = {};\nexport var GetCurrentGuardianSetResponse = {\n encode: function (message, writer) {\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.guardianSet !== undefined) {\n GuardianSet.encode(message.guardianSet, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGetCurrentGuardianSetResponse);\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.guardianSet = GuardianSet.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var message = __assign({}, baseGetCurrentGuardianSetResponse);\n if (object.guardianSet !== undefined && object.guardianSet !== null) {\n message.guardianSet = GuardianSet.fromJSON(object.guardianSet);\n }\n else {\n message.guardianSet = undefined;\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.guardianSet !== undefined &&\n (obj.guardianSet = message.guardianSet\n ? GuardianSet.toJSON(message.guardianSet)\n : undefined);\n return obj;\n },\n fromPartial: function (object) {\n var message = __assign({}, baseGetCurrentGuardianSetResponse);\n if (object.guardianSet !== undefined && object.guardianSet !== null) {\n message.guardianSet = GuardianSet.fromPartial(object.guardianSet);\n }\n else {\n message.guardianSet = undefined;\n }\n return message;\n },\n};\nvar baseGuardianSet = { index: 0, addresses: \"\" };\nexport var GuardianSet = {\n encode: function (message, writer) {\n var e_4, _a;\n if (writer === void 0) { writer = _m0.Writer.create(); }\n if (message.index !== 0) {\n writer.uint32(8).uint32(message.index);\n }\n try {\n for (var _b = __values(message.addresses), _c = _b.next(); !_c.done; _c = _b.next()) {\n var v = _c.value;\n writer.uint32(18).string(v);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_4) throw e_4.error; }\n }\n return writer;\n },\n decode: function (input, length) {\n var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n var end = length === undefined ? reader.len : reader.pos + length;\n var message = __assign({}, baseGuardianSet);\n message.addresses = [];\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.index = reader.uint32();\n break;\n case 2:\n message.addresses.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON: function (object) {\n var e_5, _a;\n var message = __assign({}, baseGuardianSet);\n message.addresses = [];\n if (object.index !== undefined && object.index !== null) {\n message.index = Number(object.index);\n }\n else {\n message.index = 0;\n }\n if (object.addresses !== undefined && object.addresses !== null) {\n try {\n for (var _b = __values(object.addresses), _c = _b.next(); !_c.done; _c = _b.next()) {\n var e = _c.value;\n message.addresses.push(String(e));\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n return message;\n },\n toJSON: function (message) {\n var obj = {};\n message.index !== undefined && (obj.index = message.index);\n if (message.addresses) {\n obj.addresses = message.addresses.map(function (e) { return e; });\n }\n else {\n obj.addresses = [];\n }\n return obj;\n },\n fromPartial: function (object) {\n var e_6, _a;\n var message = __assign({}, baseGuardianSet);\n message.addresses = [];\n if (object.index !== undefined && object.index !== null) {\n message.index = object.index;\n }\n else {\n message.index = 0;\n }\n if (object.addresses !== undefined && object.addresses !== null) {\n try {\n for (var _b = __values(object.addresses), _c = _b.next(); !_c.done; _c = _b.next()) {\n var e = _c.value;\n message.addresses.push(e);\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n return message;\n },\n};\nvar PublicRPCServiceClientImpl = /** @class */ (function () {\n function PublicRPCServiceClientImpl(rpc) {\n this.rpc = rpc;\n this.GetLastHeartbeats = this.GetLastHeartbeats.bind(this);\n this.GetSignedVAA = this.GetSignedVAA.bind(this);\n this.GetCurrentGuardianSet = this.GetCurrentGuardianSet.bind(this);\n }\n PublicRPCServiceClientImpl.prototype.GetLastHeartbeats = function (request, metadata) {\n return this.rpc.unary(PublicRPCServiceGetLastHeartbeatsDesc, GetLastHeartbeatsRequest.fromPartial(request), metadata);\n };\n PublicRPCServiceClientImpl.prototype.GetSignedVAA = function (request, metadata) {\n return this.rpc.unary(PublicRPCServiceGetSignedVAADesc, GetSignedVAARequest.fromPartial(request), metadata);\n };\n PublicRPCServiceClientImpl.prototype.GetCurrentGuardianSet = function (request, metadata) {\n return this.rpc.unary(PublicRPCServiceGetCurrentGuardianSetDesc, GetCurrentGuardianSetRequest.fromPartial(request), metadata);\n };\n return PublicRPCServiceClientImpl;\n}());\nexport { PublicRPCServiceClientImpl };\nexport var PublicRPCServiceDesc = {\n serviceName: \"publicrpc.v1.PublicRPCService\",\n};\nexport var PublicRPCServiceGetLastHeartbeatsDesc = {\n methodName: \"GetLastHeartbeats\",\n service: PublicRPCServiceDesc,\n requestStream: false,\n responseStream: false,\n requestType: {\n serializeBinary: function () {\n return GetLastHeartbeatsRequest.encode(this).finish();\n },\n },\n responseType: {\n deserializeBinary: function (data) {\n return __assign(__assign({}, GetLastHeartbeatsResponse.decode(data)), { toObject: function () {\n return this;\n } });\n },\n },\n};\nexport var PublicRPCServiceGetSignedVAADesc = {\n methodName: \"GetSignedVAA\",\n service: PublicRPCServiceDesc,\n requestStream: false,\n responseStream: false,\n requestType: {\n serializeBinary: function () {\n return GetSignedVAARequest.encode(this).finish();\n },\n },\n responseType: {\n deserializeBinary: function (data) {\n return __assign(__assign({}, GetSignedVAAResponse.decode(data)), { toObject: function () {\n return this;\n } });\n },\n },\n};\nexport var PublicRPCServiceGetCurrentGuardianSetDesc = {\n methodName: \"GetCurrentGuardianSet\",\n service: PublicRPCServiceDesc,\n requestStream: false,\n responseStream: false,\n requestType: {\n serializeBinary: function () {\n return GetCurrentGuardianSetRequest.encode(this).finish();\n },\n },\n responseType: {\n deserializeBinary: function (data) {\n return __assign(__assign({}, GetCurrentGuardianSetResponse.decode(data)), { toObject: function () {\n return this;\n } });\n },\n },\n};\nvar GrpcWebImpl = /** @class */ (function () {\n function GrpcWebImpl(host, options) {\n this.host = host;\n this.options = options;\n }\n GrpcWebImpl.prototype.unary = function (methodDesc, _request, metadata) {\n var _this = this;\n var _a;\n var request = __assign(__assign({}, _request), methodDesc.requestType);\n var maybeCombinedMetadata = metadata && this.options.metadata\n ? new BrowserHeaders(__assign(__assign({}, (_a = this.options) === null || _a === void 0 ? void 0 : _a.metadata.headersMap), metadata === null || metadata === void 0 ? void 0 : metadata.headersMap))\n : metadata || this.options.metadata;\n return new Promise(function (resolve, reject) {\n grpc.unary(methodDesc, {\n request: request,\n host: _this.host,\n metadata: maybeCombinedMetadata,\n transport: _this.options.transport,\n debug: _this.options.debug,\n onEnd: function (response) {\n if (response.status === grpc.Code.OK) {\n resolve(response.message);\n }\n else {\n var err = new Error(response.statusMessage);\n err.code = response.status;\n err.metadata = response.trailers;\n reject(err);\n }\n },\n });\n });\n };\n return GrpcWebImpl;\n}());\nexport { GrpcWebImpl };\nvar globalThis = (function () {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nvar atob = globalThis.atob ||\n (function (b64) { return globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"); });\nfunction bytesFromBase64(b64) {\n var bin = atob(b64);\n var arr = new Uint8Array(bin.length);\n for (var i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nvar btoa = globalThis.btoa ||\n (function (bin) { return globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"); });\nfunction base64FromBytes(arr) {\n var e_7, _a;\n var bin = [];\n try {\n for (var arr_1 = __values(arr), arr_1_1 = arr_1.next(); !arr_1_1.done; arr_1_1 = arr_1.next()) {\n var byte = arr_1_1.value;\n bin.push(String.fromCharCode(byte));\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (arr_1_1 && !arr_1_1.done && (_a = arr_1.return)) _a.call(arr_1);\n }\n finally { if (e_7) throw e_7.error; }\n }\n return btoa(bin.join(\"\"));\n}\nfunction longToString(long) {\n return long.toString();\n}\nif (_m0.util.Long !== Long) {\n _m0.util.Long = Long;\n _m0.configure();\n}\n","!function(e,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)(\"object\"==typeof exports?exports:e)[n]=r[n]}}(this,(function(){return e={418:function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=1)}([function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(3),o=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={splitValues:!1});var r,o=this;this.headersMap={},e&&(\"undefined\"!=typeof Headers&&e instanceof Headers?n.getHeaderKeys(e).forEach((function(r){n.getHeaderValues(e,r).forEach((function(e){t.splitValues?o.append(r,n.splitHeaderValue(e)):o.append(r,e)}))})):\"object\"==typeof(r=e)&&\"object\"==typeof r.headersMap&&\"function\"==typeof r.forEach?e.forEach((function(e,t){o.append(e,t)})):\"undefined\"!=typeof Map&&e instanceof Map?e.forEach((function(e,t){o.append(t,e)})):\"string\"==typeof e?this.appendFromString(e):\"object\"==typeof e&&Object.getOwnPropertyNames(e).forEach((function(t){var r=e[t];Array.isArray(r)?r.forEach((function(e){o.append(t,e)})):o.append(t,r)})))}return e.prototype.appendFromString=function(e){for(var t=e.split(\"\\r\\n\"),r=0;r0){var s=n.substring(0,o).trim(),i=n.substring(o+1).trim();this.append(s,i)}}},e.prototype.delete=function(e,t){var r=n.normalizeName(e);if(void 0===t)delete this.headersMap[r];else{var o=this.headersMap[r];if(o){var s=o.indexOf(t);s>=0&&o.splice(s,1),0===o.length&&delete this.headersMap[r]}}},e.prototype.append=function(e,t){var r=this,o=n.normalizeName(e);Array.isArray(this.headersMap[o])||(this.headersMap[o]=[]),Array.isArray(t)?t.forEach((function(e){r.headersMap[o].push(n.normalizeValue(e))})):this.headersMap[o].push(n.normalizeValue(t))},e.prototype.set=function(e,t){var r=n.normalizeName(e);if(Array.isArray(t)){var o=[];t.forEach((function(e){o.push(n.normalizeValue(e))})),this.headersMap[r]=o}else this.headersMap[r]=[n.normalizeValue(t)]},e.prototype.has=function(e,t){var r=this.headersMap[n.normalizeName(e)];if(!Array.isArray(r))return!1;if(void 0!==t){var o=n.normalizeValue(t);return r.indexOf(o)>=0}return!0},e.prototype.get=function(e){var t=this.headersMap[n.normalizeName(e)];return void 0!==t?t.concat():[]},e.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.headersMap).forEach((function(r){e(r,t.headersMap[r])}),this)},e.prototype.toHeaders=function(){if(\"undefined\"!=typeof Headers){var e=new Headers;return this.forEach((function(t,r){r.forEach((function(r){e.append(t,r)}))})),e}throw new Error(\"Headers class is not defined\")},e}();t.BrowserHeaders=o},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(0);t.BrowserHeaders=n.BrowserHeaders},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.iterateHeaders=function(e,t){for(var r=e[Symbol.iterator](),n=r.next();!n.done;)t(n.value[0]),n=r.next()},t.iterateHeadersKeys=function(e,t){for(var r=e.keys(),n=r.next();!n.done;)t(n.value),n=r.next()}},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(2);t.normalizeName=function(e){if(\"string\"!=typeof e&&(e=String(e)),/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(e))throw new TypeError(\"Invalid character in header field name\");return e.toLowerCase()},t.normalizeValue=function(e){return\"string\"!=typeof e&&(e=String(e)),e},t.getHeaderValues=function(e,t){var r=e;if(r instanceof Headers&&r.getAll)return r.getAll(t);var n=r.get(t);return n&&\"string\"==typeof n?[n]:n},t.getHeaderKeys=function(e){var t=e,r={},o=[];return t.keys?n.iterateHeadersKeys(t,(function(e){r[e]||(r[e]=!0,o.push(e))})):t.forEach?t.forEach((function(e,t){r[t]||(r[t]=!0,o.push(t))})):n.iterateHeaders(t,(function(e){var t=e[0];r[t]||(r[t]=!0,o.push(t))})),o},t.splitHeaderValue=function(e){var t=[];return e.split(\", \").forEach((function(e){e.split(\",\").forEach((function(e){t.push(e)}))})),t}}]))},617:function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ChunkParser=t.ChunkType=t.encodeASCII=t.decodeASCII=void 0;var n,o=r(65);function s(e){return 9===(t=e)||10===t||13===t||e>=32&&e<=126;var t}function i(e){for(var t=0;t!==e.length;++t)if(!s(e[t]))throw new Error(\"Metadata is not valid (printable) ASCII\");return String.fromCharCode.apply(String,Array.prototype.slice.call(e))}function a(e){return 128==(128&e.getUint8(0))}function u(e){return e.getUint32(1,!1)}function d(e,t,r){return e.byteLength-t>=r}function c(e,t,r){if(e.slice)return e.slice(t,r);var n=e.length;void 0!==r&&(n=r);for(var o=new Uint8Array(n-t),s=0,i=t;i=0?r:s.httpStatusToCode(t);this.props.debug&&i.debug(\"onHeaders.code\",n);var o=e.get(\"grpc-message\")||[];if(this.props.debug&&i.debug(\"onHeaders.gRPCMessage\",o),this.rawOnHeaders(e),n!==s.Code.OK){var a=this.decodeGRPCStatus(o[0]);this.rawOnError(n,a,e)}}},e.prototype.onTransportChunk=function(e){var t=this;if(this.closed)this.props.debug&&i.debug(\"grpc.onChunk received after request was closed - ignoring\");else{var r=[];try{r=this.parser.parse(e)}catch(e){return this.props.debug&&i.debug(\"onChunk.parsing error\",e,e.message),void this.rawOnError(s.Code.Internal,\"parsing error: \"+e.message)}r.forEach((function(e){if(e.chunkType===o.ChunkType.MESSAGE){var r=t.methodDefinition.responseType.deserializeBinary(e.data);t.rawOnMessage(r)}else e.chunkType===o.ChunkType.TRAILERS&&(t.responseHeaders?(t.responseTrailers=new n.Metadata(e.trailers),t.props.debug&&i.debug(\"onChunk.trailers\",t.responseTrailers)):(t.responseHeaders=new n.Metadata(e.trailers),t.rawOnHeaders(t.responseHeaders)))}))}},e.prototype.onTransportEnd=function(){if(this.props.debug&&i.debug(\"grpc.onEnd\"),this.closed)this.props.debug&&i.debug(\"grpc.onEnd received after request was closed - ignoring\");else if(void 0!==this.responseTrailers){var e=c(this.responseTrailers);if(null!==e){var t=this.responseTrailers.get(\"grpc-message\"),r=this.decodeGRPCStatus(t[0]);this.rawOnEnd(e,r,this.responseTrailers)}else this.rawOnError(s.Code.Internal,\"Response closed without grpc-status (Trailers provided)\")}else{if(void 0===this.responseHeaders)return void this.rawOnError(s.Code.Unknown,\"Response closed without headers\");var n=c(this.responseHeaders),o=this.responseHeaders.get(\"grpc-message\");if(this.props.debug&&i.debug(\"grpc.headers only response \",n,o),null===n)return void this.rawOnEnd(s.Code.Unknown,\"Response closed without grpc-status (Headers only)\",this.responseHeaders);var a=this.decodeGRPCStatus(o[0]);this.rawOnEnd(n,a,this.responseHeaders)}},e.prototype.decodeGRPCStatus=function(e){if(!e)return\"\";try{return decodeURIComponent(e)}catch(t){return e}},e.prototype.rawOnEnd=function(e,t,r){var n=this;this.props.debug&&i.debug(\"rawOnEnd\",e,t,r),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(o){if(!n.closed)try{o(e,t,r)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnHeaders=function(e){this.props.debug&&i.debug(\"rawOnHeaders\",e),this.completed||this.onHeadersCallbacks.forEach((function(t){try{t(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.rawOnError=function(e,t,r){var o=this;void 0===r&&(r=new n.Metadata),this.props.debug&&i.debug(\"rawOnError\",e,t),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(n){if(!o.closed)try{n(e,t,r)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnMessage=function(e){var t=this;this.props.debug&&i.debug(\"rawOnMessage\",e.toObject()),this.completed||this.closed||this.onMessageCallbacks.forEach((function(r){if(!t.closed)try{r(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.onHeaders=function(e){this.onHeadersCallbacks.push(e)},e.prototype.onMessage=function(e){this.onMessageCallbacks.push(e)},e.prototype.onEnd=function(e){this.onEndCallbacks.push(e)},e.prototype.start=function(e){if(this.started)throw new Error(\"Client already started - cannot .start()\");this.started=!0;var t=new n.Metadata(e||{});t.set(\"content-type\",\"application/grpc-web+proto\"),t.set(\"x-grpc-web\",\"1\"),this.transport.start(t)},e.prototype.send=function(e){if(!this.started)throw new Error(\"Client not started - .start() must be called before .send()\");if(this.closed)throw new Error(\"Client already closed - cannot .send()\");if(this.finishedSending)throw new Error(\"Client already finished sending - cannot .send()\");if(!this.methodDefinition.requestStream&&this.sentFirstMessage)throw new Error(\"Message already sent for non-client-streaming method - cannot .send()\");this.sentFirstMessage=!0;var t=u.frameRequest(e);this.transport.sendMessage(t)},e.prototype.finishSend=function(){if(!this.started)throw new Error(\"Client not started - .finishSend() must be called before .close()\");if(this.closed)throw new Error(\"Client already closed - cannot .send()\");if(this.finishedSending)throw new Error(\"Client already finished sending - cannot .finishSend()\");this.finishedSending=!0,this.transport.finishSend()},e.prototype.close=function(){if(!this.started)throw new Error(\"Client not started - .start() must be called before .close()\");if(this.closed)throw new Error(\"Client already closed - cannot .close()\");this.closed=!0,this.props.debug&&i.debug(\"request.abort aborting request\"),this.transport.cancel()},e}();function c(e){var t=e.get(\"grpc-status\")||[];if(t.length>0)try{var r=t[0];return parseInt(r,10)}catch(e){return null}return null}},346:function(e,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.debug=void 0,t.debug=function(){for(var e=[],t=0;t=55296&&r<=56319){var n=e.charCodeAt(t+1);n>=56320&&n<=57343&&(r=65536+(r-55296<<10)+(n-56320))}return r}function p(e){for(var t=new Uint8Array(e.length),r=0,n=0;n\r\n * https://github.com/MikeMcl/big.js/LICENCE\r\n */\r\n;(function (GLOBAL) {\r\n 'use strict';\r\n var Big,\r\n\r\n\r\n/************************************** EDITABLE DEFAULTS *****************************************/\r\n\r\n\r\n // The default values below must be integers within the stated ranges.\r\n\r\n /*\r\n * The maximum number of decimal places (DP) of the results of operations involving division:\r\n * div and sqrt, and pow with negative exponents.\r\n */\r\n DP = 20, // 0 to MAX_DP\r\n\r\n /*\r\n * The rounding mode (RM) used when rounding to the above decimal places.\r\n *\r\n * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)\r\n * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)\r\n * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)\r\n * 3 Away from zero. (ROUND_UP)\r\n */\r\n RM = 1, // 0, 1, 2 or 3\r\n\r\n // The maximum value of DP and Big.DP.\r\n MAX_DP = 1E6, // 0 to 1000000\r\n\r\n // The maximum magnitude of the exponent argument to the pow method.\r\n MAX_POWER = 1E6, // 1 to 1000000\r\n\r\n /*\r\n * The negative exponent (NE) at and beneath which toString returns exponential notation.\r\n * (JavaScript numbers: -7)\r\n * -1000000 is the minimum recommended exponent value of a Big.\r\n */\r\n NE = -7, // 0 to -1000000\r\n\r\n /*\r\n * The positive exponent (PE) at and above which toString returns exponential notation.\r\n * (JavaScript numbers: 21)\r\n * 1000000 is the maximum recommended exponent value of a Big.\r\n * (This limit is not enforced or checked.)\r\n */\r\n PE = 21, // 0 to 1000000\r\n\r\n\r\n/**************************************************************************************************/\r\n\r\n\r\n // Error messages.\r\n NAME = '[big.js] ',\r\n INVALID = NAME + 'Invalid ',\r\n INVALID_DP = INVALID + 'decimal places',\r\n INVALID_RM = INVALID + 'rounding mode',\r\n DIV_BY_ZERO = NAME + 'Division by zero',\r\n\r\n // The shared prototype object.\r\n P = {},\r\n UNDEFINED = void 0,\r\n NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\r\n\r\n\r\n /*\r\n * Create and return a Big constructor.\r\n *\r\n */\r\n function _Big_() {\r\n\r\n /*\r\n * The Big constructor and exported function.\r\n * Create and return a new instance of a Big number object.\r\n *\r\n * n {number|string|Big} A numeric value.\r\n */\r\n function Big(n) {\r\n var x = this;\r\n\r\n // Enable constructor usage without new.\r\n if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n);\r\n\r\n // Duplicate.\r\n if (n instanceof Big) {\r\n x.s = n.s;\r\n x.e = n.e;\r\n x.c = n.c.slice();\r\n } else {\r\n parse(x, n);\r\n }\r\n\r\n /*\r\n * Retain a reference to this Big constructor, and shadow Big.prototype.constructor which\r\n * points to Object.\r\n */\r\n x.constructor = Big;\r\n }\r\n\r\n Big.prototype = P;\r\n Big.DP = DP;\r\n Big.RM = RM;\r\n Big.NE = NE;\r\n Big.PE = PE;\r\n Big.version = '5.2.2';\r\n\r\n return Big;\r\n }\r\n\r\n\r\n /*\r\n * Parse the number or string value passed to a Big constructor.\r\n *\r\n * x {Big} A Big number instance.\r\n * n {number|string} A numeric value.\r\n */\r\n function parse(x, n) {\r\n var e, i, nl;\r\n\r\n // Minus zero?\r\n if (n === 0 && 1 / n < 0) n = '-0';\r\n else if (!NUMERIC.test(n += '')) throw Error(INVALID + 'number');\r\n\r\n // Determine sign.\r\n x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\r\n\r\n // Decimal point?\r\n if ((e = n.indexOf('.')) > -1) n = n.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = n.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +n.slice(i + 1);\r\n n = n.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = n.length;\r\n }\r\n\r\n nl = n.length;\r\n\r\n // Determine leading zeros.\r\n for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\r\n\r\n if (i == nl) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n\r\n // Determine trailing zeros.\r\n for (; nl > 0 && n.charAt(--nl) == '0';);\r\n x.e = e - i - 1;\r\n x.c = [];\r\n\r\n // Convert string to array of digits without leading/trailing zeros.\r\n for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Round Big x to a maximum of dp decimal places using rounding mode rm.\r\n * Called by stringify, P.div, P.round and P.sqrt.\r\n *\r\n * x {Big} The Big to round.\r\n * dp {number} Integer, 0 to MAX_DP inclusive.\r\n * rm {number} 0, 1, 2 or 3 (DOWN, HALF_UP, HALF_EVEN, UP)\r\n * [more] {boolean} Whether the result of division was truncated.\r\n */\r\n function round(x, dp, rm, more) {\r\n var xc = x.c,\r\n i = x.e + dp + 1;\r\n\r\n if (i < xc.length) {\r\n if (rm === 1) {\r\n\r\n // xc[i] is the digit after the digit that may be rounded up.\r\n more = xc[i] >= 5;\r\n } else if (rm === 2) {\r\n more = xc[i] > 5 || xc[i] == 5 &&\r\n (more || i < 0 || xc[i + 1] !== UNDEFINED || xc[i - 1] & 1);\r\n } else if (rm === 3) {\r\n more = more || !!xc[0];\r\n } else {\r\n more = false;\r\n if (rm !== 0) throw Error(INVALID_RM);\r\n }\r\n\r\n if (i < 1) {\r\n xc.length = 1;\r\n\r\n if (more) {\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n x.e = -dp;\r\n xc[0] = 1;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n } else {\r\n\r\n // Remove any digits after the required decimal places.\r\n xc.length = i--;\r\n\r\n // Round up?\r\n if (more) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up.\r\n for (; ++xc[i] > 9;) {\r\n xc[i] = 0;\r\n if (!i--) {\r\n ++x.e;\r\n xc.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xc.length; !xc[--i];) xc.pop();\r\n }\r\n } else if (rm < 0 || rm > 3 || rm !== ~~rm) {\r\n throw Error(INVALID_RM);\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Return a string representing the value of Big x in normal or exponential notation.\r\n * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\r\n *\r\n * x {Big}\r\n * id? {number} Caller id.\r\n * 1 toExponential\r\n * 2 toFixed\r\n * 3 toPrecision\r\n * 4 valueOf\r\n * n? {number|undefined} Caller's argument.\r\n * k? {number|undefined}\r\n */\r\n function stringify(x, id, n, k) {\r\n var e, s,\r\n Big = x.constructor,\r\n z = !x.c[0];\r\n\r\n if (n !== UNDEFINED) {\r\n if (n !== ~~n || n < (id == 3) || n > MAX_DP) {\r\n throw Error(id == 3 ? INVALID + 'precision' : INVALID_DP);\r\n }\r\n\r\n x = new Big(x);\r\n\r\n // The index of the digit that may be rounded up.\r\n n = k - x.e;\r\n\r\n // Round?\r\n if (x.c.length > ++k) round(x, n, Big.RM);\r\n\r\n // toFixed: recalculate k as x.e may have changed if value rounded up.\r\n if (id == 2) k = x.e + n + 1;\r\n\r\n // Append zeros?\r\n for (; x.c.length < k;) x.c.push(0);\r\n }\r\n\r\n e = x.e;\r\n s = x.c.join('');\r\n n = s.length;\r\n\r\n // Exponential notation?\r\n if (id != 2 && (id == 1 || id == 3 && k <= e || e <= Big.NE || e >= Big.PE)) {\r\n s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\r\n\r\n // Normal notation.\r\n } else if (e < 0) {\r\n for (; ++e;) s = '0' + s;\r\n s = '0.' + s;\r\n } else if (e > 0) {\r\n if (++e > n) for (e -= n; e--;) s += '0';\r\n else if (e < n) s = s.slice(0, e) + '.' + s.slice(e);\r\n } else if (n > 1) {\r\n s = s.charAt(0) + '.' + s.slice(1);\r\n }\r\n\r\n return x.s < 0 && (!z || id == 4) ? '-' + s : s;\r\n }\r\n\r\n\r\n // Prototype/instance methods\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the absolute value of this Big.\r\n */\r\n P.abs = function () {\r\n var x = new this.constructor(this);\r\n x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return 1 if the value of this Big is greater than the value of Big y,\r\n * -1 if the value of this Big is less than the value of Big y, or\r\n * 0 if they have the same value.\r\n */\r\n P.cmp = function (y) {\r\n var isneg,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new x.constructor(y)).c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n isneg = i < 0;\r\n\r\n // Compare exponents.\r\n if (k != l) return k > l ^ isneg ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = -1; ++i < j;) {\r\n if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ isneg ? 1 : -1;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\r\n * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n */\r\n P.div = function (y) {\r\n var x = this,\r\n Big = x.constructor,\r\n a = x.c, // dividend\r\n b = (y = new Big(y)).c, // divisor\r\n k = x.s == y.s ? 1 : -1,\r\n dp = Big.DP;\r\n\r\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);\r\n\r\n // Divisor is zero?\r\n if (!b[0]) throw Error(DIV_BY_ZERO);\r\n\r\n // Dividend is 0? Return +-0.\r\n if (!a[0]) return new Big(k * 0);\r\n\r\n var bl, bt, n, cmp, ri,\r\n bz = b.slice(),\r\n ai = bl = b.length,\r\n al = a.length,\r\n r = a.slice(0, bl), // remainder\r\n rl = r.length,\r\n q = y, // quotient\r\n qc = q.c = [],\r\n qi = 0,\r\n d = dp + (q.e = x.e - y.e) + 1; // number of digits of the result\r\n\r\n q.s = k;\r\n k = d < 0 ? 0 : d;\r\n\r\n // Create version of divisor with leading zero.\r\n bz.unshift(0);\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; rl++ < bl;) r.push(0);\r\n\r\n do {\r\n\r\n // n is how many times the divisor goes into current remainder.\r\n for (n = 0; n < 10; n++) {\r\n\r\n // Compare divisor and remainder.\r\n if (bl != (rl = r.length)) {\r\n cmp = bl > rl ? 1 : -1;\r\n } else {\r\n for (ri = -1, cmp = 0; ++ri < bl;) {\r\n if (b[ri] != r[ri]) {\r\n cmp = b[ri] > r[ri] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // If divisor < remainder, subtract divisor from remainder.\r\n if (cmp < 0) {\r\n\r\n // Remainder can't be more than 1 digit longer than divisor.\r\n // Equalise lengths using divisor with extra leading zero?\r\n for (bt = rl == bl ? b : bz; rl;) {\r\n if (r[--rl] < bt[rl]) {\r\n ri = rl;\r\n for (; ri && !r[--ri];) r[ri] = 9;\r\n --r[ri];\r\n r[rl] += 10;\r\n }\r\n r[rl] -= bt[rl];\r\n }\r\n\r\n for (; !r[0];) r.shift();\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n // Add the digit n to the result array.\r\n qc[qi++] = cmp ? n : ++n;\r\n\r\n // Update the remainder.\r\n if (r[0] && cmp) r[rl] = a[ai] || 0;\r\n else r = [a[ai]];\r\n\r\n } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\r\n\r\n // Leading zero? Do not remove if result is simply zero (qi == 1).\r\n if (!qc[0] && qi != 1) {\r\n\r\n // There can't be more than one zero.\r\n qc.shift();\r\n q.e--;\r\n }\r\n\r\n // Round?\r\n if (qi > d) round(q, dp, Big.RM, r[0] !== UNDEFINED);\r\n\r\n return q;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\r\n */\r\n P.eq = function (y) {\r\n return !this.cmp(y);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Big is greater than the value of Big y, otherwise return\r\n * false.\r\n */\r\n P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\r\n * return false.\r\n */\r\n P.gte = function (y) {\r\n return this.cmp(y) > -1;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Big is less than the value of Big y, otherwise return false.\r\n */\r\n P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\r\n * return false.\r\n */\r\n P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the value of this Big minus the value of Big y.\r\n */\r\n P.minus = P.sub = function (y) {\r\n var i, j, t, xlty,\r\n x = this,\r\n Big = x.constructor,\r\n a = x.s,\r\n b = (y = new Big(y)).s;\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xc = x.c.slice(),\r\n xe = x.e,\r\n yc = y.c,\r\n ye = y.e;\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n\r\n // y is non-zero? x is non-zero? Or both are zero.\r\n return yc[0] ? (y.s = -b, y) : new Big(xc[0] ? x : 0);\r\n }\r\n\r\n // Determine which is the bigger number. Prepend zeros to equalise exponents.\r\n if (a = xe - ye) {\r\n\r\n if (xlty = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n for (b = a; b--;) t.push(0);\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = ((xlty = xc.length < yc.length) ? xc : yc).length;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n if (xc[b] != yc[b]) {\r\n xlty = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xlty) {\r\n t = xc;\r\n xc = yc;\r\n yc = t;\r\n y.s = -y.s;\r\n }\r\n\r\n /*\r\n * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\r\n * needs to start at yc.length.\r\n */\r\n if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--;) xc[i++] = 0;\r\n\r\n // Subtract yc from xc.\r\n for (b = i; j > a;) {\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i];) xc[i] = 9;\r\n --xc[i];\r\n xc[j] += 10;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--b] === 0;) xc.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] === 0;) {\r\n xc.shift();\r\n --ye;\r\n }\r\n\r\n if (!xc[0]) {\r\n\r\n // n - n = +0\r\n y.s = 1;\r\n\r\n // Result must be zero.\r\n xc = [ye = 0];\r\n }\r\n\r\n y.c = xc;\r\n y.e = ye;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the value of this Big modulo the value of Big y.\r\n */\r\n P.mod = function (y) {\r\n var ygtx,\r\n x = this,\r\n Big = x.constructor,\r\n a = x.s,\r\n b = (y = new Big(y)).s;\r\n\r\n if (!y.c[0]) throw Error(DIV_BY_ZERO);\r\n\r\n x.s = y.s = 1;\r\n ygtx = y.cmp(x) == 1;\r\n x.s = a;\r\n y.s = b;\r\n\r\n if (ygtx) return new Big(x);\r\n\r\n a = Big.DP;\r\n b = Big.RM;\r\n Big.DP = Big.RM = 0;\r\n x = x.div(y);\r\n Big.DP = a;\r\n Big.RM = b;\r\n\r\n return this.minus(x.times(y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the value of this Big plus the value of Big y.\r\n */\r\n P.plus = P.add = function (y) {\r\n var t,\r\n x = this,\r\n Big = x.constructor,\r\n a = x.s,\r\n b = (y = new Big(y)).s;\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e,\r\n xc = x.c,\r\n ye = y.e,\r\n yc = y.c;\r\n\r\n // Either zero? y is non-zero? x is non-zero? Or both are zero.\r\n if (!xc[0] || !yc[0]) return yc[0] ? y : new Big(xc[0] ? x : a * 0);\r\n\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents.\r\n // Note: reverse faster than unshifts.\r\n if (a = xe - ye) {\r\n if (a > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n a = -a;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; a--;) t.push(0);\r\n t.reverse();\r\n }\r\n\r\n // Point xc to the longer array.\r\n if (xc.length - yc.length < 0) {\r\n t = yc;\r\n yc = xc;\r\n xc = t;\r\n }\r\n\r\n a = yc.length;\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\r\n for (b = 0; a; xc[a] %= 10) b = (xc[--a] = xc[a] + yc[a] + b) / 10 | 0;\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n\r\n if (b) {\r\n xc.unshift(b);\r\n ++ye;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (a = xc.length; xc[--a] === 0;) xc.pop();\r\n\r\n y.c = xc;\r\n y.e = ye;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * Return a Big whose value is the value of this Big raised to the power n.\r\n * If n is negative, round to a maximum of Big.DP decimal places using rounding\r\n * mode Big.RM.\r\n *\r\n * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\r\n */\r\n P.pow = function (n) {\r\n var x = this,\r\n one = new x.constructor(1),\r\n y = one,\r\n isneg = n < 0;\r\n\r\n if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) throw Error(INVALID + 'exponent');\r\n if (isneg) n = -n;\r\n\r\n for (;;) {\r\n if (n & 1) y = y.times(x);\r\n n >>= 1;\r\n if (!n) break;\r\n x = x.times(x);\r\n }\r\n\r\n return isneg ? one.div(y) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the value of this Big rounded using rounding mode rm\r\n * to a maximum of dp decimal places, or, if dp is negative, to an integer which is a\r\n * multiple of 10**-dp.\r\n * If dp is not specified, round to 0 decimal places.\r\n * If rm is not specified, use Big.RM.\r\n *\r\n * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.\r\n * rm? 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP)\r\n */\r\n P.round = function (dp, rm) {\r\n var Big = this.constructor;\r\n if (dp === UNDEFINED) dp = 0;\r\n else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) throw Error(INVALID_DP);\r\n return round(new Big(this), dp, rm === UNDEFINED ? Big.RM : rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the square root of the value of this Big, rounded, if\r\n * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n */\r\n P.sqrt = function () {\r\n var r, c, t,\r\n x = this,\r\n Big = x.constructor,\r\n s = x.s,\r\n e = x.e,\r\n half = new Big(0.5);\r\n\r\n // Zero?\r\n if (!x.c[0]) return new Big(x);\r\n\r\n // Negative?\r\n if (s < 0) throw Error(NAME + 'No square root');\r\n\r\n // Estimate.\r\n s = Math.sqrt(x + '');\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.\r\n if (s === 0 || s === 1 / 0) {\r\n c = x.c.join('');\r\n if (!(c.length + e & 1)) c += '0';\r\n s = Math.sqrt(c);\r\n e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\r\n r = new Big((s == 1 / 0 ? '1e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);\r\n } else {\r\n r = new Big(s);\r\n }\r\n\r\n e = r.e + (Big.DP += 4);\r\n\r\n // Newton-Raphson iteration.\r\n do {\r\n t = r;\r\n r = half.times(t.plus(x.div(t)));\r\n } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\r\n\r\n return round(r, Big.DP -= 4, Big.RM);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Big whose value is the value of this Big times the value of Big y.\r\n */\r\n P.times = P.mul = function (y) {\r\n var c,\r\n x = this,\r\n Big = x.constructor,\r\n xc = x.c,\r\n yc = (y = new Big(y)).c,\r\n a = xc.length,\r\n b = yc.length,\r\n i = x.e,\r\n j = y.e;\r\n\r\n // Determine sign of result.\r\n y.s = x.s == y.s ? 1 : -1;\r\n\r\n // Return signed 0 if either 0.\r\n if (!xc[0] || !yc[0]) return new Big(y.s * 0);\r\n\r\n // Initialise exponent of result as x.e + y.e.\r\n y.e = i + j;\r\n\r\n // If array xc has fewer digits than yc, swap xc and yc, and lengths.\r\n if (a < b) {\r\n c = xc;\r\n xc = yc;\r\n yc = c;\r\n j = a;\r\n a = b;\r\n b = j;\r\n }\r\n\r\n // Initialise coefficient array of result with zeros.\r\n for (c = new Array(j = a + b); j--;) c[j] = 0;\r\n\r\n // Multiply.\r\n\r\n // i is initially xc.length.\r\n for (i = b; i--;) {\r\n b = 0;\r\n\r\n // a is yc.length.\r\n for (j = a + i; j > i;) {\r\n\r\n // Current sum of products at this digit position, plus carry.\r\n b = c[j] + yc[i] * xc[j - i - 1] + b;\r\n c[j--] = b % 10;\r\n\r\n // carry\r\n b = b / 10 | 0;\r\n }\r\n\r\n c[j] = (c[j] + b) % 10;\r\n }\r\n\r\n // Increment result exponent if there is a final carry, otherwise remove leading zero.\r\n if (b) ++y.e;\r\n else c.shift();\r\n\r\n // Remove trailing zeros.\r\n for (i = c.length; !c[--i];) c.pop();\r\n y.c = c;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Big in exponential notation to dp fixed decimal\r\n * places and rounded using Big.RM.\r\n *\r\n * dp? {number} Integer, 0 to MAX_DP inclusive.\r\n */\r\n P.toExponential = function (dp) {\r\n return stringify(this, 1, dp, dp);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Big in normal notation to dp fixed decimal\r\n * places and rounded using Big.RM.\r\n *\r\n * dp? {number} Integer, 0 to MAX_DP inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n */\r\n P.toFixed = function (dp) {\r\n return stringify(this, 2, dp, this.e + dp);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Big rounded to sd significant digits using\r\n * Big.RM. Use exponential notation if sd is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * sd {number} Integer, 1 to MAX_DP inclusive.\r\n */\r\n P.toPrecision = function (sd) {\r\n return stringify(this, 3, sd, sd - 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Big.\r\n * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n * Omit the sign for negative zero.\r\n */\r\n P.toString = function () {\r\n return stringify(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Big.\r\n * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n * Include the sign for negative zero.\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n return stringify(this, 4);\r\n };\r\n\r\n\r\n // Export\r\n\r\n\r\n Big = _Big_();\r\n\r\n Big['default'] = Big.Big = Big;\r\n\r\n //AMD.\r\n if (typeof define === 'function' && define.amd) {\r\n define(function () { return Big; });\r\n\r\n // Node and other CommonJS-like environments that support module.exports.\r\n } else if (typeof module !== 'undefined' && module.exports) {\r\n module.exports = Big;\r\n\r\n //Browser.\r\n } else {\r\n GLOBAL.Big = Big;\r\n }\r\n})(this);\r\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar assert = require('minimalistic-assert');\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xf3bcc908,\n 0xbb67ae85, 0x84caa73b,\n 0x3c6ef372, 0xfe94f82b,\n 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1,\n 0x9b05688c, 0x2b3e6c1f,\n 0x1f83d9ab, 0xfb41bd6b,\n 0x5be0cd19, 0x137e2179 ];\n this.k = sha512_K;\n this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n var W = this.W;\n\n // 32 x 32bit words\n for (var i = 0; i < 32; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2\n var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n var c1_hi = W[i - 14]; // i - 7\n var c1_lo = W[i - 13];\n var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15\n var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n var c3_hi = W[i - 32]; // i - 16\n var c3_lo = W[i - 31];\n\n W[i] = sum64_4_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n W[i + 1] = sum64_4_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n this._prepareBlock(msg, start);\n\n var W = this.W;\n\n var ah = this.h[0];\n var al = this.h[1];\n var bh = this.h[2];\n var bl = this.h[3];\n var ch = this.h[4];\n var cl = this.h[5];\n var dh = this.h[6];\n var dl = this.h[7];\n var eh = this.h[8];\n var el = this.h[9];\n var fh = this.h[10];\n var fl = this.h[11];\n var gh = this.h[12];\n var gl = this.h[13];\n var hh = this.h[14];\n var hl = this.h[15];\n\n assert(this.k.length === W.length);\n for (var i = 0; i < W.length; i += 2) {\n var c0_hi = hh;\n var c0_lo = hl;\n var c1_hi = s1_512_hi(eh, el);\n var c1_lo = s1_512_lo(eh, el);\n var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n var c3_hi = this.k[i];\n var c3_lo = this.k[i + 1];\n var c4_hi = W[i];\n var c4_lo = W[i + 1];\n\n var T1_hi = sum64_5_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n var T1_lo = sum64_5_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n\n c0_hi = s0_512_hi(ah, al);\n c0_lo = s0_512_lo(ah, al);\n c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n hh = gh;\n hl = gl;\n\n gh = fh;\n gl = fl;\n\n fh = eh;\n fl = el;\n\n eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n dh = ch;\n dl = cl;\n\n ch = bh;\n cl = bl;\n\n bh = ah;\n bl = al;\n\n ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n\n sum64(this.h, 0, ah, al);\n sum64(this.h, 2, bh, bl);\n sum64(this.h, 4, ch, cl);\n sum64(this.h, 6, dh, dl);\n sum64(this.h, 8, eh, el);\n sum64(this.h, 10, fh, fl);\n sum64(this.h, 12, gh, gl);\n sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ ((~xh) & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ ((~xl) & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28);\n var c1_hi = rotr64_hi(xl, xh, 2); // 34\n var c2_hi = rotr64_hi(xl, xh, 7); // 39\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28);\n var c1_lo = rotr64_lo(xl, xh, 2); // 34\n var c2_lo = rotr64_lo(xl, xh, 7); // 39\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14);\n var c1_hi = rotr64_hi(xh, xl, 18);\n var c2_hi = rotr64_hi(xl, xh, 9); // 41\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14);\n var c1_lo = rotr64_lo(xh, xl, 18);\n var c2_lo = rotr64_lo(xl, xh, 9); // 41\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1);\n var c1_hi = rotr64_hi(xh, xl, 8);\n var c2_hi = shr64_hi(xh, xl, 7);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1);\n var c1_lo = rotr64_lo(xh, xl, 8);\n var c2_lo = shr64_lo(xh, xl, 7);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19);\n var c1_hi = rotr64_hi(xl, xh, 29); // 61\n var c2_hi = shr64_hi(xh, xl, 6);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19);\n var c1_lo = rotr64_lo(xl, xh, 29); // 61\n var c2_lo = shr64_lo(xh, xl, 6);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, hexConcat, hexlify, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { deepCopy, defineReadOnly, shallowCopy } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { id } from \"./id\";\nconst padding = new Uint8Array(32);\npadding.fill(0);\nconst NegativeOne = BigNumber.from(-1);\nconst Zero = BigNumber.from(0);\nconst One = BigNumber.from(1);\nconst MaxUint256 = BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nfunction hexPadRight(value) {\n const bytes = arrayify(value);\n const padOffset = bytes.length % 32;\n if (padOffset) {\n return hexConcat([bytes, padding.slice(padOffset)]);\n }\n return hexlify(bytes);\n}\nconst hexTrue = hexZeroPad(One.toHexString(), 32);\nconst hexFalse = hexZeroPad(Zero.toHexString(), 32);\nconst domainFieldTypes = {\n name: \"string\",\n version: \"string\",\n chainId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\"\n};\nconst domainFieldNames = [\n \"name\", \"version\", \"chainId\", \"verifyingContract\", \"salt\"\n];\nfunction checkString(key) {\n return function (value) {\n if (typeof (value) !== \"string\") {\n logger.throwArgumentError(`invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);\n }\n return value;\n };\n}\nconst domainChecks = {\n name: checkString(\"name\"),\n version: checkString(\"version\"),\n chainId: function (value) {\n try {\n return BigNumber.from(value).toString();\n }\n catch (error) { }\n return logger.throwArgumentError(`invalid domain value for \"chainId\"`, \"domain.chainId\", value);\n },\n verifyingContract: function (value) {\n try {\n return getAddress(value).toLowerCase();\n }\n catch (error) { }\n return logger.throwArgumentError(`invalid domain value \"verifyingContract\"`, \"domain.verifyingContract\", value);\n },\n salt: function (value) {\n try {\n const bytes = arrayify(value);\n if (bytes.length !== 32) {\n throw new Error(\"bad length\");\n }\n return hexlify(bytes);\n }\n catch (error) { }\n return logger.throwArgumentError(`invalid domain value \"salt\"`, \"domain.salt\", value);\n }\n};\nfunction getBaseEncoder(type) {\n // intXX and uintXX\n {\n const match = type.match(/^(u?)int(\\d*)$/);\n if (match) {\n const signed = (match[1] === \"\");\n const width = parseInt(match[2] || \"256\");\n if (width % 8 !== 0 || width > 256 || (match[2] && match[2] !== String(width))) {\n logger.throwArgumentError(\"invalid numeric width\", \"type\", type);\n }\n const boundsUpper = MaxUint256.mask(signed ? (width - 1) : width);\n const boundsLower = signed ? boundsUpper.add(One).mul(NegativeOne) : Zero;\n return function (value) {\n const v = BigNumber.from(value);\n if (v.lt(boundsLower) || v.gt(boundsUpper)) {\n logger.throwArgumentError(`value out-of-bounds for ${type}`, \"value\", value);\n }\n return hexZeroPad(v.toTwos(256).toHexString(), 32);\n };\n }\n }\n // bytesXX\n {\n const match = type.match(/^bytes(\\d+)$/);\n if (match) {\n const width = parseInt(match[1]);\n if (width === 0 || width > 32 || match[1] !== String(width)) {\n logger.throwArgumentError(\"invalid bytes width\", \"type\", type);\n }\n return function (value) {\n const bytes = arrayify(value);\n if (bytes.length !== width) {\n logger.throwArgumentError(`invalid length for ${type}`, \"value\", value);\n }\n return hexPadRight(value);\n };\n }\n }\n switch (type) {\n case \"address\": return function (value) {\n return hexZeroPad(getAddress(value), 32);\n };\n case \"bool\": return function (value) {\n return ((!value) ? hexFalse : hexTrue);\n };\n case \"bytes\": return function (value) {\n return keccak256(value);\n };\n case \"string\": return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields.map(({ name, type }) => (type + \" \" + name)).join(\",\")})`;\n}\nexport class TypedDataEncoder {\n constructor(types) {\n defineReadOnly(this, \"types\", Object.freeze(deepCopy(types)));\n defineReadOnly(this, \"_encoderCache\", {});\n defineReadOnly(this, \"_types\", {});\n // Link struct types to their direct child structs\n const links = {};\n // Link structs to structs which contain them as a child\n const parents = {};\n // Link all subtypes within a given struct\n const subtypes = {};\n Object.keys(types).forEach((type) => {\n links[type] = {};\n parents[type] = [];\n subtypes[type] = {};\n });\n for (const name in types) {\n const uniqueNames = {};\n types[name].forEach((field) => {\n // Check each field has a unique name\n if (uniqueNames[field.name]) {\n logger.throwArgumentError(`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, \"types\", types);\n }\n uniqueNames[field.name] = true;\n // Get the base type (drop any array specifiers)\n const baseType = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1];\n if (baseType === name) {\n logger.throwArgumentError(`circular type reference to ${JSON.stringify(baseType)}`, \"types\", types);\n }\n // Is this a base encoding type?\n const encoder = getBaseEncoder(baseType);\n if (encoder) {\n return;\n }\n if (!parents[baseType]) {\n logger.throwArgumentError(`unknown type ${JSON.stringify(baseType)}`, \"types\", types);\n }\n // Add linkage\n parents[baseType].push(name);\n links[name][baseType] = true;\n });\n }\n // Deduce the primary type\n const primaryTypes = Object.keys(parents).filter((n) => (parents[n].length === 0));\n if (primaryTypes.length === 0) {\n logger.throwArgumentError(\"missing primary type\", \"types\", types);\n }\n else if (primaryTypes.length > 1) {\n logger.throwArgumentError(`ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(\", \")}`, \"types\", types);\n }\n defineReadOnly(this, \"primaryType\", primaryTypes[0]);\n // Check for circular type references\n function checkCircular(type, found) {\n if (found[type]) {\n logger.throwArgumentError(`circular type reference to ${JSON.stringify(type)}`, \"types\", types);\n }\n found[type] = true;\n Object.keys(links[type]).forEach((child) => {\n if (!parents[child]) {\n return;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n Object.keys(found).forEach((subtype) => {\n subtypes[subtype][child] = true;\n });\n });\n delete found[type];\n }\n checkCircular(this.primaryType, {});\n // Compute each fully describe type\n for (const name in subtypes) {\n const st = Object.keys(subtypes[name]);\n st.sort();\n this._types[name] = encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join(\"\");\n }\n }\n getEncoder(type) {\n let encoder = this._encoderCache[type];\n if (!encoder) {\n encoder = this._encoderCache[type] = this._getEncoder(type);\n }\n return encoder;\n }\n _getEncoder(type) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return encoder;\n }\n }\n // Array\n const match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n const length = parseInt(match[3]);\n return (value) => {\n if (length >= 0 && value.length !== length) {\n logger.throwArgumentError(\"array length mismatch; expected length ${ arrayLength }\", \"value\", value);\n }\n let result = value.map(subEncoder);\n if (this._types[subtype]) {\n result = result.map(keccak256);\n }\n return keccak256(hexConcat(result));\n };\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n const encodedType = id(this._types[type]);\n return (value) => {\n const values = fields.map(({ name, type }) => {\n const result = this.getEncoder(type)(value[name]);\n if (this._types[type]) {\n return keccak256(result);\n }\n return result;\n });\n values.unshift(encodedType);\n return hexConcat(values);\n };\n }\n return logger.throwArgumentError(`unknown type: ${type}`, \"type\", type);\n }\n encodeType(name) {\n const result = this._types[name];\n if (!result) {\n logger.throwArgumentError(`unknown type: ${JSON.stringify(name)}`, \"name\", name);\n }\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return keccak256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\n }\n _visit(type, value, callback) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return callback(type, value);\n }\n }\n // Array\n const match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const length = parseInt(match[3]);\n if (length >= 0 && value.length !== length) {\n logger.throwArgumentError(\"array length mismatch; expected length ${ arrayLength }\", \"value\", value);\n }\n return value.map((v) => this._visit(subtype, v, callback));\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n return fields.reduce((accum, { name, type }) => {\n accum[name] = this._visit(type, value[name], callback);\n return accum;\n }, {});\n }\n return logger.throwArgumentError(`unknown type: ${type}`, \"type\", type);\n }\n visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\n }\n static hashDomain(domain) {\n const domainFields = [];\n for (const name in domain) {\n const type = domainFieldTypes[name];\n if (!type) {\n logger.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(name)}`, \"domain\", domain);\n }\n domainFields.push({ name, type });\n }\n domainFields.sort((a, b) => {\n return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);\n });\n return TypedDataEncoder.hashStruct(\"EIP712Domain\", { EIP712Domain: domainFields }, domain);\n }\n static encode(domain, types, value) {\n return hexConcat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value)\n ]);\n }\n static hash(domain, types, value) {\n return keccak256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\n static resolveNames(domain, types, value, resolveName) {\n return __awaiter(this, void 0, void 0, function* () {\n // Make a copy to isolate it from the object passed in\n domain = shallowCopy(domain);\n // Look up all ENS names\n const ensCache = {};\n // Do we need to look up the domain's verifyingContract?\n if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {\n ensCache[domain.verifyingContract] = \"0x\";\n }\n // We are going to use the encoder to visit all the base values\n const encoder = TypedDataEncoder.from(types);\n // Get a list of all the addresses\n encoder.visit(value, (type, value) => {\n if (type === \"address\" && !isHexString(value, 20)) {\n ensCache[value] = \"0x\";\n }\n return value;\n });\n // Lookup each name\n for (const name in ensCache) {\n ensCache[name] = yield resolveName(name);\n }\n // Replace the domain verifyingContract if needed\n if (domain.verifyingContract && ensCache[domain.verifyingContract]) {\n domain.verifyingContract = ensCache[domain.verifyingContract];\n }\n // Replace all ENS names with their address\n value = encoder.visit(value, (type, value) => {\n if (type === \"address\" && ensCache[value]) {\n return ensCache[value];\n }\n return value;\n });\n return { domain, value };\n });\n }\n static getPayload(domain, types, value) {\n // Validate the domain fields\n TypedDataEncoder.hashDomain(domain);\n // Derive the EIP712Domain Struct reference type\n const domainValues = {};\n const domainTypes = [];\n domainFieldNames.forEach((name) => {\n const value = domain[name];\n if (value == null) {\n return;\n }\n domainValues[name] = domainChecks[name](value);\n domainTypes.push({ name, type: domainFieldTypes[name] });\n });\n const encoder = TypedDataEncoder.from(types);\n const typesWithDomain = shallowCopy(types);\n if (typesWithDomain.EIP712Domain) {\n logger.throwArgumentError(\"types must not contain EIP712Domain type\", \"types.EIP712Domain\", types);\n }\n else {\n typesWithDomain.EIP712Domain = domainTypes;\n }\n // Validate the data structures and types\n encoder.encode(value);\n return {\n types: typesWithDomain,\n domain: domainValues,\n primaryType: encoder.primaryType,\n message: encoder.visit(value, (type, value) => {\n // bytes\n if (type.match(/^bytes(\\d*)/)) {\n return hexlify(arrayify(value));\n }\n // uint or int\n if (type.match(/^u?int/)) {\n return BigNumber.from(value).toString();\n }\n switch (type) {\n case \"address\":\n return value.toLowerCase();\n case \"bool\":\n return !!value;\n case \"string\":\n if (typeof (value) !== \"string\") {\n logger.throwArgumentError(`invalid string`, \"value\", value);\n }\n return value;\n }\n return logger.throwArgumentError(\"unsupported type\", \"type\", type);\n })\n };\n }\n}\n//# sourceMappingURL=typed-data.js.map","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","export const AddressZero = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map","\"use strict\";\nexport function shuffled(array) {\n array = array.slice();\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n return array;\n}\n//# sourceMappingURL=shuffle.js.map","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var getPrototypeOf = require(\"./getPrototypeOf.js\");\n\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct.js\");\n\nvar possibleConstructorReturn = require(\"./possibleConstructorReturn.js\");\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return possibleConstructorReturn(this, result);\n };\n}\n\nmodule.exports = _createSuper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var getPrototypeOf = require(\"./getPrototypeOf.js\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nvar isNativeFunction = require(\"./isNativeFunction.js\");\n\nvar construct = require(\"./construct.js\");\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = require('../package.json').version;\nelliptic.utils = require('./elliptic/utils');\nelliptic.rand = require('brorand');\nelliptic.curve = require('./elliptic/curve');\nelliptic.curves = require('./elliptic/curves');\n\n// Protocols\nelliptic.ec = require('./elliptic/ec');\nelliptic.eddsa = require('./elliptic/eddsa');\n","'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n","var r;\n\nmodule.exports = function rand(len) {\n if (!r)\n r = new Rand(null);\n\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes)\n return this.rand.getBytes(n);\n\n var res = new Uint8Array(n);\n for (var i = 0; i < res.length; i++)\n res[i] = this.rand.getByte();\n return res;\n};\n\nif (typeof self === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n };\n\n // Safari's WebWorkers do not have `crypto`\n } else if (typeof window === 'object') {\n // Old junk\n Rand.prototype._rand = function() {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = require('crypto');\n if (typeof crypto.randomBytes !== 'function')\n throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {\n }\n}\n","'use strict';\n\nvar curve = exports;\n\ncurve.base = require('./base');\ncurve.short = require('./short');\ncurve.mont = require('./mont');\ncurve.edwards = require('./edwards');\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { PublicKey } from \"@solana/web3.js\";\nimport { bech32 } from \"bech32\";\nimport { arrayify, zeroPad } from \"ethers/lib/utils\";\nimport { importTokenWasm } from \"../solana/wasm\";\nexport function getEmitterAddressEth(contractAddress) {\n return Buffer.from(zeroPad(arrayify(contractAddress), 32)).toString(\"hex\");\n}\nexport function getEmitterAddressSolana(programAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var emitter_address;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importTokenWasm()];\n case 1:\n emitter_address = (_a.sent()).emitter_address;\n return [2 /*return*/, Buffer.from(zeroPad(new PublicKey(emitter_address(programAddress)).toBytes(), 32)).toString(\"hex\")];\n }\n });\n });\n}\nexport function getEmitterAddressTerra(programAddress) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, Buffer.from(zeroPad(bech32.fromWords(bech32.decode(programAddress).words), 32)).toString(\"hex\")];\n });\n });\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgSend\"), exports);\n__exportStar(require(\"./MsgMultiSend\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgMultiSendResponse = exports.MsgMultiSend = exports.MsgSendResponse = exports.MsgSend = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nconst bank_1 = require(\"../../../cosmos/bank/v1beta1/bank\");\nexports.protobufPackage = \"cosmos.bank.v1beta1\";\nconst baseMsgSend = { fromAddress: \"\", toAddress: \"\" };\nexports.MsgSend = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.fromAddress !== \"\") {\n writer.uint32(10).string(message.fromAddress);\n }\n if (message.toAddress !== \"\") {\n writer.uint32(18).string(message.toAddress);\n }\n for (const v of message.amount) {\n coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSend);\n message.amount = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.fromAddress = reader.string();\n break;\n case 2:\n message.toAddress = reader.string();\n break;\n case 3:\n message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSend);\n message.amount = [];\n if (object.fromAddress !== undefined && object.fromAddress !== null) {\n message.fromAddress = String(object.fromAddress);\n }\n else {\n message.fromAddress = \"\";\n }\n if (object.toAddress !== undefined && object.toAddress !== null) {\n message.toAddress = String(object.toAddress);\n }\n else {\n message.toAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);\n message.toAddress !== undefined && (obj.toAddress = message.toAddress);\n if (message.amount) {\n obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.amount = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSend);\n message.amount = [];\n if (object.fromAddress !== undefined && object.fromAddress !== null) {\n message.fromAddress = object.fromAddress;\n }\n else {\n message.fromAddress = \"\";\n }\n if (object.toAddress !== undefined && object.toAddress !== null) {\n message.toAddress = object.toAddress;\n }\n else {\n message.toAddress = \"\";\n }\n if (object.amount !== undefined && object.amount !== null) {\n for (const e of object.amount) {\n message.amount.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseMsgSendResponse = {};\nexports.MsgSendResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSendResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgSendResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgSendResponse);\n return message;\n },\n};\nconst baseMsgMultiSend = {};\nexports.MsgMultiSend = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.inputs) {\n bank_1.Input.encode(v, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.outputs) {\n bank_1.Output.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgMultiSend);\n message.inputs = [];\n message.outputs = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.inputs.push(bank_1.Input.decode(reader, reader.uint32()));\n break;\n case 2:\n message.outputs.push(bank_1.Output.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgMultiSend);\n message.inputs = [];\n message.outputs = [];\n if (object.inputs !== undefined && object.inputs !== null) {\n for (const e of object.inputs) {\n message.inputs.push(bank_1.Input.fromJSON(e));\n }\n }\n if (object.outputs !== undefined && object.outputs !== null) {\n for (const e of object.outputs) {\n message.outputs.push(bank_1.Output.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.inputs) {\n obj.inputs = message.inputs.map((e) => (e ? bank_1.Input.toJSON(e) : undefined));\n }\n else {\n obj.inputs = [];\n }\n if (message.outputs) {\n obj.outputs = message.outputs.map((e) => (e ? bank_1.Output.toJSON(e) : undefined));\n }\n else {\n obj.outputs = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgMultiSend);\n message.inputs = [];\n message.outputs = [];\n if (object.inputs !== undefined && object.inputs !== null) {\n for (const e of object.inputs) {\n message.inputs.push(bank_1.Input.fromPartial(e));\n }\n }\n if (object.outputs !== undefined && object.outputs !== null) {\n for (const e of object.outputs) {\n message.outputs.push(bank_1.Output.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseMsgMultiSendResponse = {};\nexports.MsgMultiSendResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgMultiSendResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgMultiSendResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgMultiSendResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.Send = this.Send.bind(this);\n this.MultiSend = this.MultiSend.bind(this);\n }\n Send(request) {\n const data = exports.MsgSend.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.bank.v1beta1.Msg\", \"Send\", data);\n return promise.then((data) => exports.MsgSendResponse.decode(new minimal_1.default.Reader(data)));\n }\n MultiSend(request) {\n const data = exports.MsgMultiSend.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.bank.v1beta1.Msg\", \"MultiSend\", data);\n return promise.then((data) => exports.MsgMultiSendResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Metadata = exports.DenomUnit = exports.Supply = exports.Output = exports.Input = exports.SendEnabled = exports.Params = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"cosmos.bank.v1beta1\";\nconst baseParams = { defaultSendEnabled: false };\nexports.Params = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.sendEnabled) {\n exports.SendEnabled.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (message.defaultSendEnabled === true) {\n writer.uint32(16).bool(message.defaultSendEnabled);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParams);\n message.sendEnabled = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.sendEnabled.push(exports.SendEnabled.decode(reader, reader.uint32()));\n break;\n case 2:\n message.defaultSendEnabled = reader.bool();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParams);\n message.sendEnabled = [];\n if (object.sendEnabled !== undefined && object.sendEnabled !== null) {\n for (const e of object.sendEnabled) {\n message.sendEnabled.push(exports.SendEnabled.fromJSON(e));\n }\n }\n if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) {\n message.defaultSendEnabled = Boolean(object.defaultSendEnabled);\n }\n else {\n message.defaultSendEnabled = false;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.sendEnabled) {\n obj.sendEnabled = message.sendEnabled.map((e) => (e ? exports.SendEnabled.toJSON(e) : undefined));\n }\n else {\n obj.sendEnabled = [];\n }\n message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParams);\n message.sendEnabled = [];\n if (object.sendEnabled !== undefined && object.sendEnabled !== null) {\n for (const e of object.sendEnabled) {\n message.sendEnabled.push(exports.SendEnabled.fromPartial(e));\n }\n }\n if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) {\n message.defaultSendEnabled = object.defaultSendEnabled;\n }\n else {\n message.defaultSendEnabled = false;\n }\n return message;\n },\n};\nconst baseSendEnabled = { denom: \"\", enabled: false };\nexports.SendEnabled = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.denom !== \"\") {\n writer.uint32(10).string(message.denom);\n }\n if (message.enabled === true) {\n writer.uint32(16).bool(message.enabled);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSendEnabled);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.denom = reader.string();\n break;\n case 2:\n message.enabled = reader.bool();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSendEnabled);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = String(object.denom);\n }\n else {\n message.denom = \"\";\n }\n if (object.enabled !== undefined && object.enabled !== null) {\n message.enabled = Boolean(object.enabled);\n }\n else {\n message.enabled = false;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.denom !== undefined && (obj.denom = message.denom);\n message.enabled !== undefined && (obj.enabled = message.enabled);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSendEnabled);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = object.denom;\n }\n else {\n message.denom = \"\";\n }\n if (object.enabled !== undefined && object.enabled !== null) {\n message.enabled = object.enabled;\n }\n else {\n message.enabled = false;\n }\n return message;\n },\n};\nconst baseInput = { address: \"\" };\nexports.Input = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n for (const v of message.coins) {\n coin_1.Coin.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseInput);\n message.coins = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.address = reader.string();\n break;\n case 2:\n message.coins.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseInput);\n message.coins = [];\n if (object.address !== undefined && object.address !== null) {\n message.address = String(object.address);\n }\n else {\n message.address = \"\";\n }\n if (object.coins !== undefined && object.coins !== null) {\n for (const e of object.coins) {\n message.coins.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.address !== undefined && (obj.address = message.address);\n if (message.coins) {\n obj.coins = message.coins.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.coins = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseInput);\n message.coins = [];\n if (object.address !== undefined && object.address !== null) {\n message.address = object.address;\n }\n else {\n message.address = \"\";\n }\n if (object.coins !== undefined && object.coins !== null) {\n for (const e of object.coins) {\n message.coins.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseOutput = { address: \"\" };\nexports.Output = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n for (const v of message.coins) {\n coin_1.Coin.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseOutput);\n message.coins = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.address = reader.string();\n break;\n case 2:\n message.coins.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseOutput);\n message.coins = [];\n if (object.address !== undefined && object.address !== null) {\n message.address = String(object.address);\n }\n else {\n message.address = \"\";\n }\n if (object.coins !== undefined && object.coins !== null) {\n for (const e of object.coins) {\n message.coins.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.address !== undefined && (obj.address = message.address);\n if (message.coins) {\n obj.coins = message.coins.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.coins = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseOutput);\n message.coins = [];\n if (object.address !== undefined && object.address !== null) {\n message.address = object.address;\n }\n else {\n message.address = \"\";\n }\n if (object.coins !== undefined && object.coins !== null) {\n for (const e of object.coins) {\n message.coins.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseSupply = {};\nexports.Supply = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.total) {\n coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSupply);\n message.total = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.total.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSupply);\n message.total = [];\n if (object.total !== undefined && object.total !== null) {\n for (const e of object.total) {\n message.total.push(coin_1.Coin.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.total) {\n obj.total = message.total.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.total = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSupply);\n message.total = [];\n if (object.total !== undefined && object.total !== null) {\n for (const e of object.total) {\n message.total.push(coin_1.Coin.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseDenomUnit = { denom: \"\", exponent: 0, aliases: \"\" };\nexports.DenomUnit = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.denom !== \"\") {\n writer.uint32(10).string(message.denom);\n }\n if (message.exponent !== 0) {\n writer.uint32(16).uint32(message.exponent);\n }\n for (const v of message.aliases) {\n writer.uint32(26).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDenomUnit);\n message.aliases = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.denom = reader.string();\n break;\n case 2:\n message.exponent = reader.uint32();\n break;\n case 3:\n message.aliases.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDenomUnit);\n message.aliases = [];\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = String(object.denom);\n }\n else {\n message.denom = \"\";\n }\n if (object.exponent !== undefined && object.exponent !== null) {\n message.exponent = Number(object.exponent);\n }\n else {\n message.exponent = 0;\n }\n if (object.aliases !== undefined && object.aliases !== null) {\n for (const e of object.aliases) {\n message.aliases.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.denom !== undefined && (obj.denom = message.denom);\n message.exponent !== undefined && (obj.exponent = message.exponent);\n if (message.aliases) {\n obj.aliases = message.aliases.map((e) => e);\n }\n else {\n obj.aliases = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDenomUnit);\n message.aliases = [];\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = object.denom;\n }\n else {\n message.denom = \"\";\n }\n if (object.exponent !== undefined && object.exponent !== null) {\n message.exponent = object.exponent;\n }\n else {\n message.exponent = 0;\n }\n if (object.aliases !== undefined && object.aliases !== null) {\n for (const e of object.aliases) {\n message.aliases.push(e);\n }\n }\n return message;\n },\n};\nconst baseMetadata = { description: \"\", base: \"\", display: \"\", name: \"\", symbol: \"\" };\nexports.Metadata = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.description !== \"\") {\n writer.uint32(10).string(message.description);\n }\n for (const v of message.denomUnits) {\n exports.DenomUnit.encode(v, writer.uint32(18).fork()).ldelim();\n }\n if (message.base !== \"\") {\n writer.uint32(26).string(message.base);\n }\n if (message.display !== \"\") {\n writer.uint32(34).string(message.display);\n }\n if (message.name !== \"\") {\n writer.uint32(42).string(message.name);\n }\n if (message.symbol !== \"\") {\n writer.uint32(50).string(message.symbol);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMetadata);\n message.denomUnits = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.description = reader.string();\n break;\n case 2:\n message.denomUnits.push(exports.DenomUnit.decode(reader, reader.uint32()));\n break;\n case 3:\n message.base = reader.string();\n break;\n case 4:\n message.display = reader.string();\n break;\n case 5:\n message.name = reader.string();\n break;\n case 6:\n message.symbol = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMetadata);\n message.denomUnits = [];\n if (object.description !== undefined && object.description !== null) {\n message.description = String(object.description);\n }\n else {\n message.description = \"\";\n }\n if (object.denomUnits !== undefined && object.denomUnits !== null) {\n for (const e of object.denomUnits) {\n message.denomUnits.push(exports.DenomUnit.fromJSON(e));\n }\n }\n if (object.base !== undefined && object.base !== null) {\n message.base = String(object.base);\n }\n else {\n message.base = \"\";\n }\n if (object.display !== undefined && object.display !== null) {\n message.display = String(object.display);\n }\n else {\n message.display = \"\";\n }\n if (object.name !== undefined && object.name !== null) {\n message.name = String(object.name);\n }\n else {\n message.name = \"\";\n }\n if (object.symbol !== undefined && object.symbol !== null) {\n message.symbol = String(object.symbol);\n }\n else {\n message.symbol = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.description !== undefined && (obj.description = message.description);\n if (message.denomUnits) {\n obj.denomUnits = message.denomUnits.map((e) => (e ? exports.DenomUnit.toJSON(e) : undefined));\n }\n else {\n obj.denomUnits = [];\n }\n message.base !== undefined && (obj.base = message.base);\n message.display !== undefined && (obj.display = message.display);\n message.name !== undefined && (obj.name = message.name);\n message.symbol !== undefined && (obj.symbol = message.symbol);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMetadata);\n message.denomUnits = [];\n if (object.description !== undefined && object.description !== null) {\n message.description = object.description;\n }\n else {\n message.description = \"\";\n }\n if (object.denomUnits !== undefined && object.denomUnits !== null) {\n for (const e of object.denomUnits) {\n message.denomUnits.push(exports.DenomUnit.fromPartial(e));\n }\n }\n if (object.base !== undefined && object.base !== null) {\n message.base = object.base;\n }\n else {\n message.base = \"\";\n }\n if (object.display !== undefined && object.display !== null) {\n message.display = object.display;\n }\n else {\n message.display = \"\";\n }\n if (object.name !== undefined && object.name !== null) {\n message.name = object.name;\n }\n else {\n message.name = \"\";\n }\n if (object.symbol !== undefined && object.symbol !== null) {\n message.symbol = object.symbol;\n }\n else {\n message.symbol = \"\";\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=bank.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgSetWithdrawAddress\"), exports);\n__exportStar(require(\"./MsgWithdrawDelegatorReward\"), exports);\n__exportStar(require(\"./MsgWithdrawValidatorCommission\"), exports);\n__exportStar(require(\"./MsgFundCommunityPool\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgGrantAllowance\"), exports);\n__exportStar(require(\"./MsgRevokeAllowance\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Allowance = void 0;\nvar BasicAllowance_1 = require(\"./BasicAllowance\");\nvar PeriodicAllowance_1 = require(\"./PeriodicAllowance\");\nvar AllowedMsgAllowance_1 = require(\"./AllowedMsgAllowance\");\n__exportStar(require(\"./BasicAllowance\"), exports);\n__exportStar(require(\"./PeriodicAllowance\"), exports);\n__exportStar(require(\"./AllowedMsgAllowance\"), exports);\nvar Allowance;\n(function (Allowance) {\n function fromAmino(data) {\n switch (data.type) {\n case 'feegrant/BasicAllowance':\n return BasicAllowance_1.BasicAllowance.fromAmino(data);\n case 'feegrant/PeriodicAllowance':\n return PeriodicAllowance_1.PeriodicAllowance.fromAmino(data);\n case 'feegrant/AllowedMsgAllowance':\n return AllowedMsgAllowance_1.AllowedMsgAllowance.fromAmino(data);\n }\n }\n Allowance.fromAmino = fromAmino;\n function fromData(data) {\n switch (data['@type']) {\n case '/cosmos.feegrant.v1beta1.PeriodicAllowance':\n return PeriodicAllowance_1.PeriodicAllowance.fromData(data);\n case '/cosmos.feegrant.v1beta1.BasicAllowance':\n return BasicAllowance_1.BasicAllowance.fromData(data);\n case '/cosmos.feegrant.v1beta1.AllowedMsgAllowance':\n return AllowedMsgAllowance_1.AllowedMsgAllowance.fromData(data);\n }\n }\n Allowance.fromData = fromData;\n function fromProto(proto) {\n switch (proto.typeUrl) {\n case '/cosmos.feegrant.v1beta1.PeriodicAllowance':\n return PeriodicAllowance_1.PeriodicAllowance.unpackAny(proto);\n case '/cosmos.feegrant.v1beta1.BasicAllowance':\n return BasicAllowance_1.BasicAllowance.unpackAny(proto);\n case '/cosmos.feegrant.v1beta1.AllowedMsgAllowance':\n return AllowedMsgAllowance_1.AllowedMsgAllowance.unpackAny(proto);\n }\n throw new Error(\"not supported allowance \" + proto.typeUrl);\n }\n Allowance.fromProto = fromProto;\n})(Allowance = exports.Allowance || (exports.Allowance = {}));\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AllowedMsgAllowance = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar BasicAllowance_1 = require(\"./BasicAllowance\");\nvar PeriodicAllowance_1 = require(\"./PeriodicAllowance\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar feegrant_1 = require(\"@terra-money/terra.proto/cosmos/feegrant/v1beta1/feegrant\");\n/**\n * AllowedMsgAllowance creates allowance only for specified message types.\n */\nvar AllowedMsgAllowance = /** @class */ (function (_super) {\n __extends(AllowedMsgAllowance, _super);\n /**\n * @param allowance any of basic and periodic fee allowance.\n * @param allowed_messages the messages for which the grantee has the access.\n */\n function AllowedMsgAllowance(allowance, allowed_messages) {\n var _this = _super.call(this) || this;\n _this.allowance = allowance;\n _this.allowed_messages = allowed_messages;\n return _this;\n }\n AllowedMsgAllowance.fromAmino = function (data) {\n var _a = data.value, allowance = _a.allowance, allowed_messages = _a.allowed_messages;\n return new AllowedMsgAllowance(allowance.type === 'feegrant/BasicAllowance'\n ? BasicAllowance_1.BasicAllowance.fromAmino(allowance)\n : PeriodicAllowance_1.PeriodicAllowance.fromAmino(allowance), allowed_messages);\n };\n AllowedMsgAllowance.prototype.toAmino = function () {\n var _a = this, allowance = _a.allowance, allowed_messages = _a.allowed_messages;\n return {\n type: 'feegrant/AllowedMsgAllowance',\n value: {\n allowance: allowance.toAmino(),\n allowed_messages: allowed_messages,\n },\n };\n };\n AllowedMsgAllowance.fromData = function (proto) {\n var allowance = proto.allowance, allowed_messages = proto.allowed_messages;\n return new AllowedMsgAllowance(allowance['@type'] === '/cosmos.feegrant.v1beta1.BasicAllowance'\n ? BasicAllowance_1.BasicAllowance.fromData(allowance)\n : PeriodicAllowance_1.PeriodicAllowance.fromData(allowance), allowed_messages);\n };\n AllowedMsgAllowance.prototype.toData = function () {\n var _a = this, allowance = _a.allowance, allowed_messages = _a.allowed_messages;\n return {\n '@type': '/cosmos.feegrant.v1beta1.AllowedMsgAllowance',\n allowance: allowance.toData(),\n allowed_messages: allowed_messages,\n };\n };\n AllowedMsgAllowance.fromProto = function (proto) {\n var allowance = proto.allowance;\n return new AllowedMsgAllowance((allowance === null || allowance === void 0 ? void 0 : allowance.typeUrl) === '/cosmos.feegrant.v1beta1.BasicAllowance'\n ? BasicAllowance_1.BasicAllowance.unpackAny(allowance)\n : PeriodicAllowance_1.PeriodicAllowance.unpackAny(allowance), proto.allowedMessages);\n };\n AllowedMsgAllowance.prototype.toProto = function () {\n var _a = this, allowance = _a.allowance, allowed_messages = _a.allowed_messages;\n return feegrant_1.AllowedMsgAllowance.fromPartial({\n allowance: allowance.packAny(),\n allowedMessages: allowed_messages,\n });\n };\n AllowedMsgAllowance.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.feegrant.v1beta1.AllowedMsgAllowance',\n value: feegrant_1.AllowedMsgAllowance.encode(this.toProto()).finish(),\n });\n };\n AllowedMsgAllowance.unpackAny = function (msgAny) {\n return AllowedMsgAllowance.fromProto(feegrant_1.AllowedMsgAllowance.decode(msgAny.value));\n };\n return AllowedMsgAllowance;\n}(json_1.JSONSerializable));\nexports.AllowedMsgAllowance = AllowedMsgAllowance;\n//# sourceMappingURL=AllowedMsgAllowance.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgRevokeAllowanceResponse = exports.MsgRevokeAllowance = exports.MsgGrantAllowanceResponse = exports.MsgGrantAllowance = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../google/protobuf/any\");\nexports.protobufPackage = \"cosmos.feegrant.v1beta1\";\nconst baseMsgGrantAllowance = { granter: \"\", grantee: \"\" };\nexports.MsgGrantAllowance = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.granter !== \"\") {\n writer.uint32(10).string(message.granter);\n }\n if (message.grantee !== \"\") {\n writer.uint32(18).string(message.grantee);\n }\n if (message.allowance !== undefined) {\n any_1.Any.encode(message.allowance, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgGrantAllowance);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.granter = reader.string();\n break;\n case 2:\n message.grantee = reader.string();\n break;\n case 3:\n message.allowance = any_1.Any.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgGrantAllowance);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = String(object.granter);\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = String(object.grantee);\n }\n else {\n message.grantee = \"\";\n }\n if (object.allowance !== undefined && object.allowance !== null) {\n message.allowance = any_1.Any.fromJSON(object.allowance);\n }\n else {\n message.allowance = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.granter !== undefined && (obj.granter = message.granter);\n message.grantee !== undefined && (obj.grantee = message.grantee);\n message.allowance !== undefined &&\n (obj.allowance = message.allowance ? any_1.Any.toJSON(message.allowance) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgGrantAllowance);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = object.granter;\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = object.grantee;\n }\n else {\n message.grantee = \"\";\n }\n if (object.allowance !== undefined && object.allowance !== null) {\n message.allowance = any_1.Any.fromPartial(object.allowance);\n }\n else {\n message.allowance = undefined;\n }\n return message;\n },\n};\nconst baseMsgGrantAllowanceResponse = {};\nexports.MsgGrantAllowanceResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgGrantAllowanceResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgGrantAllowanceResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgGrantAllowanceResponse);\n return message;\n },\n};\nconst baseMsgRevokeAllowance = { granter: \"\", grantee: \"\" };\nexports.MsgRevokeAllowance = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.granter !== \"\") {\n writer.uint32(10).string(message.granter);\n }\n if (message.grantee !== \"\") {\n writer.uint32(18).string(message.grantee);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgRevokeAllowance);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.granter = reader.string();\n break;\n case 2:\n message.grantee = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgRevokeAllowance);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = String(object.granter);\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = String(object.grantee);\n }\n else {\n message.grantee = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.granter !== undefined && (obj.granter = message.granter);\n message.grantee !== undefined && (obj.grantee = message.grantee);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgRevokeAllowance);\n if (object.granter !== undefined && object.granter !== null) {\n message.granter = object.granter;\n }\n else {\n message.granter = \"\";\n }\n if (object.grantee !== undefined && object.grantee !== null) {\n message.grantee = object.grantee;\n }\n else {\n message.grantee = \"\";\n }\n return message;\n },\n};\nconst baseMsgRevokeAllowanceResponse = {};\nexports.MsgRevokeAllowanceResponse = {\n encode(_, writer = minimal_1.default.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgRevokeAllowanceResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(_) {\n const message = Object.assign({}, baseMsgRevokeAllowanceResponse);\n return message;\n },\n toJSON(_) {\n const obj = {};\n return obj;\n },\n fromPartial(_) {\n const message = Object.assign({}, baseMsgRevokeAllowanceResponse);\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.GrantAllowance = this.GrantAllowance.bind(this);\n this.RevokeAllowance = this.RevokeAllowance.bind(this);\n }\n GrantAllowance(request) {\n const data = exports.MsgGrantAllowance.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.feegrant.v1beta1.Msg\", \"GrantAllowance\", data);\n return promise.then((data) => exports.MsgGrantAllowanceResponse.decode(new minimal_1.default.Reader(data)));\n }\n RevokeAllowance(request) {\n const data = exports.MsgRevokeAllowance.encode(request).finish();\n const promise = this.rpc.request(\"cosmos.feegrant.v1beta1.Msg\", \"RevokeAllowance\", data);\n return promise.then((data) => exports.MsgRevokeAllowanceResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgDeposit\"), exports);\n__exportStar(require(\"./MsgSubmitProposal\"), exports);\n__exportStar(require(\"./MsgVote\"), exports);\n__exportStar(require(\"./MsgVoteWeighted\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Proposal = void 0;\nvar Coins_1 = require(\"../Coins\");\nvar numeric_1 = require(\"../numeric\");\nvar json_1 = require(\"../../util/json\");\nvar proposals_1 = require(\"../distribution/proposals\");\nvar proposals_2 = require(\"../params/proposals\");\nvar proposals_3 = require(\"./proposals\");\nvar proposals_4 = require(\"../upgrade/proposals\");\nvar gov_1 = require(\"@terra-money/terra.proto/cosmos/gov/v1beta1/gov\");\nvar Long = __importStar(require(\"long\"));\n/**\n * Stores information pertaining to a submitted proposal, such as its status and time of\n * the voting period\n */\nvar Proposal = /** @class */ (function (_super) {\n __extends(Proposal, _super);\n /**\n *\n * @param id proposal's ID\n * @param content content of the proposal\n * @param status proposal's status\n * @param final_tally_result tally result\n * @param submit_time time proposal was submitted and deposit period started\n * @param deposit_end_time time deposit period will end\n * @param total_deposit amount of coins deposited by all users\n * @param voting_start_time time voting period will start\n * @param voting_end_time time voting period will end\n */\n function Proposal(id, content, status, final_tally_result, submit_time, deposit_end_time, total_deposit, voting_start_time, voting_end_time) {\n var _this = _super.call(this) || this;\n _this.id = id;\n _this.content = content;\n _this.status = status;\n _this.final_tally_result = final_tally_result;\n _this.submit_time = submit_time;\n _this.deposit_end_time = deposit_end_time;\n _this.total_deposit = total_deposit;\n _this.voting_start_time = voting_start_time;\n _this.voting_end_time = voting_end_time;\n return _this;\n }\n Proposal.fromAmino = function (data) {\n var id = data.id, content = data.content, status = data.status, final_tally_result = data.final_tally_result, submit_time = data.submit_time, deposit_end_time = data.deposit_end_time, total_deposit = data.total_deposit, voting_start_time = data.voting_start_time, voting_end_time = data.voting_end_time;\n return new Proposal(Number.parseInt(id), Proposal.Content.fromAmino(content), status, {\n yes: new numeric_1.Int(final_tally_result.yes || 0),\n no: new numeric_1.Int(final_tally_result.no || 0),\n abstain: new numeric_1.Int(final_tally_result.abstain || 0),\n no_with_veto: new numeric_1.Int(final_tally_result.no_with_veto || 0),\n }, new Date(submit_time), new Date(deposit_end_time), Coins_1.Coins.fromAmino(total_deposit), new Date(voting_start_time), new Date(voting_end_time));\n };\n Proposal.prototype.toAmino = function () {\n var _a = this, status = _a.status, final_tally_result = _a.final_tally_result;\n return {\n id: this.id.toFixed(),\n content: this.content.toAmino(),\n status: status,\n final_tally_result: {\n yes: final_tally_result.yes.toFixed(),\n no: final_tally_result.no.toFixed(),\n abstain: final_tally_result.abstain.toFixed(),\n no_with_veto: final_tally_result.no_with_veto.toFixed(),\n },\n submit_time: this.submit_time.toISOString(),\n deposit_end_time: this.deposit_end_time.toISOString(),\n total_deposit: this.total_deposit.toAmino(),\n voting_start_time: this.voting_start_time.toISOString(),\n voting_end_time: this.voting_end_time.toISOString(),\n };\n };\n Proposal.fromData = function (data) {\n var proposal_id = data.proposal_id, content = data.content, status = data.status, final_tally_result = data.final_tally_result, submit_time = data.submit_time, deposit_end_time = data.deposit_end_time, total_deposit = data.total_deposit, voting_start_time = data.voting_start_time, voting_end_time = data.voting_end_time;\n return new Proposal(Number.parseInt(proposal_id), Proposal.Content.fromData(content), (0, gov_1.proposalStatusFromJSON)(status), {\n yes: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.yes) || 0),\n no: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.no) || 0),\n abstain: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.abstain) || 0),\n no_with_veto: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.no_with_veto) || 0),\n }, new Date(submit_time), new Date(deposit_end_time), Coins_1.Coins.fromData(total_deposit), new Date(voting_start_time), new Date(voting_end_time));\n };\n Proposal.prototype.toData = function () {\n var _a = this, status = _a.status, final_tally_result = _a.final_tally_result;\n return {\n proposal_id: this.id.toFixed(),\n content: this.content.toData(),\n status: (0, gov_1.proposalStatusToJSON)(status),\n final_tally_result: {\n yes: final_tally_result.yes.toString(),\n no: final_tally_result.no.toString(),\n abstain: final_tally_result.abstain.toString(),\n no_with_veto: final_tally_result.no_with_veto.toString(),\n },\n submit_time: this.submit_time.toISOString(),\n deposit_end_time: this.deposit_end_time.toISOString(),\n total_deposit: this.total_deposit.toData(),\n voting_start_time: this.voting_start_time.toISOString(),\n voting_end_time: this.voting_end_time.toISOString(),\n };\n };\n Proposal.fromProto = function (data) {\n var id = data.proposalId;\n var content = data.content;\n var status = data.status;\n var final_tally_result = data.finalTallyResult;\n var submit_time = data.submitTime;\n var deposit_end_time = data.depositEndTime;\n var total_deposit = data.totalDeposit;\n var voting_start_time = data.votingStartTime;\n var voting_end_time = data.votingEndTime;\n return new Proposal(id.toNumber(), Proposal.Content.fromProto(content), status, {\n yes: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.yes) || 0),\n no: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.no) || 0),\n abstain: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.abstain) || 0),\n no_with_veto: new numeric_1.Int((final_tally_result === null || final_tally_result === void 0 ? void 0 : final_tally_result.noWithVeto) || 0),\n }, submit_time, deposit_end_time, Coins_1.Coins.fromProto(total_deposit), voting_start_time, voting_end_time);\n };\n Proposal.prototype.toProto = function () {\n var _a = this, status = _a.status, final_tally_result = _a.final_tally_result;\n var ftr;\n if (final_tally_result) {\n ftr = gov_1.TallyResult.fromPartial({\n yes: final_tally_result.yes.toString(),\n no: final_tally_result.no.toString(),\n abstain: final_tally_result.abstain.toString(),\n noWithVeto: final_tally_result.no_with_veto.toString(),\n });\n }\n return gov_1.Proposal.fromPartial({\n proposalId: Long.fromNumber(this.id),\n content: this.content.packAny(),\n status: status,\n finalTallyResult: ftr,\n submitTime: this.submit_time,\n depositEndTime: this.deposit_end_time,\n totalDeposit: this.total_deposit.toProto(),\n votingEndTime: this.voting_end_time,\n votingStartTime: this.voting_start_time,\n });\n };\n return Proposal;\n}(json_1.JSONSerializable));\nexports.Proposal = Proposal;\n(function (Proposal) {\n Proposal.Status = gov_1.ProposalStatus;\n var Content;\n (function (Content) {\n function fromAmino(amino) {\n switch (amino.type) {\n case 'gov/TextProposal':\n return proposals_3.TextProposal.fromAmino(amino);\n case 'distribution/CommunityPoolSpendProposal':\n return proposals_1.CommunityPoolSpendProposal.fromAmino(amino);\n case 'params/ParameterChangeProposal':\n return proposals_2.ParameterChangeProposal.fromAmino(amino);\n case 'upgrade/SoftwareUpgradeProposal':\n return proposals_4.SoftwareUpgradeProposal.fromAmino(amino);\n case 'upgrade/CancelSoftwareUpgradeProposal':\n return proposals_4.CancelSoftwareUpgradeProposal.fromAmino(amino);\n }\n }\n Content.fromAmino = fromAmino;\n function fromData(data) {\n switch (data['@type']) {\n case '/cosmos.gov.v1beta1.TextProposal':\n return proposals_3.TextProposal.fromData(data);\n case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal':\n return proposals_1.CommunityPoolSpendProposal.fromData(data);\n case '/cosmos.params.v1beta1.ParameterChangeProposal':\n return proposals_2.ParameterChangeProposal.fromData(data);\n case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal':\n return proposals_4.SoftwareUpgradeProposal.fromData(data);\n case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal':\n return proposals_4.CancelSoftwareUpgradeProposal.fromData(data);\n }\n }\n Content.fromData = fromData;\n function fromProto(anyProto) {\n var typeUrl = anyProto.typeUrl;\n switch (typeUrl) {\n case '/cosmos.gov.v1beta1.TextProposal':\n return proposals_3.TextProposal.unpackAny(anyProto);\n case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal':\n return proposals_1.CommunityPoolSpendProposal.unpackAny(anyProto);\n case '/cosmos.params.v1beta1.ParameterChangeProposal':\n return proposals_2.ParameterChangeProposal.unpackAny(anyProto);\n case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal':\n return proposals_4.SoftwareUpgradeProposal.unpackAny(anyProto);\n case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal':\n return proposals_4.CancelSoftwareUpgradeProposal.unpackAny(anyProto);\n }\n throw \"Proposal content \" + typeUrl + \" not recognized\";\n }\n Content.fromProto = fromProto;\n })(Content = Proposal.Content || (Proposal.Content = {}));\n})(Proposal = exports.Proposal || (exports.Proposal = {}));\nexports.Proposal = Proposal;\n//# sourceMappingURL=Proposal.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./CommunityPoolSpendProposal\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./ParameterChangeProposal\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParamChange = exports.ParamChanges = void 0;\nvar json_1 = require(\"../../util/json\");\nvar params_1 = require(\"@terra-money/terra.proto/cosmos/params/v1beta1/params\");\nvar ParamChanges = /** @class */ (function (_super) {\n __extends(ParamChanges, _super);\n function ParamChanges(paramChanges) {\n var _this = _super.call(this) || this;\n _this.paramChanges = paramChanges;\n return _this;\n }\n ParamChanges.fromAmino = function (proto) {\n return new ParamChanges((proto !== null && proto !== void 0 ? proto : []).map(ParamChange.fromAmino));\n };\n ParamChanges.prototype.toAmino = function () {\n return this.paramChanges.map(function (c) { return c.toAmino(); });\n };\n ParamChanges.fromData = function (proto) {\n return new ParamChanges((proto !== null && proto !== void 0 ? proto : []).map(ParamChange.fromData));\n };\n ParamChanges.prototype.toData = function () {\n return this.paramChanges.map(function (c) { return c.toData(); });\n };\n ParamChanges.fromProto = function (proto) {\n return new ParamChanges((proto !== null && proto !== void 0 ? proto : []).map(ParamChange.fromProto));\n };\n ParamChanges.prototype.toProto = function () {\n return this.paramChanges.map(function (c) { return c.toProto(); });\n };\n return ParamChanges;\n}(json_1.JSONSerializable));\nexports.ParamChanges = ParamChanges;\nvar ParamChange = /** @class */ (function (_super) {\n __extends(ParamChange, _super);\n function ParamChange(subspace, key, value) {\n var _this = _super.call(this) || this;\n _this.subspace = subspace;\n _this.key = key;\n _this.value = value;\n return _this;\n }\n ParamChange.fromAmino = function (data) {\n var subspace = data.subspace, key = data.key, value = data.value;\n return new ParamChange(subspace, key, value);\n };\n ParamChange.prototype.toAmino = function () {\n var _a = this, subspace = _a.subspace, key = _a.key, value = _a.value;\n return {\n subspace: subspace,\n key: key,\n value: value,\n };\n };\n ParamChange.fromData = function (data) {\n var subspace = data.subspace, key = data.key, value = data.value;\n return new ParamChange(subspace, key, value);\n };\n ParamChange.prototype.toData = function () {\n var _a = this, subspace = _a.subspace, key = _a.key, value = _a.value;\n return {\n subspace: subspace,\n key: key,\n value: value,\n };\n };\n ParamChange.fromProto = function (proto) {\n return new ParamChange(proto.subspace, proto.key, proto.value);\n };\n ParamChange.prototype.toProto = function () {\n var _a = this, subspace = _a.subspace, key = _a.key, value = _a.value;\n return params_1.ParamChange.fromPartial({\n key: key,\n subspace: subspace,\n value: value,\n });\n };\n return ParamChange;\n}(json_1.JSONSerializable));\nexports.ParamChange = ParamChange;\n//# sourceMappingURL=ParamChange.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParamChange = exports.ParameterChangeProposal = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"cosmos.params.v1beta1\";\nconst baseParameterChangeProposal = { title: \"\", description: \"\" };\nexports.ParameterChangeProposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.title !== \"\") {\n writer.uint32(10).string(message.title);\n }\n if (message.description !== \"\") {\n writer.uint32(18).string(message.description);\n }\n for (const v of message.changes) {\n exports.ParamChange.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParameterChangeProposal);\n message.changes = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.title = reader.string();\n break;\n case 2:\n message.description = reader.string();\n break;\n case 3:\n message.changes.push(exports.ParamChange.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParameterChangeProposal);\n message.changes = [];\n if (object.title !== undefined && object.title !== null) {\n message.title = String(object.title);\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = String(object.description);\n }\n else {\n message.description = \"\";\n }\n if (object.changes !== undefined && object.changes !== null) {\n for (const e of object.changes) {\n message.changes.push(exports.ParamChange.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.title !== undefined && (obj.title = message.title);\n message.description !== undefined && (obj.description = message.description);\n if (message.changes) {\n obj.changes = message.changes.map((e) => (e ? exports.ParamChange.toJSON(e) : undefined));\n }\n else {\n obj.changes = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParameterChangeProposal);\n message.changes = [];\n if (object.title !== undefined && object.title !== null) {\n message.title = object.title;\n }\n else {\n message.title = \"\";\n }\n if (object.description !== undefined && object.description !== null) {\n message.description = object.description;\n }\n else {\n message.description = \"\";\n }\n if (object.changes !== undefined && object.changes !== null) {\n for (const e of object.changes) {\n message.changes.push(exports.ParamChange.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseParamChange = { subspace: \"\", key: \"\", value: \"\" };\nexports.ParamChange = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.subspace !== \"\") {\n writer.uint32(10).string(message.subspace);\n }\n if (message.key !== \"\") {\n writer.uint32(18).string(message.key);\n }\n if (message.value !== \"\") {\n writer.uint32(26).string(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParamChange);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.subspace = reader.string();\n break;\n case 2:\n message.key = reader.string();\n break;\n case 3:\n message.value = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParamChange);\n if (object.subspace !== undefined && object.subspace !== null) {\n message.subspace = String(object.subspace);\n }\n else {\n message.subspace = \"\";\n }\n if (object.key !== undefined && object.key !== null) {\n message.key = String(object.key);\n }\n else {\n message.key = \"\";\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = String(object.value);\n }\n else {\n message.value = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.subspace !== undefined && (obj.subspace = message.subspace);\n message.key !== undefined && (obj.key = message.key);\n message.value !== undefined && (obj.value = message.value);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParamChange);\n if (object.subspace !== undefined && object.subspace !== null) {\n message.subspace = object.subspace;\n }\n else {\n message.subspace = \"\";\n }\n if (object.key !== undefined && object.key !== null) {\n message.key = object.key;\n }\n else {\n message.key = \"\";\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = object.value;\n }\n else {\n message.value = \"\";\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=params.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./TextProposal\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WeightedVoteOption = exports.Vote = void 0;\nvar json_1 = require(\"../../util/json\");\nvar gov_1 = require(\"@terra-money/terra.proto/cosmos/gov/v1beta1/gov\");\nvar numeric_1 = require(\"../numeric\");\nvar Long = __importStar(require(\"long\"));\n/**\n * Stores vote information for a proposal\n */\nvar Vote = /** @class */ (function (_super) {\n __extends(Vote, _super);\n /**\n * @param proposal_id ID of proposal to vote on\n * @param voter voter's account address\n * @param option one of voting options\n */\n function Vote(proposal_id, voter, options) {\n var _this = _super.call(this) || this;\n _this.proposal_id = proposal_id;\n _this.voter = voter;\n _this.options = options;\n _this.Option = gov_1.VoteOption;\n return _this;\n }\n Vote.fromAmino = function (data) {\n var proposal_id = data.proposal_id, voter = data.voter, options = data.options;\n return new Vote(Number.parseInt(proposal_id), voter, options.map(function (v) { return WeightedVoteOption.fromAmino(v); }));\n };\n Vote.prototype.toAmino = function () {\n var _a = this, proposal_id = _a.proposal_id, voter = _a.voter, options = _a.options;\n var res = {\n proposal_id: proposal_id.toFixed(),\n voter: voter,\n options: options.map(function (v) { return v.toAmino(); }),\n };\n return res;\n };\n Vote.fromData = function (data) {\n var proposal_id = data.proposal_id, voter = data.voter, options = data.options;\n return new Vote(Number.parseInt(proposal_id), voter, options.map(function (v) { return WeightedVoteOption.fromData(v); }));\n };\n Vote.prototype.toData = function () {\n var _a = this, proposal_id = _a.proposal_id, voter = _a.voter, options = _a.options;\n var res = {\n proposal_id: proposal_id.toFixed(),\n voter: voter,\n options: options.map(function (v) { return v.toData(); }),\n };\n return res;\n };\n Vote.fromProto = function (proto) {\n return new Vote(proto.proposalId.toNumber(), proto.voter, proto.options.map(function (o) { return WeightedVoteOption.fromProto(o); }));\n };\n Vote.prototype.toProto = function () {\n var _a = this, proposal_id = _a.proposal_id, voter = _a.voter, options = _a.options;\n return gov_1.Vote.fromPartial({\n options: options.map(function (o) { return o.toProto(); }),\n proposalId: Long.fromNumber(proposal_id),\n voter: voter,\n });\n };\n return Vote;\n}(json_1.JSONSerializable));\nexports.Vote = Vote;\n(function (Vote) {\n Vote.Option = gov_1.VoteOption;\n})(Vote = exports.Vote || (exports.Vote = {}));\nexports.Vote = Vote;\nvar WeightedVoteOption = /** @class */ (function (_super) {\n __extends(WeightedVoteOption, _super);\n function WeightedVoteOption(option, weight) {\n var _this = _super.call(this) || this;\n _this.option = option;\n _this.weight = new numeric_1.Dec(weight);\n return _this;\n }\n WeightedVoteOption.fromAmino = function (data) {\n var option = data.option, weight = data.weight;\n return new WeightedVoteOption(option, weight);\n };\n WeightedVoteOption.prototype.toAmino = function () {\n var _a = this, option = _a.option, weight = _a.weight;\n return {\n option: option,\n weight: weight.toString(),\n };\n };\n WeightedVoteOption.fromData = function (data) {\n var option = data.option, weight = data.weight;\n return new WeightedVoteOption(option, weight);\n };\n WeightedVoteOption.prototype.toData = function () {\n var _a = this, option = _a.option, weight = _a.weight;\n return {\n option: option,\n weight: weight.toString(),\n };\n };\n WeightedVoteOption.fromProto = function (proto) {\n return new WeightedVoteOption(proto.option, proto.weight);\n };\n WeightedVoteOption.prototype.toProto = function () {\n var _a = this, option = _a.option, weight = _a.weight;\n return gov_1.WeightedVoteOption.fromPartial({\n option: option,\n weight: weight.toString(),\n });\n };\n return WeightedVoteOption;\n}(json_1.JSONSerializable));\nexports.WeightedVoteOption = WeightedVoteOption;\n//# sourceMappingURL=Vote.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgSwap\"), exports);\n__exportStar(require(\"./MsgSwapSend\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgClientImpl = exports.MsgSwapSendResponse = exports.MsgSwapSend = exports.MsgSwapResponse = exports.MsgSwap = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"terra.market.v1beta1\";\nconst baseMsgSwap = { trader: \"\", askDenom: \"\" };\nexports.MsgSwap = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.trader !== \"\") {\n writer.uint32(10).string(message.trader);\n }\n if (message.offerCoin !== undefined) {\n coin_1.Coin.encode(message.offerCoin, writer.uint32(18).fork()).ldelim();\n }\n if (message.askDenom !== \"\") {\n writer.uint32(26).string(message.askDenom);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSwap);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.trader = reader.string();\n break;\n case 2:\n message.offerCoin = coin_1.Coin.decode(reader, reader.uint32());\n break;\n case 3:\n message.askDenom = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSwap);\n if (object.trader !== undefined && object.trader !== null) {\n message.trader = String(object.trader);\n }\n else {\n message.trader = \"\";\n }\n if (object.offerCoin !== undefined && object.offerCoin !== null) {\n message.offerCoin = coin_1.Coin.fromJSON(object.offerCoin);\n }\n else {\n message.offerCoin = undefined;\n }\n if (object.askDenom !== undefined && object.askDenom !== null) {\n message.askDenom = String(object.askDenom);\n }\n else {\n message.askDenom = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.trader !== undefined && (obj.trader = message.trader);\n message.offerCoin !== undefined &&\n (obj.offerCoin = message.offerCoin ? coin_1.Coin.toJSON(message.offerCoin) : undefined);\n message.askDenom !== undefined && (obj.askDenom = message.askDenom);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSwap);\n if (object.trader !== undefined && object.trader !== null) {\n message.trader = object.trader;\n }\n else {\n message.trader = \"\";\n }\n if (object.offerCoin !== undefined && object.offerCoin !== null) {\n message.offerCoin = coin_1.Coin.fromPartial(object.offerCoin);\n }\n else {\n message.offerCoin = undefined;\n }\n if (object.askDenom !== undefined && object.askDenom !== null) {\n message.askDenom = object.askDenom;\n }\n else {\n message.askDenom = \"\";\n }\n return message;\n },\n};\nconst baseMsgSwapResponse = {};\nexports.MsgSwapResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.swapCoin !== undefined) {\n coin_1.Coin.encode(message.swapCoin, writer.uint32(10).fork()).ldelim();\n }\n if (message.swapFee !== undefined) {\n coin_1.Coin.encode(message.swapFee, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSwapResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.swapCoin = coin_1.Coin.decode(reader, reader.uint32());\n break;\n case 2:\n message.swapFee = coin_1.Coin.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSwapResponse);\n if (object.swapCoin !== undefined && object.swapCoin !== null) {\n message.swapCoin = coin_1.Coin.fromJSON(object.swapCoin);\n }\n else {\n message.swapCoin = undefined;\n }\n if (object.swapFee !== undefined && object.swapFee !== null) {\n message.swapFee = coin_1.Coin.fromJSON(object.swapFee);\n }\n else {\n message.swapFee = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.swapCoin !== undefined &&\n (obj.swapCoin = message.swapCoin ? coin_1.Coin.toJSON(message.swapCoin) : undefined);\n message.swapFee !== undefined &&\n (obj.swapFee = message.swapFee ? coin_1.Coin.toJSON(message.swapFee) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSwapResponse);\n if (object.swapCoin !== undefined && object.swapCoin !== null) {\n message.swapCoin = coin_1.Coin.fromPartial(object.swapCoin);\n }\n else {\n message.swapCoin = undefined;\n }\n if (object.swapFee !== undefined && object.swapFee !== null) {\n message.swapFee = coin_1.Coin.fromPartial(object.swapFee);\n }\n else {\n message.swapFee = undefined;\n }\n return message;\n },\n};\nconst baseMsgSwapSend = { fromAddress: \"\", toAddress: \"\", askDenom: \"\" };\nexports.MsgSwapSend = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.fromAddress !== \"\") {\n writer.uint32(10).string(message.fromAddress);\n }\n if (message.toAddress !== \"\") {\n writer.uint32(18).string(message.toAddress);\n }\n if (message.offerCoin !== undefined) {\n coin_1.Coin.encode(message.offerCoin, writer.uint32(26).fork()).ldelim();\n }\n if (message.askDenom !== \"\") {\n writer.uint32(34).string(message.askDenom);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSwapSend);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.fromAddress = reader.string();\n break;\n case 2:\n message.toAddress = reader.string();\n break;\n case 3:\n message.offerCoin = coin_1.Coin.decode(reader, reader.uint32());\n break;\n case 4:\n message.askDenom = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSwapSend);\n if (object.fromAddress !== undefined && object.fromAddress !== null) {\n message.fromAddress = String(object.fromAddress);\n }\n else {\n message.fromAddress = \"\";\n }\n if (object.toAddress !== undefined && object.toAddress !== null) {\n message.toAddress = String(object.toAddress);\n }\n else {\n message.toAddress = \"\";\n }\n if (object.offerCoin !== undefined && object.offerCoin !== null) {\n message.offerCoin = coin_1.Coin.fromJSON(object.offerCoin);\n }\n else {\n message.offerCoin = undefined;\n }\n if (object.askDenom !== undefined && object.askDenom !== null) {\n message.askDenom = String(object.askDenom);\n }\n else {\n message.askDenom = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);\n message.toAddress !== undefined && (obj.toAddress = message.toAddress);\n message.offerCoin !== undefined &&\n (obj.offerCoin = message.offerCoin ? coin_1.Coin.toJSON(message.offerCoin) : undefined);\n message.askDenom !== undefined && (obj.askDenom = message.askDenom);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSwapSend);\n if (object.fromAddress !== undefined && object.fromAddress !== null) {\n message.fromAddress = object.fromAddress;\n }\n else {\n message.fromAddress = \"\";\n }\n if (object.toAddress !== undefined && object.toAddress !== null) {\n message.toAddress = object.toAddress;\n }\n else {\n message.toAddress = \"\";\n }\n if (object.offerCoin !== undefined && object.offerCoin !== null) {\n message.offerCoin = coin_1.Coin.fromPartial(object.offerCoin);\n }\n else {\n message.offerCoin = undefined;\n }\n if (object.askDenom !== undefined && object.askDenom !== null) {\n message.askDenom = object.askDenom;\n }\n else {\n message.askDenom = \"\";\n }\n return message;\n },\n};\nconst baseMsgSwapSendResponse = {};\nexports.MsgSwapSendResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.swapCoin !== undefined) {\n coin_1.Coin.encode(message.swapCoin, writer.uint32(10).fork()).ldelim();\n }\n if (message.swapFee !== undefined) {\n coin_1.Coin.encode(message.swapFee, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgSwapSendResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.swapCoin = coin_1.Coin.decode(reader, reader.uint32());\n break;\n case 2:\n message.swapFee = coin_1.Coin.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgSwapSendResponse);\n if (object.swapCoin !== undefined && object.swapCoin !== null) {\n message.swapCoin = coin_1.Coin.fromJSON(object.swapCoin);\n }\n else {\n message.swapCoin = undefined;\n }\n if (object.swapFee !== undefined && object.swapFee !== null) {\n message.swapFee = coin_1.Coin.fromJSON(object.swapFee);\n }\n else {\n message.swapFee = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.swapCoin !== undefined &&\n (obj.swapCoin = message.swapCoin ? coin_1.Coin.toJSON(message.swapCoin) : undefined);\n message.swapFee !== undefined &&\n (obj.swapFee = message.swapFee ? coin_1.Coin.toJSON(message.swapFee) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgSwapSendResponse);\n if (object.swapCoin !== undefined && object.swapCoin !== null) {\n message.swapCoin = coin_1.Coin.fromPartial(object.swapCoin);\n }\n else {\n message.swapCoin = undefined;\n }\n if (object.swapFee !== undefined && object.swapFee !== null) {\n message.swapFee = coin_1.Coin.fromPartial(object.swapFee);\n }\n else {\n message.swapFee = undefined;\n }\n return message;\n },\n};\nclass MsgClientImpl {\n constructor(rpc) {\n this.rpc = rpc;\n this.Swap = this.Swap.bind(this);\n this.SwapSend = this.SwapSend.bind(this);\n }\n Swap(request) {\n const data = exports.MsgSwap.encode(request).finish();\n const promise = this.rpc.request(\"terra.market.v1beta1.Msg\", \"Swap\", data);\n return promise.then((data) => exports.MsgSwapResponse.decode(new minimal_1.default.Reader(data)));\n }\n SwapSend(request) {\n const data = exports.MsgSwapSend.encode(request).finish();\n const promise = this.rpc.request(\"terra.market.v1beta1.Msg\", \"SwapSend\", data);\n return promise.then((data) => exports.MsgSwapSendResponse.decode(new minimal_1.default.Reader(data)));\n }\n}\nexports.MsgClientImpl = MsgClientImpl;\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=tx.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgGrantAuthorization\"), exports);\n__exportStar(require(\"./MsgRevokeAuthorization\"), exports);\n__exportStar(require(\"./MsgExecAuthorized\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StakeAuthorizationValidators = exports.StakeAuthorization = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coin_1 = require(\"../../Coin\");\nvar authz_1 = require(\"@terra-money/terra.proto/cosmos/staking/v1beta1/authz\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar StakeAuthorization = /** @class */ (function (_super) {\n __extends(StakeAuthorization, _super);\n function StakeAuthorization(authorization_type, max_tokens, allow_list, deny_list) {\n var _this = _super.call(this) || this;\n _this.authorization_type = authorization_type;\n _this.max_tokens = max_tokens;\n _this.allow_list = allow_list;\n _this.deny_list = deny_list;\n return _this;\n }\n StakeAuthorization.fromAmino = function (_) {\n _;\n throw new Error('Amino not supported');\n };\n StakeAuthorization.prototype.toAmino = function () {\n throw new Error('Amino not supported');\n };\n StakeAuthorization.fromData = function (data) {\n return new StakeAuthorization((0, authz_1.authorizationTypeFromJSON)(data.authorization_type), data.max_tokens ? Coin_1.Coin.fromProto(data.max_tokens) : undefined, data.allow_list\n ? StakeAuthorizationValidators.fromData(data.allow_list)\n : undefined, data.deny_list\n ? StakeAuthorizationValidators.fromData(data.deny_list)\n : undefined);\n };\n StakeAuthorization.prototype.toData = function () {\n var _a = this, max_tokens = _a.max_tokens, allow_list = _a.allow_list, deny_list = _a.deny_list, authorization_type = _a.authorization_type;\n return {\n '@type': '/cosmos.staking.v1beta1.StakeAuthorization',\n authorization_type: (0, authz_1.authorizationTypeToJSON)(authorization_type),\n max_tokens: max_tokens === null || max_tokens === void 0 ? void 0 : max_tokens.toData(),\n allow_list: allow_list === null || allow_list === void 0 ? void 0 : allow_list.toData(),\n deny_list: deny_list === null || deny_list === void 0 ? void 0 : deny_list.toData(),\n };\n };\n StakeAuthorization.fromProto = function (proto) {\n return new StakeAuthorization(proto.authorizationType, proto.maxTokens ? Coin_1.Coin.fromProto(proto.maxTokens) : undefined, proto.allowList\n ? StakeAuthorizationValidators.fromProto(proto.allowList)\n : undefined, proto.denyList\n ? StakeAuthorizationValidators.fromProto(proto.denyList)\n : undefined);\n };\n StakeAuthorization.prototype.toProto = function () {\n var _a = this, max_tokens = _a.max_tokens, allow_list = _a.allow_list, deny_list = _a.deny_list, authorization_type = _a.authorization_type;\n return authz_1.StakeAuthorization.fromPartial({\n allowList: allow_list === null || allow_list === void 0 ? void 0 : allow_list.toProto(),\n authorizationType: authorization_type,\n denyList: deny_list === null || deny_list === void 0 ? void 0 : deny_list.toProto(),\n maxTokens: max_tokens === null || max_tokens === void 0 ? void 0 : max_tokens.toProto(),\n });\n };\n StakeAuthorization.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization',\n value: authz_1.StakeAuthorization.encode(this.toProto()).finish(),\n });\n };\n StakeAuthorization.unpackAny = function (msgAny) {\n return StakeAuthorization.fromProto(authz_1.StakeAuthorization.decode(msgAny.value));\n };\n return StakeAuthorization;\n}(json_1.JSONSerializable));\nexports.StakeAuthorization = StakeAuthorization;\nvar StakeAuthorizationValidators = /** @class */ (function (_super) {\n __extends(StakeAuthorizationValidators, _super);\n function StakeAuthorizationValidators(address) {\n var _this = _super.call(this) || this;\n _this.address = address;\n return _this;\n }\n StakeAuthorizationValidators.fromAmino = function (_) {\n _;\n throw new Error('Amino not supported');\n };\n StakeAuthorizationValidators.prototype.toAmino = function () {\n throw new Error('Amino not supported');\n };\n StakeAuthorizationValidators.fromData = function (data) {\n return new StakeAuthorizationValidators(data.address);\n };\n StakeAuthorizationValidators.prototype.toData = function () {\n return {\n address: this.address,\n };\n };\n StakeAuthorizationValidators.fromProto = function (proto) {\n return new StakeAuthorizationValidators(proto.address);\n };\n StakeAuthorizationValidators.prototype.toProto = function () {\n return authz_1.StakeAuthorization_Validators.fromPartial({\n address: this.address,\n });\n };\n return StakeAuthorizationValidators;\n}(json_1.JSONSerializable));\nexports.StakeAuthorizationValidators = StakeAuthorizationValidators;\n(function (StakeAuthorization) {\n StakeAuthorization.Type = authz_1.AuthorizationType;\n})(StakeAuthorization = exports.StakeAuthorization || (exports.StakeAuthorization = {}));\nexports.StakeAuthorization = StakeAuthorization;\n//# sourceMappingURL=StakeAuthorization.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SendAuthorization = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\nvar authz_1 = require(\"@terra-money/terra.proto/cosmos/bank/v1beta1/authz\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar SendAuthorization = /** @class */ (function (_super) {\n __extends(SendAuthorization, _super);\n function SendAuthorization(spend_limit) {\n var _this = _super.call(this) || this;\n _this.spend_limit = new Coins_1.Coins(spend_limit);\n return _this;\n }\n SendAuthorization.fromAmino = function (data) {\n return new SendAuthorization(Coins_1.Coins.fromAmino(data.value.spend_limit));\n };\n SendAuthorization.prototype.toAmino = function () {\n var spend_limit = this.spend_limit;\n return {\n type: 'msgauth/SendAuthorization',\n value: {\n spend_limit: spend_limit.toAmino(),\n },\n };\n };\n SendAuthorization.fromData = function (data) {\n return new SendAuthorization(Coins_1.Coins.fromData(data.spend_limit));\n };\n SendAuthorization.prototype.toData = function () {\n var spend_limit = this.spend_limit;\n return {\n '@type': '/cosmos.bank.v1beta1.SendAuthorization',\n spend_limit: spend_limit.toAmino(),\n };\n };\n SendAuthorization.fromProto = function (proto) {\n return new SendAuthorization(Coins_1.Coins.fromProto(proto.spendLimit));\n };\n SendAuthorization.prototype.toProto = function () {\n return authz_1.SendAuthorization.fromPartial({\n spendLimit: this.spend_limit.toProto(),\n });\n };\n SendAuthorization.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.bank.v1beta1.SendAuthorization',\n value: authz_1.SendAuthorization.encode(this.toProto()).finish(),\n });\n };\n SendAuthorization.unpackAny = function (msgAny) {\n return SendAuthorization.fromProto(authz_1.SendAuthorization.decode(msgAny.value));\n };\n return SendAuthorization;\n}(json_1.JSONSerializable));\nexports.SendAuthorization = SendAuthorization;\n//# sourceMappingURL=SendAuthorization.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GenericAuthorization = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar authz_1 = require(\"@terra-money/terra.proto/cosmos/authz/v1beta1/authz\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar GenericAuthorization = /** @class */ (function (_super) {\n __extends(GenericAuthorization, _super);\n function GenericAuthorization(msg) {\n var _this = _super.call(this) || this;\n _this.msg = msg;\n return _this;\n }\n GenericAuthorization.fromAmino = function (data) {\n return new GenericAuthorization(data.value.msg);\n };\n GenericAuthorization.prototype.toAmino = function () {\n var msg = this.msg;\n return {\n type: 'msgauth/GenericAuthorization',\n value: {\n msg: msg,\n },\n };\n };\n GenericAuthorization.fromData = function (data) {\n return new GenericAuthorization(data.msg);\n };\n GenericAuthorization.prototype.toData = function () {\n var msg = this.msg;\n return {\n '@type': '/cosmos.authz.v1beta1.GenericAuthorization',\n msg: msg,\n };\n };\n GenericAuthorization.fromProto = function (data) {\n return new GenericAuthorization(data.msg);\n };\n GenericAuthorization.prototype.toProto = function () {\n return authz_1.GenericAuthorization.fromPartial({\n msg: this.msg,\n });\n };\n GenericAuthorization.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization',\n value: authz_1.GenericAuthorization.encode(this.toProto()).finish(),\n });\n };\n GenericAuthorization.unpackAny = function (msgAny) {\n return GenericAuthorization.fromProto(authz_1.GenericAuthorization.decode(msgAny.value));\n };\n return GenericAuthorization;\n}(json_1.JSONSerializable));\nexports.GenericAuthorization = GenericAuthorization;\n//# sourceMappingURL=GenericAuthorization.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgDelegateFeedConsent\"), exports);\n__exportStar(require(\"./MsgAggregateExchangeRateVote\"), exports);\n__exportStar(require(\"./MsgAggregateExchangeRatePrevote\"), exports);\n//# sourceMappingURL=index.js.map","!function(n,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else if(\"object\"==typeof exports)exports.JsCrypto=t();else{var r=t();for(var i in n.JsCrypto=n.JsCrypto||{},r)n.JsCrypto[i]=r[i]}}(this,(function(){return function(){\"use strict\";var n={3354:function(n,t,r){r.d(t,{e:function(){return o}});var i=r(5720),e=r(9054),o=function(){function n(t,r){if(Array.isArray(t)||!t)return this.t=Array.isArray(t)?t:[],void(this.i=\"number\"==typeof r?r:4*this.t.length);if(t instanceof n)return this.t=t.words.slice(),void(this.i=t.nSigBytes);var i;try{t instanceof ArrayBuffer?i=new Uint8Array(t):(t instanceof Uint8Array||t instanceof Int8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}catch(n){throw new Error(\"Invalid argument\")}if(!i)throw new Error(\"Invalid argument\");for(var e=i.byteLength,o=[],u=0;u>>2]|=i[u]<<24-u%4*8;this.t=o,this.i=e}return Object.defineProperty(n.prototype,\"nSigBytes\",{get:function(){return this.i},set:function(n){this.i=n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"words\",{get:function(){return this.t},enumerable:!1,configurable:!0}),n.prototype.toString=function(n){return n?n.stringify(this):i.p.stringify(this)},n.prototype.toUint8Array=function(){for(var n=this.t,t=this.i,r=new Uint8Array(t),i=0;i>>2]>>>24-i%4*8&255;return r},n.prototype.concat=function(n){var t=n.words.slice(),r=n.nSigBytes;if(this.clamp(),this.i%4)for(var i=0;i>>2]>>>24-i%4*8&255;this.t[this.i+i>>>2]|=e<<24-(this.i+i)%4*8}else for(i=0;i>>2]=t[i>>>2];return this.i+=r,this},n.prototype.clamp=function(){var n=this.i;this.t[n>>>2]&=4294967295<<32-n%4*8,this.t.length=Math.ceil(n/4)},n.prototype.clone=function(){return new n(this.t.slice(),this.i)},n.random=function(t){for(var r=[],i=0;i\"===n?o>t:\">=\"===n?o>=t:o===t))}},5720:function(n,t,r){r.d(t,{p:function(){return e}});var i=r(3354),e={stringify:function(n){for(var t=n.nSigBytes,r=n.words,i=[],e=0;e>>2]>>>24-e%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join(\"\")},parse:function(n){var t=n.length;if(t%2!=0)throw new Error(\"Hex string count must be even\");if(!/^[a-fA-F0-9]+$/.test(n))throw new Error(\"Invalid Hex string: \"+n);for(var r=[],e=0;e>>3]|=parseInt(n.substr(e,2),16)<<24-e%8*4;return new i.e(r,t/2)}}},8702:function(n,t,r){r.d(t,{m:function(){return e}});var i=r(3354),e={stringify:function(n){for(var t=n.nSigBytes,r=n.words,i=[],e=0;e>>2]>>>24-e%4*8&255;i.push(String.fromCharCode(o))}return i.join(\"\")},parse:function(n){for(var t=n.length,r=[],e=0;e>>2]|=(255&n.charCodeAt(e))<<24-e%4*8;return new i.e(r,t)}}},4768:function(n,t,r){r.d(t,{d:function(){return e}});var i=r(8702),e={stringify:function(n){try{return decodeURIComponent(escape(i.m.stringify(n)))}catch(n){throw new Error(\"Malformed UTF-8 data\")}},parse:function(n){return i.m.parse(unescape(encodeURIComponent(n)))}}},9054:function(n,t,r){r.d(t,{M:function(){return e}});var i=r(1756);var e=function(){if(\"undefined\"!=typeof window){var n=window.crypto||window.msCrypto;if(!n){if((0,i.w)(\"<\",11))return console.warn(\"IE <= 10 uses insecure random generator. Please consider to use IE11 or another modern browser\"),function(){return Math.floor(512*Math.random())%256};throw new Error(\"Crypto module not found\")}return function(){return n.getRandomValues(new Uint32Array(1))[0]}}return void 0!==r.g&&r.g.crypto?function(){return r.g.crypto.randomBytes(4).readInt32LE()}:function(){return require(\"crypto\").randomBytes(4).readInt32LE()}}()}},t={};function r(i){var e=t[i];if(void 0!==e)return e.exports;var o=t[i]={exports:{}};return n[i](o,o.exports,r),o.exports}r.d=function(n,t){for(var i in t)r.o(t,i)&&!r.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},r.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(n){if(\"object\"==typeof window)return window}}(),r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.r=function(n){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(n,\"S\",{value:!0})};var i={};return function(){r.r(i),r.d(i,{SHA256:function(){return h}});var n,t=r(1868),e=r(3354),o=(n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(t,r)},function(t,r){function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),u=[],f=[];function c(n){for(var t=Math.sqrt(n),r=2;r<=t;r++)if(!(n%r))return!1;return!0}function a(n){return 4294967296*(n-(0|n))|0}!function(){for(var n=2,t=0;t<64;)c(n)&&(t<8&&(u[t]=a(Math.pow(n,.5))),f[t]=a(Math.pow(n,1/3)),t++),n++}();var s=[],h=function(n){function t(t){var r=n.call(this,t)||this;return r.N=new e.e(u.slice(0)),r.v=t,t&&void 0!==t.hash&&(r.N=t.hash.clone()),r}return o(t,n),t.prototype.U=function(){this.N=new e.e(u.slice(0))},t.prototype.I=function(n,t){for(var r=this.N.words,i=r[0],e=r[1],o=r[2],u=r[3],c=r[4],a=r[5],h=r[6],v=r[7],d=0;d<64;d++){if(d<16)s[d]=0|n[t+d];else{var w=s[d-15],l=(w<<25|w>>>7)^(w<<14|w>>>18)^w>>>3,y=s[d-2],b=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;s[d]=l+s[d-7]+b+s[d-16]}var p=i&e^i&o^e&o,m=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),g=v+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&a^~c&h)+f[d]+s[d];v=h,h=a,a=c,c=u+g|0,u=o,o=e,e=i,i=g+(m+p)|0}r[0]=r[0]+i|0,r[1]=r[1]+e|0,r[2]=r[2]+o|0,r[3]=r[3]+u|0,r[4]=r[4]+c|0,r[5]=r[5]+a|0,r[6]=r[6]+h|0,r[7]=r[7]+v|0},t.prototype._=function(){var n=this.l.words,t=8*this.A,r=8*this.l.nSigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=Math.floor(t/4294967296),n[15+(r+64>>>9<<4)]=t,this.l.nSigBytes=4*n.length,this.O(),this.N},t.prototype.clone=function(){return new t({hash:this.N,blockSize:this.h,data:this.l,nBytes:this.A})},t.hash=function(n,r){return new t(r).finalize(n)},t}(t.P)}(),i}()}));","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgAggregateExchangeRatePrevote = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar tx_1 = require(\"@terra-money/terra.proto/terra/oracle/v1beta1/tx\");\n/**\n * Aggregate analog of MsgExchangeRatePrevote\n */\nvar MsgAggregateExchangeRatePrevote = /** @class */ (function (_super) {\n __extends(MsgAggregateExchangeRatePrevote, _super);\n /**\n * @param hash vote hash\n * @param feeder validator's feeder account address\n * @param validator validator's operator address\n */\n function MsgAggregateExchangeRatePrevote(hash, feeder, validator) {\n var _this = _super.call(this) || this;\n _this.hash = hash;\n _this.feeder = feeder;\n _this.validator = validator;\n return _this;\n }\n MsgAggregateExchangeRatePrevote.fromAmino = function (data) {\n var _a = data.value, hash = _a.hash, feeder = _a.feeder, validator = _a.validator;\n return new MsgAggregateExchangeRatePrevote(hash, feeder, validator);\n };\n MsgAggregateExchangeRatePrevote.prototype.toAmino = function () {\n var _a = this, hash = _a.hash, feeder = _a.feeder, validator = _a.validator;\n return {\n type: 'oracle/MsgAggregateExchangeRatePrevote',\n value: {\n hash: hash,\n feeder: feeder,\n validator: validator,\n },\n };\n };\n MsgAggregateExchangeRatePrevote.fromData = function (data) {\n var hash = data.hash, feeder = data.feeder, validator = data.validator;\n return new MsgAggregateExchangeRatePrevote(hash, feeder, validator);\n };\n MsgAggregateExchangeRatePrevote.prototype.toData = function () {\n var _a = this, hash = _a.hash, feeder = _a.feeder, validator = _a.validator;\n return {\n '@type': '/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote',\n hash: hash,\n feeder: feeder,\n validator: validator,\n };\n };\n MsgAggregateExchangeRatePrevote.fromProto = function (proto) {\n return new MsgAggregateExchangeRatePrevote(proto.hash, proto.feeder, proto.validator);\n };\n MsgAggregateExchangeRatePrevote.prototype.toProto = function () {\n var _a = this, hash = _a.hash, feeder = _a.feeder, validator = _a.validator;\n return tx_1.MsgAggregateExchangeRatePrevote.fromPartial({\n hash: hash,\n feeder: feeder,\n validator: validator,\n });\n };\n MsgAggregateExchangeRatePrevote.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote',\n value: tx_1.MsgAggregateExchangeRatePrevote.encode(this.toProto()).finish(),\n });\n };\n MsgAggregateExchangeRatePrevote.unpackAny = function (msgAny) {\n return MsgAggregateExchangeRatePrevote.fromProto(tx_1.MsgAggregateExchangeRatePrevote.decode(msgAny.value));\n };\n return MsgAggregateExchangeRatePrevote;\n}(json_1.JSONSerializable));\nexports.MsgAggregateExchangeRatePrevote = MsgAggregateExchangeRatePrevote;\n//# sourceMappingURL=MsgAggregateExchangeRatePrevote.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgUnjail\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgDelegate\"), exports);\n__exportStar(require(\"./MsgUndelegate\"), exports);\n__exportStar(require(\"./MsgBeginRedelegate\"), exports);\n__exportStar(require(\"./MsgCreateValidator\"), exports);\n__exportStar(require(\"./MsgEditValidator\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TxProof = exports.BlockMeta = exports.LightBlock = exports.SignedHeader = exports.Proposal = exports.CommitSig = exports.Commit = exports.Vote = exports.Data = exports.Header = exports.BlockID = exports.Part = exports.PartSetHeader = exports.signedMsgTypeToJSON = exports.signedMsgTypeFromJSON = exports.SignedMsgType = exports.blockIDFlagToJSON = exports.blockIDFlagFromJSON = exports.BlockIDFlag = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst proof_1 = require(\"../../tendermint/crypto/proof\");\nconst types_1 = require(\"../../tendermint/version/types\");\nconst validator_1 = require(\"../../tendermint/types/validator\");\nconst timestamp_1 = require(\"../../google/protobuf/timestamp\");\nexports.protobufPackage = \"tendermint.types\";\n/** BlockIdFlag indicates which BlcokID the signature is for */\nvar BlockIDFlag;\n(function (BlockIDFlag) {\n BlockIDFlag[BlockIDFlag[\"BLOCK_ID_FLAG_UNKNOWN\"] = 0] = \"BLOCK_ID_FLAG_UNKNOWN\";\n BlockIDFlag[BlockIDFlag[\"BLOCK_ID_FLAG_ABSENT\"] = 1] = \"BLOCK_ID_FLAG_ABSENT\";\n BlockIDFlag[BlockIDFlag[\"BLOCK_ID_FLAG_COMMIT\"] = 2] = \"BLOCK_ID_FLAG_COMMIT\";\n BlockIDFlag[BlockIDFlag[\"BLOCK_ID_FLAG_NIL\"] = 3] = \"BLOCK_ID_FLAG_NIL\";\n BlockIDFlag[BlockIDFlag[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(BlockIDFlag = exports.BlockIDFlag || (exports.BlockIDFlag = {}));\nfunction blockIDFlagFromJSON(object) {\n switch (object) {\n case 0:\n case \"BLOCK_ID_FLAG_UNKNOWN\":\n return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN;\n case 1:\n case \"BLOCK_ID_FLAG_ABSENT\":\n return BlockIDFlag.BLOCK_ID_FLAG_ABSENT;\n case 2:\n case \"BLOCK_ID_FLAG_COMMIT\":\n return BlockIDFlag.BLOCK_ID_FLAG_COMMIT;\n case 3:\n case \"BLOCK_ID_FLAG_NIL\":\n return BlockIDFlag.BLOCK_ID_FLAG_NIL;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return BlockIDFlag.UNRECOGNIZED;\n }\n}\nexports.blockIDFlagFromJSON = blockIDFlagFromJSON;\nfunction blockIDFlagToJSON(object) {\n switch (object) {\n case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN:\n return \"BLOCK_ID_FLAG_UNKNOWN\";\n case BlockIDFlag.BLOCK_ID_FLAG_ABSENT:\n return \"BLOCK_ID_FLAG_ABSENT\";\n case BlockIDFlag.BLOCK_ID_FLAG_COMMIT:\n return \"BLOCK_ID_FLAG_COMMIT\";\n case BlockIDFlag.BLOCK_ID_FLAG_NIL:\n return \"BLOCK_ID_FLAG_NIL\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.blockIDFlagToJSON = blockIDFlagToJSON;\n/** SignedMsgType is a type of signed message in the consensus. */\nvar SignedMsgType;\n(function (SignedMsgType) {\n SignedMsgType[SignedMsgType[\"SIGNED_MSG_TYPE_UNKNOWN\"] = 0] = \"SIGNED_MSG_TYPE_UNKNOWN\";\n /** SIGNED_MSG_TYPE_PREVOTE - Votes */\n SignedMsgType[SignedMsgType[\"SIGNED_MSG_TYPE_PREVOTE\"] = 1] = \"SIGNED_MSG_TYPE_PREVOTE\";\n SignedMsgType[SignedMsgType[\"SIGNED_MSG_TYPE_PRECOMMIT\"] = 2] = \"SIGNED_MSG_TYPE_PRECOMMIT\";\n /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */\n SignedMsgType[SignedMsgType[\"SIGNED_MSG_TYPE_PROPOSAL\"] = 32] = \"SIGNED_MSG_TYPE_PROPOSAL\";\n SignedMsgType[SignedMsgType[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(SignedMsgType = exports.SignedMsgType || (exports.SignedMsgType = {}));\nfunction signedMsgTypeFromJSON(object) {\n switch (object) {\n case 0:\n case \"SIGNED_MSG_TYPE_UNKNOWN\":\n return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN;\n case 1:\n case \"SIGNED_MSG_TYPE_PREVOTE\":\n return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE;\n case 2:\n case \"SIGNED_MSG_TYPE_PRECOMMIT\":\n return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT;\n case 32:\n case \"SIGNED_MSG_TYPE_PROPOSAL\":\n return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return SignedMsgType.UNRECOGNIZED;\n }\n}\nexports.signedMsgTypeFromJSON = signedMsgTypeFromJSON;\nfunction signedMsgTypeToJSON(object) {\n switch (object) {\n case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN:\n return \"SIGNED_MSG_TYPE_UNKNOWN\";\n case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE:\n return \"SIGNED_MSG_TYPE_PREVOTE\";\n case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT:\n return \"SIGNED_MSG_TYPE_PRECOMMIT\";\n case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL:\n return \"SIGNED_MSG_TYPE_PROPOSAL\";\n default:\n return \"UNKNOWN\";\n }\n}\nexports.signedMsgTypeToJSON = signedMsgTypeToJSON;\nconst basePartSetHeader = { total: 0 };\nexports.PartSetHeader = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.total !== 0) {\n writer.uint32(8).uint32(message.total);\n }\n if (message.hash.length !== 0) {\n writer.uint32(18).bytes(message.hash);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePartSetHeader);\n message.hash = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.total = reader.uint32();\n break;\n case 2:\n message.hash = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePartSetHeader);\n message.hash = new Uint8Array();\n if (object.total !== undefined && object.total !== null) {\n message.total = Number(object.total);\n }\n else {\n message.total = 0;\n }\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = bytesFromBase64(object.hash);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.total !== undefined && (obj.total = message.total);\n message.hash !== undefined &&\n (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePartSetHeader);\n if (object.total !== undefined && object.total !== null) {\n message.total = object.total;\n }\n else {\n message.total = 0;\n }\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = object.hash;\n }\n else {\n message.hash = new Uint8Array();\n }\n return message;\n },\n};\nconst basePart = { index: 0 };\nexports.Part = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.index !== 0) {\n writer.uint32(8).uint32(message.index);\n }\n if (message.bytes.length !== 0) {\n writer.uint32(18).bytes(message.bytes);\n }\n if (message.proof !== undefined) {\n proof_1.Proof.encode(message.proof, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePart);\n message.bytes = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.index = reader.uint32();\n break;\n case 2:\n message.bytes = reader.bytes();\n break;\n case 3:\n message.proof = proof_1.Proof.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePart);\n message.bytes = new Uint8Array();\n if (object.index !== undefined && object.index !== null) {\n message.index = Number(object.index);\n }\n else {\n message.index = 0;\n }\n if (object.bytes !== undefined && object.bytes !== null) {\n message.bytes = bytesFromBase64(object.bytes);\n }\n if (object.proof !== undefined && object.proof !== null) {\n message.proof = proof_1.Proof.fromJSON(object.proof);\n }\n else {\n message.proof = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.index !== undefined && (obj.index = message.index);\n message.bytes !== undefined &&\n (obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array()));\n message.proof !== undefined && (obj.proof = message.proof ? proof_1.Proof.toJSON(message.proof) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePart);\n if (object.index !== undefined && object.index !== null) {\n message.index = object.index;\n }\n else {\n message.index = 0;\n }\n if (object.bytes !== undefined && object.bytes !== null) {\n message.bytes = object.bytes;\n }\n else {\n message.bytes = new Uint8Array();\n }\n if (object.proof !== undefined && object.proof !== null) {\n message.proof = proof_1.Proof.fromPartial(object.proof);\n }\n else {\n message.proof = undefined;\n }\n return message;\n },\n};\nconst baseBlockID = {};\nexports.BlockID = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.hash.length !== 0) {\n writer.uint32(10).bytes(message.hash);\n }\n if (message.partSetHeader !== undefined) {\n exports.PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseBlockID);\n message.hash = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.hash = reader.bytes();\n break;\n case 2:\n message.partSetHeader = exports.PartSetHeader.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseBlockID);\n message.hash = new Uint8Array();\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = bytesFromBase64(object.hash);\n }\n if (object.partSetHeader !== undefined && object.partSetHeader !== null) {\n message.partSetHeader = exports.PartSetHeader.fromJSON(object.partSetHeader);\n }\n else {\n message.partSetHeader = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.hash !== undefined &&\n (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));\n message.partSetHeader !== undefined &&\n (obj.partSetHeader = message.partSetHeader ? exports.PartSetHeader.toJSON(message.partSetHeader) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseBlockID);\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = object.hash;\n }\n else {\n message.hash = new Uint8Array();\n }\n if (object.partSetHeader !== undefined && object.partSetHeader !== null) {\n message.partSetHeader = exports.PartSetHeader.fromPartial(object.partSetHeader);\n }\n else {\n message.partSetHeader = undefined;\n }\n return message;\n },\n};\nconst baseHeader = { chainId: \"\", height: long_1.default.ZERO };\nexports.Header = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.version !== undefined) {\n types_1.Consensus.encode(message.version, writer.uint32(10).fork()).ldelim();\n }\n if (message.chainId !== \"\") {\n writer.uint32(18).string(message.chainId);\n }\n if (!message.height.isZero()) {\n writer.uint32(24).int64(message.height);\n }\n if (message.time !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim();\n }\n if (message.lastBlockId !== undefined) {\n exports.BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim();\n }\n if (message.lastCommitHash.length !== 0) {\n writer.uint32(50).bytes(message.lastCommitHash);\n }\n if (message.dataHash.length !== 0) {\n writer.uint32(58).bytes(message.dataHash);\n }\n if (message.validatorsHash.length !== 0) {\n writer.uint32(66).bytes(message.validatorsHash);\n }\n if (message.nextValidatorsHash.length !== 0) {\n writer.uint32(74).bytes(message.nextValidatorsHash);\n }\n if (message.consensusHash.length !== 0) {\n writer.uint32(82).bytes(message.consensusHash);\n }\n if (message.appHash.length !== 0) {\n writer.uint32(90).bytes(message.appHash);\n }\n if (message.lastResultsHash.length !== 0) {\n writer.uint32(98).bytes(message.lastResultsHash);\n }\n if (message.evidenceHash.length !== 0) {\n writer.uint32(106).bytes(message.evidenceHash);\n }\n if (message.proposerAddress.length !== 0) {\n writer.uint32(114).bytes(message.proposerAddress);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseHeader);\n message.lastCommitHash = new Uint8Array();\n message.dataHash = new Uint8Array();\n message.validatorsHash = new Uint8Array();\n message.nextValidatorsHash = new Uint8Array();\n message.consensusHash = new Uint8Array();\n message.appHash = new Uint8Array();\n message.lastResultsHash = new Uint8Array();\n message.evidenceHash = new Uint8Array();\n message.proposerAddress = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.version = types_1.Consensus.decode(reader, reader.uint32());\n break;\n case 2:\n message.chainId = reader.string();\n break;\n case 3:\n message.height = reader.int64();\n break;\n case 4:\n message.time = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 5:\n message.lastBlockId = exports.BlockID.decode(reader, reader.uint32());\n break;\n case 6:\n message.lastCommitHash = reader.bytes();\n break;\n case 7:\n message.dataHash = reader.bytes();\n break;\n case 8:\n message.validatorsHash = reader.bytes();\n break;\n case 9:\n message.nextValidatorsHash = reader.bytes();\n break;\n case 10:\n message.consensusHash = reader.bytes();\n break;\n case 11:\n message.appHash = reader.bytes();\n break;\n case 12:\n message.lastResultsHash = reader.bytes();\n break;\n case 13:\n message.evidenceHash = reader.bytes();\n break;\n case 14:\n message.proposerAddress = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseHeader);\n message.lastCommitHash = new Uint8Array();\n message.dataHash = new Uint8Array();\n message.validatorsHash = new Uint8Array();\n message.nextValidatorsHash = new Uint8Array();\n message.consensusHash = new Uint8Array();\n message.appHash = new Uint8Array();\n message.lastResultsHash = new Uint8Array();\n message.evidenceHash = new Uint8Array();\n message.proposerAddress = new Uint8Array();\n if (object.version !== undefined && object.version !== null) {\n message.version = types_1.Consensus.fromJSON(object.version);\n }\n else {\n message.version = undefined;\n }\n if (object.chainId !== undefined && object.chainId !== null) {\n message.chainId = String(object.chainId);\n }\n else {\n message.chainId = \"\";\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = long_1.default.fromString(object.height);\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.time !== undefined && object.time !== null) {\n message.time = fromJsonTimestamp(object.time);\n }\n else {\n message.time = undefined;\n }\n if (object.lastBlockId !== undefined && object.lastBlockId !== null) {\n message.lastBlockId = exports.BlockID.fromJSON(object.lastBlockId);\n }\n else {\n message.lastBlockId = undefined;\n }\n if (object.lastCommitHash !== undefined && object.lastCommitHash !== null) {\n message.lastCommitHash = bytesFromBase64(object.lastCommitHash);\n }\n if (object.dataHash !== undefined && object.dataHash !== null) {\n message.dataHash = bytesFromBase64(object.dataHash);\n }\n if (object.validatorsHash !== undefined && object.validatorsHash !== null) {\n message.validatorsHash = bytesFromBase64(object.validatorsHash);\n }\n if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) {\n message.nextValidatorsHash = bytesFromBase64(object.nextValidatorsHash);\n }\n if (object.consensusHash !== undefined && object.consensusHash !== null) {\n message.consensusHash = bytesFromBase64(object.consensusHash);\n }\n if (object.appHash !== undefined && object.appHash !== null) {\n message.appHash = bytesFromBase64(object.appHash);\n }\n if (object.lastResultsHash !== undefined && object.lastResultsHash !== null) {\n message.lastResultsHash = bytesFromBase64(object.lastResultsHash);\n }\n if (object.evidenceHash !== undefined && object.evidenceHash !== null) {\n message.evidenceHash = bytesFromBase64(object.evidenceHash);\n }\n if (object.proposerAddress !== undefined && object.proposerAddress !== null) {\n message.proposerAddress = bytesFromBase64(object.proposerAddress);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.version !== undefined &&\n (obj.version = message.version ? types_1.Consensus.toJSON(message.version) : undefined);\n message.chainId !== undefined && (obj.chainId = message.chainId);\n message.height !== undefined && (obj.height = (message.height || long_1.default.ZERO).toString());\n message.time !== undefined && (obj.time = message.time.toISOString());\n message.lastBlockId !== undefined &&\n (obj.lastBlockId = message.lastBlockId ? exports.BlockID.toJSON(message.lastBlockId) : undefined);\n message.lastCommitHash !== undefined &&\n (obj.lastCommitHash = base64FromBytes(message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array()));\n message.dataHash !== undefined &&\n (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array()));\n message.validatorsHash !== undefined &&\n (obj.validatorsHash = base64FromBytes(message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array()));\n message.nextValidatorsHash !== undefined &&\n (obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array()));\n message.consensusHash !== undefined &&\n (obj.consensusHash = base64FromBytes(message.consensusHash !== undefined ? message.consensusHash : new Uint8Array()));\n message.appHash !== undefined &&\n (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));\n message.lastResultsHash !== undefined &&\n (obj.lastResultsHash = base64FromBytes(message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array()));\n message.evidenceHash !== undefined &&\n (obj.evidenceHash = base64FromBytes(message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array()));\n message.proposerAddress !== undefined &&\n (obj.proposerAddress = base64FromBytes(message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseHeader);\n if (object.version !== undefined && object.version !== null) {\n message.version = types_1.Consensus.fromPartial(object.version);\n }\n else {\n message.version = undefined;\n }\n if (object.chainId !== undefined && object.chainId !== null) {\n message.chainId = object.chainId;\n }\n else {\n message.chainId = \"\";\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = object.height;\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.time !== undefined && object.time !== null) {\n message.time = object.time;\n }\n else {\n message.time = undefined;\n }\n if (object.lastBlockId !== undefined && object.lastBlockId !== null) {\n message.lastBlockId = exports.BlockID.fromPartial(object.lastBlockId);\n }\n else {\n message.lastBlockId = undefined;\n }\n if (object.lastCommitHash !== undefined && object.lastCommitHash !== null) {\n message.lastCommitHash = object.lastCommitHash;\n }\n else {\n message.lastCommitHash = new Uint8Array();\n }\n if (object.dataHash !== undefined && object.dataHash !== null) {\n message.dataHash = object.dataHash;\n }\n else {\n message.dataHash = new Uint8Array();\n }\n if (object.validatorsHash !== undefined && object.validatorsHash !== null) {\n message.validatorsHash = object.validatorsHash;\n }\n else {\n message.validatorsHash = new Uint8Array();\n }\n if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) {\n message.nextValidatorsHash = object.nextValidatorsHash;\n }\n else {\n message.nextValidatorsHash = new Uint8Array();\n }\n if (object.consensusHash !== undefined && object.consensusHash !== null) {\n message.consensusHash = object.consensusHash;\n }\n else {\n message.consensusHash = new Uint8Array();\n }\n if (object.appHash !== undefined && object.appHash !== null) {\n message.appHash = object.appHash;\n }\n else {\n message.appHash = new Uint8Array();\n }\n if (object.lastResultsHash !== undefined && object.lastResultsHash !== null) {\n message.lastResultsHash = object.lastResultsHash;\n }\n else {\n message.lastResultsHash = new Uint8Array();\n }\n if (object.evidenceHash !== undefined && object.evidenceHash !== null) {\n message.evidenceHash = object.evidenceHash;\n }\n else {\n message.evidenceHash = new Uint8Array();\n }\n if (object.proposerAddress !== undefined && object.proposerAddress !== null) {\n message.proposerAddress = object.proposerAddress;\n }\n else {\n message.proposerAddress = new Uint8Array();\n }\n return message;\n },\n};\nconst baseData = {};\nexports.Data = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.txs) {\n writer.uint32(10).bytes(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseData);\n message.txs = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.txs.push(reader.bytes());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseData);\n message.txs = [];\n if (object.txs !== undefined && object.txs !== null) {\n for (const e of object.txs) {\n message.txs.push(bytesFromBase64(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.txs) {\n obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));\n }\n else {\n obj.txs = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseData);\n message.txs = [];\n if (object.txs !== undefined && object.txs !== null) {\n for (const e of object.txs) {\n message.txs.push(e);\n }\n }\n return message;\n },\n};\nconst baseVote = { type: 0, height: long_1.default.ZERO, round: 0, validatorIndex: 0 };\nexports.Vote = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.type !== 0) {\n writer.uint32(8).int32(message.type);\n }\n if (!message.height.isZero()) {\n writer.uint32(16).int64(message.height);\n }\n if (message.round !== 0) {\n writer.uint32(24).int32(message.round);\n }\n if (message.blockId !== undefined) {\n exports.BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim();\n }\n if (message.timestamp !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim();\n }\n if (message.validatorAddress.length !== 0) {\n writer.uint32(50).bytes(message.validatorAddress);\n }\n if (message.validatorIndex !== 0) {\n writer.uint32(56).int32(message.validatorIndex);\n }\n if (message.signature.length !== 0) {\n writer.uint32(66).bytes(message.signature);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseVote);\n message.validatorAddress = new Uint8Array();\n message.signature = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.type = reader.int32();\n break;\n case 2:\n message.height = reader.int64();\n break;\n case 3:\n message.round = reader.int32();\n break;\n case 4:\n message.blockId = exports.BlockID.decode(reader, reader.uint32());\n break;\n case 5:\n message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 6:\n message.validatorAddress = reader.bytes();\n break;\n case 7:\n message.validatorIndex = reader.int32();\n break;\n case 8:\n message.signature = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseVote);\n message.validatorAddress = new Uint8Array();\n message.signature = new Uint8Array();\n if (object.type !== undefined && object.type !== null) {\n message.type = signedMsgTypeFromJSON(object.type);\n }\n else {\n message.type = 0;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = long_1.default.fromString(object.height);\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.round !== undefined && object.round !== null) {\n message.round = Number(object.round);\n }\n else {\n message.round = 0;\n }\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromJSON(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = fromJsonTimestamp(object.timestamp);\n }\n else {\n message.timestamp = undefined;\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = bytesFromBase64(object.validatorAddress);\n }\n if (object.validatorIndex !== undefined && object.validatorIndex !== null) {\n message.validatorIndex = Number(object.validatorIndex);\n }\n else {\n message.validatorIndex = 0;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = bytesFromBase64(object.signature);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));\n message.height !== undefined && (obj.height = (message.height || long_1.default.ZERO).toString());\n message.round !== undefined && (obj.round = message.round);\n message.blockId !== undefined &&\n (obj.blockId = message.blockId ? exports.BlockID.toJSON(message.blockId) : undefined);\n message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());\n message.validatorAddress !== undefined &&\n (obj.validatorAddress = base64FromBytes(message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array()));\n message.validatorIndex !== undefined && (obj.validatorIndex = message.validatorIndex);\n message.signature !== undefined &&\n (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseVote);\n if (object.type !== undefined && object.type !== null) {\n message.type = object.type;\n }\n else {\n message.type = 0;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = object.height;\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.round !== undefined && object.round !== null) {\n message.round = object.round;\n }\n else {\n message.round = 0;\n }\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromPartial(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = object.timestamp;\n }\n else {\n message.timestamp = undefined;\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = new Uint8Array();\n }\n if (object.validatorIndex !== undefined && object.validatorIndex !== null) {\n message.validatorIndex = object.validatorIndex;\n }\n else {\n message.validatorIndex = 0;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = object.signature;\n }\n else {\n message.signature = new Uint8Array();\n }\n return message;\n },\n};\nconst baseCommit = { height: long_1.default.ZERO, round: 0 };\nexports.Commit = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.height.isZero()) {\n writer.uint32(8).int64(message.height);\n }\n if (message.round !== 0) {\n writer.uint32(16).int32(message.round);\n }\n if (message.blockId !== undefined) {\n exports.BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim();\n }\n for (const v of message.signatures) {\n exports.CommitSig.encode(v, writer.uint32(34).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCommit);\n message.signatures = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.height = reader.int64();\n break;\n case 2:\n message.round = reader.int32();\n break;\n case 3:\n message.blockId = exports.BlockID.decode(reader, reader.uint32());\n break;\n case 4:\n message.signatures.push(exports.CommitSig.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCommit);\n message.signatures = [];\n if (object.height !== undefined && object.height !== null) {\n message.height = long_1.default.fromString(object.height);\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.round !== undefined && object.round !== null) {\n message.round = Number(object.round);\n }\n else {\n message.round = 0;\n }\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromJSON(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(exports.CommitSig.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.height !== undefined && (obj.height = (message.height || long_1.default.ZERO).toString());\n message.round !== undefined && (obj.round = message.round);\n message.blockId !== undefined &&\n (obj.blockId = message.blockId ? exports.BlockID.toJSON(message.blockId) : undefined);\n if (message.signatures) {\n obj.signatures = message.signatures.map((e) => (e ? exports.CommitSig.toJSON(e) : undefined));\n }\n else {\n obj.signatures = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCommit);\n message.signatures = [];\n if (object.height !== undefined && object.height !== null) {\n message.height = object.height;\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.round !== undefined && object.round !== null) {\n message.round = object.round;\n }\n else {\n message.round = 0;\n }\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromPartial(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.signatures !== undefined && object.signatures !== null) {\n for (const e of object.signatures) {\n message.signatures.push(exports.CommitSig.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseCommitSig = { blockIdFlag: 0 };\nexports.CommitSig = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.blockIdFlag !== 0) {\n writer.uint32(8).int32(message.blockIdFlag);\n }\n if (message.validatorAddress.length !== 0) {\n writer.uint32(18).bytes(message.validatorAddress);\n }\n if (message.timestamp !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim();\n }\n if (message.signature.length !== 0) {\n writer.uint32(34).bytes(message.signature);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseCommitSig);\n message.validatorAddress = new Uint8Array();\n message.signature = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.blockIdFlag = reader.int32();\n break;\n case 2:\n message.validatorAddress = reader.bytes();\n break;\n case 3:\n message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 4:\n message.signature = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseCommitSig);\n message.validatorAddress = new Uint8Array();\n message.signature = new Uint8Array();\n if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) {\n message.blockIdFlag = blockIDFlagFromJSON(object.blockIdFlag);\n }\n else {\n message.blockIdFlag = 0;\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = bytesFromBase64(object.validatorAddress);\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = fromJsonTimestamp(object.timestamp);\n }\n else {\n message.timestamp = undefined;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = bytesFromBase64(object.signature);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag));\n message.validatorAddress !== undefined &&\n (obj.validatorAddress = base64FromBytes(message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array()));\n message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());\n message.signature !== undefined &&\n (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseCommitSig);\n if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) {\n message.blockIdFlag = object.blockIdFlag;\n }\n else {\n message.blockIdFlag = 0;\n }\n if (object.validatorAddress !== undefined && object.validatorAddress !== null) {\n message.validatorAddress = object.validatorAddress;\n }\n else {\n message.validatorAddress = new Uint8Array();\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = object.timestamp;\n }\n else {\n message.timestamp = undefined;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = object.signature;\n }\n else {\n message.signature = new Uint8Array();\n }\n return message;\n },\n};\nconst baseProposal = { type: 0, height: long_1.default.ZERO, round: 0, polRound: 0 };\nexports.Proposal = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.type !== 0) {\n writer.uint32(8).int32(message.type);\n }\n if (!message.height.isZero()) {\n writer.uint32(16).int64(message.height);\n }\n if (message.round !== 0) {\n writer.uint32(24).int32(message.round);\n }\n if (message.polRound !== 0) {\n writer.uint32(32).int32(message.polRound);\n }\n if (message.blockId !== undefined) {\n exports.BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim();\n }\n if (message.timestamp !== undefined) {\n timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim();\n }\n if (message.signature.length !== 0) {\n writer.uint32(58).bytes(message.signature);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseProposal);\n message.signature = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.type = reader.int32();\n break;\n case 2:\n message.height = reader.int64();\n break;\n case 3:\n message.round = reader.int32();\n break;\n case 4:\n message.polRound = reader.int32();\n break;\n case 5:\n message.blockId = exports.BlockID.decode(reader, reader.uint32());\n break;\n case 6:\n message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));\n break;\n case 7:\n message.signature = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseProposal);\n message.signature = new Uint8Array();\n if (object.type !== undefined && object.type !== null) {\n message.type = signedMsgTypeFromJSON(object.type);\n }\n else {\n message.type = 0;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = long_1.default.fromString(object.height);\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.round !== undefined && object.round !== null) {\n message.round = Number(object.round);\n }\n else {\n message.round = 0;\n }\n if (object.polRound !== undefined && object.polRound !== null) {\n message.polRound = Number(object.polRound);\n }\n else {\n message.polRound = 0;\n }\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromJSON(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = fromJsonTimestamp(object.timestamp);\n }\n else {\n message.timestamp = undefined;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = bytesFromBase64(object.signature);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));\n message.height !== undefined && (obj.height = (message.height || long_1.default.ZERO).toString());\n message.round !== undefined && (obj.round = message.round);\n message.polRound !== undefined && (obj.polRound = message.polRound);\n message.blockId !== undefined &&\n (obj.blockId = message.blockId ? exports.BlockID.toJSON(message.blockId) : undefined);\n message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());\n message.signature !== undefined &&\n (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseProposal);\n if (object.type !== undefined && object.type !== null) {\n message.type = object.type;\n }\n else {\n message.type = 0;\n }\n if (object.height !== undefined && object.height !== null) {\n message.height = object.height;\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.round !== undefined && object.round !== null) {\n message.round = object.round;\n }\n else {\n message.round = 0;\n }\n if (object.polRound !== undefined && object.polRound !== null) {\n message.polRound = object.polRound;\n }\n else {\n message.polRound = 0;\n }\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromPartial(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = object.timestamp;\n }\n else {\n message.timestamp = undefined;\n }\n if (object.signature !== undefined && object.signature !== null) {\n message.signature = object.signature;\n }\n else {\n message.signature = new Uint8Array();\n }\n return message;\n },\n};\nconst baseSignedHeader = {};\nexports.SignedHeader = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.header !== undefined) {\n exports.Header.encode(message.header, writer.uint32(10).fork()).ldelim();\n }\n if (message.commit !== undefined) {\n exports.Commit.encode(message.commit, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSignedHeader);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.header = exports.Header.decode(reader, reader.uint32());\n break;\n case 2:\n message.commit = exports.Commit.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSignedHeader);\n if (object.header !== undefined && object.header !== null) {\n message.header = exports.Header.fromJSON(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.commit !== undefined && object.commit !== null) {\n message.commit = exports.Commit.fromJSON(object.commit);\n }\n else {\n message.commit = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.header !== undefined && (obj.header = message.header ? exports.Header.toJSON(message.header) : undefined);\n message.commit !== undefined && (obj.commit = message.commit ? exports.Commit.toJSON(message.commit) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSignedHeader);\n if (object.header !== undefined && object.header !== null) {\n message.header = exports.Header.fromPartial(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.commit !== undefined && object.commit !== null) {\n message.commit = exports.Commit.fromPartial(object.commit);\n }\n else {\n message.commit = undefined;\n }\n return message;\n },\n};\nconst baseLightBlock = {};\nexports.LightBlock = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.signedHeader !== undefined) {\n exports.SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim();\n }\n if (message.validatorSet !== undefined) {\n validator_1.ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseLightBlock);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.signedHeader = exports.SignedHeader.decode(reader, reader.uint32());\n break;\n case 2:\n message.validatorSet = validator_1.ValidatorSet.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseLightBlock);\n if (object.signedHeader !== undefined && object.signedHeader !== null) {\n message.signedHeader = exports.SignedHeader.fromJSON(object.signedHeader);\n }\n else {\n message.signedHeader = undefined;\n }\n if (object.validatorSet !== undefined && object.validatorSet !== null) {\n message.validatorSet = validator_1.ValidatorSet.fromJSON(object.validatorSet);\n }\n else {\n message.validatorSet = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.signedHeader !== undefined &&\n (obj.signedHeader = message.signedHeader ? exports.SignedHeader.toJSON(message.signedHeader) : undefined);\n message.validatorSet !== undefined &&\n (obj.validatorSet = message.validatorSet ? validator_1.ValidatorSet.toJSON(message.validatorSet) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseLightBlock);\n if (object.signedHeader !== undefined && object.signedHeader !== null) {\n message.signedHeader = exports.SignedHeader.fromPartial(object.signedHeader);\n }\n else {\n message.signedHeader = undefined;\n }\n if (object.validatorSet !== undefined && object.validatorSet !== null) {\n message.validatorSet = validator_1.ValidatorSet.fromPartial(object.validatorSet);\n }\n else {\n message.validatorSet = undefined;\n }\n return message;\n },\n};\nconst baseBlockMeta = { blockSize: long_1.default.ZERO, numTxs: long_1.default.ZERO };\nexports.BlockMeta = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.blockId !== undefined) {\n exports.BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim();\n }\n if (!message.blockSize.isZero()) {\n writer.uint32(16).int64(message.blockSize);\n }\n if (message.header !== undefined) {\n exports.Header.encode(message.header, writer.uint32(26).fork()).ldelim();\n }\n if (!message.numTxs.isZero()) {\n writer.uint32(32).int64(message.numTxs);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseBlockMeta);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.blockId = exports.BlockID.decode(reader, reader.uint32());\n break;\n case 2:\n message.blockSize = reader.int64();\n break;\n case 3:\n message.header = exports.Header.decode(reader, reader.uint32());\n break;\n case 4:\n message.numTxs = reader.int64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseBlockMeta);\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromJSON(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.blockSize !== undefined && object.blockSize !== null) {\n message.blockSize = long_1.default.fromString(object.blockSize);\n }\n else {\n message.blockSize = long_1.default.ZERO;\n }\n if (object.header !== undefined && object.header !== null) {\n message.header = exports.Header.fromJSON(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.numTxs !== undefined && object.numTxs !== null) {\n message.numTxs = long_1.default.fromString(object.numTxs);\n }\n else {\n message.numTxs = long_1.default.ZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.blockId !== undefined &&\n (obj.blockId = message.blockId ? exports.BlockID.toJSON(message.blockId) : undefined);\n message.blockSize !== undefined && (obj.blockSize = (message.blockSize || long_1.default.ZERO).toString());\n message.header !== undefined && (obj.header = message.header ? exports.Header.toJSON(message.header) : undefined);\n message.numTxs !== undefined && (obj.numTxs = (message.numTxs || long_1.default.ZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseBlockMeta);\n if (object.blockId !== undefined && object.blockId !== null) {\n message.blockId = exports.BlockID.fromPartial(object.blockId);\n }\n else {\n message.blockId = undefined;\n }\n if (object.blockSize !== undefined && object.blockSize !== null) {\n message.blockSize = object.blockSize;\n }\n else {\n message.blockSize = long_1.default.ZERO;\n }\n if (object.header !== undefined && object.header !== null) {\n message.header = exports.Header.fromPartial(object.header);\n }\n else {\n message.header = undefined;\n }\n if (object.numTxs !== undefined && object.numTxs !== null) {\n message.numTxs = object.numTxs;\n }\n else {\n message.numTxs = long_1.default.ZERO;\n }\n return message;\n },\n};\nconst baseTxProof = {};\nexports.TxProof = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.rootHash.length !== 0) {\n writer.uint32(10).bytes(message.rootHash);\n }\n if (message.data.length !== 0) {\n writer.uint32(18).bytes(message.data);\n }\n if (message.proof !== undefined) {\n proof_1.Proof.encode(message.proof, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTxProof);\n message.rootHash = new Uint8Array();\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.rootHash = reader.bytes();\n break;\n case 2:\n message.data = reader.bytes();\n break;\n case 3:\n message.proof = proof_1.Proof.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTxProof);\n message.rootHash = new Uint8Array();\n message.data = new Uint8Array();\n if (object.rootHash !== undefined && object.rootHash !== null) {\n message.rootHash = bytesFromBase64(object.rootHash);\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n if (object.proof !== undefined && object.proof !== null) {\n message.proof = proof_1.Proof.fromJSON(object.proof);\n }\n else {\n message.proof = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.rootHash !== undefined &&\n (obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array()));\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n message.proof !== undefined && (obj.proof = message.proof ? proof_1.Proof.toJSON(message.proof) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTxProof);\n if (object.rootHash !== undefined && object.rootHash !== null) {\n message.rootHash = object.rootHash;\n }\n else {\n message.rootHash = new Uint8Array();\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n if (object.proof !== undefined && object.proof !== null) {\n message.proof = proof_1.Proof.fromPartial(object.proof);\n }\n else {\n message.proof = undefined;\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nfunction toTimestamp(date) {\n const seconds = numberToLong(date.getTime() / 1000);\n const nanos = (date.getTime() % 1000) * 1000000;\n return { seconds, nanos };\n}\nfunction fromTimestamp(t) {\n let millis = t.seconds.toNumber() * 1000;\n millis += t.nanos / 1000000;\n return new Date(millis);\n}\nfunction fromJsonTimestamp(o) {\n if (o instanceof Date) {\n return o;\n }\n else if (typeof o === \"string\") {\n return new Date(o);\n }\n else {\n return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));\n }\n}\nfunction numberToLong(number) {\n return long_1.default.fromNumber(number);\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=types.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProofOps = exports.ProofOp = exports.DominoOp = exports.ValueOp = exports.Proof = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"tendermint.crypto\";\nconst baseProof = { total: long_1.default.ZERO, index: long_1.default.ZERO };\nexports.Proof = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.total.isZero()) {\n writer.uint32(8).int64(message.total);\n }\n if (!message.index.isZero()) {\n writer.uint32(16).int64(message.index);\n }\n if (message.leafHash.length !== 0) {\n writer.uint32(26).bytes(message.leafHash);\n }\n for (const v of message.aunts) {\n writer.uint32(34).bytes(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseProof);\n message.aunts = [];\n message.leafHash = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.total = reader.int64();\n break;\n case 2:\n message.index = reader.int64();\n break;\n case 3:\n message.leafHash = reader.bytes();\n break;\n case 4:\n message.aunts.push(reader.bytes());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseProof);\n message.aunts = [];\n message.leafHash = new Uint8Array();\n if (object.total !== undefined && object.total !== null) {\n message.total = long_1.default.fromString(object.total);\n }\n else {\n message.total = long_1.default.ZERO;\n }\n if (object.index !== undefined && object.index !== null) {\n message.index = long_1.default.fromString(object.index);\n }\n else {\n message.index = long_1.default.ZERO;\n }\n if (object.leafHash !== undefined && object.leafHash !== null) {\n message.leafHash = bytesFromBase64(object.leafHash);\n }\n if (object.aunts !== undefined && object.aunts !== null) {\n for (const e of object.aunts) {\n message.aunts.push(bytesFromBase64(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.total !== undefined && (obj.total = (message.total || long_1.default.ZERO).toString());\n message.index !== undefined && (obj.index = (message.index || long_1.default.ZERO).toString());\n message.leafHash !== undefined &&\n (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array()));\n if (message.aunts) {\n obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));\n }\n else {\n obj.aunts = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseProof);\n message.aunts = [];\n if (object.total !== undefined && object.total !== null) {\n message.total = object.total;\n }\n else {\n message.total = long_1.default.ZERO;\n }\n if (object.index !== undefined && object.index !== null) {\n message.index = object.index;\n }\n else {\n message.index = long_1.default.ZERO;\n }\n if (object.leafHash !== undefined && object.leafHash !== null) {\n message.leafHash = object.leafHash;\n }\n else {\n message.leafHash = new Uint8Array();\n }\n if (object.aunts !== undefined && object.aunts !== null) {\n for (const e of object.aunts) {\n message.aunts.push(e);\n }\n }\n return message;\n },\n};\nconst baseValueOp = {};\nexports.ValueOp = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.key.length !== 0) {\n writer.uint32(10).bytes(message.key);\n }\n if (message.proof !== undefined) {\n exports.Proof.encode(message.proof, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseValueOp);\n message.key = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.key = reader.bytes();\n break;\n case 2:\n message.proof = exports.Proof.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseValueOp);\n message.key = new Uint8Array();\n if (object.key !== undefined && object.key !== null) {\n message.key = bytesFromBase64(object.key);\n }\n if (object.proof !== undefined && object.proof !== null) {\n message.proof = exports.Proof.fromJSON(object.proof);\n }\n else {\n message.proof = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.key !== undefined &&\n (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));\n message.proof !== undefined && (obj.proof = message.proof ? exports.Proof.toJSON(message.proof) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseValueOp);\n if (object.key !== undefined && object.key !== null) {\n message.key = object.key;\n }\n else {\n message.key = new Uint8Array();\n }\n if (object.proof !== undefined && object.proof !== null) {\n message.proof = exports.Proof.fromPartial(object.proof);\n }\n else {\n message.proof = undefined;\n }\n return message;\n },\n};\nconst baseDominoOp = { key: \"\", input: \"\", output: \"\" };\nexports.DominoOp = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.input !== \"\") {\n writer.uint32(18).string(message.input);\n }\n if (message.output !== \"\") {\n writer.uint32(26).string(message.output);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDominoOp);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.key = reader.string();\n break;\n case 2:\n message.input = reader.string();\n break;\n case 3:\n message.output = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDominoOp);\n if (object.key !== undefined && object.key !== null) {\n message.key = String(object.key);\n }\n else {\n message.key = \"\";\n }\n if (object.input !== undefined && object.input !== null) {\n message.input = String(object.input);\n }\n else {\n message.input = \"\";\n }\n if (object.output !== undefined && object.output !== null) {\n message.output = String(object.output);\n }\n else {\n message.output = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.key !== undefined && (obj.key = message.key);\n message.input !== undefined && (obj.input = message.input);\n message.output !== undefined && (obj.output = message.output);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDominoOp);\n if (object.key !== undefined && object.key !== null) {\n message.key = object.key;\n }\n else {\n message.key = \"\";\n }\n if (object.input !== undefined && object.input !== null) {\n message.input = object.input;\n }\n else {\n message.input = \"\";\n }\n if (object.output !== undefined && object.output !== null) {\n message.output = object.output;\n }\n else {\n message.output = \"\";\n }\n return message;\n },\n};\nconst baseProofOp = { type: \"\" };\nexports.ProofOp = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.type !== \"\") {\n writer.uint32(10).string(message.type);\n }\n if (message.key.length !== 0) {\n writer.uint32(18).bytes(message.key);\n }\n if (message.data.length !== 0) {\n writer.uint32(26).bytes(message.data);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseProofOp);\n message.key = new Uint8Array();\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.type = reader.string();\n break;\n case 2:\n message.key = reader.bytes();\n break;\n case 3:\n message.data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseProofOp);\n message.key = new Uint8Array();\n message.data = new Uint8Array();\n if (object.type !== undefined && object.type !== null) {\n message.type = String(object.type);\n }\n else {\n message.type = \"\";\n }\n if (object.key !== undefined && object.key !== null) {\n message.key = bytesFromBase64(object.key);\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.type !== undefined && (obj.type = message.type);\n message.key !== undefined &&\n (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseProofOp);\n if (object.type !== undefined && object.type !== null) {\n message.type = object.type;\n }\n else {\n message.type = \"\";\n }\n if (object.key !== undefined && object.key !== null) {\n message.key = object.key;\n }\n else {\n message.key = new Uint8Array();\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n return message;\n },\n};\nconst baseProofOps = {};\nexports.ProofOps = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.ops) {\n exports.ProofOp.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseProofOps);\n message.ops = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.ops.push(exports.ProofOp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseProofOps);\n message.ops = [];\n if (object.ops !== undefined && object.ops !== null) {\n for (const e of object.ops) {\n message.ops.push(exports.ProofOp.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.ops) {\n obj.ops = message.ops.map((e) => (e ? exports.ProofOp.toJSON(e) : undefined));\n }\n else {\n obj.ops = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseProofOps);\n message.ops = [];\n if (object.ops !== undefined && object.ops !== null) {\n for (const e of object.ops) {\n message.ops.push(exports.ProofOp.fromPartial(e));\n }\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=proof.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PublicKey = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"tendermint.crypto\";\nconst basePublicKey = {};\nexports.PublicKey = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.ed25519 !== undefined) {\n writer.uint32(10).bytes(message.ed25519);\n }\n if (message.secp256k1 !== undefined) {\n writer.uint32(18).bytes(message.secp256k1);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, basePublicKey);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.ed25519 = reader.bytes();\n break;\n case 2:\n message.secp256k1 = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, basePublicKey);\n if (object.ed25519 !== undefined && object.ed25519 !== null) {\n message.ed25519 = bytesFromBase64(object.ed25519);\n }\n if (object.secp256k1 !== undefined && object.secp256k1 !== null) {\n message.secp256k1 = bytesFromBase64(object.secp256k1);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.ed25519 !== undefined &&\n (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined);\n message.secp256k1 !== undefined &&\n (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, basePublicKey);\n if (object.ed25519 !== undefined && object.ed25519 !== null) {\n message.ed25519 = object.ed25519;\n }\n else {\n message.ed25519 = undefined;\n }\n if (object.secp256k1 !== undefined && object.secp256k1 !== null) {\n message.secp256k1 = object.secp256k1;\n }\n else {\n message.secp256k1 = undefined;\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=keys.js.map","!function(n,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else if(\"object\"==typeof exports)exports.JsCrypto=t();else{var r=t();for(var i in n.JsCrypto=n.JsCrypto||{},r)n.JsCrypto[i]=r[i]}}(this,(function(){return function(){\"use strict\";var n={9691:function(n,t,r){r.d(t,{AES:function(){return _}});var i,e=r(9456),o=r(787),u=r(5693),f=r(9109),c=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=function(){return(s=Object.assign||function(n){for(var t,r=1,i=arguments.length;r>>8^255&e^99,a[r]=e,h[e]=r;var o=n[r],u=n[o],f=n[u],c=257*n[e]^16843008*e;v[r]=c<<24|c>>>8,w[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,b[r]=c,c=16843009*f^65537*u^257*o^16843008*r,d[e]=c<<24|c>>>8,y[e]=c<<16|c>>>16,p[e]=c<<8|c>>>24,O[e]=c,r?(r=o^n[n[n[f^o]]],i^=n[n[i]]):r=i=1}}();var j=[0,1,2,4,8,16,32,64,128,27,54],_=function(n){function t(t){var r=n.call(this,t)||this;return r.u=0,r.h=[],r.v=[],r.O=t,r.A(),r}return c(t,n),t.prototype.A=function(){var n;if(!this.u||this.k!==this.H){for(var t=this.k=this.H,r=t.words,i=t.nSigBytes/4,e=4*((this.u=i+6)+1),o=this.h=[],u=0;u6&&u%i==4&&(n=a[n>>>24]<<24|a[n>>>16&255]<<16|a[n>>>8&255]<<8|a[255&n]):(n=a[(n=n<<8|n>>>24)>>>24]<<24|a[n>>>16&255]<<16|a[n>>>8&255]<<8|a[255&n],n^=j[u/i|0]<<24),o[u]=o[u-i]^n);this.v=[];for(var f=0;f>>24]]^y[a[n>>>16&255]]^p[a[n>>>8&255]]^O[a[255&n]]}}},t.prototype.encryptBlock=function(n,t){this.B(n,t,this.h,v,w,l,b,a)},t.prototype.decryptBlock=function(n,t){var r=n[t+1];n[t+1]=n[t+3],n[t+3]=r,this.B(n,t,this.v,d,y,p,O,h),r=n[t+1],n[t+1]=n[t+3],n[t+3]=r},t.prototype.B=function(n,t,r,i,e,o,u,f){for(var c=this.u,s=n[t]^r[0],a=n[t+1]^r[1],h=n[t+2]^r[2],v=n[t+3]^r[3],w=4,l=1;l>>24]^e[a>>>16&255]^o[h>>>8&255]^u[255&v]^r[w++],d=i[a>>>24]^e[h>>>16&255]^o[v>>>8&255]^u[255&s]^r[w++],y=i[h>>>24]^e[v>>>16&255]^o[s>>>8&255]^u[255&a]^r[w++],p=i[v>>>24]^e[s>>>16&255]^o[a>>>8&255]^u[255&h]^r[w++];s=b,a=d,h=y,v=p}var O=(f[s>>>24]<<24|f[a>>>16&255]<<16|f[h>>>8&255]<<8|f[255&v])^r[w++],j=(f[a>>>24]<<24|f[h>>>16&255]<<16|f[v>>>8&255]<<8|f[255&s])^r[w++],_=(f[h>>>24]<<24|f[v>>>16&255]<<16|f[s>>>8&255]<<8|f[255&a])^r[w++],m=(f[v>>>24]<<24|f[s>>>16&255]<<16|f[a>>>8&255]<<8|f[255&h])^r[w++];n[t]=O,n[t+1]=j,n[t+2]=_,n[t+3]=m},t.createEncryptor=function(n,r){return new t(s(s({},r=void 0===r?{}:r),{key:n,transformMode:e.t.ENC_TRANSFORM_MODE}))},t.createDecryptor=function(n,r){return new t(s(s({},r=void 0===r?{}:r),{key:n,transformMode:e.t.DEC_TRANSFORM_MODE}))},t.encrypt=function(n,r,i){if(\"string\"==typeof r)return u.E.encrypt(t,n,r,i);if(r.nSigBytes%4!=0)throw new Error(\"Key size must be multiple of 32bit/4byte/1word\");return f.D.encrypt(t,n,r,i)},t.decrypt=function(n,r,i){if(\"string\"==typeof r)return u.E.decrypt(t,n,r,i);if(r.nSigBytes%4!=0)throw new Error(\"Key size must be multiple of 32bit/4byte/1word\");return f.D.decrypt(t,n,r,i)},t.keySize=8,t}(o.G)},3967:function(n,t,r){r.d(t,{CBCMAC:function(){return f}});var i=r(4768),e=r(3354),o=r(9691),u=r(3664);function f(n,t,r,f,c,s){var a=s&&s.Cipher?s.Cipher:o.AES,h=\"string\"==typeof r?i.d.parse(r):r,v=f||new e.e([0,0]),w=\"string\"==typeof t?i.d.parse(t):t,l=\"string\"==typeof n?i.d.parse(n):n,b=c||16;return u.K.mac(a,h,v,w,l,b)}},9910:function(n,t,r){r.d(t,{DES:function(){return b}});var i,e=r(787),o=r(9456),u=r(5693),f=r(9109),c=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=function(){return(s=Object.assign||function(n){for(var t,r=1,i=arguments.length;r>>5]>>>31-i%32&1}for(var e=this.I=[],o=0;o<16;o++){var u=e[o]=[],f=v[o];for(r=0;r<24;r++)u[r/6|0]|=t[(h[r]-1+f)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(h[r+24]-1+f)%28]<<31-r%6;u[0]=u[0]<<1|u[0]>>>31;for(r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}this.U=[];for(r=0;r<16;r++)this.U[r]=e[15-r]},t.prototype.encryptBlock=function(n,t){this.R(n,t,this.I)},t.prototype.decryptBlock=function(n,t){this.R(n,t,this.U)},t.prototype.R=function(n,t,r){this.L=n[t],this.F=n[t+1],this.X(4,252645135),this.X(16,65535),this.Z(2,858993459),this.Z(8,16711935),this.X(1,1431655765);for(var i=0;i<16;i++){for(var e=r[i],o=this.L,u=this.F,f=0,c=0;c<8;c++){var s=(u^e[c])&l[c];f|=w[c][s>>>0]}this.L=u,this.F=o^f}var a=this.L;this.L=this.F,this.F=a,this.X(1,1431655765),this.Z(8,16711935),this.Z(2,858993459),this.X(16,65535),this.X(4,252645135),n[t]=this.L,n[t+1]=this.F},t.prototype.X=function(n,t){var r=(this.L>>>n^this.F)&t;this.F^=r,this.L^=r<>>n^this.L)&t;this.L^=r,this.F^=r<192.\");var t=n.slice(0,2),r=n.length<4?n.slice(0,2):n.slice(2,4),i=n.length<6?n.slice(0,2):n.slice(4,6);return[f.DES.createEncryptor(new c.e(t)),f.DES.createEncryptor(new c.e(r)),f.DES.createEncryptor(new c.e(i))]},t.prototype.A=function(){var n=this.J();this.Y=n[0],this.$=n[1],this.nn=n[2]},t.prototype.encryptBlock=function(n,t){this.Y.encryptBlock(n,t),this.$.decryptBlock(n,t),this.nn.encryptBlock(n,t)},t.prototype.decryptBlock=function(n,t){this.nn.decryptBlock(n,t),this.$.encryptBlock(n,t),this.Y.decryptBlock(n,t)},t.createEncryptor=function(n,r){return new t(h(h({},r=void 0===r?{}:r),{key:n,transformMode:u.t.ENC_TRANSFORM_MODE}))},t.createDecryptor=function(n,r){return new t(h(h({},r=void 0===r?{}:r),{key:n,transformMode:u.t.DEC_TRANSFORM_MODE}))},t.encrypt=function(n,r,i){return\"string\"==typeof r?s.E.encrypt(t,n,r,i):e.D.encrypt(t,n,r,i)},t.decrypt=function(n,r,i){return\"string\"==typeof r?s.E.decrypt(t,n,r,i):e.D.decrypt(t,n,r,i)},t.keySize=6,t.ivSize=2,t}(o.G)},7753:function(n,t,r){r.d(t,{GMAC:function(){return f}});var i=r(4768),e=r(3354),o=r(9691),u=r(5607);function f(n,t,r,f,c){var s=\"string\"==typeof n?i.d.parse(n):n,a=r||new e.e([0,0,0,0]),h=c&&c.Cipher?c.Cipher:o.AES,v=\"string\"==typeof t?i.d.parse(t):t,w=f||16;return u.V.mac(h,v,a,s,void 0,w)}},6367:function(n,t,r){r.d(t,{Hmac:function(){return e}});var i=r(4768),e=function(){function n(n,t){this.tn=n,\"string\"==typeof t&&(t=i.d.parse(t));var r=n.blockSize,e=4*r;t.nSigBytes>e&&(t=n.finalize(t)),t.clamp();for(var o=this.rn=t.clone(),u=this.en=t.clone(),f=o.words,c=u.words,s=0;s>>32-o)+t}function s(n,t,r,i,e,o,u){var f=n+(t&i|r&~i)+e+u;return(f<>>32-o)+t}function a(n,t,r,i,e,o,u){var f=n+(t^r^i)+e+u;return(f<>>32-o)+t}function h(n,t,r,i,e,o,u){var f=n+(r^(t|~i))+e+u;return(f<>>32-o)+t}!function(){for(var n=0;n<64;n++)f[n]=4294967296*Math.abs(Math.sin(n+1))|0}();var v=function(n){function t(t){var r=n.call(this,t)||this;return r.on=new e.e([1732584193,4023233417,2562383102,271733878]),t&&void 0!==t.hash&&(r.on=t.hash.clone()),r}return u(t,n),t.prototype.A=function(){this.on=new e.e([1732584193,4023233417,2562383102,271733878])},t.prototype.un=function(n,t){for(var r=0;r<16;r++){var i=t+r,e=n[i];n[i]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8)}var o=this.on.words,u=n[t],v=n[t+1],w=n[t+2],l=n[t+3],b=n[t+4],d=n[t+5],y=n[t+6],p=n[t+7],O=n[t+8],j=n[t+9],_=n[t+10],m=n[t+11],A=n[t+12],g=n[t+13],E=n[t+14],S=n[t+15],M=o[0],k=o[1],H=o[2],C=o[3];M=c(M,k,H,C,u,7,f[0]),C=c(C,M,k,H,v,12,f[1]),H=c(H,C,M,k,w,17,f[2]),k=c(k,H,C,M,l,22,f[3]),M=c(M,k,H,C,b,7,f[4]),C=c(C,M,k,H,d,12,f[5]),H=c(H,C,M,k,y,17,f[6]),k=c(k,H,C,M,p,22,f[7]),M=c(M,k,H,C,O,7,f[8]),C=c(C,M,k,H,j,12,f[9]),H=c(H,C,M,k,_,17,f[10]),k=c(k,H,C,M,m,22,f[11]),M=c(M,k,H,C,A,7,f[12]),C=c(C,M,k,H,g,12,f[13]),H=c(H,C,M,k,E,17,f[14]),M=s(M,k=c(k,H,C,M,S,22,f[15]),H,C,v,5,f[16]),C=s(C,M,k,H,y,9,f[17]),H=s(H,C,M,k,m,14,f[18]),k=s(k,H,C,M,u,20,f[19]),M=s(M,k,H,C,d,5,f[20]),C=s(C,M,k,H,_,9,f[21]),H=s(H,C,M,k,S,14,f[22]),k=s(k,H,C,M,b,20,f[23]),M=s(M,k,H,C,j,5,f[24]),C=s(C,M,k,H,E,9,f[25]),H=s(H,C,M,k,l,14,f[26]),k=s(k,H,C,M,O,20,f[27]),M=s(M,k,H,C,g,5,f[28]),C=s(C,M,k,H,w,9,f[29]),H=s(H,C,M,k,p,14,f[30]),M=a(M,k=s(k,H,C,M,A,20,f[31]),H,C,d,4,f[32]),C=a(C,M,k,H,O,11,f[33]),H=a(H,C,M,k,m,16,f[34]),k=a(k,H,C,M,E,23,f[35]),M=a(M,k,H,C,v,4,f[36]),C=a(C,M,k,H,b,11,f[37]),H=a(H,C,M,k,p,16,f[38]),k=a(k,H,C,M,_,23,f[39]),M=a(M,k,H,C,g,4,f[40]),C=a(C,M,k,H,u,11,f[41]),H=a(H,C,M,k,l,16,f[42]),k=a(k,H,C,M,y,23,f[43]),M=a(M,k,H,C,j,4,f[44]),C=a(C,M,k,H,A,11,f[45]),H=a(H,C,M,k,S,16,f[46]),M=h(M,k=a(k,H,C,M,w,23,f[47]),H,C,u,6,f[48]),C=h(C,M,k,H,p,10,f[49]),H=h(H,C,M,k,E,15,f[50]),k=h(k,H,C,M,d,21,f[51]),M=h(M,k,H,C,A,6,f[52]),C=h(C,M,k,H,l,10,f[53]),H=h(H,C,M,k,_,15,f[54]),k=h(k,H,C,M,v,21,f[55]),M=h(M,k,H,C,O,6,f[56]),C=h(C,M,k,H,S,10,f[57]),H=h(H,C,M,k,y,15,f[58]),k=h(k,H,C,M,g,21,f[59]),M=h(M,k,H,C,b,6,f[60]),C=h(C,M,k,H,m,10,f[61]),H=h(H,C,M,k,w,15,f[62]),k=h(k,H,C,M,j,21,f[63]),o[0]=o[0]+M|0,o[1]=o[1]+k|0,o[2]=o[2]+H|0,o[3]=o[3]+C|0},t.prototype.fn=function(){var n=this.cn,t=n.words,r=8*this.sn,i=8*n.nSigBytes;t[i>>>5]|=128<<24-i%32;var e=Math.floor(r/4294967296),o=r;t[15+(i+64>>>9<<4)]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),t[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n.nSigBytes=4*(t.length+1),this.an();for(var u=this.on,f=u.words,c=0;c<4;c++){var s=f[c];f[c]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return u},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n){return(new t).finalize(n)},t}(o.P)},4615:function(n,t,r){r.d(t,{RC4:function(){return s}});var i,e=r(30),o=r(5693),u=r(9109),f=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(){return(c=Object.assign||function(n){for(var t,r=1,i=arguments.length;r>>2]>>>24-o%4*8&255;e=(e+this.S[i]+u)%256;var f=this.S[i];this.S[i]=this.S[e],this.S[e]=f}this.i=this.j=0},t.prototype.un=function(n,t){n[t]^=this.generateKeyStreamWord()},t.prototype.generateKeyStreamWord=function(){for(var n=this.S,t=this.i,r=this.j,i=0,e=0;e<4;e++){r=(r+n[t=(t+1)%256])%256;var o=n[t];n[t]=n[r],n[r]=o,i|=n[(n[t]+n[r])%256]<<24-8*e}return this.i=t,this.j=r,i},t.createEncryptor=function(n,r){return new t(c(c({},r=void 0===r?{}:r),{key:n}))},t.createDecryptor=function(n,r){return new t(c(c({},r=void 0===r?{}:r),{key:n}))},t.encrypt=function(n,r,i){return\"string\"==typeof r?o.E.encrypt(t,n,r,i):u.D.encrypt(t,n,r,i)},t.decrypt=function(n,r,i){return\"string\"==typeof r?o.E.decrypt(t,n,r,i):u.D.decrypt(t,n,r,i)},t.ivSize=0,t.keySize=8,t}(e.q)},9639:function(n,t,r){r.d(t,{RC4Drop:function(){return s}});var i,e=r(5693),o=r(9109),u=r(4615),f=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(){return(c=Object.assign||function(n){for(var t,r=1,i=arguments.length;r0;t--)this.generateKeyStreamWord()},t.createEncryptor=function(n,r){return new t(c(c({},r=void 0===r?{}:r),{key:n}))},t.createDecryptor=function(n,r){return new t(c(c({},r=void 0===r?{}:r),{key:n}))},t.encrypt=function(n,r,i){return\"string\"==typeof r?e.E.encrypt(t,n,r,i):o.D.encrypt(t,n,r,i)},t.decrypt=function(n,r,i){return\"string\"==typeof r?e.E.decrypt(t,n,r,i):o.D.decrypt(t,n,r,i)},t}(u.RC4)},7104:function(n,t,r){r.d(t,{RIPEMD160:function(){return O}});var i,e=r(1868),o=r(3354),u=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=new o.e([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=new o.e([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=new o.e([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),a=new o.e([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=new o.e([0,1518500249,1859775393,2400959708,2840853838]),v=new o.e([1352829926,1548603684,1836072691,2053994217,0]);function w(n,t,r){return n^t^r}function l(n,t,r){return n&t|~n&r}function b(n,t,r){return(n|~t)^r}function d(n,t,r){return n&r|t&~r}function y(n,t,r){return n^(t|~r)}function p(n,t){return n<>>32-t}var O=function(n){function t(t){var r=n.call(this,t)||this;return r.on=new o.e([1732584193,4023233417,2562383102,271733878,3285377520]),r.O=t,t&&void 0!==t.hash&&(r.on=t.hash.clone()),r}return u(t,n),t.prototype.A=function(){this.on=new o.e([1732584193,4023233417,2562383102,271733878,3285377520])},t.prototype.un=function(n,t){for(var r=0;r<16;r++){var i=t+r,e=n[i];n[i]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8)}var o,u,O,j,_,m,A,g,E,S,M,k=this.on.words,H=h.words,C=v.words,B=f.words,N=c.words,I=s.words,z=a.words;m=o=k[0],A=u=k[1],g=O=k[2],E=j=k[3],S=_=k[4];for(r=0;r<80;r+=1)M=o+n[t+B[r]]|0,M+=r<16?w(u,O,j)+H[0]:r<32?l(u,O,j)+H[1]:r<48?b(u,O,j)+H[2]:r<64?d(u,O,j)+H[3]:y(u,O,j)+H[4],M=(M=p(M|=0,I[r]))+_|0,o=_,_=j,j=p(O,10),O=u,u=M,M=m+n[t+N[r]]|0,M+=r<16?y(A,g,E)+C[0]:r<32?d(A,g,E)+C[1]:r<48?b(A,g,E)+C[2]:r<64?l(A,g,E)+C[3]:w(A,g,E)+C[4],M=(M=p(M|=0,z[r]))+S|0,m=S,S=E,E=p(g,10),g=A,A=M;M=k[1]+O+E|0,k[1]=k[2]+j+S|0,k[2]=k[3]+_+m|0,k[3]=k[4]+o+A|0,k[4]=k[0]+u+g|0,k[0]=M},t.prototype.fn=function(){var n=this.cn,t=n.words,r=8*this.sn,i=8*n.nSigBytes;t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n.nSigBytes=4*(t.length+1),this.an();for(var e=this.on,o=e.words,u=0;u<5;u++){var f=o[u];o[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return e},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n,r){return new t(r).finalize(n)},t}(e.P)},5187:function(n,t,r){r.d(t,{Rabbit:function(){return s}});var i,e=r(30),o=r(5693),u=r(9109),f=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(){return(c=Object.assign||function(n){for(var t,r=1,i=arguments.length;r>>24)|4278255360&(n[r]<<24|n[r]>>>8);var i=this.hn=[n[0],n[3]<<16|n[2]>>>16,n[1],n[0]<<16|n[3]>>>16,n[2],n[1]<<16|n[0]>>>16,n[3],n[2]<<16|n[1]>>>16],e=this.vn=[n[2]<<16|n[2]>>>16,4294901760&n[0]|65535&n[1],n[3]<<16|n[3]>>>16,4294901760&n[1]|65535&n[2],n[0]<<16|n[0]>>>16,4294901760&n[2]|65535&n[3],n[1]<<16|n[1]>>>16,4294901760&n[3]|65535&n[0]];this.wn=0;for(r=0;r<4;r++)this.nextState();for(r=0;r<8;r++)e[r]^=i[r+4&7];if(t){var o=t.words,u=o[0],f=o[1],c=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),s=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),a=c>>>16|4294901760&s,h=s<<16|65535&c;e[0]^=c,e[1]^=a,e[2]^=s,e[3]^=h,e[4]^=c,e[5]^=a,e[6]^=s,e[7]^=h;for(r=0;r<4;r++)this.nextState()}},t.prototype.un=function(n,t){var r=this.hn;this.nextState(),this.S[0]=r[0]^r[5]>>>16^r[3]<<16,this.S[1]=r[2]^r[7]>>>16^r[5]<<16,this.S[2]=r[4]^r[1]>>>16^r[7]<<16,this.S[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)this.S[i]=16711935&(this.S[i]<<8|this.S[i]>>>24)|4278255360&(this.S[i]<<24|this.S[i]>>>8),n[t+i]^=this.S[i]},t.prototype.nextState=function(){for(var n=this.hn,t=this.vn,r=0;r<8;r++)this.C[r]=t[r];t[0]=t[0]+1295307597+this.wn|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this.wn=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=n[r]+t[r],e=65535&i,o=i>>>16,u=((e*e>>>17)+e*o>>>15)+o*o,f=((4294901760&i)*i|0)+((65535&i)*i|0);this.G[r]=u^f}var c=this.G;n[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,n[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,n[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,n[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,n[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,n[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,n[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,n[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0},t.createEncryptor=function(n,r){return new t(c(c({},r=void 0===r?{}:r),{key:n}))},t.createDecryptor=function(n,r){return new t(c(c({},r=void 0===r?{}:r),{key:n}))},t.encrypt=function(n,r,i){return\"string\"==typeof r?o.E.encrypt(t,n,r,i):u.D.encrypt(t,n,r,i)},t.decrypt=function(n,r,i){return\"string\"==typeof r?o.E.decrypt(t,n,r,i):u.D.decrypt(t,n,r,i)},t.ivSize=4,t}(e.q)},3173:function(n,t,r){r.d(t,{SHA1:function(){return c}});var i,e=r(1868),o=r(3354),u=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=[],c=function(n){function t(t){var r=n.call(this,t)||this;return r.on=new o.e([1732584193,4023233417,2562383102,271733878,3285377520]),r.O=t,t&&void 0!==t.hash&&(r.on=t.hash.clone()),r}return u(t,n),t.prototype.A=function(){this.on=new o.e([1732584193,4023233417,2562383102,271733878,3285377520])},t.prototype.un=function(n,t){for(var r=this.on.words,i=r[0],e=r[1],o=r[2],u=r[3],c=r[4],s=0;s<80;s++){if(s<16)f[s]=0|n[t+s];else{var a=f[s-3]^f[s-8]^f[s-14]^f[s-16];f[s]=a<<1|a>>>31}var h=(i<<5|i>>>27)+c+f[s];h+=s<20?1518500249+(e&o|~e&u):s<40?1859775393+(e^o^u):s<60?(e&o|e&u|o&u)-1894007588:(e^o^u)-899497514,c=u,u=o,o=e<<30|e>>>2,e=i,i=h}r[0]=r[0]+i|0,r[1]=r[1]+e|0,r[2]=r[2]+o|0,r[3]=r[3]+u|0,r[4]=r[4]+c|0},t.prototype.fn=function(){var n=this.cn.words,t=8*this.sn,r=8*this.cn.nSigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=Math.floor(t/4294967296),n[15+(r+64>>>9<<4)]=t,this.cn.nSigBytes=4*n.length,this.an(),this.on},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n,r){return new t(r).finalize(n)},t}(e.P)},766:function(n,t,r){r.d(t,{SHA224:function(){return f}});var i,e=r(3354),o=r(5561),u=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(n){function t(t){var r=n.call(this,t)||this;return r.on=new e.e([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),r.O=t,t&&void 0!==t.hash&&(r.on=t.hash.clone()),r}return u(t,n),t.prototype.A=function(){this.on=new e.e([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},t.prototype.fn=function(){var t=n.prototype.fn.call(this);return t.nSigBytes-=4,t},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n,r){return new t(r).finalize(n)},t}(o.SHA256)},5561:function(n,t,r){r.d(t,{SHA256:function(){return v}});var i,e=r(1868),o=r(3354),u=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=[],c=[];function s(n){for(var t=Math.sqrt(n),r=2;r<=t;r++)if(!(n%r))return!1;return!0}function a(n){return 4294967296*(n-(0|n))|0}!function(){for(var n=2,t=0;t<64;)s(n)&&(t<8&&(f[t]=a(Math.pow(n,.5))),c[t]=a(Math.pow(n,1/3)),t++),n++}();var h=[],v=function(n){function t(t){var r=n.call(this,t)||this;return r.on=new o.e(f.slice(0)),r.O=t,t&&void 0!==t.hash&&(r.on=t.hash.clone()),r}return u(t,n),t.prototype.A=function(){this.on=new o.e(f.slice(0))},t.prototype.un=function(n,t){for(var r=this.on.words,i=r[0],e=r[1],o=r[2],u=r[3],f=r[4],s=r[5],a=r[6],v=r[7],w=0;w<64;w++){if(w<16)h[w]=0|n[t+w];else{var l=h[w-15],b=(l<<25|l>>>7)^(l<<14|l>>>18)^l>>>3,d=h[w-2],y=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;h[w]=b+h[w-7]+y+h[w-16]}var p=i&e^i&o^e&o,O=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),j=v+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&s^~f&a)+c[w]+h[w];v=a,a=s,s=f,f=u+j|0,u=o,o=e,e=i,i=j+(O+p)|0}r[0]=r[0]+i|0,r[1]=r[1]+e|0,r[2]=r[2]+o|0,r[3]=r[3]+u|0,r[4]=r[4]+f|0,r[5]=r[5]+s|0,r[6]=r[6]+a|0,r[7]=r[7]+v|0},t.prototype.fn=function(){var n=this.cn.words,t=8*this.sn,r=8*this.cn.nSigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=Math.floor(t/4294967296),n[15+(r+64>>>9<<4)]=t,this.cn.nSigBytes=4*n.length,this.an(),this.on},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n,r){return new t(r).finalize(n)},t}(e.P)},3408:function(n,t,r){r.d(t,{SHA3:function(){return v}});var i,e=r(6957),o=r(1868),u=r(3354),f=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=[],s=[],a=[];!function(){for(var n=1,t=0,r=0;r<24;r++){c[n+5*t]=(r+1)*(r+2)/2%64;var i=(2*n+3*t)%5;n=t%5,t=i}for(var o=0;o<5;o++)for(var u=0;u<5;u++)s[o+5*u]=u+(2*o+3*u)%5*5;for(var f=1,h=0;h<24;h++){for(var v=0,w=0,l=0;l<7;l++){if(1&f){var b=(1<>>24)|4278255360&(o<<24|o>>>8),u=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),r[e].high^=u,r[e].low^=o}for(var f=0;f<24;f++){for(var v=0;v<5;v++){for(var w=0,l=0,b=0;b<5;b++){w^=(k=r[v+5*b]).high,l^=k.low}var d=h[v];d.high=w,d.low=l}for(v=0;v<5;v++){var y=h[(v+4)%5],p=h[(v+1)%5],O=p.high,j=p.low;for(w=y.high^(O<<1|j>>>31),l=y.low^(j<<1|O>>>31),b=0;b<5;b++){(k=r[v+5*b]).high^=w,k.low^=l}}for(var _=1;_<25;_++){w=void 0,l=void 0;var m=r[_].high,A=r[_].low,g=c[_];g<32?(w=m<>>32-g,l=A<>>32-g):(w=A<>>64-g,l=m<>>64-g);var E=h[s[_]];E.high=w,E.low=l}var S=h[0],M=r[0];S.high=M.high,S.low=M.low;for(v=0;v<5;v++)for(b=0;b<5;b++){var k=r[_=v+5*b],H=h[_],C=h[(v+1)%5+5*b],B=h[(v+2)%5+5*b];k.high=H.high^~C.high&B.high,k.low=H.low^~C.low&B.low}var N=r[0],I=a[f];N.high^=I.high,N.low^=I.low}},t.prototype.fn=function(){var n=this.cn,t=n.words,r=8*n.nSigBytes,i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(Math.ceil((r+1)/i)*i>>>5)-1]|=128,n.nSigBytes=4*t.length,this.an();for(var e=this.bn,o=this.dn/8,f=o/8,c=[],s=0;s>>24)|4278255360&(h<<24|h>>>8),v=16711935&(v<<8|v>>>24)|4278255360&(v<<24|v>>>8),c.push(v),c.push(h)}return new u.e(c,o)},t.prototype.clone=function(){return new t({outputLength:this.dn,state:this.bn,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n,r){return new t(r).finalize(n)},t}(o.P)},6324:function(n,t,r){r.d(t,{SHA384:function(){return f}});var i,e=r(6957),o=r(7491),u=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(n){function t(t){var r=n.call(this,t)||this;return r.on=new e.m([new e.r(3418070365,3238371032),new e.r(1654270250,914150663),new e.r(2438529370,812702999),new e.r(355462360,4144912697),new e.r(1731405415,4290775857),new e.r(2394180231,1750603025),new e.r(3675008525,1694076839),new e.r(1203062813,3204075428)]),r.O=t,t&&void 0!==t.hash&&(r.on=t.hash.clone()),r}return u(t,n),t.prototype.A=function(){this.on=new e.m([new e.r(3418070365,3238371032),new e.r(1654270250,914150663),new e.r(2438529370,812702999),new e.r(355462360,4144912697),new e.r(1731405415,4290775857),new e.r(2394180231,1750603025),new e.r(3675008525,1694076839),new e.r(1203062813,3204075428)])},t.prototype.fn=function(){var t=n.prototype.fn.call(this);return t.nSigBytes-=16,t},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n,r){return new t(r).finalize(n)},t}(o.SHA512)},7491:function(n,t,r){r.d(t,{SHA512:function(){return s}});var i,e=r(1868),o=r(6957),u=(i=function(n,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}i(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=[new o.r(1116352408,3609767458),new o.r(1899447441,602891725),new o.r(3049323471,3964484399),new o.r(3921009573,2173295548),new o.r(961987163,4081628472),new o.r(1508970993,3053834265),new o.r(2453635748,2937671579),new o.r(2870763221,3664609560),new o.r(3624381080,2734883394),new o.r(310598401,1164996542),new o.r(607225278,1323610764),new o.r(1426881987,3590304994),new o.r(1925078388,4068182383),new o.r(2162078206,991336113),new o.r(2614888103,633803317),new o.r(3248222580,3479774868),new o.r(3835390401,2666613458),new o.r(4022224774,944711139),new o.r(264347078,2341262773),new o.r(604807628,2007800933),new o.r(770255983,1495990901),new o.r(1249150122,1856431235),new o.r(1555081692,3175218132),new o.r(1996064986,2198950837),new o.r(2554220882,3999719339),new o.r(2821834349,766784016),new o.r(2952996808,2566594879),new o.r(3210313671,3203337956),new o.r(3336571891,1034457026),new o.r(3584528711,2466948901),new o.r(113926993,3758326383),new o.r(338241895,168717936),new o.r(666307205,1188179964),new o.r(773529912,1546045734),new o.r(1294757372,1522805485),new o.r(1396182291,2643833823),new o.r(1695183700,2343527390),new o.r(1986661051,1014477480),new o.r(2177026350,1206759142),new o.r(2456956037,344077627),new o.r(2730485921,1290863460),new o.r(2820302411,3158454273),new o.r(3259730800,3505952657),new o.r(3345764771,106217008),new o.r(3516065817,3606008344),new o.r(3600352804,1432725776),new o.r(4094571909,1467031594),new o.r(275423344,851169720),new o.r(430227734,3100823752),new o.r(506948616,1363258195),new o.r(659060556,3750685593),new o.r(883997877,3785050280),new o.r(958139571,3318307427),new o.r(1322822218,3812723403),new o.r(1537002063,2003034995),new o.r(1747873779,3602036899),new o.r(1955562222,1575990012),new o.r(2024104815,1125592928),new o.r(2227730452,2716904306),new o.r(2361852424,442776044),new o.r(2428436474,593698344),new o.r(2756734187,3733110249),new o.r(3204031479,2999351573),new o.r(3329325298,3815920427),new o.r(3391569614,3928383900),new o.r(3515267271,566280711),new o.r(3940187606,3454069534),new o.r(4118630271,4000239992),new o.r(116418474,1914138554),new o.r(174292421,2731055270),new o.r(289380356,3203993006),new o.r(460393269,320620315),new o.r(685471733,587496836),new o.r(852142971,1086792851),new o.r(1017036298,365543100),new o.r(1126000580,2618297676),new o.r(1288033470,3409855158),new o.r(1501505948,4234509866),new o.r(1607167915,987167468),new o.r(1816402316,1246189591)],c=[];!function(){for(var n=0;n<80;n++)c[n]=new o.r(0,0)}();var s=function(n){function t(t){var r=n.call(this,t)||this;return r.N=32,r.on=new o.m([new o.r(1779033703,4089235720),new o.r(3144134277,2227873595),new o.r(1013904242,4271175723),new o.r(2773480762,1595750129),new o.r(1359893119,2917565137),new o.r(2600822924,725511199),new o.r(528734635,4215389547),new o.r(1541459225,327033209)]),r.O=t,t&&void 0!==t.hash&&(r.on=t.hash.clone()),r}return u(t,n),t.prototype.A=function(){this.on=new o.m([new o.r(1779033703,4089235720),new o.r(3144134277,2227873595),new o.r(1013904242,4271175723),new o.r(2773480762,1595750129),new o.r(1359893119,2917565137),new o.r(2600822924,725511199),new o.r(528734635,4215389547),new o.r(1541459225,327033209)])},t.prototype.un=function(n,t){for(var r=this.on.words,i=r[0],e=r[1],o=r[2],u=r[3],s=r[4],a=r[5],h=r[6],v=r[7],w=i.high,l=i.low,b=e.high,d=e.low,y=o.high,p=o.low,O=u.high,j=u.low,_=s.high,m=s.low,A=a.high,g=a.low,E=h.high,S=h.low,M=v.high,k=v.low,H=w,C=l,B=b,N=d,I=y,z=p,D=O,U=j,L=_,F=m,x=A,P=g,R=E,T=S,K=M,W=k,G=0;G<80;G++){var q=void 0,Q=void 0,X=c[G];if(G<16)Q=X.high=0|n[t+2*G],q=X.low=0|n[t+2*G+1];else{var V=c[G-15],Z=V.high,J=V.low,Y=(Z>>>1|J<<31)^(Z>>>8|J<<24)^Z>>>7,$=(J>>>1|Z<<31)^(J>>>8|Z<<24)^(J>>>7|Z<<25),nn=c[G-2],tn=nn.high,rn=nn.low,en=(tn>>>19|rn<<13)^(tn<<3|rn>>>29)^tn>>>6,on=(rn>>>19|tn<<13)^(rn<<3|tn>>>29)^(rn>>>6|tn<<26),un=c[G-7],fn=un.high,cn=un.low,sn=c[G-16],an=sn.high,hn=sn.low;Q=(Q=(Q=Y+fn+((q=$+cn)>>>0<$>>>0?1:0))+en+((q+=on)>>>0>>0?1:0))+an+((q+=hn)>>>0>>0?1:0),X.high=Q,X.low=q}var vn=L&x^~L&R,wn=F&P^~F&T,ln=H&B^H&I^B&I,bn=C&N^C&z^N&z,dn=(H>>>28|C<<4)^(H<<30|C>>>2)^(H<<25|C>>>7),yn=(C>>>28|H<<4)^(C<<30|H>>>2)^(C<<25|H>>>7),pn=(L>>>14|F<<18)^(L>>>18|F<<14)^(L<<23|F>>>9),On=(F>>>14|L<<18)^(F>>>18|L<<14)^(F<<23|L>>>9),jn=f[G],_n=jn.high,mn=jn.low,An=W+On,gn=K+pn+(An>>>0>>0?1:0),En=yn+bn;K=R,W=T,R=x,T=P,x=L,P=F,L=D+(gn=(gn=(gn=gn+vn+((An+=wn)>>>0>>0?1:0))+_n+((An+=mn)>>>0>>0?1:0))+Q+((An+=q)>>>0>>0?1:0))+((F=U+An|0)>>>0>>0?1:0)|0,D=I,U=z,I=B,z=N,B=H,N=C,H=gn+(dn+ln+(En>>>0>>0?1:0))+((C=An+En|0)>>>0>>0?1:0)|0}l=i.low=l+C,i.high=w+H+(l>>>0>>0?1:0),d=e.low=d+N,e.high=b+B+(d>>>0>>0?1:0),p=o.low=p+z,o.high=y+I+(p>>>0>>0?1:0),j=u.low=j+U,u.high=O+D+(j>>>0>>0?1:0),m=s.low=m+F,s.high=_+L+(m>>>0>>0?1:0),g=a.low=g+P,a.high=A+x+(g>>>0

>>0?1:0),S=h.low=S+T,h.high=E+R+(S>>>0>>0?1:0),k=v.low=k+W,v.high=M+K+(k>>>0>>0?1:0)},t.prototype.fn=function(){var n=this.cn,t=n.words,r=8*this.sn,i=8*n.nSigBytes;return t[i>>>5]|=128<<24-i%32,t[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(i+128>>>10<<5)]=r,n.nSigBytes=4*t.length,this.an(),this.on.to32()},t.prototype.clone=function(){return new t({hash:this.on,blockSize:this.N,data:this.cn,nBytes:this.sn})},t.hash=function(n,r){return new t(r).finalize(n)},t}(e.P)},3354:function(n,t,r){r.d(t,{e:function(){return o}});var i=r(5720),e=r(9054),o=function(){function n(t,r){if(Array.isArray(t)||!t)return this.yn=Array.isArray(t)?t:[],void(this.pn=\"number\"==typeof r?r:4*this.yn.length);if(t instanceof n)return this.yn=t.words.slice(),void(this.pn=t.nSigBytes);var i;try{t instanceof ArrayBuffer?i=new Uint8Array(t):(t instanceof Uint8Array||t instanceof Int8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}catch(n){throw new Error(\"Invalid argument\")}if(!i)throw new Error(\"Invalid argument\");for(var e=i.byteLength,o=[],u=0;u>>2]|=i[u]<<24-u%4*8;this.yn=o,this.pn=e}return Object.defineProperty(n.prototype,\"nSigBytes\",{get:function(){return this.pn},set:function(n){this.pn=n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"words\",{get:function(){return this.yn},enumerable:!1,configurable:!0}),n.prototype.toString=function(n){return n?n.stringify(this):i.p.stringify(this)},n.prototype.toUint8Array=function(){for(var n=this.yn,t=this.pn,r=new Uint8Array(t),i=0;i>>2]>>>24-i%4*8&255;return r},n.prototype.concat=function(n){var t=n.words.slice(),r=n.nSigBytes;if(this.clamp(),this.pn%4)for(var i=0;i>>2]>>>24-i%4*8&255;this.yn[this.pn+i>>>2]|=e<<24-(this.pn+i)%4*8}else for(i=0;i>>2]=t[i>>>2];return this.pn+=r,this},n.prototype.clamp=function(){var n=this.pn;this.yn[n>>>2]&=4294967295<<32-n%4*8,this.yn.length=Math.ceil(n/4)},n.prototype.clone=function(){return new n(this.yn.slice(),this.pn)},n.random=function(t){for(var r=[],i=0;i0&&e.push(0),n.concat(new i.e(e,r))}}function o(n,t){return new i.e(n.words.slice(),t)}function u(n,t){for(var r=n.nSigBytes-t,e=[],o=0;o>>2,f=r+o,c=f>>>2,s=n.words[c]>>>24-f%4*8&255;e[u]=0|e[u]|s<<24-o%4*8}var a=new i.e(e,t);return a.clamp(),a}},7919:function(n,t,r){r.d(t,{l:function(){return e}});var i=r(3354);var e={pad:function(n,t){for(var r=4*t,e=r-n.nSigBytes%r,o=e<<24|e<<16|e<<8|e,u=[],f=0;f>>2];n.nSigBytes-=t}}},1756:function(n,t,r){r.d(t,{w:function(){return u}});var i,e=\"undefined\"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():\"\",o=(i=parseInt((/msie (\\d+)/.exec(e)||[])[1],10),isNaN(i)?(i=parseInt((/trident\\/.*; rv:(\\d+)/.exec(e)||[])[1],10),!isNaN(i)&&i):i);function u(n,t){return!1!==o&&(!t||(\"<\"===n?o\"===n?o>t:\">=\"===n?o>=t:o===t))}},1773:function(n,t,r){r.d(t,{D:function(){return f}});for(var i=r(3354),e=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",o=[],u=0;u>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,f=0;f<4&&o+.75*f>>6*(3-f)&63));var c=e.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join(\"\")},parse:function(n){var t=n.length,r=e.charAt(64);if(r){var u=n.indexOf(r);-1!==u&&(t=u)}for(var f=[],c=0,s=0;s>>6-s%4*2;f[c>>>2]|=a<<24-c%4*8,c++}return new i.e(f,c)}}},5720:function(n,t,r){r.d(t,{p:function(){return e}});var i=r(3354),e={stringify:function(n){for(var t=n.nSigBytes,r=n.words,i=[],e=0;e>>2]>>>24-e%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join(\"\")},parse:function(n){var t=n.length;if(t%2!=0)throw new Error(\"Hex string count must be even\");if(!/^[a-fA-F0-9]+$/.test(n))throw new Error(\"Invalid Hex string: \"+n);for(var r=[],e=0;e>>3]|=parseInt(n.substr(e,2),16)<<24-e%8*4;return new i.e(r,t/2)}}},8702:function(n,t,r){r.d(t,{m:function(){return e}});var i=r(3354),e={stringify:function(n){for(var t=n.nSigBytes,r=n.words,i=[],e=0;e>>2]>>>24-e%4*8&255;i.push(String.fromCharCode(o))}return i.join(\"\")},parse:function(n){for(var t=n.length,r=[],e=0;e>>2]|=(255&n.charCodeAt(e))<<24-e%4*8;return new i.e(r,t)}}},4768:function(n,t,r){r.d(t,{d:function(){return e}});var i=r(8702),e={stringify:function(n){try{return decodeURIComponent(escape(i.m.stringify(n)))}catch(n){throw new Error(\"Malformed UTF-8 data\")}},parse:function(n){return i.m.parse(unescape(encodeURIComponent(n)))}}},2688:function(n,t,r){r.d(t,{Base64:function(){return o.D},EvpKDF:function(){return O},Hex:function(){return c.p},Latin1:function(){return f.m},OpenSSLKDF:function(){return l.s},PBKDF2:function(){return b.E},Utf16:function(){return w},Utf16BE:function(){return s},Utf16LE:function(){return v},Utf8:function(){return u.d},Word32Array:function(){return i.e},Word64:function(){return e.r},Word64Array:function(){return e.m}});r(9054);var i=r(3354),e=r(6957),o=(r(1756),r(1773)),u=r(4768),f=r(8702),c=r(5720),s={stringify:function(n){for(var t=n.words,r=n.nSigBytes,i=[],e=0;e>>2]>>>16-e%4*8&65535;i.push(String.fromCharCode(o))}return i.join(\"\")},parse:function(n){for(var t=n.length,r=[],e=0;e>>1]|=n.charCodeAt(e)<<16-e%2*16;return new i.e(r,2*t)}};function a(n){return n<<8&4278255360|n>>>8&16711935}var h,v={stringify:function(n){for(var t=n.words,r=n.nSigBytes,i=[],e=0;e>>2]>>>16-e%4*8&65535);i.push(String.fromCharCode(o))}return i.join(\"\")},parse:function(n){for(var t=n.length,r=[],e=0;e>>1]|=a(n.charCodeAt(e)<<16-e%2*16);return new i.e(r,2*t)}},w=s,l=r(2214),b=r(7008),d=r(670),y=r(9541),p=(h=function(n,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,t)},function(n,t){function r(){this.constructor=n}h(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),O=function(n){function t(t){var r=n.call(this,t)||this;return r.Sn=4,r.Mn=d.MD5,r.kn=1,t&&(r.Sn=void 0!==t.keySize?t.keySize:r.Sn,r.Mn=void 0!==t.Hasher?t.Hasher:r.Mn,r.kn=void 0!==t.iterations?t.iterations:r.kn),r}return p(t,n),t.prototype.compute=function(n,t){for(var r,e=new this.Mn,o=new i.e,u=o.words,f=this.Sn,c=this.kn;u.length13||e.nSigBytes<7))throw new Error(\"Byte size of iv must be between 7 and 13\");return r.Nn=e||new o.e([0,0],8),r.In=15-r.Nn.nSigBytes,r}return f(t,n),t.getB0=function(n,t,r,i){if(r.nSigBytes+i.nSigBytes!==15)throw new Error(\"LEN(Q)+LEN(N) must be 15\");var e=255&(0|(n?1:0)<<6|(t-2)/2<<3|r.nSigBytes-1),u=i.clone().concat(r);return new o.e([e<<24],1).concat(u)},t.formatAssociatedDataAndPayload=function(n,t){var r,i=n.nSigBytes;if(0===i)r=new o.e([0],0);else if(i4?(e.concat(new o.e([0],n%4)),e.concat(new o.e([r],4))):e.concat(new o.e([r<<32-8*n],n)):e.concat(new o.e([r],4)),i.concat(t).concat(e)},t.mac=function(n,r,i,e,f,c){var s=new n({key:r,iv:i});if(4!==s.blockSize)throw new Error(\"In CCM, cipher block size must be 128bit\");if(i&&(i.nSigBytes>13||i.nSigBytes<7))throw new Error(\"Byte size of iv must be between 7 and 13\");var a=i||new o.e([0,0],8),h=(null==e?void 0:e.clone())||new o.e,v=h.nSigBytes,w=(null==f?void 0:f.clone())||new o.e,l=w.nSigBytes;if(l>>>0>4294967295)throw new Error(\"Byte length of Payload(plainText) larger than 2^32-1 (4,294,967,295byte) is not supported at this time.\");var b=15-a.nSigBytes,d=(0,u.ur)(new o.e([0,l],8),b),y=c||16,p=t.getB0(Boolean(v),y,d,a),O=t.formatAssociatedDataAndPayload(h,w),j=p.words.slice();s.encryptBlock(j,0);for(var _=O.nSigBytes/16,m=O.words,A=j,g=0;g<_;g++){var E=[m[4*g]^A[0],m[4*g+1]^A[1],m[4*g+2]^A[2],m[4*g+3]^A[3]];s.encryptBlock(E,0),A=E}var S=new o.e(A,y),M=t.genCtr(b,a,0);s.encryptBlock(M.words,0);for(g=0;g<4;g++)S.words[g]^=M.words[g];return S.clamp(),S},t.combineCipherTextAndAuthTag=function(n,t){return n.clone().concat(t)},t.splitCipherTextAndAuthTag=function(n,t){var r=t||16;return{cipherText:(0,u.z6)(n,n.nSigBytes-r),authTag:(0,u.ur)(n,r)}},t.createEncryptor=function(n){return new t.Encryptor(n)},t.createDecryptor=function(n){return new t.Decryptor(n)},t.Encryptor=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return f(r,n),r.prototype.processBlock=function(n,r){var i=this.Hn,e=i.blockSize,o=t.genCtr(this.In,this.Nn,this.Bn);i.encryptBlock(o.words,0);for(var u=0;u0?4-r.length%4:0,o=r.slice(),u=0;u>>0,i=r+1>>>0>>0,o=e+1>>>0>>5]>>>31-o%32&1)>0&&(i[0]=i[0]^e[0],i[1]=i[1]^e[1],i[2]=i[2]^e[2],i[3]=i[3]^e[3]);var u=(1&e[3])>>>0,f=(1&e[0])>>>0,c=(1&e[1])>>>0,s=(1&e[2])>>>0;e[0]=e[0]>>>1,e[1]=e[1]>>>1|(f?2147483648:0),e[2]=e[2]>>>1|(c?2147483648:0),e[3]=e[3]>>>1|(s?2147483648:0),u>0&&(e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3])}return i},t.GHASH=function(n,r){if(n.length%4!=0)throw new Error(\"Length of 32bit word array 'H' must be multiple of 4(128bit)\");if(r.length%4!=0)throw new Error(\"Length of 32bit word array 'X' must be multiple of 4(128bit)\");for(var i=r.length,e=[0,0,0,0],o=0;o0){var A=e[4*c+O]<<32-8*m^f[c][O];y.push(A),p+=m}var g=new o.e(y,p);a.concat(g)}}return a.nSigBytes=i.nSigBytes,a.clamp(),a},t.mac=function(n,r,i,e,f,c){var s=new n({key:r,iv:i}),a=[0,0,0,0];s.encryptBlock(a,0);var h=t.getJ0(a,i.words),v=(null==e?void 0:e.clone())||new o.e,w=[0,8*v.nSigBytes],l=(null==f?void 0:f.clone())||new o.e,b=[0,8*l.nSigBytes],d=c||16;(0,u.I4)(v),(0,u.I4)(l);var y=v.words.concat(l.words).concat(w).concat(b),p=t.GHASH(a,y),O=t.GCTR(s,h,new o.e(p));return(0,u.z6)(O,d)},t.createEncryptor=function(n){return new t.Encryptor(n)},t.createDecryptor=function(n){return new t.Decryptor(n)},t.Encryptor=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return f(r,n),r.prototype.processBlock=function(n,r){var i=this.Hn.blockSize;this.Un=t.inc32(this.Un);for(var e=new o.e(n.slice(r,r+i)),u=t.GCTR(this.Hn,this.Un,e),f=0;f>>2]|=e<<24-o%4*8,n.nSigBytes+=e},unpad:function(n){var t=255&n.words[n.nSigBytes-1>>>2];n.nSigBytes-=t}},K=r(3354);var W={pad:function(n,t){var r=4*t,i=r-n.nSigBytes%r;n.concat(K.e.random(i-1)).concat(new K.e([i<<24],1))},unpad:function(n){var t=255&n.words[n.nSigBytes-1>>>2];n.nSigBytes-=t}};var G={pad:function(n,t){var r=4*t;n.clamp(),n.nSigBytes+=r-(n.nSigBytes%r||r)},unpad:function(n){for(var t=n.words,r=n.nSigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){n.nSigBytes=r+1;break}}};var q={pad:function(n,t){n.concat(new K.e([2147483648],1)),G.pad(n,t)},unpad:function(n){G.unpad(n),n.nSigBytes-=1}},Q=r(7919);var X={pad:function(n,t){},unpad:function(n){}},V=r(1232),Z={CBC:C.n,CFB:I,CTR:D,ECB:L,OFB:x,GCM:P.V,CCM:R.K},J={AnsiX923:T,ISO10126:W,ISO97971:q,Pkcs7:Q.l,NoPadding:X,Zero:G},Y={OpenSSLFormatter:V.w}}(),i}()}));","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgStoreCode\"), exports);\n__exportStar(require(\"./MsgMigrateCode\"), exports);\n__exportStar(require(\"./MsgInstantiateContract\"), exports);\n__exportStar(require(\"./MsgExecuteContract\"), exports);\n__exportStar(require(\"./MsgMigrateContract\"), exports);\n__exportStar(require(\"./MsgUpdateContractAdmin\"), exports);\n__exportStar(require(\"./MsgClearContractAdmin\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgTransfer\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgCreateClient\"), exports);\n__exportStar(require(\"./MsgUpdateClient\"), exports);\n__exportStar(require(\"./MsgUpgradeClient\"), exports);\n__exportStar(require(\"./MsgSubmitMisbehaviour\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgConnectionOpenInit\"), exports);\n__exportStar(require(\"./MsgConnectionOpenTry\"), exports);\n__exportStar(require(\"./MsgConnectionOpenConfirm\"), exports);\n__exportStar(require(\"./MsgConnectionOpenAck\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Counterparty = void 0;\nvar connection_1 = require(\"@terra-money/terra.proto/ibc/core/connection/v1/connection\");\nvar json_1 = require(\"../../../../util/json\");\nvar MerklePrefix_1 = require(\"../../core/commitment/MerklePrefix\");\n/** Counterparty defines a channel end counterparty */\nvar Counterparty = /** @class */ (function (_super) {\n __extends(Counterparty, _super);\n /**\n * @param client_id identifies the client on the counterparty chain associated with a given connection.\n * @param connection_id identifies the connection end on the counterparty chain associated with a given connection.\n * @param prefix commitment merkle prefix of the counterparty chain.\n */\n function Counterparty(client_id, connection_id, prefix) {\n var _this = _super.call(this) || this;\n _this.client_id = client_id;\n _this.connection_id = connection_id;\n _this.prefix = prefix;\n return _this;\n }\n Counterparty.fromAmino = function (data) {\n var client_id = data.client_id, connection_id = data.connection_id, prefix = data.prefix;\n return new Counterparty(client_id, connection_id, prefix ? MerklePrefix_1.MerklePrefix.fromAmino(prefix) : undefined);\n };\n Counterparty.prototype.toAmino = function () {\n var _a = this, client_id = _a.client_id, connection_id = _a.connection_id, prefix = _a.prefix;\n var res = {\n client_id: client_id,\n connection_id: connection_id,\n prefix: prefix,\n };\n return res;\n };\n Counterparty.fromData = function (data) {\n var client_id = data.client_id, connection_id = data.connection_id, prefix = data.prefix;\n return new Counterparty(client_id, connection_id, prefix ? MerklePrefix_1.MerklePrefix.fromData(prefix) : undefined);\n };\n Counterparty.prototype.toData = function () {\n var _a = this, client_id = _a.client_id, connection_id = _a.connection_id, prefix = _a.prefix;\n var res = {\n client_id: client_id,\n connection_id: connection_id,\n prefix: prefix ? prefix.toData() : undefined,\n };\n return res;\n };\n Counterparty.fromProto = function (proto) {\n return new Counterparty(proto.clientId, proto.connectionId, proto.prefix ? MerklePrefix_1.MerklePrefix.fromProto(proto.prefix) : undefined);\n };\n Counterparty.prototype.toProto = function () {\n var _a = this, client_id = _a.client_id, connection_id = _a.connection_id, prefix = _a.prefix;\n return connection_1.Counterparty.fromPartial({\n clientId: client_id,\n connectionId: connection_id,\n prefix: prefix ? prefix.toProto() : undefined,\n });\n };\n return Counterparty;\n}(json_1.JSONSerializable));\nexports.Counterparty = Counterparty;\n//# sourceMappingURL=Counterparty.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MerkleProof = exports.MerklePath = exports.MerklePrefix = exports.MerkleRoot = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst proofs_1 = require(\"../../../../confio/proofs\");\nexports.protobufPackage = \"ibc.core.commitment.v1\";\nconst baseMerkleRoot = {};\nexports.MerkleRoot = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.hash.length !== 0) {\n writer.uint32(10).bytes(message.hash);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMerkleRoot);\n message.hash = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.hash = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMerkleRoot);\n message.hash = new Uint8Array();\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = bytesFromBase64(object.hash);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.hash !== undefined &&\n (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMerkleRoot);\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = object.hash;\n }\n else {\n message.hash = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMerklePrefix = {};\nexports.MerklePrefix = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.keyPrefix.length !== 0) {\n writer.uint32(10).bytes(message.keyPrefix);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMerklePrefix);\n message.keyPrefix = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.keyPrefix = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMerklePrefix);\n message.keyPrefix = new Uint8Array();\n if (object.keyPrefix !== undefined && object.keyPrefix !== null) {\n message.keyPrefix = bytesFromBase64(object.keyPrefix);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.keyPrefix !== undefined &&\n (obj.keyPrefix = base64FromBytes(message.keyPrefix !== undefined ? message.keyPrefix : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMerklePrefix);\n if (object.keyPrefix !== undefined && object.keyPrefix !== null) {\n message.keyPrefix = object.keyPrefix;\n }\n else {\n message.keyPrefix = new Uint8Array();\n }\n return message;\n },\n};\nconst baseMerklePath = { keyPath: \"\" };\nexports.MerklePath = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.keyPath) {\n writer.uint32(10).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMerklePath);\n message.keyPath = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.keyPath.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMerklePath);\n message.keyPath = [];\n if (object.keyPath !== undefined && object.keyPath !== null) {\n for (const e of object.keyPath) {\n message.keyPath.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.keyPath) {\n obj.keyPath = message.keyPath.map((e) => e);\n }\n else {\n obj.keyPath = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMerklePath);\n message.keyPath = [];\n if (object.keyPath !== undefined && object.keyPath !== null) {\n for (const e of object.keyPath) {\n message.keyPath.push(e);\n }\n }\n return message;\n },\n};\nconst baseMerkleProof = {};\nexports.MerkleProof = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.proofs) {\n proofs_1.CommitmentProof.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMerkleProof);\n message.proofs = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.proofs.push(proofs_1.CommitmentProof.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMerkleProof);\n message.proofs = [];\n if (object.proofs !== undefined && object.proofs !== null) {\n for (const e of object.proofs) {\n message.proofs.push(proofs_1.CommitmentProof.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.proofs) {\n obj.proofs = message.proofs.map((e) => (e ? proofs_1.CommitmentProof.toJSON(e) : undefined));\n }\n else {\n obj.proofs = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMerkleProof);\n message.proofs = [];\n if (object.proofs !== undefined && object.proofs !== null) {\n for (const e of object.proofs) {\n message.proofs.push(proofs_1.CommitmentProof.fromPartial(e));\n }\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=commitment.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgChannelOpenInit\"), exports);\n__exportStar(require(\"./MsgChannelOpenTry\"), exports);\n__exportStar(require(\"./MsgChannelOpenConfirm\"), exports);\n__exportStar(require(\"./MsgChannelOpenAck\"), exports);\n__exportStar(require(\"./MsgChannelCloseInit\"), exports);\n__exportStar(require(\"./MsgChannelCloseConfirm\"), exports);\n__exportStar(require(\"./MsgRecvPacket\"), exports);\n__exportStar(require(\"./MsgRecvAcknowledgement\"), exports);\n__exportStar(require(\"./MsgTimeout\"), exports);\n__exportStar(require(\"./MsgTimeoutClose\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Channel = void 0;\nvar channel_1 = require(\"@terra-money/terra.proto/ibc/core/channel/v1/channel\");\nvar json_1 = require(\"../../../../util/json\");\nvar Counterparty_1 = require(\"./Counterparty\");\n/**\n * Channel is a monotonically increasing data type\n * that can be compared against another Channel for the purposes of updating and\n * freezing clients\n *\n * Normally the RevisionChannel is incremented at each height while keeping\n * RevisionNumber the same. However some consensus algorithms may choose to\n * reset the height in certain conditions e.g. hard forks, state-machine\n * breaking changes In these cases, the RevisionNumber is incremented so that\n * height continues to be monitonically increasing even as the RevisionChannel\n * gets reset\n */\nvar Channel = /** @class */ (function (_super) {\n __extends(Channel, _super);\n /**\n * @param state current state of the channel end\n * @param ordering whether the channel is ordered or unordered\n * @param counterparty counterparty channel end\n * @param connection_hops list of connection identifiers, in order, along which packets sent on this channel will travel\n * @param version opaque channel version, which is agreed upon during the handshake\n */\n function Channel(state, ordering, counterparty, connection_hops, version) {\n var _this = _super.call(this) || this;\n _this.state = state;\n _this.ordering = ordering;\n _this.counterparty = counterparty;\n _this.connection_hops = connection_hops;\n _this.version = version;\n return _this;\n }\n Channel.fromAmino = function (data) {\n var state = data.state, ordering = data.ordering, counterparty = data.counterparty, connection_hops = data.connection_hops, version = data.version;\n return new Channel(state, ordering, counterparty ? Counterparty_1.Counterparty.fromAmino(counterparty) : undefined, connection_hops, version);\n };\n Channel.prototype.toAmino = function () {\n var _a = this, state = _a.state, ordering = _a.ordering, counterparty = _a.counterparty, connection_hops = _a.connection_hops, version = _a.version;\n var res = {\n state: state,\n ordering: ordering,\n counterparty: counterparty ? counterparty.toAmino() : undefined,\n connection_hops: connection_hops,\n version: version,\n };\n return res;\n };\n Channel.fromData = function (data) {\n var state = data.state, ordering = data.ordering, counterparty = data.counterparty, connection_hops = data.connection_hops, version = data.version;\n return new Channel(state, ordering, counterparty ? Counterparty_1.Counterparty.fromData(counterparty) : undefined, connection_hops, version);\n };\n Channel.prototype.toData = function () {\n var _a = this, state = _a.state, ordering = _a.ordering, counterparty = _a.counterparty, connection_hops = _a.connection_hops, version = _a.version;\n var res = {\n state: state,\n ordering: ordering,\n counterparty: counterparty ? counterparty.toData() : undefined,\n connection_hops: connection_hops,\n version: version,\n };\n return res;\n };\n Channel.fromProto = function (proto) {\n return new Channel(proto.state, proto.ordering, proto.counterparty ? Counterparty_1.Counterparty.fromProto(proto.counterparty) : undefined, proto.connectionHops, proto.version);\n };\n Channel.prototype.toProto = function () {\n var _a = this, state = _a.state, ordering = _a.ordering, counterparty = _a.counterparty, connection_hops = _a.connection_hops, version = _a.version;\n return channel_1.Channel.fromPartial({\n state: state,\n ordering: ordering,\n counterparty: counterparty ? counterparty.toProto() : undefined,\n connectionHops: connection_hops,\n version: version,\n });\n };\n return Channel;\n}(json_1.JSONSerializable));\nexports.Channel = Channel;\n//# sourceMappingURL=Channel.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Fee = void 0;\nvar json_1 = require(\"../util/json\");\nvar Coins_1 = require(\"./Coins\");\nvar numeric_1 = require(\"./numeric\");\nvar tx_1 = require(\"@terra-money/terra.proto/cosmos/tx/v1beta1/tx\");\nvar Long = __importStar(require(\"long\"));\n/**\n * A transaction must include a fee, otherwise it will be rejected.\n */\nvar Fee = /** @class */ (function (_super) {\n __extends(Fee, _super);\n /**\n * Creates a new Fee object.\n * @param gas gas limit\n * @param amount amount to be paid to validator\n */\n function Fee(gas_limit, amount, payer, granter) {\n var _this = _super.call(this) || this;\n _this.gas_limit = gas_limit;\n _this.payer = payer;\n _this.granter = granter;\n _this.amount = new Coins_1.Coins(amount);\n return _this;\n }\n Fee.fromAmino = function (data) {\n var gas = data.gas, amount = data.amount;\n return new Fee(Number.parseInt(gas), Coins_1.Coins.fromAmino(amount), '', '');\n };\n Fee.prototype.toAmino = function () {\n return {\n gas: new numeric_1.Int(this.gas_limit).toString(),\n amount: this.amount.toAmino(),\n };\n };\n Fee.fromData = function (data) {\n return new Fee(Number.parseInt(data.gas_limit), Coins_1.Coins.fromData(data.amount), data.payer, data.granter);\n };\n Fee.prototype.toData = function () {\n var _a = this, amount = _a.amount, gas_limit = _a.gas_limit, payer = _a.payer, granter = _a.granter;\n return {\n amount: amount.toData(),\n gas_limit: gas_limit.toFixed(),\n granter: granter !== null && granter !== void 0 ? granter : '',\n payer: payer !== null && payer !== void 0 ? payer : '',\n };\n };\n Fee.fromProto = function (proto) {\n return new Fee(proto.gasLimit.toNumber(), Coins_1.Coins.fromProto(proto.amount), proto.payer, proto.granter);\n };\n Fee.prototype.toProto = function () {\n var _a = this, amount = _a.amount, gas_limit = _a.gas_limit, payer = _a.payer, granter = _a.granter;\n return tx_1.Fee.fromPartial({\n amount: amount.toProto(),\n gasLimit: Long.fromNumber(gas_limit),\n granter: granter,\n payer: payer,\n });\n };\n /**\n * Gets the minimum gas prices implied by the fee. Minimum gas prices are `fee amount / gas`.\n */\n Fee.prototype.gasPrices = function () {\n return this.amount.toDecCoins().div(this.gas_limit);\n };\n return Fee;\n}(json_1.JSONSerializable));\nexports.Fee = Fee;\n//# sourceMappingURL=Fee.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SearchTxsResult = exports.TxMsgData = exports.MsgData = exports.SimulationResponse = exports.Result = exports.GasInfo = exports.Attribute = exports.StringEvent = exports.ABCIMessageLog = exports.TxResponse = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../../google/protobuf/any\");\nconst types_1 = require(\"../../../../tendermint/abci/types\");\nexports.protobufPackage = \"cosmos.base.abci.v1beta1\";\nconst baseTxResponse = {\n height: long_1.default.ZERO,\n txhash: \"\",\n codespace: \"\",\n code: 0,\n data: \"\",\n rawLog: \"\",\n info: \"\",\n gasWanted: long_1.default.ZERO,\n gasUsed: long_1.default.ZERO,\n timestamp: \"\",\n};\nexports.TxResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.height.isZero()) {\n writer.uint32(8).int64(message.height);\n }\n if (message.txhash !== \"\") {\n writer.uint32(18).string(message.txhash);\n }\n if (message.codespace !== \"\") {\n writer.uint32(26).string(message.codespace);\n }\n if (message.code !== 0) {\n writer.uint32(32).uint32(message.code);\n }\n if (message.data !== \"\") {\n writer.uint32(42).string(message.data);\n }\n if (message.rawLog !== \"\") {\n writer.uint32(50).string(message.rawLog);\n }\n for (const v of message.logs) {\n exports.ABCIMessageLog.encode(v, writer.uint32(58).fork()).ldelim();\n }\n if (message.info !== \"\") {\n writer.uint32(66).string(message.info);\n }\n if (!message.gasWanted.isZero()) {\n writer.uint32(72).int64(message.gasWanted);\n }\n if (!message.gasUsed.isZero()) {\n writer.uint32(80).int64(message.gasUsed);\n }\n if (message.tx !== undefined) {\n any_1.Any.encode(message.tx, writer.uint32(90).fork()).ldelim();\n }\n if (message.timestamp !== \"\") {\n writer.uint32(98).string(message.timestamp);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTxResponse);\n message.logs = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.height = reader.int64();\n break;\n case 2:\n message.txhash = reader.string();\n break;\n case 3:\n message.codespace = reader.string();\n break;\n case 4:\n message.code = reader.uint32();\n break;\n case 5:\n message.data = reader.string();\n break;\n case 6:\n message.rawLog = reader.string();\n break;\n case 7:\n message.logs.push(exports.ABCIMessageLog.decode(reader, reader.uint32()));\n break;\n case 8:\n message.info = reader.string();\n break;\n case 9:\n message.gasWanted = reader.int64();\n break;\n case 10:\n message.gasUsed = reader.int64();\n break;\n case 11:\n message.tx = any_1.Any.decode(reader, reader.uint32());\n break;\n case 12:\n message.timestamp = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTxResponse);\n message.logs = [];\n if (object.height !== undefined && object.height !== null) {\n message.height = long_1.default.fromString(object.height);\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.txhash !== undefined && object.txhash !== null) {\n message.txhash = String(object.txhash);\n }\n else {\n message.txhash = \"\";\n }\n if (object.codespace !== undefined && object.codespace !== null) {\n message.codespace = String(object.codespace);\n }\n else {\n message.codespace = \"\";\n }\n if (object.code !== undefined && object.code !== null) {\n message.code = Number(object.code);\n }\n else {\n message.code = 0;\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = String(object.data);\n }\n else {\n message.data = \"\";\n }\n if (object.rawLog !== undefined && object.rawLog !== null) {\n message.rawLog = String(object.rawLog);\n }\n else {\n message.rawLog = \"\";\n }\n if (object.logs !== undefined && object.logs !== null) {\n for (const e of object.logs) {\n message.logs.push(exports.ABCIMessageLog.fromJSON(e));\n }\n }\n if (object.info !== undefined && object.info !== null) {\n message.info = String(object.info);\n }\n else {\n message.info = \"\";\n }\n if (object.gasWanted !== undefined && object.gasWanted !== null) {\n message.gasWanted = long_1.default.fromString(object.gasWanted);\n }\n else {\n message.gasWanted = long_1.default.ZERO;\n }\n if (object.gasUsed !== undefined && object.gasUsed !== null) {\n message.gasUsed = long_1.default.fromString(object.gasUsed);\n }\n else {\n message.gasUsed = long_1.default.ZERO;\n }\n if (object.tx !== undefined && object.tx !== null) {\n message.tx = any_1.Any.fromJSON(object.tx);\n }\n else {\n message.tx = undefined;\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = String(object.timestamp);\n }\n else {\n message.timestamp = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.height !== undefined && (obj.height = (message.height || long_1.default.ZERO).toString());\n message.txhash !== undefined && (obj.txhash = message.txhash);\n message.codespace !== undefined && (obj.codespace = message.codespace);\n message.code !== undefined && (obj.code = message.code);\n message.data !== undefined && (obj.data = message.data);\n message.rawLog !== undefined && (obj.rawLog = message.rawLog);\n if (message.logs) {\n obj.logs = message.logs.map((e) => (e ? exports.ABCIMessageLog.toJSON(e) : undefined));\n }\n else {\n obj.logs = [];\n }\n message.info !== undefined && (obj.info = message.info);\n message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || long_1.default.ZERO).toString());\n message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || long_1.default.ZERO).toString());\n message.tx !== undefined && (obj.tx = message.tx ? any_1.Any.toJSON(message.tx) : undefined);\n message.timestamp !== undefined && (obj.timestamp = message.timestamp);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTxResponse);\n message.logs = [];\n if (object.height !== undefined && object.height !== null) {\n message.height = object.height;\n }\n else {\n message.height = long_1.default.ZERO;\n }\n if (object.txhash !== undefined && object.txhash !== null) {\n message.txhash = object.txhash;\n }\n else {\n message.txhash = \"\";\n }\n if (object.codespace !== undefined && object.codespace !== null) {\n message.codespace = object.codespace;\n }\n else {\n message.codespace = \"\";\n }\n if (object.code !== undefined && object.code !== null) {\n message.code = object.code;\n }\n else {\n message.code = 0;\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = \"\";\n }\n if (object.rawLog !== undefined && object.rawLog !== null) {\n message.rawLog = object.rawLog;\n }\n else {\n message.rawLog = \"\";\n }\n if (object.logs !== undefined && object.logs !== null) {\n for (const e of object.logs) {\n message.logs.push(exports.ABCIMessageLog.fromPartial(e));\n }\n }\n if (object.info !== undefined && object.info !== null) {\n message.info = object.info;\n }\n else {\n message.info = \"\";\n }\n if (object.gasWanted !== undefined && object.gasWanted !== null) {\n message.gasWanted = object.gasWanted;\n }\n else {\n message.gasWanted = long_1.default.ZERO;\n }\n if (object.gasUsed !== undefined && object.gasUsed !== null) {\n message.gasUsed = object.gasUsed;\n }\n else {\n message.gasUsed = long_1.default.ZERO;\n }\n if (object.tx !== undefined && object.tx !== null) {\n message.tx = any_1.Any.fromPartial(object.tx);\n }\n else {\n message.tx = undefined;\n }\n if (object.timestamp !== undefined && object.timestamp !== null) {\n message.timestamp = object.timestamp;\n }\n else {\n message.timestamp = \"\";\n }\n return message;\n },\n};\nconst baseABCIMessageLog = { msgIndex: 0, log: \"\" };\nexports.ABCIMessageLog = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.msgIndex !== 0) {\n writer.uint32(8).uint32(message.msgIndex);\n }\n if (message.log !== \"\") {\n writer.uint32(18).string(message.log);\n }\n for (const v of message.events) {\n exports.StringEvent.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseABCIMessageLog);\n message.events = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.msgIndex = reader.uint32();\n break;\n case 2:\n message.log = reader.string();\n break;\n case 3:\n message.events.push(exports.StringEvent.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseABCIMessageLog);\n message.events = [];\n if (object.msgIndex !== undefined && object.msgIndex !== null) {\n message.msgIndex = Number(object.msgIndex);\n }\n else {\n message.msgIndex = 0;\n }\n if (object.log !== undefined && object.log !== null) {\n message.log = String(object.log);\n }\n else {\n message.log = \"\";\n }\n if (object.events !== undefined && object.events !== null) {\n for (const e of object.events) {\n message.events.push(exports.StringEvent.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.msgIndex !== undefined && (obj.msgIndex = message.msgIndex);\n message.log !== undefined && (obj.log = message.log);\n if (message.events) {\n obj.events = message.events.map((e) => (e ? exports.StringEvent.toJSON(e) : undefined));\n }\n else {\n obj.events = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseABCIMessageLog);\n message.events = [];\n if (object.msgIndex !== undefined && object.msgIndex !== null) {\n message.msgIndex = object.msgIndex;\n }\n else {\n message.msgIndex = 0;\n }\n if (object.log !== undefined && object.log !== null) {\n message.log = object.log;\n }\n else {\n message.log = \"\";\n }\n if (object.events !== undefined && object.events !== null) {\n for (const e of object.events) {\n message.events.push(exports.StringEvent.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseStringEvent = { type: \"\" };\nexports.StringEvent = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.type !== \"\") {\n writer.uint32(10).string(message.type);\n }\n for (const v of message.attributes) {\n exports.Attribute.encode(v, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseStringEvent);\n message.attributes = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.type = reader.string();\n break;\n case 2:\n message.attributes.push(exports.Attribute.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseStringEvent);\n message.attributes = [];\n if (object.type !== undefined && object.type !== null) {\n message.type = String(object.type);\n }\n else {\n message.type = \"\";\n }\n if (object.attributes !== undefined && object.attributes !== null) {\n for (const e of object.attributes) {\n message.attributes.push(exports.Attribute.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.type !== undefined && (obj.type = message.type);\n if (message.attributes) {\n obj.attributes = message.attributes.map((e) => (e ? exports.Attribute.toJSON(e) : undefined));\n }\n else {\n obj.attributes = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseStringEvent);\n message.attributes = [];\n if (object.type !== undefined && object.type !== null) {\n message.type = object.type;\n }\n else {\n message.type = \"\";\n }\n if (object.attributes !== undefined && object.attributes !== null) {\n for (const e of object.attributes) {\n message.attributes.push(exports.Attribute.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseAttribute = { key: \"\", value: \"\" };\nexports.Attribute = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.value !== \"\") {\n writer.uint32(18).string(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseAttribute);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.key = reader.string();\n break;\n case 2:\n message.value = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseAttribute);\n if (object.key !== undefined && object.key !== null) {\n message.key = String(object.key);\n }\n else {\n message.key = \"\";\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = String(object.value);\n }\n else {\n message.value = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.key !== undefined && (obj.key = message.key);\n message.value !== undefined && (obj.value = message.value);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseAttribute);\n if (object.key !== undefined && object.key !== null) {\n message.key = object.key;\n }\n else {\n message.key = \"\";\n }\n if (object.value !== undefined && object.value !== null) {\n message.value = object.value;\n }\n else {\n message.value = \"\";\n }\n return message;\n },\n};\nconst baseGasInfo = { gasWanted: long_1.default.UZERO, gasUsed: long_1.default.UZERO };\nexports.GasInfo = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.gasWanted.isZero()) {\n writer.uint32(8).uint64(message.gasWanted);\n }\n if (!message.gasUsed.isZero()) {\n writer.uint32(16).uint64(message.gasUsed);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseGasInfo);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.gasWanted = reader.uint64();\n break;\n case 2:\n message.gasUsed = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseGasInfo);\n if (object.gasWanted !== undefined && object.gasWanted !== null) {\n message.gasWanted = long_1.default.fromString(object.gasWanted);\n }\n else {\n message.gasWanted = long_1.default.UZERO;\n }\n if (object.gasUsed !== undefined && object.gasUsed !== null) {\n message.gasUsed = long_1.default.fromString(object.gasUsed);\n }\n else {\n message.gasUsed = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || long_1.default.UZERO).toString());\n message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseGasInfo);\n if (object.gasWanted !== undefined && object.gasWanted !== null) {\n message.gasWanted = object.gasWanted;\n }\n else {\n message.gasWanted = long_1.default.UZERO;\n }\n if (object.gasUsed !== undefined && object.gasUsed !== null) {\n message.gasUsed = object.gasUsed;\n }\n else {\n message.gasUsed = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseResult = { log: \"\" };\nexports.Result = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.data.length !== 0) {\n writer.uint32(10).bytes(message.data);\n }\n if (message.log !== \"\") {\n writer.uint32(18).string(message.log);\n }\n for (const v of message.events) {\n types_1.Event.encode(v, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseResult);\n message.events = [];\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.data = reader.bytes();\n break;\n case 2:\n message.log = reader.string();\n break;\n case 3:\n message.events.push(types_1.Event.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseResult);\n message.events = [];\n message.data = new Uint8Array();\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n if (object.log !== undefined && object.log !== null) {\n message.log = String(object.log);\n }\n else {\n message.log = \"\";\n }\n if (object.events !== undefined && object.events !== null) {\n for (const e of object.events) {\n message.events.push(types_1.Event.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n message.log !== undefined && (obj.log = message.log);\n if (message.events) {\n obj.events = message.events.map((e) => (e ? types_1.Event.toJSON(e) : undefined));\n }\n else {\n obj.events = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseResult);\n message.events = [];\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n if (object.log !== undefined && object.log !== null) {\n message.log = object.log;\n }\n else {\n message.log = \"\";\n }\n if (object.events !== undefined && object.events !== null) {\n for (const e of object.events) {\n message.events.push(types_1.Event.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseSimulationResponse = {};\nexports.SimulationResponse = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.gasInfo !== undefined) {\n exports.GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim();\n }\n if (message.result !== undefined) {\n exports.Result.encode(message.result, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSimulationResponse);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.gasInfo = exports.GasInfo.decode(reader, reader.uint32());\n break;\n case 2:\n message.result = exports.Result.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSimulationResponse);\n if (object.gasInfo !== undefined && object.gasInfo !== null) {\n message.gasInfo = exports.GasInfo.fromJSON(object.gasInfo);\n }\n else {\n message.gasInfo = undefined;\n }\n if (object.result !== undefined && object.result !== null) {\n message.result = exports.Result.fromJSON(object.result);\n }\n else {\n message.result = undefined;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.gasInfo !== undefined &&\n (obj.gasInfo = message.gasInfo ? exports.GasInfo.toJSON(message.gasInfo) : undefined);\n message.result !== undefined && (obj.result = message.result ? exports.Result.toJSON(message.result) : undefined);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSimulationResponse);\n if (object.gasInfo !== undefined && object.gasInfo !== null) {\n message.gasInfo = exports.GasInfo.fromPartial(object.gasInfo);\n }\n else {\n message.gasInfo = undefined;\n }\n if (object.result !== undefined && object.result !== null) {\n message.result = exports.Result.fromPartial(object.result);\n }\n else {\n message.result = undefined;\n }\n return message;\n },\n};\nconst baseMsgData = { msgType: \"\" };\nexports.MsgData = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.msgType !== \"\") {\n writer.uint32(10).string(message.msgType);\n }\n if (message.data.length !== 0) {\n writer.uint32(18).bytes(message.data);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseMsgData);\n message.data = new Uint8Array();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.msgType = reader.string();\n break;\n case 2:\n message.data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseMsgData);\n message.data = new Uint8Array();\n if (object.msgType !== undefined && object.msgType !== null) {\n message.msgType = String(object.msgType);\n }\n else {\n message.msgType = \"\";\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = bytesFromBase64(object.data);\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.msgType !== undefined && (obj.msgType = message.msgType);\n message.data !== undefined &&\n (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseMsgData);\n if (object.msgType !== undefined && object.msgType !== null) {\n message.msgType = object.msgType;\n }\n else {\n message.msgType = \"\";\n }\n if (object.data !== undefined && object.data !== null) {\n message.data = object.data;\n }\n else {\n message.data = new Uint8Array();\n }\n return message;\n },\n};\nconst baseTxMsgData = {};\nexports.TxMsgData = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.data) {\n exports.MsgData.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseTxMsgData);\n message.data = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.data.push(exports.MsgData.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseTxMsgData);\n message.data = [];\n if (object.data !== undefined && object.data !== null) {\n for (const e of object.data) {\n message.data.push(exports.MsgData.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.data) {\n obj.data = message.data.map((e) => (e ? exports.MsgData.toJSON(e) : undefined));\n }\n else {\n obj.data = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseTxMsgData);\n message.data = [];\n if (object.data !== undefined && object.data !== null) {\n for (const e of object.data) {\n message.data.push(exports.MsgData.fromPartial(e));\n }\n }\n return message;\n },\n};\nconst baseSearchTxsResult = {\n totalCount: long_1.default.UZERO,\n count: long_1.default.UZERO,\n pageNumber: long_1.default.UZERO,\n pageTotal: long_1.default.UZERO,\n limit: long_1.default.UZERO,\n};\nexports.SearchTxsResult = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.totalCount.isZero()) {\n writer.uint32(8).uint64(message.totalCount);\n }\n if (!message.count.isZero()) {\n writer.uint32(16).uint64(message.count);\n }\n if (!message.pageNumber.isZero()) {\n writer.uint32(24).uint64(message.pageNumber);\n }\n if (!message.pageTotal.isZero()) {\n writer.uint32(32).uint64(message.pageTotal);\n }\n if (!message.limit.isZero()) {\n writer.uint32(40).uint64(message.limit);\n }\n for (const v of message.txs) {\n exports.TxResponse.encode(v, writer.uint32(50).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseSearchTxsResult);\n message.txs = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.totalCount = reader.uint64();\n break;\n case 2:\n message.count = reader.uint64();\n break;\n case 3:\n message.pageNumber = reader.uint64();\n break;\n case 4:\n message.pageTotal = reader.uint64();\n break;\n case 5:\n message.limit = reader.uint64();\n break;\n case 6:\n message.txs.push(exports.TxResponse.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseSearchTxsResult);\n message.txs = [];\n if (object.totalCount !== undefined && object.totalCount !== null) {\n message.totalCount = long_1.default.fromString(object.totalCount);\n }\n else {\n message.totalCount = long_1.default.UZERO;\n }\n if (object.count !== undefined && object.count !== null) {\n message.count = long_1.default.fromString(object.count);\n }\n else {\n message.count = long_1.default.UZERO;\n }\n if (object.pageNumber !== undefined && object.pageNumber !== null) {\n message.pageNumber = long_1.default.fromString(object.pageNumber);\n }\n else {\n message.pageNumber = long_1.default.UZERO;\n }\n if (object.pageTotal !== undefined && object.pageTotal !== null) {\n message.pageTotal = long_1.default.fromString(object.pageTotal);\n }\n else {\n message.pageTotal = long_1.default.UZERO;\n }\n if (object.limit !== undefined && object.limit !== null) {\n message.limit = long_1.default.fromString(object.limit);\n }\n else {\n message.limit = long_1.default.UZERO;\n }\n if (object.txs !== undefined && object.txs !== null) {\n for (const e of object.txs) {\n message.txs.push(exports.TxResponse.fromJSON(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.totalCount !== undefined && (obj.totalCount = (message.totalCount || long_1.default.UZERO).toString());\n message.count !== undefined && (obj.count = (message.count || long_1.default.UZERO).toString());\n message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || long_1.default.UZERO).toString());\n message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || long_1.default.UZERO).toString());\n message.limit !== undefined && (obj.limit = (message.limit || long_1.default.UZERO).toString());\n if (message.txs) {\n obj.txs = message.txs.map((e) => (e ? exports.TxResponse.toJSON(e) : undefined));\n }\n else {\n obj.txs = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseSearchTxsResult);\n message.txs = [];\n if (object.totalCount !== undefined && object.totalCount !== null) {\n message.totalCount = object.totalCount;\n }\n else {\n message.totalCount = long_1.default.UZERO;\n }\n if (object.count !== undefined && object.count !== null) {\n message.count = object.count;\n }\n else {\n message.count = long_1.default.UZERO;\n }\n if (object.pageNumber !== undefined && object.pageNumber !== null) {\n message.pageNumber = object.pageNumber;\n }\n else {\n message.pageNumber = long_1.default.UZERO;\n }\n if (object.pageTotal !== undefined && object.pageTotal !== null) {\n message.pageTotal = object.pageTotal;\n }\n else {\n message.pageTotal = long_1.default.UZERO;\n }\n if (object.limit !== undefined && object.limit !== null) {\n message.limit = object.limit;\n }\n else {\n message.limit = long_1.default.UZERO;\n }\n if (object.txs !== undefined && object.txs !== null) {\n for (const e of object.txs) {\n message.txs.push(exports.TxResponse.fromPartial(e));\n }\n }\n return message;\n },\n};\nvar globalThis = (() => {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\")\n return self;\n if (typeof window !== \"undefined\")\n return window;\n if (typeof global !== \"undefined\")\n return global;\n throw \"Unable to locate global object\";\n})();\nconst atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, \"base64\").toString(\"binary\"));\nfunction bytesFromBase64(b64) {\n const bin = atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n}\nconst btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, \"binary\").toString(\"base64\"));\nfunction base64FromBytes(arr) {\n const bin = [];\n for (const byte of arr) {\n bin.push(String.fromCharCode(byte));\n }\n return btoa(bin.join(\"\"));\n}\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=abci.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Params = exports.ModuleAccount = exports.BaseAccount = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst any_1 = require(\"../../../google/protobuf/any\");\nexports.protobufPackage = \"cosmos.auth.v1beta1\";\nconst baseBaseAccount = { address: \"\", accountNumber: long_1.default.UZERO, sequence: long_1.default.UZERO };\nexports.BaseAccount = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n if (message.pubKey !== undefined) {\n any_1.Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim();\n }\n if (!message.accountNumber.isZero()) {\n writer.uint32(24).uint64(message.accountNumber);\n }\n if (!message.sequence.isZero()) {\n writer.uint32(32).uint64(message.sequence);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseBaseAccount);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.address = reader.string();\n break;\n case 2:\n message.pubKey = any_1.Any.decode(reader, reader.uint32());\n break;\n case 3:\n message.accountNumber = reader.uint64();\n break;\n case 4:\n message.sequence = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseBaseAccount);\n if (object.address !== undefined && object.address !== null) {\n message.address = String(object.address);\n }\n else {\n message.address = \"\";\n }\n if (object.pubKey !== undefined && object.pubKey !== null) {\n message.pubKey = any_1.Any.fromJSON(object.pubKey);\n }\n else {\n message.pubKey = undefined;\n }\n if (object.accountNumber !== undefined && object.accountNumber !== null) {\n message.accountNumber = long_1.default.fromString(object.accountNumber);\n }\n else {\n message.accountNumber = long_1.default.UZERO;\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = long_1.default.fromString(object.sequence);\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.address !== undefined && (obj.address = message.address);\n message.pubKey !== undefined && (obj.pubKey = message.pubKey ? any_1.Any.toJSON(message.pubKey) : undefined);\n message.accountNumber !== undefined &&\n (obj.accountNumber = (message.accountNumber || long_1.default.UZERO).toString());\n message.sequence !== undefined && (obj.sequence = (message.sequence || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseBaseAccount);\n if (object.address !== undefined && object.address !== null) {\n message.address = object.address;\n }\n else {\n message.address = \"\";\n }\n if (object.pubKey !== undefined && object.pubKey !== null) {\n message.pubKey = any_1.Any.fromPartial(object.pubKey);\n }\n else {\n message.pubKey = undefined;\n }\n if (object.accountNumber !== undefined && object.accountNumber !== null) {\n message.accountNumber = object.accountNumber;\n }\n else {\n message.accountNumber = long_1.default.UZERO;\n }\n if (object.sequence !== undefined && object.sequence !== null) {\n message.sequence = object.sequence;\n }\n else {\n message.sequence = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseModuleAccount = { name: \"\", permissions: \"\" };\nexports.ModuleAccount = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.baseAccount !== undefined) {\n exports.BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim();\n }\n if (message.name !== \"\") {\n writer.uint32(18).string(message.name);\n }\n for (const v of message.permissions) {\n writer.uint32(26).string(v);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseModuleAccount);\n message.permissions = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.baseAccount = exports.BaseAccount.decode(reader, reader.uint32());\n break;\n case 2:\n message.name = reader.string();\n break;\n case 3:\n message.permissions.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseModuleAccount);\n message.permissions = [];\n if (object.baseAccount !== undefined && object.baseAccount !== null) {\n message.baseAccount = exports.BaseAccount.fromJSON(object.baseAccount);\n }\n else {\n message.baseAccount = undefined;\n }\n if (object.name !== undefined && object.name !== null) {\n message.name = String(object.name);\n }\n else {\n message.name = \"\";\n }\n if (object.permissions !== undefined && object.permissions !== null) {\n for (const e of object.permissions) {\n message.permissions.push(String(e));\n }\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.baseAccount !== undefined &&\n (obj.baseAccount = message.baseAccount ? exports.BaseAccount.toJSON(message.baseAccount) : undefined);\n message.name !== undefined && (obj.name = message.name);\n if (message.permissions) {\n obj.permissions = message.permissions.map((e) => e);\n }\n else {\n obj.permissions = [];\n }\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseModuleAccount);\n message.permissions = [];\n if (object.baseAccount !== undefined && object.baseAccount !== null) {\n message.baseAccount = exports.BaseAccount.fromPartial(object.baseAccount);\n }\n else {\n message.baseAccount = undefined;\n }\n if (object.name !== undefined && object.name !== null) {\n message.name = object.name;\n }\n else {\n message.name = \"\";\n }\n if (object.permissions !== undefined && object.permissions !== null) {\n for (const e of object.permissions) {\n message.permissions.push(e);\n }\n }\n return message;\n },\n};\nconst baseParams = {\n maxMemoCharacters: long_1.default.UZERO,\n txSigLimit: long_1.default.UZERO,\n txSizeCostPerByte: long_1.default.UZERO,\n sigVerifyCostEd25519: long_1.default.UZERO,\n sigVerifyCostSecp256k1: long_1.default.UZERO,\n};\nexports.Params = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.maxMemoCharacters.isZero()) {\n writer.uint32(8).uint64(message.maxMemoCharacters);\n }\n if (!message.txSigLimit.isZero()) {\n writer.uint32(16).uint64(message.txSigLimit);\n }\n if (!message.txSizeCostPerByte.isZero()) {\n writer.uint32(24).uint64(message.txSizeCostPerByte);\n }\n if (!message.sigVerifyCostEd25519.isZero()) {\n writer.uint32(32).uint64(message.sigVerifyCostEd25519);\n }\n if (!message.sigVerifyCostSecp256k1.isZero()) {\n writer.uint32(40).uint64(message.sigVerifyCostSecp256k1);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParams);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.maxMemoCharacters = reader.uint64();\n break;\n case 2:\n message.txSigLimit = reader.uint64();\n break;\n case 3:\n message.txSizeCostPerByte = reader.uint64();\n break;\n case 4:\n message.sigVerifyCostEd25519 = reader.uint64();\n break;\n case 5:\n message.sigVerifyCostSecp256k1 = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParams);\n if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) {\n message.maxMemoCharacters = long_1.default.fromString(object.maxMemoCharacters);\n }\n else {\n message.maxMemoCharacters = long_1.default.UZERO;\n }\n if (object.txSigLimit !== undefined && object.txSigLimit !== null) {\n message.txSigLimit = long_1.default.fromString(object.txSigLimit);\n }\n else {\n message.txSigLimit = long_1.default.UZERO;\n }\n if (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) {\n message.txSizeCostPerByte = long_1.default.fromString(object.txSizeCostPerByte);\n }\n else {\n message.txSizeCostPerByte = long_1.default.UZERO;\n }\n if (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) {\n message.sigVerifyCostEd25519 = long_1.default.fromString(object.sigVerifyCostEd25519);\n }\n else {\n message.sigVerifyCostEd25519 = long_1.default.UZERO;\n }\n if (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) {\n message.sigVerifyCostSecp256k1 = long_1.default.fromString(object.sigVerifyCostSecp256k1);\n }\n else {\n message.sigVerifyCostSecp256k1 = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.maxMemoCharacters !== undefined &&\n (obj.maxMemoCharacters = (message.maxMemoCharacters || long_1.default.UZERO).toString());\n message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || long_1.default.UZERO).toString());\n message.txSizeCostPerByte !== undefined &&\n (obj.txSizeCostPerByte = (message.txSizeCostPerByte || long_1.default.UZERO).toString());\n message.sigVerifyCostEd25519 !== undefined &&\n (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || long_1.default.UZERO).toString());\n message.sigVerifyCostSecp256k1 !== undefined &&\n (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParams);\n if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) {\n message.maxMemoCharacters = object.maxMemoCharacters;\n }\n else {\n message.maxMemoCharacters = long_1.default.UZERO;\n }\n if (object.txSigLimit !== undefined && object.txSigLimit !== null) {\n message.txSigLimit = object.txSigLimit;\n }\n else {\n message.txSigLimit = long_1.default.UZERO;\n }\n if (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) {\n message.txSizeCostPerByte = object.txSizeCostPerByte;\n }\n else {\n message.txSizeCostPerByte = long_1.default.UZERO;\n }\n if (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) {\n message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519;\n }\n else {\n message.sigVerifyCostEd25519 = long_1.default.UZERO;\n }\n if (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) {\n message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1;\n }\n else {\n message.sigVerifyCostSecp256k1 = long_1.default.UZERO;\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=auth.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LazyGradedVestingAccount = void 0;\nvar json_1 = require(\"../../util/json\");\nvar BaseVestingAccount_1 = require(\"./BaseVestingAccount\");\nvar numeric_1 = require(\"../numeric\");\nvar vesting_1 = require(\"@terra-money/terra.proto/terra/vesting/v1beta1/vesting\");\nvar any_1 = require(\"@terra-money/terra.proto/google/protobuf/any\");\nvar Long = __importStar(require(\"long\"));\n/**\n * Holds information about a Account which has vesting information.\n */\nvar LazyGradedVestingAccount = /** @class */ (function (_super) {\n __extends(LazyGradedVestingAccount, _super);\n /**\n *\n * @param BaseAccount account information\n * @param original_vesting initial vesting amount\n * @param delegated_free\n * @param delegated_vesting\n * @param end_time -not used-\n * @param vesting_schedules Entries that make up vesting\n */\n function LazyGradedVestingAccount(base_vesting_account, vesting_schedules) {\n var _this = _super.call(this) || this;\n _this.base_vesting_account = base_vesting_account;\n _this.vesting_schedules = vesting_schedules;\n return _this;\n }\n LazyGradedVestingAccount.prototype.getAccountNumber = function () {\n return this.base_vesting_account.getAccountNumber();\n };\n LazyGradedVestingAccount.prototype.getSequenceNumber = function () {\n return this.base_vesting_account.getSequenceNumber();\n };\n LazyGradedVestingAccount.prototype.getPublicKey = function () {\n return this.base_vesting_account.base_account.public_key;\n };\n LazyGradedVestingAccount.prototype.toAmino = function () {\n var _a = this, base_vesting_account = _a.base_vesting_account, vesting_schedules = _a.vesting_schedules;\n return {\n type: 'core/LazyGradedVestingAccount',\n value: {\n base_vesting_account: base_vesting_account.toAmino().value,\n vesting_schedules: vesting_schedules.map(function (vs) { return vs.toAmino(); }),\n },\n };\n };\n LazyGradedVestingAccount.fromAmino = function (data) {\n var base_vesting_account = BaseVestingAccount_1.BaseVestingAccount.fromAmino({\n type: 'core/BaseVestingAccount',\n value: data.value.base_vesting_account,\n });\n return new LazyGradedVestingAccount(base_vesting_account, data.value.vesting_schedules.map(function (vs) {\n return LazyGradedVestingAccount.VestingSchedule.fromAmino(vs);\n }));\n };\n LazyGradedVestingAccount.prototype.toData = function () {\n var _a = this, base_vesting_account = _a.base_vesting_account, vesting_schedules = _a.vesting_schedules;\n return {\n '@type': '/terra.vesting.v1beta1.LazyGradedVestingAccount',\n base_vesting_account: base_vesting_account.toData(),\n vesting_schedules: vesting_schedules.map(function (vs) { return vs.toData(); }),\n };\n };\n LazyGradedVestingAccount.fromData = function (data) {\n var base_vesting_account = BaseVestingAccount_1.BaseVestingAccount.fromData(__assign({ '@type': '/terra.vesting.v1beta1.LazyGradedVestingAccount' }, data.base_vesting_account));\n return new LazyGradedVestingAccount(base_vesting_account, data.vesting_schedules.map(function (vs) {\n return LazyGradedVestingAccount.VestingSchedule.fromData(vs);\n }));\n };\n LazyGradedVestingAccount.prototype.toProto = function () {\n var _a = this, base_vesting_account = _a.base_vesting_account, vesting_schedules = _a.vesting_schedules;\n return vesting_1.LazyGradedVestingAccount.fromPartial({\n baseVestingAccount: base_vesting_account.toProto(),\n vestingSchedules: vesting_schedules.map(function (s) { return s.toProto(); }),\n });\n };\n LazyGradedVestingAccount.fromProto = function (lazyGradedVestingAccountProto) {\n var _this = this;\n var baseVestingAccount = BaseVestingAccount_1.BaseVestingAccount.fromProto(lazyGradedVestingAccountProto.baseVestingAccount);\n return new LazyGradedVestingAccount(baseVestingAccount, lazyGradedVestingAccountProto.vestingSchedules.map(function (s) {\n return _this.VestingSchedule.fromProto(s);\n }));\n };\n LazyGradedVestingAccount.prototype.packAny = function () {\n return any_1.Any.fromPartial({\n typeUrl: '/terra.vesting.v1beta1.LazyGradedVestingAccount',\n value: vesting_1.LazyGradedVestingAccount.encode(this.toProto()).finish(),\n });\n };\n LazyGradedVestingAccount.unpackAny = function (pubkeyAny) {\n return LazyGradedVestingAccount.fromProto(vesting_1.LazyGradedVestingAccount.decode(pubkeyAny.value));\n };\n return LazyGradedVestingAccount;\n}(json_1.JSONSerializable));\nexports.LazyGradedVestingAccount = LazyGradedVestingAccount;\n(function (LazyGradedVestingAccount) {\n var VestingSchedule = /** @class */ (function (_super) {\n __extends(VestingSchedule, _super);\n function VestingSchedule(denom, schedules) {\n var _this = _super.call(this) || this;\n _this.denom = denom;\n _this.schedules = schedules;\n return _this;\n }\n VestingSchedule.prototype.toAmino = function () {\n var _a = this, denom = _a.denom, schedules = _a.schedules;\n return {\n denom: denom,\n schedules: schedules.map(function (s) { return s.toAmino(); }),\n };\n };\n VestingSchedule.fromAmino = function (data) {\n var denom = data.denom, schedules = data.schedules;\n return new VestingSchedule(denom, schedules.map(function (s) { return VestingSchedule.Entry.fromAmino(s); }));\n };\n VestingSchedule.prototype.toData = function () {\n var _a = this, denom = _a.denom, schedules = _a.schedules;\n return {\n denom: denom,\n schedules: schedules.map(function (s) { return s.toData(); }),\n };\n };\n VestingSchedule.fromData = function (data) {\n var denom = data.denom, schedules = data.schedules;\n return new VestingSchedule(denom, schedules.map(function (s) { return VestingSchedule.Entry.fromData(s); }));\n };\n VestingSchedule.prototype.toProto = function () {\n var _a = this, denom = _a.denom, schedules = _a.schedules;\n return vesting_1.VestingSchedule.fromPartial({\n denom: denom,\n schedules: schedules.map(function (s) { return s.toProto(); }),\n });\n };\n VestingSchedule.fromProto = function (vestingScheduleProto) {\n return new VestingSchedule(vestingScheduleProto.denom, vestingScheduleProto.schedules.map(function (s) {\n return VestingSchedule.Entry.fromProto(s);\n }));\n };\n return VestingSchedule;\n }(json_1.JSONSerializable));\n LazyGradedVestingAccount.VestingSchedule = VestingSchedule;\n (function (VestingSchedule) {\n var Entry = /** @class */ (function (_super) {\n __extends(Entry, _super);\n /**\n *\n * @param start_time Starting time (block height)\n * @param end_time Ending time (block height)\n * @param ratio Ratio (percentage of vested funds that should be released)\n */\n function Entry(start_time, end_time, ratio) {\n var _this = _super.call(this) || this;\n _this.start_time = start_time;\n _this.end_time = end_time;\n _this.ratio = ratio;\n return _this;\n }\n Entry.fromAmino = function (data) {\n var start_time = data.start_time, end_time = data.end_time, ratio = data.ratio;\n return new Entry(Number.parseInt(start_time), Number.parseInt(end_time), new numeric_1.Dec(ratio));\n };\n Entry.prototype.toAmino = function () {\n return {\n start_time: this.start_time.toFixed(),\n end_time: this.end_time.toFixed(),\n ratio: this.ratio.toString(),\n };\n };\n Entry.fromData = function (data) {\n var start_time = data.start_time, end_time = data.end_time, ratio = data.ratio;\n return new Entry(Number.parseInt(start_time), Number.parseInt(end_time), new numeric_1.Dec(ratio));\n };\n Entry.prototype.toData = function () {\n return {\n start_time: this.start_time.toFixed(),\n end_time: this.end_time.toFixed(),\n ratio: this.ratio.toString(),\n };\n };\n Entry.fromProto = function (entryProto) {\n return new Entry(entryProto.endTime.toNumber(), entryProto.startTime.toNumber(), new numeric_1.Dec(entryProto.ratio));\n };\n Entry.prototype.toProto = function () {\n return vesting_1.Schedule.fromPartial({\n endTime: Long.fromNumber(this.end_time),\n ratio: this.ratio.toString(),\n startTime: Long.fromNumber(this.start_time),\n });\n };\n return Entry;\n }(json_1.JSONSerializable));\n VestingSchedule.Entry = Entry;\n })(VestingSchedule = LazyGradedVestingAccount.VestingSchedule || (LazyGradedVestingAccount.VestingSchedule = {}));\n})(LazyGradedVestingAccount = exports.LazyGradedVestingAccount || (exports.LazyGradedVestingAccount = {}));\nexports.LazyGradedVestingAccount = LazyGradedVestingAccount;\n//# sourceMappingURL=LazyGradedVestingAccount.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseVestingAccount = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nconst auth_1 = require(\"../../../cosmos/auth/v1beta1/auth\");\nconst coin_1 = require(\"../../../cosmos/base/v1beta1/coin\");\nexports.protobufPackage = \"cosmos.vesting.v1beta1\";\nconst baseBaseVestingAccount = { endTime: long_1.default.ZERO };\nexports.BaseVestingAccount = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.baseAccount !== undefined) {\n auth_1.BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim();\n }\n for (const v of message.originalVesting) {\n coin_1.Coin.encode(v, writer.uint32(18).fork()).ldelim();\n }\n for (const v of message.delegatedFree) {\n coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();\n }\n for (const v of message.delegatedVesting) {\n coin_1.Coin.encode(v, writer.uint32(34).fork()).ldelim();\n }\n if (!message.endTime.isZero()) {\n writer.uint32(40).int64(message.endTime);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseBaseVestingAccount);\n message.originalVesting = [];\n message.delegatedFree = [];\n message.delegatedVesting = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.baseAccount = auth_1.BaseAccount.decode(reader, reader.uint32());\n break;\n case 2:\n message.originalVesting.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 3:\n message.delegatedFree.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 4:\n message.delegatedVesting.push(coin_1.Coin.decode(reader, reader.uint32()));\n break;\n case 5:\n message.endTime = reader.int64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseBaseVestingAccount);\n message.originalVesting = [];\n message.delegatedFree = [];\n message.delegatedVesting = [];\n if (object.baseAccount !== undefined && object.baseAccount !== null) {\n message.baseAccount = auth_1.BaseAccount.fromJSON(object.baseAccount);\n }\n else {\n message.baseAccount = undefined;\n }\n if (object.originalVesting !== undefined && object.originalVesting !== null) {\n for (const e of object.originalVesting) {\n message.originalVesting.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.delegatedFree !== undefined && object.delegatedFree !== null) {\n for (const e of object.delegatedFree) {\n message.delegatedFree.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.delegatedVesting !== undefined && object.delegatedVesting !== null) {\n for (const e of object.delegatedVesting) {\n message.delegatedVesting.push(coin_1.Coin.fromJSON(e));\n }\n }\n if (object.endTime !== undefined && object.endTime !== null) {\n message.endTime = long_1.default.fromString(object.endTime);\n }\n else {\n message.endTime = long_1.default.ZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.baseAccount !== undefined &&\n (obj.baseAccount = message.baseAccount ? auth_1.BaseAccount.toJSON(message.baseAccount) : undefined);\n if (message.originalVesting) {\n obj.originalVesting = message.originalVesting.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.originalVesting = [];\n }\n if (message.delegatedFree) {\n obj.delegatedFree = message.delegatedFree.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.delegatedFree = [];\n }\n if (message.delegatedVesting) {\n obj.delegatedVesting = message.delegatedVesting.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));\n }\n else {\n obj.delegatedVesting = [];\n }\n message.endTime !== undefined && (obj.endTime = (message.endTime || long_1.default.ZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseBaseVestingAccount);\n message.originalVesting = [];\n message.delegatedFree = [];\n message.delegatedVesting = [];\n if (object.baseAccount !== undefined && object.baseAccount !== null) {\n message.baseAccount = auth_1.BaseAccount.fromPartial(object.baseAccount);\n }\n else {\n message.baseAccount = undefined;\n }\n if (object.originalVesting !== undefined && object.originalVesting !== null) {\n for (const e of object.originalVesting) {\n message.originalVesting.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.delegatedFree !== undefined && object.delegatedFree !== null) {\n for (const e of object.delegatedFree) {\n message.delegatedFree.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.delegatedVesting !== undefined && object.delegatedVesting !== null) {\n for (const e of object.delegatedVesting) {\n message.delegatedVesting.push(coin_1.Coin.fromPartial(e));\n }\n }\n if (object.endTime !== undefined && object.endTime !== null) {\n message.endTime = object.endTime;\n }\n else {\n message.endTime = long_1.default.ZERO;\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=vesting.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExchangeRateTuple = exports.AggregateExchangeRateVote = exports.AggregateExchangeRatePrevote = exports.Denom = exports.Params = exports.protobufPackage = void 0;\n/* eslint-disable */\nconst long_1 = __importDefault(require(\"long\"));\nconst minimal_1 = __importDefault(require(\"protobufjs/minimal\"));\nexports.protobufPackage = \"terra.oracle.v1beta1\";\nconst baseParams = {\n votePeriod: long_1.default.UZERO,\n voteThreshold: \"\",\n rewardBand: \"\",\n rewardDistributionWindow: long_1.default.UZERO,\n slashFraction: \"\",\n slashWindow: long_1.default.UZERO,\n minValidPerWindow: \"\",\n};\nexports.Params = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (!message.votePeriod.isZero()) {\n writer.uint32(8).uint64(message.votePeriod);\n }\n if (message.voteThreshold !== \"\") {\n writer.uint32(18).string(message.voteThreshold);\n }\n if (message.rewardBand !== \"\") {\n writer.uint32(26).string(message.rewardBand);\n }\n if (!message.rewardDistributionWindow.isZero()) {\n writer.uint32(32).uint64(message.rewardDistributionWindow);\n }\n for (const v of message.whitelist) {\n exports.Denom.encode(v, writer.uint32(42).fork()).ldelim();\n }\n if (message.slashFraction !== \"\") {\n writer.uint32(50).string(message.slashFraction);\n }\n if (!message.slashWindow.isZero()) {\n writer.uint32(56).uint64(message.slashWindow);\n }\n if (message.minValidPerWindow !== \"\") {\n writer.uint32(66).string(message.minValidPerWindow);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseParams);\n message.whitelist = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.votePeriod = reader.uint64();\n break;\n case 2:\n message.voteThreshold = reader.string();\n break;\n case 3:\n message.rewardBand = reader.string();\n break;\n case 4:\n message.rewardDistributionWindow = reader.uint64();\n break;\n case 5:\n message.whitelist.push(exports.Denom.decode(reader, reader.uint32()));\n break;\n case 6:\n message.slashFraction = reader.string();\n break;\n case 7:\n message.slashWindow = reader.uint64();\n break;\n case 8:\n message.minValidPerWindow = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseParams);\n message.whitelist = [];\n if (object.votePeriod !== undefined && object.votePeriod !== null) {\n message.votePeriod = long_1.default.fromString(object.votePeriod);\n }\n else {\n message.votePeriod = long_1.default.UZERO;\n }\n if (object.voteThreshold !== undefined && object.voteThreshold !== null) {\n message.voteThreshold = String(object.voteThreshold);\n }\n else {\n message.voteThreshold = \"\";\n }\n if (object.rewardBand !== undefined && object.rewardBand !== null) {\n message.rewardBand = String(object.rewardBand);\n }\n else {\n message.rewardBand = \"\";\n }\n if (object.rewardDistributionWindow !== undefined && object.rewardDistributionWindow !== null) {\n message.rewardDistributionWindow = long_1.default.fromString(object.rewardDistributionWindow);\n }\n else {\n message.rewardDistributionWindow = long_1.default.UZERO;\n }\n if (object.whitelist !== undefined && object.whitelist !== null) {\n for (const e of object.whitelist) {\n message.whitelist.push(exports.Denom.fromJSON(e));\n }\n }\n if (object.slashFraction !== undefined && object.slashFraction !== null) {\n message.slashFraction = String(object.slashFraction);\n }\n else {\n message.slashFraction = \"\";\n }\n if (object.slashWindow !== undefined && object.slashWindow !== null) {\n message.slashWindow = long_1.default.fromString(object.slashWindow);\n }\n else {\n message.slashWindow = long_1.default.UZERO;\n }\n if (object.minValidPerWindow !== undefined && object.minValidPerWindow !== null) {\n message.minValidPerWindow = String(object.minValidPerWindow);\n }\n else {\n message.minValidPerWindow = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.votePeriod !== undefined && (obj.votePeriod = (message.votePeriod || long_1.default.UZERO).toString());\n message.voteThreshold !== undefined && (obj.voteThreshold = message.voteThreshold);\n message.rewardBand !== undefined && (obj.rewardBand = message.rewardBand);\n message.rewardDistributionWindow !== undefined &&\n (obj.rewardDistributionWindow = (message.rewardDistributionWindow || long_1.default.UZERO).toString());\n if (message.whitelist) {\n obj.whitelist = message.whitelist.map((e) => (e ? exports.Denom.toJSON(e) : undefined));\n }\n else {\n obj.whitelist = [];\n }\n message.slashFraction !== undefined && (obj.slashFraction = message.slashFraction);\n message.slashWindow !== undefined && (obj.slashWindow = (message.slashWindow || long_1.default.UZERO).toString());\n message.minValidPerWindow !== undefined && (obj.minValidPerWindow = message.minValidPerWindow);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseParams);\n message.whitelist = [];\n if (object.votePeriod !== undefined && object.votePeriod !== null) {\n message.votePeriod = object.votePeriod;\n }\n else {\n message.votePeriod = long_1.default.UZERO;\n }\n if (object.voteThreshold !== undefined && object.voteThreshold !== null) {\n message.voteThreshold = object.voteThreshold;\n }\n else {\n message.voteThreshold = \"\";\n }\n if (object.rewardBand !== undefined && object.rewardBand !== null) {\n message.rewardBand = object.rewardBand;\n }\n else {\n message.rewardBand = \"\";\n }\n if (object.rewardDistributionWindow !== undefined && object.rewardDistributionWindow !== null) {\n message.rewardDistributionWindow = object.rewardDistributionWindow;\n }\n else {\n message.rewardDistributionWindow = long_1.default.UZERO;\n }\n if (object.whitelist !== undefined && object.whitelist !== null) {\n for (const e of object.whitelist) {\n message.whitelist.push(exports.Denom.fromPartial(e));\n }\n }\n if (object.slashFraction !== undefined && object.slashFraction !== null) {\n message.slashFraction = object.slashFraction;\n }\n else {\n message.slashFraction = \"\";\n }\n if (object.slashWindow !== undefined && object.slashWindow !== null) {\n message.slashWindow = object.slashWindow;\n }\n else {\n message.slashWindow = long_1.default.UZERO;\n }\n if (object.minValidPerWindow !== undefined && object.minValidPerWindow !== null) {\n message.minValidPerWindow = object.minValidPerWindow;\n }\n else {\n message.minValidPerWindow = \"\";\n }\n return message;\n },\n};\nconst baseDenom = { name: \"\", tobinTax: \"\" };\nexports.Denom = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.name !== \"\") {\n writer.uint32(10).string(message.name);\n }\n if (message.tobinTax !== \"\") {\n writer.uint32(18).string(message.tobinTax);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseDenom);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.name = reader.string();\n break;\n case 2:\n message.tobinTax = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseDenom);\n if (object.name !== undefined && object.name !== null) {\n message.name = String(object.name);\n }\n else {\n message.name = \"\";\n }\n if (object.tobinTax !== undefined && object.tobinTax !== null) {\n message.tobinTax = String(object.tobinTax);\n }\n else {\n message.tobinTax = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.name !== undefined && (obj.name = message.name);\n message.tobinTax !== undefined && (obj.tobinTax = message.tobinTax);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseDenom);\n if (object.name !== undefined && object.name !== null) {\n message.name = object.name;\n }\n else {\n message.name = \"\";\n }\n if (object.tobinTax !== undefined && object.tobinTax !== null) {\n message.tobinTax = object.tobinTax;\n }\n else {\n message.tobinTax = \"\";\n }\n return message;\n },\n};\nconst baseAggregateExchangeRatePrevote = { hash: \"\", voter: \"\", submitBlock: long_1.default.UZERO };\nexports.AggregateExchangeRatePrevote = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.hash !== \"\") {\n writer.uint32(10).string(message.hash);\n }\n if (message.voter !== \"\") {\n writer.uint32(18).string(message.voter);\n }\n if (!message.submitBlock.isZero()) {\n writer.uint32(24).uint64(message.submitBlock);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseAggregateExchangeRatePrevote);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.hash = reader.string();\n break;\n case 2:\n message.voter = reader.string();\n break;\n case 3:\n message.submitBlock = reader.uint64();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseAggregateExchangeRatePrevote);\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = String(object.hash);\n }\n else {\n message.hash = \"\";\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = String(object.voter);\n }\n else {\n message.voter = \"\";\n }\n if (object.submitBlock !== undefined && object.submitBlock !== null) {\n message.submitBlock = long_1.default.fromString(object.submitBlock);\n }\n else {\n message.submitBlock = long_1.default.UZERO;\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.hash !== undefined && (obj.hash = message.hash);\n message.voter !== undefined && (obj.voter = message.voter);\n message.submitBlock !== undefined && (obj.submitBlock = (message.submitBlock || long_1.default.UZERO).toString());\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseAggregateExchangeRatePrevote);\n if (object.hash !== undefined && object.hash !== null) {\n message.hash = object.hash;\n }\n else {\n message.hash = \"\";\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = object.voter;\n }\n else {\n message.voter = \"\";\n }\n if (object.submitBlock !== undefined && object.submitBlock !== null) {\n message.submitBlock = object.submitBlock;\n }\n else {\n message.submitBlock = long_1.default.UZERO;\n }\n return message;\n },\n};\nconst baseAggregateExchangeRateVote = { voter: \"\" };\nexports.AggregateExchangeRateVote = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n for (const v of message.exchangeRateTuples) {\n exports.ExchangeRateTuple.encode(v, writer.uint32(10).fork()).ldelim();\n }\n if (message.voter !== \"\") {\n writer.uint32(18).string(message.voter);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseAggregateExchangeRateVote);\n message.exchangeRateTuples = [];\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.exchangeRateTuples.push(exports.ExchangeRateTuple.decode(reader, reader.uint32()));\n break;\n case 2:\n message.voter = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseAggregateExchangeRateVote);\n message.exchangeRateTuples = [];\n if (object.exchangeRateTuples !== undefined && object.exchangeRateTuples !== null) {\n for (const e of object.exchangeRateTuples) {\n message.exchangeRateTuples.push(exports.ExchangeRateTuple.fromJSON(e));\n }\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = String(object.voter);\n }\n else {\n message.voter = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n if (message.exchangeRateTuples) {\n obj.exchangeRateTuples = message.exchangeRateTuples.map((e) => e ? exports.ExchangeRateTuple.toJSON(e) : undefined);\n }\n else {\n obj.exchangeRateTuples = [];\n }\n message.voter !== undefined && (obj.voter = message.voter);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseAggregateExchangeRateVote);\n message.exchangeRateTuples = [];\n if (object.exchangeRateTuples !== undefined && object.exchangeRateTuples !== null) {\n for (const e of object.exchangeRateTuples) {\n message.exchangeRateTuples.push(exports.ExchangeRateTuple.fromPartial(e));\n }\n }\n if (object.voter !== undefined && object.voter !== null) {\n message.voter = object.voter;\n }\n else {\n message.voter = \"\";\n }\n return message;\n },\n};\nconst baseExchangeRateTuple = { denom: \"\", exchangeRate: \"\" };\nexports.ExchangeRateTuple = {\n encode(message, writer = minimal_1.default.Writer.create()) {\n if (message.denom !== \"\") {\n writer.uint32(10).string(message.denom);\n }\n if (message.exchangeRate !== \"\") {\n writer.uint32(18).string(message.exchangeRate);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = Object.assign({}, baseExchangeRateTuple);\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.denom = reader.string();\n break;\n case 2:\n message.exchangeRate = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n fromJSON(object) {\n const message = Object.assign({}, baseExchangeRateTuple);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = String(object.denom);\n }\n else {\n message.denom = \"\";\n }\n if (object.exchangeRate !== undefined && object.exchangeRate !== null) {\n message.exchangeRate = String(object.exchangeRate);\n }\n else {\n message.exchangeRate = \"\";\n }\n return message;\n },\n toJSON(message) {\n const obj = {};\n message.denom !== undefined && (obj.denom = message.denom);\n message.exchangeRate !== undefined && (obj.exchangeRate = message.exchangeRate);\n return obj;\n },\n fromPartial(object) {\n const message = Object.assign({}, baseExchangeRateTuple);\n if (object.denom !== undefined && object.denom !== null) {\n message.denom = object.denom;\n }\n else {\n message.denom = \"\";\n }\n if (object.exchangeRate !== undefined && object.exchangeRate !== null) {\n message.exchangeRate = object.exchangeRate;\n }\n else {\n message.exchangeRate = \"\";\n }\n return message;\n },\n};\nif (minimal_1.default.util.Long !== long_1.default) {\n minimal_1.default.util.Long = long_1.default;\n minimal_1.default.configure();\n}\n//# sourceMappingURL=oracle.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Delegation = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\nvar Coin_1 = require(\"../Coin\");\nvar staking_1 = require(\"@terra-money/terra.proto/cosmos/staking/v1beta1/staking\");\n/**\n * Stores information about the status of a delegation between a delegator and validator, fetched from the blockchain.\n */\nvar Delegation = /** @class */ (function (_super) {\n __extends(Delegation, _super);\n /**\n * @param delegator_address \tdelegator's account address\n * @param validator_address \tvalidator's operator address\n * @param shares \tdelegator's shares\n * @param balance balance of the delegation\n */\n function Delegation(delegator_address, validator_address, shares, balance) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_address = validator_address;\n _this.shares = shares;\n _this.balance = balance;\n return _this;\n }\n Delegation.fromAmino = function (data) {\n var _a = data.delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = data.balance;\n return new Delegation(delegator_address, validator_address, new numeric_1.Dec(shares), Coin_1.Coin.fromAmino(balance));\n };\n Delegation.prototype.toAmino = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;\n return {\n delegation: {\n delegator_address: delegator_address,\n validator_address: validator_address,\n shares: shares.toString(),\n },\n balance: balance.toAmino(),\n };\n };\n Delegation.fromData = function (data) {\n var _a = data.delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = data.balance;\n return new Delegation(delegator_address, validator_address, new numeric_1.Dec(shares), Coin_1.Coin.fromData(balance));\n };\n Delegation.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;\n return {\n delegation: {\n delegator_address: delegator_address,\n validator_address: validator_address,\n shares: shares.toString(),\n },\n balance: balance.toData(),\n };\n };\n Delegation.fromProto = function (proto) {\n var delegationProto = proto.delegation;\n return new Delegation(delegationProto.delegatorAddress, delegationProto.validatorAddress, new numeric_1.Dec(delegationProto.shares), Coin_1.Coin.fromProto(proto.balance));\n };\n Delegation.prototype.toProto = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;\n return staking_1.DelegationResponse.fromPartial({\n delegation: staking_1.Delegation.fromPartial({\n delegatorAddress: delegator_address,\n shares: shares.toString(),\n validatorAddress: validator_address,\n }),\n balance: balance.toProto(),\n });\n };\n return Delegation;\n}(json_1.JSONSerializable));\nexports.Delegation = Delegation;\n//# sourceMappingURL=Delegation.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Redelegation = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\nvar staking_1 = require(\"@terra-money/terra.proto/cosmos/staking/v1beta1/staking\");\nvar Long = __importStar(require(\"long\"));\n/**\n * A redelegation is when a delegator decides to stop staking with one validator and\n * transfer their delegation to another validator. Rather than unbonding (which takes\n * some time) and re-staking, the funds can be redelegated immediately if a\n * [[Redelegation.Entry]] can be created.\n *\n * A redelegation, like an unbonding delegation, is implemented through\n * [[Redelegation.Entry]] objects, limited by the `max_entry` parameter in the staking\n * module params. For each pair of source and target validators, you cannot redelegate\n * more times than the amount of entries. Entries are cleared when the redelegation is\n * completed, the same amount of time as unbonding.\n */\nvar Redelegation = /** @class */ (function (_super) {\n __extends(Redelegation, _super);\n /**\n *\n * @param delegator_address delegator's account address\n * @param validator_src_address source validator's operator address (from)\n * @param validator_dst_address target validator's operator address (to)\n * @param entries entries\n */\n function Redelegation(delegator_address, validator_src_address, validator_dst_address, entries) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_src_address = validator_src_address;\n _this.validator_dst_address = validator_dst_address;\n _this.entries = entries;\n return _this;\n }\n Redelegation.fromAmino = function (data) {\n var _a = data.redelegation, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = data.entries;\n return new Redelegation(delegator_address, validator_src_address, validator_dst_address, entries.map(function (e) { return Redelegation.Entry.fromAmino(e); }));\n };\n Redelegation.prototype.toAmino = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = _a.entries;\n return {\n redelegation: {\n delegator_address: delegator_address,\n validator_src_address: validator_src_address,\n validator_dst_address: validator_dst_address,\n },\n entries: entries.map(function (e) { return e.toAmino(); }),\n };\n };\n Redelegation.fromData = function (data) {\n var _a = data.redelegation, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = data.entries;\n return new Redelegation(delegator_address, validator_src_address, validator_dst_address, entries.map(function (e) { return Redelegation.Entry.fromData(e); }));\n };\n Redelegation.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = _a.entries;\n return {\n redelegation: {\n delegator_address: delegator_address,\n validator_src_address: validator_src_address,\n validator_dst_address: validator_dst_address,\n },\n entries: entries.map(function (e) { return e.toData(); }),\n };\n };\n Redelegation.fromProto = function (data) {\n var redelegationProto = data.redelegation;\n return new Redelegation(redelegationProto.delegatorAddress, redelegationProto.validatorDstAddress, redelegationProto.validatorDstAddress, data.entries.map(function (e) { return Redelegation.Entry.fromProto(e); }));\n };\n Redelegation.prototype.toProto = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = _a.entries;\n return staking_1.RedelegationResponse.fromPartial({\n entries: entries.map(function (e) { return e.toProto(); }),\n redelegation: staking_1.Redelegation.fromPartial({\n delegatorAddress: delegator_address,\n entries: entries.map(function (e) { return e.toProto().redelegationEntry; }),\n validatorDstAddress: validator_dst_address,\n validatorSrcAddress: validator_src_address,\n }),\n });\n };\n return Redelegation;\n}(json_1.JSONSerializable));\nexports.Redelegation = Redelegation;\n(function (Redelegation) {\n var Entry = /** @class */ (function (_super) {\n __extends(Entry, _super);\n /**\n *\n * @param initial_balance balance of delegation prior to initiating redelegation\n * @param shares_dst\n * @param creation_height \theight of blockchain when entry was created\n * @param completion_time time when redelegation entry will be removed\n */\n function Entry(initial_balance, balance, shares_dst, creation_height, completion_time) {\n var _this = _super.call(this) || this;\n _this.initial_balance = initial_balance;\n _this.balance = balance;\n _this.shares_dst = shares_dst;\n _this.creation_height = creation_height;\n _this.completion_time = completion_time;\n return _this;\n }\n Entry.prototype.toAmino = function () {\n return {\n redelegation_entry: {\n initial_balance: this.initial_balance.toString(),\n shares_dst: this.shares_dst.toString(),\n creation_height: this.creation_height,\n completion_time: this.completion_time.toISOString(),\n },\n balance: this.balance.toString(),\n };\n };\n Entry.fromAmino = function (data) {\n var _a = data.redelegation_entry, initial_balance = _a.initial_balance, shares_dst = _a.shares_dst, creation_height = _a.creation_height, completion_time = _a.completion_time, balance = data.balance;\n return new Entry(new numeric_1.Int(initial_balance), new numeric_1.Int(balance), new numeric_1.Dec(shares_dst), creation_height, new Date(completion_time));\n };\n Entry.prototype.toData = function () {\n return {\n redelegation_entry: {\n initial_balance: this.initial_balance.toString(),\n shares_dst: this.shares_dst.toString(),\n creation_height: this.creation_height,\n completion_time: this.completion_time.toISOString(),\n },\n balance: this.balance.toString(),\n };\n };\n Entry.fromData = function (data) {\n var _a = data.redelegation_entry, initial_balance = _a.initial_balance, shares_dst = _a.shares_dst, creation_height = _a.creation_height, completion_time = _a.completion_time, balance = data.balance;\n return new Entry(new numeric_1.Int(initial_balance), new numeric_1.Int(balance), new numeric_1.Dec(shares_dst), creation_height, new Date(completion_time));\n };\n Entry.prototype.toProto = function () {\n var _a = this, initial_balance = _a.initial_balance, balance = _a.balance, shares_dst = _a.shares_dst, creation_height = _a.creation_height, completion_time = _a.completion_time;\n return staking_1.RedelegationEntryResponse.fromPartial({\n balance: balance.toString(),\n redelegationEntry: staking_1.RedelegationEntry.fromPartial({\n completionTime: completion_time,\n creationHeight: Long.fromNumber(creation_height),\n initialBalance: initial_balance.toString(),\n sharesDst: shares_dst.toString(),\n }),\n });\n };\n Entry.fromProto = function (proto) {\n var redelegationEntryProto = proto.redelegationEntry;\n return new Entry(new numeric_1.Int(redelegationEntryProto.initialBalance), new numeric_1.Int(proto.balance), new numeric_1.Dec(redelegationEntryProto.sharesDst), redelegationEntryProto.creationHeight.toNumber(), redelegationEntryProto.completionTime);\n };\n return Entry;\n }(json_1.JSONSerializable));\n Redelegation.Entry = Entry;\n})(Redelegation = exports.Redelegation || (exports.Redelegation = {}));\nexports.Redelegation = Redelegation;\n//# sourceMappingURL=Redelegation.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Key = void 0;\nvar bech32_1 = require(\"bech32\");\nvar core_1 = require(\"../core\");\nvar SignatureV2_1 = require(\"../core/SignatureV2\");\nvar signing_1 = require(\"@terra-money/terra.proto/cosmos/tx/signing/v1beta1/signing\");\n/**\n * Abstract key interface that provides transaction signing features and Bech32 address\n * and public key derivation from a public key. This allows you to create custom key\n * solutions, such as for various hardware wallets, by implementing signing and calling\n * `super` with the raw public key from within your subclass. See [[MnemonicKey]] for\n * an implementation of a basic mnemonic-based key.\n */\nvar Key = /** @class */ (function () {\n /**\n * Called to derive the relevant account and validator addresses and public keys from\n * the raw compressed public key in bytes.\n *\n * @param publicKey raw compressed bytes public key\n */\n function Key(publicKey) {\n this.publicKey = publicKey;\n }\n Object.defineProperty(Key.prototype, \"accAddress\", {\n /**\n * Terra account address. `terra-` prefixed.\n */\n get: function () {\n if (!this.publicKey) {\n throw new Error('Could not compute accAddress: missing rawAddress');\n }\n return this.publicKey.address();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Key.prototype, \"valAddress\", {\n /**\n * Terra validator address. `terravaloper-` prefixed.\n */\n get: function () {\n if (!this.publicKey) {\n throw new Error('Could not compute valAddress: missing rawAddress');\n }\n return bech32_1.bech32.encode('terravaloper', this.publicKey.rawAddress());\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Signs a [[StdSignMsg]] with the method supplied by the child class.\n * only used Amino sign\n *\n * @param tx sign-message of the transaction to sign\n */\n Key.prototype.createSignatureAmino = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, _b, _c, _d, _e, _f, _g;\n return __generator(this, function (_h) {\n switch (_h.label) {\n case 0:\n if (!this.publicKey) {\n throw new Error('Signature could not be created: Key instance missing publicKey');\n }\n _a = SignatureV2_1.SignatureV2.bind;\n _b = [void 0, this.publicKey];\n _d = (_c = SignatureV2_1.SignatureV2.Descriptor).bind;\n _f = (_e = SignatureV2_1.SignatureV2.Descriptor.Single).bind;\n _g = [void 0, signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON];\n return [4 /*yield*/, this.sign(Buffer.from(tx.toAminoJSON()))];\n case 1: return [2 /*return*/, new (_a.apply(SignatureV2_1.SignatureV2, _b.concat([new (_d.apply(_c, [void 0, new (_f.apply(_e, _g.concat([(_h.sent()).toString('base64')])))()]))(),\n tx.sequence])))()];\n }\n });\n });\n };\n /**\n * Signs a [[SignDoc]] with the method supplied by the child class.\n *\n * @param tx sign-message of the transaction to sign\n */\n Key.prototype.createSignature = function (signDoc) {\n return __awaiter(this, void 0, void 0, function () {\n var signerInfos, sigBytes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.publicKey) {\n throw new Error('Signature could not be created: Key instance missing publicKey');\n }\n signerInfos = signDoc.auth_info.signer_infos;\n signDoc.auth_info.signer_infos = [\n new core_1.SignerInfo(this.publicKey, signDoc.sequence, new core_1.ModeInfo(new core_1.ModeInfo.Single(signing_1.SignMode.SIGN_MODE_DIRECT))),\n ];\n return [4 /*yield*/, this.sign(Buffer.from(signDoc.toBytes()))];\n case 1:\n sigBytes = (_a.sent()).toString('base64');\n // restore signDoc to origin\n signDoc.auth_info.signer_infos = signerInfos;\n return [2 /*return*/, new SignatureV2_1.SignatureV2(this.publicKey, new SignatureV2_1.SignatureV2.Descriptor(new SignatureV2_1.SignatureV2.Descriptor.Single(signing_1.SignMode.SIGN_MODE_DIRECT, sigBytes)), signDoc.sequence)];\n }\n });\n });\n };\n /**\n * Signs a [[Tx]] and adds the signature to a generated StdTx that is ready to be broadcasted.\n * @param tx\n */\n Key.prototype.signTx = function (tx, options) {\n return __awaiter(this, void 0, void 0, function () {\n var copyTx, sign_doc, signature, sigData;\n var _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n copyTx = new core_1.Tx(tx.body, new core_1.AuthInfo([], tx.auth_info.fee), []);\n sign_doc = new core_1.SignDoc(options.chainID, options.accountNumber, options.sequence, copyTx.auth_info, copyTx.body);\n if (!(options.signMode === signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.createSignatureAmino(sign_doc)];\n case 1:\n signature = _c.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.createSignature(sign_doc)];\n case 3:\n signature = _c.sent();\n _c.label = 4;\n case 4:\n sigData = signature.data.single;\n (_a = copyTx.signatures).push.apply(_a, __spreadArray(__spreadArray([], tx.signatures, false), [sigData.signature], false));\n (_b = copyTx.auth_info.signer_infos).push.apply(_b, __spreadArray(__spreadArray([], tx.auth_info.signer_infos, false), [new core_1.SignerInfo(signature.public_key, signature.sequence, new core_1.ModeInfo(new core_1.ModeInfo.Single(sigData.mode)))], false));\n return [2 /*return*/, copyTx];\n }\n });\n });\n };\n return Key;\n}());\nexports.Key = Key;\n//# sourceMappingURL=Key.js.map","\"use strict\";\n// Adapted from https://github.com/terra-money/terra-js/blob/master/src/utils/keyUtils.ts\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MnemonicKey = exports.LUNA_COIN_TYPE = void 0;\nvar bip32 = __importStar(require(\"bip32\"));\nvar bip39 = __importStar(require(\"bip39\"));\nvar RawKey_1 = require(\"./RawKey\");\nexports.LUNA_COIN_TYPE = 330;\nvar DEFAULT_OPTIONS = {\n account: 0,\n index: 0,\n coinType: exports.LUNA_COIN_TYPE,\n};\n/**\n * Implements a BIP39 mnemonic wallet with standard key derivation from a word list. Note\n * that this implementation exposes the private key in memory, so it is not advised to use\n * for applications requiring high security.\n */\nvar MnemonicKey = /** @class */ (function (_super) {\n __extends(MnemonicKey, _super);\n /**\n * Creates a new signing key from a mnemonic phrase. If no mnemonic is provided, one\n * will be automatically generated.\n *\n * ### Providing a mnemonic\n *\n * ```ts\n * import { MnemonicKey } from 'terra.js';\n *\n * const mk = new MnemonicKey({ mnemonic: '...' });\n * console.log(mk.accAddress);\n * ```\n *\n * ### Generating a random mnemonic\n *\n * ```ts\n * const mk2 = new MnemonicKey();\n * console.log(mk2.mnemonic);\n * ```\n *\n * @param options\n */\n function MnemonicKey(options) {\n if (options === void 0) { options = {}; }\n var _this = this;\n var _a = __assign(__assign({}, DEFAULT_OPTIONS), options), account = _a.account, index = _a.index, coinType = _a.coinType;\n var mnemonic = options.mnemonic;\n if (mnemonic === undefined) {\n mnemonic = bip39.generateMnemonic(256);\n }\n var seed = bip39.mnemonicToSeedSync(mnemonic);\n var masterKey = bip32.fromSeed(seed);\n var hdPathLuna = \"m/44'/\" + coinType + \"'/\" + account + \"'/0/\" + index;\n var terraHD = masterKey.derivePath(hdPathLuna);\n var privateKey = terraHD.privateKey;\n if (!privateKey) {\n throw new Error('Failed to derive key pair');\n }\n _this = _super.call(this, privateKey) || this;\n _this.mnemonic = mnemonic;\n return _this;\n }\n return MnemonicKey;\n}(RawKey_1.RawKey));\nexports.MnemonicKey = MnemonicKey;\n//# sourceMappingURL=MnemonicKey.js.map","'use strict'\nvar inherits = require('inherits')\nvar HashBase = require('hash-base')\nvar Buffer = require('safe-buffer').Buffer\n\nvar ARRAY16 = new Array(16)\n\nfunction MD5 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n}\n\ninherits(MD5, HashBase)\n\nMD5.prototype._update = function () {\n var M = ARRAY16\n for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)\n\n var a = this._a\n var b = this._b\n var c = this._c\n var d = this._d\n\n a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)\n d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)\n c = fnF(c, d, a, b, M[2], 0x242070db, 17)\n b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)\n a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)\n d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)\n c = fnF(c, d, a, b, M[6], 0xa8304613, 17)\n b = fnF(b, c, d, a, M[7], 0xfd469501, 22)\n a = fnF(a, b, c, d, M[8], 0x698098d8, 7)\n d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)\n c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)\n b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)\n a = fnF(a, b, c, d, M[12], 0x6b901122, 7)\n d = fnF(d, a, b, c, M[13], 0xfd987193, 12)\n c = fnF(c, d, a, b, M[14], 0xa679438e, 17)\n b = fnF(b, c, d, a, M[15], 0x49b40821, 22)\n\n a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)\n d = fnG(d, a, b, c, M[6], 0xc040b340, 9)\n c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)\n b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)\n a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)\n d = fnG(d, a, b, c, M[10], 0x02441453, 9)\n c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)\n b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)\n a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)\n d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)\n c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)\n b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)\n a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)\n d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)\n c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)\n b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)\n\n a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)\n d = fnH(d, a, b, c, M[8], 0x8771f681, 11)\n c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)\n b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)\n a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)\n d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)\n c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)\n b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)\n a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)\n d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)\n c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)\n b = fnH(b, c, d, a, M[6], 0x04881d05, 23)\n a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)\n d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)\n c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)\n b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)\n\n a = fnI(a, b, c, d, M[0], 0xf4292244, 6)\n d = fnI(d, a, b, c, M[7], 0x432aff97, 10)\n c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)\n b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)\n a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)\n d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)\n c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)\n b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)\n a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)\n d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)\n c = fnI(c, d, a, b, M[6], 0xa3014314, 15)\n b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)\n a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)\n d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)\n c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)\n b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)\n\n this._a = (this._a + a) | 0\n this._b = (this._b + b) | 0\n this._c = (this._c + c) | 0\n this._d = (this._d + d) | 0\n}\n\nMD5.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = Buffer.allocUnsafe(16)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fnF (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnG (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnH (a, b, c, d, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnI (a, b, c, d, m, k, s) {\n return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0\n}\n\nmodule.exports = MD5\n","'use strict'\nvar Buffer = require('safe-buffer').Buffer\nvar Transform = require('readable-stream').Transform\nvar inherits = require('inherits')\n\nfunction throwIfNotStringOrBuffer (val, prefix) {\n if (!Buffer.isBuffer(val) && typeof val !== 'string') {\n throw new TypeError(prefix + ' must be a string or a buffer')\n }\n}\n\nfunction HashBase (blockSize) {\n Transform.call(this)\n\n this._block = Buffer.allocUnsafe(blockSize)\n this._blockSize = blockSize\n this._blockOffset = 0\n this._length = [0, 0, 0, 0]\n\n this._finalized = false\n}\n\ninherits(HashBase, Transform)\n\nHashBase.prototype._transform = function (chunk, encoding, callback) {\n var error = null\n try {\n this.update(chunk, encoding)\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype._flush = function (callback) {\n var error = null\n try {\n this.push(this.digest())\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype.update = function (data, encoding) {\n throwIfNotStringOrBuffer(data, 'Data')\n if (this._finalized) throw new Error('Digest already called')\n if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)\n\n // consume data\n var block = this._block\n var offset = 0\n while (this._blockOffset + data.length - offset >= this._blockSize) {\n for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\n this._update()\n this._blockOffset = 0\n }\n while (offset < data.length) block[this._blockOffset++] = data[offset++]\n\n // update length\n for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\n this._length[j] += carry\n carry = (this._length[j] / 0x0100000000) | 0\n if (carry > 0) this._length[j] -= 0x0100000000 * carry\n }\n\n return this\n}\n\nHashBase.prototype._update = function () {\n throw new Error('_update is not implemented')\n}\n\nHashBase.prototype.digest = function (encoding) {\n if (this._finalized) throw new Error('Digest already called')\n this._finalized = true\n\n var digest = this._digest()\n if (encoding !== undefined) digest = digest.toString(encoding)\n\n // reset state\n this._block.fill(0)\n this._blockOffset = 0\n for (var i = 0; i < 4; ++i) this._length[i] = 0\n\n return digest\n}\n\nHashBase.prototype._digest = function () {\n throw new Error('_digest is not implemented')\n}\n\nmodule.exports = HashBase\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\nexports.finished = require('./lib/internal/streams/end-of-stream.js');\nexports.pipeline = require('./lib/internal/streams/pipeline.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nmodule.exports = Readable;\n/**/\n\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n/**/\n\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\n\n\nvar Stream = require('./internal/streams/stream');\n/**/\n\n\nvar Buffer = require('buffer').Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/**/\n\n\nvar debugUtil = require('util');\n\nvar debug;\n\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\n\nvar BufferList = require('./internal/streams/buffer_list');\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.\n\n\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\n\nrequire('inherits')(Readable, Stream);\n\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n\n this.sync = true; // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')\n\n this.autoDestroy = !!options.autoDestroy; // has it been destroyed\n\n this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s\n\n this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled\n\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex); // legacy\n\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\n\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n}; // Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\n\n\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n}; // Unshift should *always* be something directly out of read()\n\n\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n } // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n\n\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n\n return er;\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n}; // backwards compatibility.\n\n\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8\n\n this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:\n\n var p = this._readableState.buffer.head;\n var content = '';\n\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n\n this._readableState.buffer.clear();\n\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n}; // Don't raise the hwm > 1GB\n\n\nvar MAX_HWM = 0x40000000;\n\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n\n return n;\n} // This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.\n\n\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.\n\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n } // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n // if we need a readable event, then we need to do some reading.\n\n\n var doRead = state.needReadable;\n debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some\n\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n } // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n\n\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true; // if the length is currently zero, then we *need* a readable event.\n\n if (state.length === 0) state.needReadable = true; // call internal read method\n\n this._read(state.highWaterMark);\n\n state.sync = false; // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.\n\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n\n if (state.decoder) {\n var chunk = state.decoder.end();\n\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n\n state.ended = true;\n\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n} // Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\n\n\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\n\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n } // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n\n\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n} // at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\n\n\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length) // didn't get any data, stop spinning.\n break;\n }\n\n state.readingMore = false;\n} // abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\n\n\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n\n default:\n state.pipes.push(dest);\n break;\n }\n\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n } // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n\n\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n\n function cleanup() {\n debug('cleanup'); // cleanup event handlers once the pipe is broken\n\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true; // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n src.on('data', ondata);\n\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n\n src.pause();\n }\n } // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n\n\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.\n\n\n prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.\n\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n\n dest.once('close', onclose);\n\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n } // tell the dest that it's being piped to\n\n\n dest.emit('pipe', src); // start the flow if it hasn't been started already.\n\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n }; // if we're not piping anywhere, then do nothing.\n\n if (state.pipesCount === 0) return this; // just one destination. most common case.\n\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes; // got a match.\n\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n } // slow case. multiple pipe destinations.\n\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n }\n\n return this;\n } // try to find the right one.\n\n\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n}; // set up data events if they are asked for\n// Ensure readable listeners eventually get something\n\n\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused\n\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n\n return res;\n};\n\nReadable.prototype.addListener = Readable.prototype.on;\n\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true; // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n} // pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\n\n\nReadable.prototype.resume = function () {\n var state = this._readableState;\n\n if (!state.flowing) {\n debug('resume'); // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n\n state.paused = false;\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n\n if (!state.reading) {\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n\n this._readableState.paused = true;\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n\n while (state.flowing && stream.read() !== null) {\n ;\n }\n} // wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\n\n\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode\n\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n\n if (!ret) {\n paused = true;\n stream.pause();\n }\n }); // proxy all the other methods.\n // important when wrapping filters and duplexes.\n\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n } // proxy certain important events.\n\n\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n } // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n\n\n this._read = function (n) {\n debug('wrapped _read', n);\n\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n\n return createReadableStreamAsyncIterator(this);\n };\n}\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n}); // exposed for testing purposes only.\n\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n}); // Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.\n\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\n\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n\n return from(Readable, iterable, opts);\n };\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n\n return -1;\n}","module.exports = require('events').EventEmitter;\n","'use strict'; // undocumented cb() API, needed for core, not for public API\n\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n process.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n process.nextTick(emitErrorNT, this, err);\n }\n }\n\n return this;\n } // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n } // if this is a duplex stream mark the writable part as destroyed as well\n\n\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n } else if (cb) {\n process.nextTick(emitCloseNT, _this);\n cb(err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n });\n\n return this;\n}\n\nfunction emitErrorAndCloseNT(self, err) {\n emitErrorNT(self, err);\n emitCloseNT(self);\n}\n\nfunction emitCloseNT(self) {\n if (self._writableState && !self._writableState.emitClose) return;\n if (self._readableState && !self._readableState.emitClose) return;\n self.emit('close');\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nfunction errorOrDestroy(stream, err) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n var rState = stream._readableState;\n var wState = stream._writableState;\n if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy,\n errorOrDestroy: errorOrDestroy\n};","'use strict';\n\nvar ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;\n\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;\n}\n\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n\n if (hwm != null) {\n if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {\n var name = isDuplex ? duplexKey : 'highWaterMark';\n throw new ERR_INVALID_OPT_VALUE(name, hwm);\n }\n\n return Math.floor(hwm);\n } // Default value\n\n\n return state.objectMode ? 16 : 16 * 1024;\n}\n\nmodule.exports = {\n getHighWaterMark: getHighWaterMark\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n'use strict';\n\nmodule.exports = Writable;\n/* */\n\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n} // It seems a linked list but it is not\n// there will be only 2 of these for each stream\n\n\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\n\n\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n/**/\n\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\n\nvar Stream = require('./internal/streams/stream');\n/**/\n\n\nvar Buffer = require('buffer').Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,\n ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;\n\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\n\nrequire('inherits')(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream,\n // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n\n this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called\n\n this.finalCalled = false; // drain event flag.\n\n this.needDrain = false; // at the start of calling end()\n\n this.ending = false; // when end() has been called, and returned\n\n this.ended = false; // when 'finish' is emitted\n\n this.finished = false; // has it been destroyed\n\n this.destroyed = false; // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n\n this.length = 0; // a flag to see when we're in the middle of a write.\n\n this.writing = false; // when true all writes will be buffered until .uncork() call\n\n this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n\n this.sync = true; // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n\n this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)\n\n this.onwrite = function (er) {\n onwrite(stream, er);\n }; // the callback that the user supplies to write(chunk,encoding,cb)\n\n\n this.writecb = null; // the amount that is being written when _write is called.\n\n this.writelen = 0;\n this.bufferedRequest = null;\n this.lastBufferedRequest = null; // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n\n this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n\n this.prefinished = false; // True if the error was already emitted and should not be thrown again\n\n this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end')\n\n this.autoDestroy = !!options.autoDestroy; // count buffered requests\n\n this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n\n while (current) {\n out.push(current);\n current = current.next;\n }\n\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function writableStateBufferGetter() {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})(); // Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\n\n\nvar realHasInstance;\n\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function value(object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function realHasInstance(object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the WritableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);\n this._writableState = new WritableState(options, this, isDuplex); // legacy.\n\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n if (typeof options.writev === 'function') this._writev = options.writev;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n} // Otherwise people can pipe Writable streams, which is just wrong.\n\n\nWritable.prototype.pipe = function () {\n errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb\n\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n} // Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\n\n\nfunction validChunk(stream, state, chunk, cb) {\n var er;\n\n if (chunk === null) {\n er = new ERR_STREAM_NULL_VALUES();\n } else if (typeof chunk !== 'string' && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);\n }\n\n if (er) {\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n return false;\n }\n\n return true;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n if (typeof cb !== 'function') cb = nop;\n if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n return ret;\n};\n\nWritable.prototype.cork = function () {\n this._writableState.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nObject.defineProperty(Writable.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n}); // if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\n\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n\n var len = state.objectMode ? 1 : chunk.length;\n state.length += len;\n var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.\n\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n process.nextTick(cb, er); // this can emit finish, and it will always happen\n // after error\n\n process.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er); // this can emit finish, but finish must\n // always follow error\n\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();\n onwriteStateUpdate(state);\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state) || stream.destroyed;\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n process.nextTick(afterWrite, stream, state, finished, cb);\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n} // Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\n\n\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it\n\n\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n var count = 0;\n var allBuffers = true;\n\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n\n buffer.allBuffers = allBuffers;\n doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n\n state.pendingcb++;\n state.lastBufferedRequest = null;\n\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks\n\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n } // ignore unnecessary end() calls.\n\n\n if (!state.ending) endWritable(this, state, cb);\n return this;\n};\n\nObject.defineProperty(Writable.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\n\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n\n if (err) {\n errorOrDestroy(stream, err);\n }\n\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\n\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function' && !state.destroyed) {\n state.pendingcb++;\n state.finalCalled = true;\n process.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n\n if (need) {\n prefinish(stream, state);\n\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the readable side is ready for autoDestroy as well\n var rState = stream._readableState;\n\n if (!rState || rState.autoDestroy && rState.endEmitted) {\n stream.destroy();\n }\n }\n }\n }\n\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n\n if (cb) {\n if (state.finished) process.nextTick(cb);else stream.once('finish', cb);\n }\n\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n } // reuse the free corkReq.\n\n\n state.corkedRequestsFree.next = corkReq;\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._writableState === undefined) {\n return false;\n }\n\n return this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._writableState.destroyed = value;\n }\n});\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\n\nWritable.prototype._destroy = function (err, cb) {\n cb(err);\n};","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n'use strict';\n\nmodule.exports = Transform;\n\nvar _require$codes = require('../errors').codes,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,\n ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;\n\nvar Duplex = require('./_stream_duplex');\n\nrequire('inherits')(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n var cb = ts.writecb;\n\n if (cb === null) {\n return this.emit('error', new ERR_MULTIPLE_CALLBACK());\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n cb(er);\n var rs = this._readableState;\n rs.reading = false;\n\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n Duplex.call(this, options);\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n }; // start out asking for a readable event once data is transformed.\n\n this._readableState.needReadable = true; // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n if (typeof options.flush === 'function') this._flush = options.flush;\n } // When the writable side finishes, then flush out anything remaining.\n\n\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function' && !this._readableState.destroyed) {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n}; // This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\n\n\nTransform.prototype._transform = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n}; // Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\n\n\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && !ts.transforming) {\n ts.transforming = true;\n\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data); // TODO(BridgeAR): Write a test for these two error cases\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n\n if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();\n if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();\n return stream.push(null);\n}","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Readable;\n\n/**/\nvar isArray = require('isarray');\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","module.exports = require('events').EventEmitter;\n","'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","'use strict'\nvar inherits = require('inherits')\nvar Legacy = require('./legacy')\nvar Base = require('cipher-base')\nvar Buffer = require('safe-buffer').Buffer\nvar md5 = require('create-hash/md5')\nvar RIPEMD160 = require('ripemd160')\n\nvar sha = require('sha.js')\n\nvar ZEROS = Buffer.alloc(128)\n\nfunction Hmac (alg, key) {\n Base.call(this, 'digest')\n if (typeof key === 'string') {\n key = Buffer.from(key)\n }\n\n var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n this._alg = alg\n this._key = key\n if (key.length > blocksize) {\n var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n key = hash.update(key).digest()\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n this._hash.update(ipad)\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHmac.prototype._final = function () {\n var h = this._hash.digest()\n var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)\n return hash.update(this._opad).update(h).digest()\n}\n\nmodule.exports = function createHmac (alg, key) {\n alg = alg.toLowerCase()\n if (alg === 'rmd160' || alg === 'ripemd160') {\n return new Hmac('rmd160', key)\n }\n if (alg === 'md5') {\n return new Legacy(md5, key)\n }\n return new Hmac(alg, key)\n}\n","var MD5 = require('md5.js')\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest()\n}\n","'use strict'\n\nvar createHash = require('create-hash')\nvar bs58checkBase = require('./base')\n\n// SHA256(SHA256(buffer))\nfunction sha256x2 (buffer) {\n var tmp = createHash('sha256').update(buffer).digest()\n return createHash('sha256').update(tmp).digest()\n}\n\nmodule.exports = bs58checkBase(sha256x2)\n","var native = require('./native')\n\nfunction getTypeName (fn) {\n return fn.name || fn.toString().match(/function (.*?)\\s*\\(/)[1]\n}\n\nfunction getValueTypeName (value) {\n return native.Nil(value) ? '' : getTypeName(value.constructor)\n}\n\nfunction getValue (value) {\n if (native.Function(value)) return ''\n if (native.String(value)) return JSON.stringify(value)\n if (value && native.Object(value)) return ''\n return value\n}\n\nfunction captureStackTrace (e, t) {\n if (Error.captureStackTrace) {\n Error.captureStackTrace(e, t)\n }\n}\n\nfunction tfJSON (type) {\n if (native.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type)\n if (native.Array(type)) return 'Array'\n if (type && native.Object(type)) return 'Object'\n\n return type !== undefined ? type : ''\n}\n\nfunction tfErrorString (type, value, valueTypeName) {\n var valueJson = getValue(value)\n\n return 'Expected ' + tfJSON(type) + ', got' +\n (valueTypeName !== '' ? ' ' + valueTypeName : '') +\n (valueJson !== '' ? ' ' + valueJson : '')\n}\n\nfunction TfTypeError (type, value, valueTypeName) {\n valueTypeName = valueTypeName || getValueTypeName(value)\n this.message = tfErrorString(type, value, valueTypeName)\n\n captureStackTrace(this, TfTypeError)\n this.__type = type\n this.__value = value\n this.__valueTypeName = valueTypeName\n}\n\nTfTypeError.prototype = Object.create(Error.prototype)\nTfTypeError.prototype.constructor = TfTypeError\n\nfunction tfPropertyErrorString (type, label, name, value, valueTypeName) {\n var description = '\" of type '\n if (label === 'key') description = '\" with key type '\n\n return tfErrorString('property \"' + tfJSON(name) + description + tfJSON(type), value, valueTypeName)\n}\n\nfunction TfPropertyTypeError (type, property, label, value, valueTypeName) {\n if (type) {\n valueTypeName = valueTypeName || getValueTypeName(value)\n this.message = tfPropertyErrorString(type, label, property, value, valueTypeName)\n } else {\n this.message = 'Unexpected property \"' + property + '\"'\n }\n\n captureStackTrace(this, TfTypeError)\n this.__label = label\n this.__property = property\n this.__type = type\n this.__value = value\n this.__valueTypeName = valueTypeName\n}\n\nTfPropertyTypeError.prototype = Object.create(Error.prototype)\nTfPropertyTypeError.prototype.constructor = TfTypeError\n\nfunction tfCustomError (expected, actual) {\n return new TfTypeError(expected, {}, actual)\n}\n\nfunction tfSubError (e, property, label) {\n // sub child?\n if (e instanceof TfPropertyTypeError) {\n property = property + '.' + e.__property\n\n e = new TfPropertyTypeError(\n e.__type, property, e.__label, e.__value, e.__valueTypeName\n )\n\n // child?\n } else if (e instanceof TfTypeError) {\n e = new TfPropertyTypeError(\n e.__type, property, label, e.__value, e.__valueTypeName\n )\n }\n\n captureStackTrace(e)\n return e\n}\n\nmodule.exports = {\n TfTypeError: TfTypeError,\n TfPropertyTypeError: TfPropertyTypeError,\n tfCustomError: tfCustomError,\n tfSubError: tfSubError,\n tfJSON: tfJSON,\n getValueTypeName: getValueTypeName\n}\n","var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs\n\nmodule.exports = function (iterations, keylen) {\n if (typeof iterations !== 'number') {\n throw new TypeError('Iterations not a number')\n }\n\n if (iterations < 0) {\n throw new TypeError('Bad iterations')\n }\n\n if (typeof keylen !== 'number') {\n throw new TypeError('Key length not a number')\n }\n\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */\n throw new TypeError('Bad key length')\n }\n}\n","var defaultEncoding\n/* istanbul ignore next */\nif (global.process && global.process.browser) {\n defaultEncoding = 'utf-8'\n} else if (global.process && global.process.version) {\n var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)\n\n defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'\n} else {\n defaultEncoding = 'utf-8'\n}\nmodule.exports = defaultEncoding\n","var md5 = require('create-hash/md5')\nvar RIPEMD160 = require('ripemd160')\nvar sha = require('sha.js')\nvar Buffer = require('safe-buffer').Buffer\n\nvar checkParameters = require('./precondition')\nvar defaultEncoding = require('./default-encoding')\nvar toBuffer = require('./to-buffer')\n\nvar ZEROS = Buffer.alloc(128)\nvar sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n}\n\nfunction Hmac (alg, key, saltLen) {\n var hash = getDigest(alg)\n var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n if (key.length > blocksize) {\n key = hash(key)\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])\n var opad = Buffer.allocUnsafe(blocksize + sizes[alg])\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)\n ipad.copy(ipad1, 0, 0, blocksize)\n this.ipad1 = ipad1\n this.ipad2 = ipad\n this.opad = opad\n this.alg = alg\n this.blocksize = blocksize\n this.hash = hash\n this.size = sizes[alg]\n}\n\nHmac.prototype.run = function (data, ipad) {\n data.copy(ipad, this.blocksize)\n var h = this.hash(ipad)\n h.copy(this.opad, this.blocksize)\n return this.hash(this.opad)\n}\n\nfunction getDigest (alg) {\n function shaFunc (data) {\n return sha(alg).update(data).digest()\n }\n function rmd160Func (data) {\n return new RIPEMD160().update(data).digest()\n }\n\n if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func\n if (alg === 'md5') return md5\n return shaFunc\n}\n\nfunction pbkdf2 (password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen)\n password = toBuffer(password, defaultEncoding, 'Password')\n salt = toBuffer(salt, defaultEncoding, 'Salt')\n\n digest = digest || 'sha1'\n\n var hmac = new Hmac(digest, password, salt.length)\n\n var DK = Buffer.allocUnsafe(keylen)\n var block1 = Buffer.allocUnsafe(salt.length + 4)\n salt.copy(block1, 0, 0, salt.length)\n\n var destPos = 0\n var hLen = sizes[digest]\n var l = Math.ceil(keylen / hLen)\n\n for (var i = 1; i <= l; i++) {\n block1.writeUInt32BE(i, salt.length)\n\n var T = hmac.run(block1, hmac.ipad1)\n var U = T\n\n for (var j = 1; j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2)\n for (var k = 0; k < hLen; k++) T[k] ^= U[k]\n }\n\n T.copy(DK, destPos)\n destPos += hLen\n }\n\n return DK\n}\n\nmodule.exports = pbkdf2\n","var Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function (thing, encoding, name) {\n if (Buffer.isBuffer(thing)) {\n return thing\n } else if (typeof thing === 'string') {\n return Buffer.from(thing, encoding)\n } else if (ArrayBuffer.isView(thing)) {\n return Buffer.from(thing.buffer)\n } else {\n throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// browserify by default only pulls in files that are hard coded in requires\n// In order of last to first in this file, the default wordlist will be chosen\n// based on what is present. (Bundles may remove wordlists they don't need)\nconst wordlists = {};\nexports.wordlists = wordlists;\nlet _default;\nexports._default = _default;\ntry {\n exports._default = _default = require('./wordlists/czech.json');\n wordlists.czech = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/chinese_simplified.json');\n wordlists.chinese_simplified = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/chinese_traditional.json');\n wordlists.chinese_traditional = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/korean.json');\n wordlists.korean = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/french.json');\n wordlists.french = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/italian.json');\n wordlists.italian = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/spanish.json');\n wordlists.spanish = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/japanese.json');\n wordlists.japanese = _default;\n wordlists.JA = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/portuguese.json');\n wordlists.portuguese = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/english.json');\n wordlists.english = _default;\n wordlists.EN = _default;\n}\ncatch (err) { }\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RawKey = void 0;\nvar jscrypto_1 = require(\"jscrypto\");\nvar secp256k1 = __importStar(require(\"secp256k1\"));\nvar Key_1 = require(\"./Key\");\nvar PublicKey_1 = require(\"../core/PublicKey\");\n/**\n * An implementation of the Key interfaces that uses a raw private key.\n */\nvar RawKey = /** @class */ (function (_super) {\n __extends(RawKey, _super);\n function RawKey(privateKey) {\n var _this = this;\n var publicKey = secp256k1.publicKeyCreate(new Uint8Array(privateKey), true);\n _this = _super.call(this, new PublicKey_1.SimplePublicKey(Buffer.from(publicKey).toString('base64'))) || this;\n _this.privateKey = privateKey;\n return _this;\n }\n RawKey.prototype.ecdsaSign = function (payload) {\n var hash = Buffer.from(jscrypto_1.SHA256.hash(new jscrypto_1.Word32Array(payload)).toString(), 'hex');\n return secp256k1.ecdsaSign(Uint8Array.from(hash), Uint8Array.from(this.privateKey));\n };\n RawKey.prototype.sign = function (payload) {\n return __awaiter(this, void 0, void 0, function () {\n var signature;\n return __generator(this, function (_a) {\n signature = this.ecdsaSign(payload).signature;\n return [2 /*return*/, Buffer.from(signature)];\n });\n });\n };\n return RawKey;\n}(Key_1.Key));\nexports.RawKey = RawKey;\n//# sourceMappingURL=RawKey.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LCDClient = void 0;\nvar APIRequester_1 = require(\"./APIRequester\");\nvar api_1 = require(\"./api\");\nvar LCDUtils_1 = require(\"./LCDUtils\");\nvar Wallet_1 = require(\"./Wallet\");\nvar DEFAULT_LCD_OPTIONS = {\n gasAdjustment: 1.75,\n};\nvar DEFAULT_GAS_PRICES_BY_CHAIN_ID = {\n default: {\n uluna: 0.15,\n },\n 'columbus-4': {\n uluna: 0.015,\n },\n 'tequila-0004': {\n uluna: 0.15,\n },\n};\n/**\n * An object repesenting a connection to a terrad node running the Lite Client Daemon (LCD)\n * server, a REST server providing access to a node.\n *\n * ### Example\n *\n * ```ts\n * import { LCDClient, Coin } from 'terra.js';\n *\n * const terra = new LCDClient({\n * URL: \"https://lcd.terra.dev\",\n * chainID: \"columbus-3\"\n * });\n *\n * terra.market.swapRate(new Coin('uluna', 10000), 'ukrw').then(c => console.log(c.toString()));\n * ```\n */\nvar LCDClient = /** @class */ (function () {\n /**\n * Creates a new LCD client with the specified configuration.\n *\n * @param config LCD configuration\n */\n function LCDClient(config) {\n this.config = __assign(__assign(__assign({}, DEFAULT_LCD_OPTIONS), { gasPrices: DEFAULT_GAS_PRICES_BY_CHAIN_ID[config.chainID] ||\n DEFAULT_GAS_PRICES_BY_CHAIN_ID['default'] }), config);\n this.apiRequester = new APIRequester_1.APIRequester(this.config.URL);\n // instantiate APIs\n this.auth = new api_1.AuthAPI(this.apiRequester);\n this.bank = new api_1.BankAPI(this.apiRequester);\n this.distribution = new api_1.DistributionAPI(this.apiRequester);\n this.gov = new api_1.GovAPI(this.apiRequester);\n this.market = new api_1.MarketAPI(this.apiRequester);\n this.mint = new api_1.MintAPI(this.apiRequester);\n this.authz = new api_1.AuthzAPI(this.apiRequester);\n this.oracle = new api_1.OracleAPI(this.apiRequester);\n this.slashing = new api_1.SlashingAPI(this.apiRequester);\n this.staking = new api_1.StakingAPI(this.apiRequester);\n this.tendermint = new api_1.TendermintAPI(this.apiRequester);\n this.treasury = new api_1.TreasuryAPI(this.apiRequester);\n this.wasm = new api_1.WasmAPI(this.apiRequester);\n this.ibcTransfer = new api_1.IbcTransferAPI(this.apiRequester);\n this.tx = new api_1.TxAPI(this);\n this.utils = new LCDUtils_1.LCDUtils(this);\n }\n /** Creates a new wallet with the Key. */\n LCDClient.prototype.wallet = function (key) {\n return new Wallet_1.Wallet(this, key);\n };\n return LCDClient;\n}());\nexports.LCDClient = LCDClient;\n//# sourceMappingURL=LCDClient.js.map","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./AuthAPI\"), exports);\n__exportStar(require(\"./BankAPI\"), exports);\n__exportStar(require(\"./DistributionAPI\"), exports);\n__exportStar(require(\"./GovAPI\"), exports);\n__exportStar(require(\"./MarketAPI\"), exports);\n__exportStar(require(\"./AuthzAPI\"), exports);\n__exportStar(require(\"./OracleAPI\"), exports);\n__exportStar(require(\"./SlashingAPI\"), exports);\n__exportStar(require(\"./StakingAPI\"), exports);\n__exportStar(require(\"./TendermintAPI\"), exports);\n__exportStar(require(\"./TreasuryAPI\"), exports);\n__exportStar(require(\"./TxAPI\"), exports);\n__exportStar(require(\"./WasmAPI\"), exports);\n__exportStar(require(\"./MintAPI\"), exports);\n__exportStar(require(\"./IbcAPI\"), exports);\n__exportStar(require(\"./IbcTransferAPI\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TxAPI = exports.SimulateResponse = exports.isTxError = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar hash_1 = require(\"../../../util/hash\");\nvar core_2 = require(\"../../../core\");\nfunction isTxError(x) {\n return (x.code !== undefined &&\n x.code !== 0 &&\n x.code !== '0');\n}\nexports.isTxError = isTxError;\nvar SimulateResponse = /** @class */ (function () {\n function SimulateResponse(gas_info, result) {\n this.gas_info = gas_info;\n this.result = result;\n }\n SimulateResponse.fromData = function (data) {\n return new SimulateResponse({\n gas_wanted: Number.parseInt(data.gas_info.gas_wanted),\n gas_used: Number.parseInt(data.gas_info.gas_used),\n }, data.result);\n };\n return SimulateResponse;\n}());\nexports.SimulateResponse = SimulateResponse;\nvar TxAPI = /** @class */ (function (_super) {\n __extends(TxAPI, _super);\n function TxAPI(lcd) {\n var _this = _super.call(this, lcd.apiRequester) || this;\n _this.lcd = lcd;\n return _this;\n }\n /**\n * Looks up a transaction on the blockchain, addressed by its hash\n * @param txHash transaction's hash\n */\n TxAPI.prototype.txInfo = function (txHash, params) {\n if (params === void 0) { params = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .getRaw(\"/cosmos/tx/v1beta1/txs/\" + txHash, params)\n .then(function (v) { return core_1.TxInfo.fromData(v.tx_response); })];\n });\n });\n };\n /**\n * Builds a [[StdSignMsg]] that is ready to be signed by a [[Key]]. The appropriate\n * account number and sequence will be fetched live from the blockchain and added to\n * the resultant [[StdSignMsg]]. If no fee is provided, fee will be automatically\n * estimated using the parameters, simulated using a \"dummy fee\" with sourceAddress's\n * nonzero denominations in its balance.\n *\n * @param sourceAddress account address of signer\n * @param options TX generation options\n */\n TxAPI.prototype.create = function (signers, options) {\n return __awaiter(this, void 0, void 0, function () {\n var fee, msgs, memo, timeoutHeight, signerDatas, _i, signers_1, signer, sequenceNumber, publicKey, account;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fee = options.fee;\n msgs = options.msgs, memo = options.memo, timeoutHeight = options.timeoutHeight;\n signerDatas = [];\n _i = 0, signers_1 = signers;\n _a.label = 1;\n case 1:\n if (!(_i < signers_1.length)) return [3 /*break*/, 5];\n signer = signers_1[_i];\n sequenceNumber = signer.sequenceNumber;\n publicKey = signer.publicKey;\n if (!(!sequenceNumber || !publicKey)) return [3 /*break*/, 3];\n return [4 /*yield*/, this.lcd.auth.accountInfo(signer.address)];\n case 2:\n account = _a.sent();\n if (!sequenceNumber) {\n sequenceNumber = account.getSequenceNumber();\n }\n if (!publicKey) {\n publicKey = account.getPublicKey();\n }\n _a.label = 3;\n case 3:\n signerDatas.push({\n sequenceNumber: sequenceNumber,\n publicKey: publicKey,\n });\n _a.label = 4;\n case 4:\n _i++;\n return [3 /*break*/, 1];\n case 5:\n if (!(fee === undefined)) return [3 /*break*/, 7];\n return [4 /*yield*/, this.lcd.tx.estimateFee(signerDatas, options)];\n case 6:\n fee = _a.sent();\n _a.label = 7;\n case 7: return [2 /*return*/, new core_1.Tx(new core_1.TxBody(msgs, memo || '', timeoutHeight || 0), new core_1.AuthInfo([], fee), [])];\n }\n });\n });\n };\n /**\n * Looks up transactions on the blockchain for the block height. If height is undefined,\n * gets the transactions for the latest block.\n * @param height block height\n */\n TxAPI.prototype.txInfosByHeight = function (height) {\n return __awaiter(this, void 0, void 0, function () {\n var blockInfo, txs, txhashes;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.lcd.tendermint.blockInfo(height)];\n case 1:\n blockInfo = _a.sent();\n txs = blockInfo.block.data.txs;\n if (!txs) {\n return [2 /*return*/, []];\n }\n else {\n txhashes = txs.map(function (txdata) { return (0, hash_1.hashToHex)(txdata); });\n return [2 /*return*/, Promise.all(txhashes.map(function (txhash) { return _this.txInfo(txhash); }))];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Estimates the transaction's fee by simulating it within the node\n * @param sourceAddress address that will pay the bill\n * @param msgs standard messages\n * @param options options for fee estimation\n */\n TxAPI.prototype.estimateFee = function (signers, options) {\n return __awaiter(this, void 0, void 0, function () {\n var gasPrices, gasAdjustment, feeDenoms, gas, gasPricesCoins, gasPricesCoinsFiltered, txBody, authInfo, tx, taxAmount, feeAmount;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n gasPrices = options.gasPrices || this.lcd.config.gasPrices;\n gasAdjustment = options.gasAdjustment || this.lcd.config.gasAdjustment;\n feeDenoms = options.feeDenoms || ['uluna'];\n gas = options.gas;\n if (gasPrices) {\n gasPricesCoins = new core_1.Coins(gasPrices);\n if (feeDenoms) {\n gasPricesCoinsFiltered = gasPricesCoins.filter(function (c) {\n return feeDenoms.includes(c.denom);\n });\n if (gasPricesCoinsFiltered.toArray().length > 0) {\n gasPricesCoins = gasPricesCoinsFiltered;\n }\n }\n }\n txBody = new core_1.TxBody(options.msgs, options.memo || '');\n authInfo = new core_1.AuthInfo([], new core_1.Fee(0, new core_1.Coins()));\n tx = new core_1.Tx(txBody, authInfo, []);\n // fill empty signature\n tx.appendEmptySignatures(signers);\n if (!(!gas || gas === 'auto' || gas === '0')) return [3 /*break*/, 2];\n return [4 /*yield*/, this.estimateGas(tx, { gasAdjustment: gasAdjustment })];\n case 1:\n gas = (_a.sent()).toString();\n _a.label = 2;\n case 2: return [4 /*yield*/, this.computeTax(tx)];\n case 3:\n taxAmount = _a.sent();\n feeAmount = gasPricesCoins\n ? taxAmount.add(gasPricesCoins.mul(gas).toIntCeilCoins())\n : taxAmount;\n return [2 /*return*/, new core_1.Fee(Number.parseInt(gas), feeAmount, '', '')];\n }\n });\n });\n };\n TxAPI.prototype.estimateGas = function (tx, options) {\n return __awaiter(this, void 0, void 0, function () {\n var gasAdjustment, simulateRes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n gasAdjustment = (options === null || options === void 0 ? void 0 : options.gasAdjustment) || this.lcd.config.gasAdjustment;\n return [4 /*yield*/, this.c\n .post(\"/cosmos/tx/v1beta1/simulate\", {\n tx_bytes: this.encode(tx),\n })\n .then(function (d) { return SimulateResponse.fromData(d); })];\n case 1:\n simulateRes = _a.sent();\n return [2 /*return*/, new core_1.Dec(gasAdjustment).mul(simulateRes.gas_info.gas_used).toNumber()];\n }\n });\n });\n };\n TxAPI.prototype.computeTax = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n var taxAmount;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.c\n .post(\"/terra/tx/v1beta1/compute_tax\", {\n tx_bytes: this.encode(tx),\n })\n .then(function (d) { return core_1.Coins.fromData(d.tax_amount); })];\n case 1:\n taxAmount = _a.sent();\n return [2 /*return*/, taxAmount];\n }\n });\n });\n };\n /**\n * Encode a transaction to Amino-encoding\n * @param tx transaction to encode\n */\n TxAPI.prototype.encode = function (tx) {\n return Buffer.from(tx.toBytes()).toString('base64');\n };\n /**\n * Get the transaction's hash\n * @param tx transaction to hash\n */\n TxAPI.prototype.hash = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n var txBytes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.encode(tx)];\n case 1:\n txBytes = _a.sent();\n return [2 /*return*/, (0, hash_1.hashToHex)(txBytes)];\n }\n });\n });\n };\n TxAPI.prototype._broadcast = function (tx, mode) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.c.post(\"/cosmos/tx/v1beta1/txs\", {\n tx_bytes: this.encode(tx),\n mode: mode,\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Broadcast the transaction using the \"block\" mode, waiting for its inclusion in the blockchain.\n * @param tx transaction to broadcast\n */\n TxAPI.prototype.broadcast = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._broadcast(tx, 'BROADCAST_MODE_BLOCK').then(function (_a) {\n var d = _a.tx_response;\n var blockResult = {\n txhash: d.txhash,\n raw_log: d.raw_log,\n gas_wanted: Number.parseInt(d.gas_wanted),\n gas_used: Number.parseInt(d.gas_used),\n height: +d.height,\n logs: d.logs.map(function (l) { return core_2.TxLog.fromData(l); }),\n code: d.code,\n codespace: d.codespace,\n data: d.data,\n info: d.info,\n timestamp: d.timestamp,\n };\n return blockResult;\n })];\n });\n });\n };\n /**\n * NOTE: This is not a synchronous function and is unconventionally named. This function\n * can be await as it returns a `Promise`.\n *\n * Broadcast the transaction using the \"sync\" mode, returning after DeliverTx() is performed.\n * @param tx transaction to broadcast\n */\n TxAPI.prototype.broadcastSync = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._broadcast(tx, 'BROADCAST_MODE_SYNC').then(function (_a) {\n var d = _a.tx_response;\n var blockResult = {\n height: +d.height,\n txhash: d.txhash,\n raw_log: d.raw_log,\n };\n if (d.code) {\n blockResult.code = d.code;\n }\n if (d.codespace) {\n blockResult.codespace = d.codespace;\n }\n return blockResult;\n })];\n });\n });\n };\n /**\n * Broadcast the transaction using the \"async\" mode, returning after CheckTx() is performed.\n * @param tx transaction to broadcast\n */\n TxAPI.prototype.broadcastAsync = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._broadcast(tx, 'BROADCAST_MODE_ASYNC').then(function (_a) {\n var d = _a.tx_response;\n return ({\n height: +d.height,\n txhash: d.txhash,\n });\n })];\n });\n });\n };\n /**\n * Search for transactions based on event attributes.\n * @param options\n */\n TxAPI.prototype.search = function (options) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var params;\n return __generator(this, function (_b) {\n params = new URLSearchParams();\n // build search params\n (_a = options.events) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {\n return params.append('events', v.key === 'tx.height' ? v.key + \"=\" + v.value : v.key + \"='\" + v.value + \"'\");\n });\n delete options['events'];\n Object.entries(options).forEach(function (v) {\n params.append(v[0], v[1]);\n });\n return [2 /*return*/, this.c\n .getRaw(\"cosmos/tx/v1beta1/txs\", params)\n .then(function (d) {\n return {\n txs: d.tx_responses.map(function (tx_response) { return core_1.TxInfo.fromData(tx_response); }),\n pagination: d.pagination,\n };\n })];\n });\n });\n };\n return TxAPI;\n}(BaseAPI_1.BaseAPI));\nexports.TxAPI = TxAPI;\n//# sourceMappingURL=TxAPI.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Wallet = void 0;\nvar signing_1 = require(\"@terra-money/terra.proto/cosmos/tx/signing/v1beta1/signing\");\nvar Wallet = /** @class */ (function () {\n function Wallet(lcd, key) {\n this.lcd = lcd;\n this.key = key;\n }\n Wallet.prototype.accountNumberAndSequence = function () {\n return this.lcd.auth.accountInfo(this.key.accAddress).then(function (d) {\n return {\n account_number: d.getAccountNumber(),\n sequence: d.getSequenceNumber(),\n };\n });\n };\n Wallet.prototype.accountNumber = function () {\n return this.lcd.auth.accountInfo(this.key.accAddress).then(function (d) {\n return d.getAccountNumber();\n });\n };\n Wallet.prototype.sequence = function () {\n return this.lcd.auth.accountInfo(this.key.accAddress).then(function (d) {\n return d.getSequenceNumber();\n });\n };\n Wallet.prototype.createTx = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.lcd.tx.create([\n {\n address: this.key.accAddress,\n sequenceNumber: options.sequence,\n publicKey: this.key.publicKey,\n },\n ], options)];\n });\n });\n };\n Wallet.prototype.createAndSignTx = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var accountNumber, sequence, res, tx;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n accountNumber = options.accountNumber;\n sequence = options.sequence;\n if (!(accountNumber === undefined || sequence == undefined)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.accountNumberAndSequence()];\n case 1:\n res = _a.sent();\n if (accountNumber === undefined) {\n accountNumber = res.account_number;\n }\n if (sequence === undefined) {\n sequence = res.sequence;\n }\n _a.label = 2;\n case 2:\n options.sequence = sequence;\n options.accountNumber = accountNumber;\n return [4 /*yield*/, this.createTx(options)];\n case 3:\n tx = _a.sent();\n return [2 /*return*/, this.key.signTx(tx, {\n accountNumber: accountNumber,\n sequence: sequence,\n chainID: this.lcd.config.chainID,\n signMode: options.signMode || signing_1.SignMode.SIGN_MODE_DIRECT,\n })];\n }\n });\n });\n };\n return Wallet;\n}());\nexports.Wallet = Wallet;\n//# sourceMappingURL=Wallet.js.map","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || defaults.transitional;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.24.0\"\n};","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { PublicKey } from \"@solana/web3.js\";\nimport { arrayify, zeroPad } from \"ethers/lib/utils\";\nimport { TokenImplementation__factory } from \"../ethers-contracts\";\nimport { importTokenWasm } from \"../solana/wasm\";\nimport { buildNativeId, canonicalAddress, isNativeDenom } from \"../terra\";\nimport { CHAIN_ID_SOLANA, CHAIN_ID_TERRA } from \"../utils\";\nimport { getIsWrappedAssetEth } from \"./getIsWrappedAsset\";\n/**\n * Returns a origin chain and asset address on {originChain} for a provided Wormhole wrapped address\n * @param tokenBridgeAddress\n * @param provider\n * @param wrappedAddress\n * @returns\n */\nexport function getOriginalAssetEth(tokenBridgeAddress, provider, wrappedAddress, lookupChainId) {\n return __awaiter(this, void 0, void 0, function () {\n var isWrapped, token, chainId, assetAddress;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getIsWrappedAssetEth(tokenBridgeAddress, provider, wrappedAddress)];\n case 1:\n isWrapped = _a.sent();\n if (!isWrapped) return [3 /*break*/, 4];\n token = TokenImplementation__factory.connect(wrappedAddress, provider);\n return [4 /*yield*/, token.chainId()];\n case 2:\n chainId = (_a.sent());\n return [4 /*yield*/, token.nativeContract()];\n case 3:\n assetAddress = _a.sent();\n return [2 /*return*/, {\n isWrapped: true,\n chainId: chainId,\n assetAddress: arrayify(assetAddress),\n }];\n case 4: return [2 /*return*/, {\n isWrapped: false,\n chainId: lookupChainId,\n assetAddress: zeroPad(arrayify(wrappedAddress), 32),\n }];\n }\n });\n });\n}\nexport function getOriginalAssetTerra(client, wrappedAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var result, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (isNativeDenom(wrappedAddress)) {\n return [2 /*return*/, {\n isWrapped: false,\n chainId: CHAIN_ID_TERRA,\n assetAddress: buildNativeId(wrappedAddress),\n }];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, client.wasm.contractQuery(wrappedAddress, {\n wrapped_asset_info: {},\n })];\n case 2:\n result = _a.sent();\n if (result) {\n return [2 /*return*/, {\n isWrapped: true,\n chainId: result.asset_chain,\n assetAddress: new Uint8Array(Buffer.from(result.asset_address, \"base64\")),\n }];\n }\n return [3 /*break*/, 4];\n case 3:\n e_1 = _a.sent();\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/, {\n isWrapped: false,\n chainId: CHAIN_ID_TERRA,\n assetAddress: zeroPad(canonicalAddress(wrappedAddress), 32),\n }];\n }\n });\n });\n}\n/**\n * Returns a origin chain and asset address on {originChain} for a provided Wormhole wrapped address\n * @param connection\n * @param tokenBridgeAddress\n * @param mintAddress\n * @returns\n */\nexport function getOriginalAssetSol(connection, tokenBridgeAddress, mintAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, parse_wrapped_meta, wrapped_meta_address, wrappedMetaAddress, wrappedMetaAddressPK, wrappedMetaAccountInfo, parsed;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!mintAddress) return [3 /*break*/, 3];\n return [4 /*yield*/, importTokenWasm()];\n case 1:\n _a = _b.sent(), parse_wrapped_meta = _a.parse_wrapped_meta, wrapped_meta_address = _a.wrapped_meta_address;\n wrappedMetaAddress = wrapped_meta_address(tokenBridgeAddress, new PublicKey(mintAddress).toBytes());\n wrappedMetaAddressPK = new PublicKey(wrappedMetaAddress);\n return [4 /*yield*/, connection.getAccountInfo(wrappedMetaAddressPK)];\n case 2:\n wrappedMetaAccountInfo = _b.sent();\n if (wrappedMetaAccountInfo) {\n parsed = parse_wrapped_meta(wrappedMetaAccountInfo.data);\n return [2 /*return*/, {\n isWrapped: true,\n chainId: parsed.chain,\n assetAddress: parsed.token_address,\n }];\n }\n _b.label = 3;\n case 3:\n try {\n return [2 /*return*/, {\n isWrapped: false,\n chainId: CHAIN_ID_SOLANA,\n assetAddress: new PublicKey(mintAddress).toBytes(),\n }];\n }\n catch (e) { }\n return [2 /*return*/, {\n isWrapped: false,\n chainId: CHAIN_ID_SOLANA,\n assetAddress: new Uint8Array(32),\n }];\n }\n });\n });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { AccountLayout, Token, TOKEN_PROGRAM_ID, u64 } from \"@solana/spl-token\";\nimport { Keypair, PublicKey, SystemProgram, Transaction, } from \"@solana/web3.js\";\nimport { MsgExecuteContract } from \"@terra-money/terra.js\";\nimport { fromUint8Array } from \"js-base64\";\nimport { Bridge__factory } from \"../ethers-contracts\";\nimport { ixFromRust } from \"../solana\";\nimport { importCoreWasm, importTokenWasm } from \"../solana/wasm\";\nimport { CHAIN_ID_SOLANA, WSOL_ADDRESS, WSOL_DECIMALS, MAX_VAA_DECIMALS, } from \"../utils\";\nimport { hexToNativeString } from \"../utils/array\";\nimport { parseTransferPayload } from \"../utils/parseVaa\";\nexport function redeemOnEth(tokenBridgeAddress, signer, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var bridge, v, receipt;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n bridge = Bridge__factory.connect(tokenBridgeAddress, signer);\n return [4 /*yield*/, bridge.completeTransfer(signedVAA)];\n case 1:\n v = _a.sent();\n return [4 /*yield*/, v.wait()];\n case 2:\n receipt = _a.sent();\n return [2 /*return*/, receipt];\n }\n });\n });\n}\nexport function redeemOnEthNative(tokenBridgeAddress, signer, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var bridge, v, receipt;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n bridge = Bridge__factory.connect(tokenBridgeAddress, signer);\n return [4 /*yield*/, bridge.completeTransferAndUnwrapETH(signedVAA)];\n case 1:\n v = _a.sent();\n return [4 /*yield*/, v.wait()];\n case 2:\n receipt = _a.sent();\n return [2 /*return*/, receipt];\n }\n });\n });\n}\nexport function redeemOnTerra(tokenBridgeAddress, walletAddress, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new MsgExecuteContract(walletAddress, tokenBridgeAddress, {\n submit_vaa: {\n data: fromUint8Array(signedVAA),\n },\n })];\n });\n });\n}\nexport function redeemAndUnwrapOnSolana(connection, bridgeAddress, tokenBridgeAddress, payerAddress, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var parse_vaa, complete_transfer_native_ix, parsedVAA, parsedPayload, targetAddress, targetPublicKey, targetAmount, rentBalance, mintPublicKey, payerPublicKey, ancillaryKeypair, completeTransferIx, createAncillaryAccountIx, initAccountIx, balanceTransferIx, closeAccountIx, blockhash, transaction;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importCoreWasm()];\n case 1:\n parse_vaa = (_a.sent()).parse_vaa;\n return [4 /*yield*/, importTokenWasm()];\n case 2:\n complete_transfer_native_ix = (_a.sent()).complete_transfer_native_ix;\n parsedVAA = parse_vaa(signedVAA);\n parsedPayload = parseTransferPayload(Buffer.from(new Uint8Array(parsedVAA.payload)));\n targetAddress = hexToNativeString(parsedPayload.targetAddress, CHAIN_ID_SOLANA);\n if (!targetAddress) {\n throw new Error(\"Failed to read the target address.\");\n }\n targetPublicKey = new PublicKey(targetAddress);\n targetAmount = parsedPayload.amount *\n BigInt(WSOL_DECIMALS - MAX_VAA_DECIMALS) *\n BigInt(10);\n return [4 /*yield*/, Token.getMinBalanceRentForExemptAccount(connection)];\n case 3:\n rentBalance = _a.sent();\n mintPublicKey = new PublicKey(WSOL_ADDRESS);\n payerPublicKey = new PublicKey(payerAddress);\n ancillaryKeypair = Keypair.generate();\n completeTransferIx = ixFromRust(complete_transfer_native_ix(tokenBridgeAddress, bridgeAddress, payerAddress, signedVAA));\n createAncillaryAccountIx = SystemProgram.createAccount({\n fromPubkey: payerPublicKey,\n newAccountPubkey: ancillaryKeypair.publicKey,\n lamports: rentBalance,\n space: AccountLayout.span,\n programId: TOKEN_PROGRAM_ID,\n });\n return [4 /*yield*/, Token.createInitAccountInstruction(TOKEN_PROGRAM_ID, mintPublicKey, ancillaryKeypair.publicKey, payerPublicKey)];\n case 4:\n initAccountIx = _a.sent();\n balanceTransferIx = Token.createTransferInstruction(TOKEN_PROGRAM_ID, targetPublicKey, ancillaryKeypair.publicKey, payerPublicKey, [], new u64(targetAmount.toString(16), 16));\n closeAccountIx = Token.createCloseAccountInstruction(TOKEN_PROGRAM_ID, ancillaryKeypair.publicKey, //account to close\n payerPublicKey, //Remaining funds destination\n payerPublicKey, //authority\n []);\n return [4 /*yield*/, connection.getRecentBlockhash()];\n case 5:\n blockhash = (_a.sent()).blockhash;\n transaction = new Transaction();\n transaction.recentBlockhash = blockhash;\n transaction.feePayer = new PublicKey(payerAddress);\n transaction.add(completeTransferIx);\n transaction.add(createAncillaryAccountIx);\n transaction.add(initAccountIx);\n transaction.add(balanceTransferIx);\n transaction.add(closeAccountIx);\n transaction.partialSign(ancillaryKeypair);\n return [2 /*return*/, transaction];\n }\n });\n });\n}\nexport function redeemOnSolana(connection, bridgeAddress, tokenBridgeAddress, payerAddress, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var parse_vaa, parsedVAA, isSolanaNative, _a, complete_transfer_wrapped_ix, complete_transfer_native_ix, ixs, transaction, blockhash;\n var _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, importCoreWasm()];\n case 1:\n parse_vaa = (_c.sent()).parse_vaa;\n parsedVAA = parse_vaa(signedVAA);\n isSolanaNative = Buffer.from(new Uint8Array(parsedVAA.payload)).readUInt16BE(65) ===\n CHAIN_ID_SOLANA;\n return [4 /*yield*/, importTokenWasm()];\n case 2:\n _a = _c.sent(), complete_transfer_wrapped_ix = _a.complete_transfer_wrapped_ix, complete_transfer_native_ix = _a.complete_transfer_native_ix;\n ixs = [];\n if (isSolanaNative) {\n ixs.push(ixFromRust(complete_transfer_native_ix(tokenBridgeAddress, bridgeAddress, payerAddress, signedVAA)));\n }\n else {\n ixs.push(ixFromRust(complete_transfer_wrapped_ix(tokenBridgeAddress, bridgeAddress, payerAddress, signedVAA)));\n }\n transaction = (_b = new Transaction()).add.apply(_b, __spreadArray([], __read(ixs)));\n return [4 /*yield*/, connection.getRecentBlockhash()];\n case 3:\n blockhash = (_c.sent()).blockhash;\n transaction.recentBlockhash = blockhash;\n transaction.feePayer = new PublicKey(payerAddress);\n return [2 /*return*/, transaction];\n }\n });\n });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { AccountLayout, Token, TOKEN_PROGRAM_ID, u64 } from \"@solana/spl-token\";\nimport { Keypair, PublicKey, SystemProgram, Transaction, } from \"@solana/web3.js\";\nimport { MsgExecuteContract } from \"@terra-money/terra.js\";\nimport { isNativeDenom } from \"..\";\nimport { Bridge__factory, TokenImplementation__factory, } from \"../ethers-contracts\";\nimport { getBridgeFeeIx, ixFromRust } from \"../solana\";\nimport { importTokenWasm } from \"../solana/wasm\";\nimport { CHAIN_ID_SOLANA, createNonce, WSOL_ADDRESS } from \"../utils\";\nexport function getAllowanceEth(tokenBridgeAddress, tokenAddress, signer) {\n return __awaiter(this, void 0, void 0, function () {\n var token, signerAddress, allowance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n token = TokenImplementation__factory.connect(tokenAddress, signer);\n return [4 /*yield*/, signer.getAddress()];\n case 1:\n signerAddress = _a.sent();\n return [4 /*yield*/, token.allowance(signerAddress, tokenBridgeAddress)];\n case 2:\n allowance = _a.sent();\n return [2 /*return*/, allowance];\n }\n });\n });\n}\nexport function approveEth(tokenBridgeAddress, tokenAddress, signer, amount) {\n return __awaiter(this, void 0, void 0, function () {\n var token;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n token = TokenImplementation__factory.connect(tokenAddress, signer);\n return [4 /*yield*/, token.approve(tokenBridgeAddress, amount)];\n case 1: return [4 /*yield*/, (_a.sent()).wait()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexport function transferFromEth(tokenBridgeAddress, signer, tokenAddress, amount, recipientChain, recipientAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var fee, bridge, v, receipt;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fee = 0;\n bridge = Bridge__factory.connect(tokenBridgeAddress, signer);\n return [4 /*yield*/, bridge.transferTokens(tokenAddress, amount, recipientChain, recipientAddress, fee, createNonce())];\n case 1:\n v = _a.sent();\n return [4 /*yield*/, v.wait()];\n case 2:\n receipt = _a.sent();\n return [2 /*return*/, receipt];\n }\n });\n });\n}\nexport function transferFromEthNative(tokenBridgeAddress, signer, amount, recipientChain, recipientAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var fee, bridge, v, receipt;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fee = 0;\n bridge = Bridge__factory.connect(tokenBridgeAddress, signer);\n return [4 /*yield*/, bridge.wrapAndTransferETH(recipientChain, recipientAddress, fee, createNonce(), {\n value: amount,\n })];\n case 1:\n v = _a.sent();\n return [4 /*yield*/, v.wait()];\n case 2:\n receipt = _a.sent();\n return [2 /*return*/, receipt];\n }\n });\n });\n}\nexport function transferFromTerra(walletAddress, tokenBridgeAddress, tokenAddress, amount, recipientChain, recipientAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var nonce, isNativeAsset;\n var _a;\n return __generator(this, function (_b) {\n nonce = Math.round(Math.random() * 100000);\n isNativeAsset = isNativeDenom(tokenAddress);\n return [2 /*return*/, isNativeAsset\n ? [\n new MsgExecuteContract(walletAddress, tokenBridgeAddress, {\n deposit_tokens: {},\n }, (_a = {}, _a[tokenAddress] = amount, _a)),\n new MsgExecuteContract(walletAddress, tokenBridgeAddress, {\n initiate_transfer: {\n asset: {\n amount: amount,\n info: {\n native_token: {\n denom: tokenAddress,\n },\n },\n },\n recipient_chain: recipientChain,\n recipient: Buffer.from(recipientAddress).toString(\"base64\"),\n fee: \"0\",\n nonce: nonce,\n },\n }, {}),\n ]\n : [\n new MsgExecuteContract(walletAddress, tokenAddress, {\n increase_allowance: {\n spender: tokenBridgeAddress,\n amount: amount,\n expires: {\n never: {},\n },\n },\n }, {}),\n new MsgExecuteContract(walletAddress, tokenBridgeAddress, {\n initiate_transfer: {\n asset: {\n amount: amount,\n info: {\n token: {\n contract_addr: tokenAddress,\n },\n },\n },\n recipient_chain: recipientChain,\n recipient: Buffer.from(recipientAddress).toString(\"base64\"),\n fee: \"0\",\n nonce: nonce,\n },\n }, {}),\n ]];\n });\n });\n}\nexport function transferNativeSol(connection, bridgeAddress, tokenBridgeAddress, payerAddress, amount, targetAddress, targetChain) {\n return __awaiter(this, void 0, void 0, function () {\n var rentBalance, mintPublicKey, payerPublicKey, ancillaryKeypair, createAncillaryAccountIx, initialBalanceTransferIx, initAccountIx, _a, transfer_native_ix, approval_authority_address, nonce, fee, transferIx, approvalIx, messageKey, ix, closeAccountIx, blockhash, transaction;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, Token.getMinBalanceRentForExemptAccount(connection)];\n case 1:\n rentBalance = _b.sent();\n mintPublicKey = new PublicKey(WSOL_ADDRESS);\n payerPublicKey = new PublicKey(payerAddress);\n ancillaryKeypair = Keypair.generate();\n createAncillaryAccountIx = SystemProgram.createAccount({\n fromPubkey: payerPublicKey,\n newAccountPubkey: ancillaryKeypair.publicKey,\n lamports: rentBalance,\n space: AccountLayout.span,\n programId: TOKEN_PROGRAM_ID,\n });\n initialBalanceTransferIx = SystemProgram.transfer({\n fromPubkey: payerPublicKey,\n lamports: Number(amount),\n toPubkey: ancillaryKeypair.publicKey,\n });\n return [4 /*yield*/, Token.createInitAccountInstruction(TOKEN_PROGRAM_ID, mintPublicKey, ancillaryKeypair.publicKey, payerPublicKey)];\n case 2:\n initAccountIx = _b.sent();\n return [4 /*yield*/, importTokenWasm()];\n case 3:\n _a = _b.sent(), transfer_native_ix = _a.transfer_native_ix, approval_authority_address = _a.approval_authority_address;\n nonce = createNonce().readUInt32LE(0);\n fee = BigInt(0);\n return [4 /*yield*/, getBridgeFeeIx(connection, bridgeAddress, payerAddress)];\n case 4:\n transferIx = _b.sent();\n approvalIx = Token.createApproveInstruction(TOKEN_PROGRAM_ID, ancillaryKeypair.publicKey, new PublicKey(approval_authority_address(tokenBridgeAddress)), payerPublicKey, //owner\n [], new u64(amount.toString(16), 16));\n messageKey = Keypair.generate();\n ix = ixFromRust(transfer_native_ix(tokenBridgeAddress, bridgeAddress, payerAddress, messageKey.publicKey.toString(), ancillaryKeypair.publicKey.toString(), WSOL_ADDRESS, nonce, amount, fee, targetAddress, targetChain));\n closeAccountIx = Token.createCloseAccountInstruction(TOKEN_PROGRAM_ID, ancillaryKeypair.publicKey, //account to close\n payerPublicKey, //Remaining funds destination\n payerPublicKey, //authority\n []);\n return [4 /*yield*/, connection.getRecentBlockhash()];\n case 5:\n blockhash = (_b.sent()).blockhash;\n transaction = new Transaction();\n transaction.recentBlockhash = blockhash;\n transaction.feePayer = new PublicKey(payerAddress);\n transaction.add(createAncillaryAccountIx);\n transaction.add(initialBalanceTransferIx);\n transaction.add(initAccountIx);\n transaction.add(transferIx, approvalIx, ix);\n transaction.add(closeAccountIx);\n transaction.partialSign(messageKey);\n transaction.partialSign(ancillaryKeypair);\n return [2 /*return*/, transaction];\n }\n });\n });\n}\nexport function transferFromSolana(connection, bridgeAddress, tokenBridgeAddress, payerAddress, fromAddress, mintAddress, amount, targetAddress, targetChain, originAddress, originChain, fromOwnerAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var nonce, fee, transferIx, _a, transfer_native_ix, transfer_wrapped_ix, approval_authority_address, approvalIx, messageKey, isSolanaNative, ix, transaction, blockhash;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n nonce = createNonce().readUInt32LE(0);\n fee = BigInt(0);\n return [4 /*yield*/, getBridgeFeeIx(connection, bridgeAddress, payerAddress)];\n case 1:\n transferIx = _b.sent();\n return [4 /*yield*/, importTokenWasm()];\n case 2:\n _a = _b.sent(), transfer_native_ix = _a.transfer_native_ix, transfer_wrapped_ix = _a.transfer_wrapped_ix, approval_authority_address = _a.approval_authority_address;\n approvalIx = Token.createApproveInstruction(TOKEN_PROGRAM_ID, new PublicKey(fromAddress), new PublicKey(approval_authority_address(tokenBridgeAddress)), new PublicKey(fromOwnerAddress || payerAddress), [], new u64(amount.toString(16), 16));\n messageKey = Keypair.generate();\n isSolanaNative = originChain === undefined || originChain === CHAIN_ID_SOLANA;\n if (!isSolanaNative && !originAddress) {\n throw new Error(\"originAddress is required when specifying originChain\");\n }\n ix = ixFromRust(isSolanaNative\n ? transfer_native_ix(tokenBridgeAddress, bridgeAddress, payerAddress, messageKey.publicKey.toString(), fromAddress, mintAddress, nonce, amount, fee, targetAddress, targetChain)\n : transfer_wrapped_ix(tokenBridgeAddress, bridgeAddress, payerAddress, messageKey.publicKey.toString(), fromAddress, fromOwnerAddress || payerAddress, originChain, // checked by isSolanaNative\n originAddress, // checked by throw\n nonce, amount, fee, targetAddress, targetChain));\n transaction = new Transaction().add(transferIx, approvalIx, ix);\n return [4 /*yield*/, connection.getRecentBlockhash()];\n case 3:\n blockhash = (_b.sent()).blockhash;\n transaction.recentBlockhash = blockhash;\n transaction.feePayer = new PublicKey(payerAddress);\n transaction.partialSign(messageKey);\n return [2 /*return*/, transaction];\n }\n });\n });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { PublicKey } from \"@solana/web3.js\";\nimport { BigNumber } from \"ethers\";\nimport { arrayify, zeroPad } from \"ethers/lib/utils\";\nimport { canonicalAddress } from \"..\";\nimport { TokenImplementation__factory } from \"../ethers-contracts\";\nimport { importNftWasm } from \"../solana/wasm\";\nimport { CHAIN_ID_SOLANA, CHAIN_ID_TERRA } from \"../utils\";\nimport { getIsWrappedAssetEth } from \"./getIsWrappedAsset\";\n/**\n * Returns a origin chain and asset address on {originChain} for a provided Wormhole wrapped address\n * @param tokenBridgeAddress\n * @param provider\n * @param wrappedAddress\n * @returns\n */\nexport function getOriginalAssetEth(tokenBridgeAddress, provider, wrappedAddress, tokenId, lookupChainId) {\n return __awaiter(this, void 0, void 0, function () {\n var isWrapped, token, chainId, assetAddress;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getIsWrappedAssetEth(tokenBridgeAddress, provider, wrappedAddress)];\n case 1:\n isWrapped = _a.sent();\n if (!isWrapped) return [3 /*break*/, 4];\n token = TokenImplementation__factory.connect(wrappedAddress, provider);\n return [4 /*yield*/, token.chainId()];\n case 2:\n chainId = (_a.sent());\n return [4 /*yield*/, token.nativeContract()];\n case 3:\n assetAddress = _a.sent();\n return [2 /*return*/, {\n isWrapped: true,\n chainId: chainId,\n assetAddress: chainId === CHAIN_ID_SOLANA\n ? arrayify(BigNumber.from(tokenId))\n : arrayify(assetAddress),\n tokenId: tokenId,\n }];\n case 4: return [2 /*return*/, {\n isWrapped: false,\n chainId: lookupChainId,\n assetAddress: zeroPad(arrayify(wrappedAddress), 32),\n tokenId: tokenId,\n }];\n }\n });\n });\n}\n/**\n * Returns a origin chain and asset address on {originChain} for a provided Wormhole wrapped address\n * @param connection\n * @param tokenBridgeAddress\n * @param mintAddress\n * @returns\n */\nexport function getOriginalAssetSol(connection, tokenBridgeAddress, mintAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, parse_wrapped_meta, wrapped_meta_address, wrappedMetaAddress, wrappedMetaAddressPK, wrappedMetaAccountInfo, parsed, token_id_arr, token_id_bytes, _b, _c, elem, token_id;\n var e_1, _d;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n if (!mintAddress) return [3 /*break*/, 3];\n return [4 /*yield*/, importNftWasm()];\n case 1:\n _a = _e.sent(), parse_wrapped_meta = _a.parse_wrapped_meta, wrapped_meta_address = _a.wrapped_meta_address;\n wrappedMetaAddress = wrapped_meta_address(tokenBridgeAddress, new PublicKey(mintAddress).toBytes());\n wrappedMetaAddressPK = new PublicKey(wrappedMetaAddress);\n return [4 /*yield*/, connection.getAccountInfo(wrappedMetaAddressPK)];\n case 2:\n wrappedMetaAccountInfo = _e.sent();\n if (wrappedMetaAccountInfo) {\n parsed = parse_wrapped_meta(wrappedMetaAccountInfo.data);\n token_id_arr = parsed.token_id;\n token_id_bytes = [];\n try {\n for (_b = __values(token_id_arr.reverse()), _c = _b.next(); !_c.done; _c = _b.next()) {\n elem = _c.value;\n token_id_bytes.push.apply(token_id_bytes, __spreadArray([], __read(bigToUint8Array(elem))));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_d = _b.return)) _d.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n token_id = BigNumber.from(token_id_bytes).toString();\n return [2 /*return*/, {\n isWrapped: true,\n chainId: parsed.chain,\n assetAddress: parsed.token_address,\n tokenId: token_id,\n }];\n }\n _e.label = 3;\n case 3:\n try {\n return [2 /*return*/, {\n isWrapped: false,\n chainId: CHAIN_ID_SOLANA,\n assetAddress: new PublicKey(mintAddress).toBytes(),\n }];\n }\n catch (e) { }\n return [2 /*return*/, {\n isWrapped: false,\n chainId: CHAIN_ID_SOLANA,\n assetAddress: new Uint8Array(32),\n }];\n }\n });\n });\n}\n// Derived from https://www.jackieli.dev/posts/bigint-to-uint8array/\nvar big0 = BigInt(0);\nvar big1 = BigInt(1);\nvar big8 = BigInt(8);\nfunction bigToUint8Array(big) {\n if (big < big0) {\n var bits = (BigInt(big.toString(2).length) / big8 + big1) * big8;\n var prefix1 = big1 << bits;\n big += prefix1;\n }\n var hex = big.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n else if (hex[0] === \"8\") {\n // maximum positive need to prepend 0 otherwise resuts in negative number\n hex = \"00\" + hex;\n }\n var len = hex.length / 2;\n var u8 = new Uint8Array(len);\n var i = 0;\n var j = 0;\n while (i < len) {\n u8[i] = parseInt(hex.slice(j, j + 2), 16);\n i += 1;\n j += 2;\n }\n return u8;\n}\nexport function getOriginalAssetTerra(client, wrappedAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var result, e_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, client.wasm.contractQuery(wrappedAddress, {\n wrapped_asset_info: {},\n })];\n case 1:\n result = _a.sent();\n if (result) {\n return [2 /*return*/, {\n isWrapped: true,\n chainId: result.asset_chain,\n assetAddress: new Uint8Array(Buffer.from(result.asset_address, \"base64\")),\n }];\n }\n return [3 /*break*/, 3];\n case 2:\n e_2 = _a.sent();\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/, {\n isWrapped: false,\n chainId: CHAIN_ID_TERRA,\n assetAddress: zeroPad(canonicalAddress(wrappedAddress), 32),\n }];\n }\n });\n });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { PublicKey, Transaction } from \"@solana/web3.js\";\nimport { MsgExecuteContract } from \"@terra-money/terra.js\";\nimport { fromUint8Array } from \"js-base64\";\nimport { CHAIN_ID_SOLANA } from \"..\";\nimport { Bridge__factory } from \"../ethers-contracts\";\nimport { ixFromRust } from \"../solana\";\nimport { importCoreWasm, importNftWasm } from \"../solana/wasm\";\nexport function redeemOnEth(tokenBridgeAddress, signer, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var bridge, v, receipt;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n bridge = Bridge__factory.connect(tokenBridgeAddress, signer);\n return [4 /*yield*/, bridge.completeTransfer(signedVAA)];\n case 1:\n v = _a.sent();\n return [4 /*yield*/, v.wait()];\n case 2:\n receipt = _a.sent();\n return [2 /*return*/, receipt];\n }\n });\n });\n}\nexport function isNFTVAASolanaNative(signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var parse_vaa, parsedVAA, isSolanaNative;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importCoreWasm()];\n case 1:\n parse_vaa = (_a.sent()).parse_vaa;\n parsedVAA = parse_vaa(signedVAA);\n isSolanaNative = Buffer.from(new Uint8Array(parsedVAA.payload)).readUInt16BE(33) ===\n CHAIN_ID_SOLANA;\n return [2 /*return*/, isSolanaNative];\n }\n });\n });\n}\nexport function redeemOnSolana(connection, bridgeAddress, tokenBridgeAddress, payerAddress, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var isSolanaNative, _a, complete_transfer_wrapped_ix, complete_transfer_native_ix, ixs, transaction, blockhash;\n var _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, isNFTVAASolanaNative(signedVAA)];\n case 1:\n isSolanaNative = _c.sent();\n return [4 /*yield*/, importNftWasm()];\n case 2:\n _a = _c.sent(), complete_transfer_wrapped_ix = _a.complete_transfer_wrapped_ix, complete_transfer_native_ix = _a.complete_transfer_native_ix;\n ixs = [];\n if (isSolanaNative) {\n ixs.push(ixFromRust(complete_transfer_native_ix(tokenBridgeAddress, bridgeAddress, payerAddress, payerAddress, //TODO: allow for a different address than payer\n signedVAA)));\n }\n else {\n ixs.push(ixFromRust(complete_transfer_wrapped_ix(tokenBridgeAddress, bridgeAddress, payerAddress, payerAddress, //TODO: allow for a different address than payer\n signedVAA)));\n }\n transaction = (_b = new Transaction()).add.apply(_b, __spreadArray([], __read(ixs)));\n return [4 /*yield*/, connection.getRecentBlockhash()];\n case 3:\n blockhash = (_c.sent()).blockhash;\n transaction.recentBlockhash = blockhash;\n transaction.feePayer = new PublicKey(payerAddress);\n return [2 /*return*/, transaction];\n }\n });\n });\n}\nexport function createMetaOnSolana(connection, bridgeAddress, tokenBridgeAddress, payerAddress, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n var complete_transfer_wrapped_meta_ix, ix, transaction, blockhash;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, importNftWasm()];\n case 1:\n complete_transfer_wrapped_meta_ix = (_a.sent()).complete_transfer_wrapped_meta_ix;\n ix = ixFromRust(complete_transfer_wrapped_meta_ix(tokenBridgeAddress, bridgeAddress, payerAddress, signedVAA));\n transaction = new Transaction().add(ix);\n return [4 /*yield*/, connection.getRecentBlockhash()];\n case 2:\n blockhash = (_a.sent()).blockhash;\n transaction.recentBlockhash = blockhash;\n transaction.feePayer = new PublicKey(payerAddress);\n return [2 /*return*/, transaction];\n }\n });\n });\n}\nexport function redeemOnTerra(tokenBridgeAddress, walletAddress, signedVAA) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new MsgExecuteContract(walletAddress, tokenBridgeAddress, {\n submit_vaa: {\n data: fromUint8Array(signedVAA),\n },\n })];\n });\n });\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { Token, TOKEN_PROGRAM_ID } from \"@solana/spl-token\";\nimport { Keypair, PublicKey, Transaction } from \"@solana/web3.js\";\nimport { MsgExecuteContract } from \"@terra-money/terra.js\";\nimport { NFTBridge__factory, NFTImplementation__factory, } from \"../ethers-contracts\";\nimport { getBridgeFeeIx, ixFromRust } from \"../solana\";\nimport { importNftWasm } from \"../solana/wasm\";\nimport { CHAIN_ID_SOLANA, createNonce } from \"../utils\";\nexport function transferFromEth(tokenBridgeAddress, signer, tokenAddress, tokenID, recipientChain, recipientAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var token, bridge, v, receipt;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n token = NFTImplementation__factory.connect(tokenAddress, signer);\n return [4 /*yield*/, token.approve(tokenBridgeAddress, tokenID)];\n case 1: return [4 /*yield*/, (_a.sent()).wait()];\n case 2:\n _a.sent();\n bridge = NFTBridge__factory.connect(tokenBridgeAddress, signer);\n return [4 /*yield*/, bridge.transferNFT(tokenAddress, tokenID, recipientChain, recipientAddress, createNonce())];\n case 3:\n v = _a.sent();\n return [4 /*yield*/, v.wait()];\n case 4:\n receipt = _a.sent();\n return [2 /*return*/, receipt];\n }\n });\n });\n}\nexport function transferFromSolana(connection, bridgeAddress, tokenBridgeAddress, payerAddress, fromAddress, mintAddress, targetAddress, targetChain, originAddress, originChain, originTokenId) {\n return __awaiter(this, void 0, void 0, function () {\n var nonce, transferIx, _a, transfer_native_ix, transfer_wrapped_ix, approval_authority_address, approvalIx, messageKey, isSolanaNative, ix, transaction, blockhash;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n nonce = createNonce().readUInt32LE(0);\n return [4 /*yield*/, getBridgeFeeIx(connection, bridgeAddress, payerAddress)];\n case 1:\n transferIx = _b.sent();\n return [4 /*yield*/, importNftWasm()];\n case 2:\n _a = _b.sent(), transfer_native_ix = _a.transfer_native_ix, transfer_wrapped_ix = _a.transfer_wrapped_ix, approval_authority_address = _a.approval_authority_address;\n approvalIx = Token.createApproveInstruction(TOKEN_PROGRAM_ID, new PublicKey(fromAddress), new PublicKey(approval_authority_address(tokenBridgeAddress)), new PublicKey(payerAddress), [], Number(1));\n messageKey = Keypair.generate();\n isSolanaNative = originChain === undefined || originChain === CHAIN_ID_SOLANA;\n if (!isSolanaNative && !originAddress && !originTokenId) {\n throw new Error(\"originAddress and originTokenId are required when specifying originChain\");\n }\n ix = ixFromRust(isSolanaNative\n ? transfer_native_ix(tokenBridgeAddress, bridgeAddress, payerAddress, messageKey.publicKey.toString(), fromAddress, mintAddress, nonce, targetAddress, targetChain)\n : transfer_wrapped_ix(tokenBridgeAddress, bridgeAddress, payerAddress, messageKey.publicKey.toString(), fromAddress, payerAddress, originChain, // checked by isSolanaNative\n originAddress, // checked by throw\n originTokenId, // checked by throw\n nonce, targetAddress, targetChain));\n transaction = new Transaction().add(transferIx, approvalIx, ix);\n return [4 /*yield*/, connection.getRecentBlockhash()];\n case 3:\n blockhash = (_b.sent()).blockhash;\n transaction.recentBlockhash = blockhash;\n transaction.feePayer = new PublicKey(payerAddress);\n transaction.partialSign(messageKey);\n return [2 /*return*/, transaction];\n }\n });\n });\n}\nexport function transferFromTerra(walletAddress, tokenBridgeAddress, tokenAddress, tokenID, recipientChain, recipientAddress) {\n return __awaiter(this, void 0, void 0, function () {\n var nonce;\n return __generator(this, function (_a) {\n nonce = Math.round(Math.random() * 100000);\n return [2 /*return*/, [\n new MsgExecuteContract(walletAddress, tokenAddress, {\n approve: {\n spender: tokenBridgeAddress,\n token_id: tokenID,\n },\n }, {}),\n new MsgExecuteContract(walletAddress, tokenBridgeAddress, {\n initiate_transfer: {\n contract_addr: tokenAddress,\n token_id: tokenID,\n recipient_chain: recipientChain,\n recipient: Buffer.from(recipientAddress).toString(\"base64\"),\n nonce: nonce,\n },\n }, {}),\n ]];\n });\n });\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || new Array(16);\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n var v;\n var arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = [];\n\n for (var i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n var bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Uint8Array(msg.length);\n\n for (var i = 0; i < msg.length; ++i) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n var output = [];\n var length32 = input.length * 32;\n var hexTab = '0123456789abcdef';\n\n for (var i = 0; i < length32; i += 8) {\n var x = input[i >> 5] >>> i % 32 & 0xff;\n var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/**\n * Calculate output length with padding and bit length\n */\n\n\nfunction getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[getOutputLength(len) - 1] = len;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nexport default md5;","import v35 from './v35.js';\nimport md5 from './md5.js';\nvar v3 = v35('v3', 0x30, md5);\nexport default v3;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (var i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var _i = 0; _i < N; ++_i) {\n var arr = new Uint32Array(16);\n\n for (var j = 0; j < 16; ++j) {\n arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];\n }\n\n M[_i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var _i2 = 0; _i2 < N; ++_i2) {\n var W = new Uint32Array(80);\n\n for (var t = 0; t < 16; ++t) {\n W[t] = M[_i2][t];\n }\n\n for (var _t = 16; _t < 80; ++_t) {\n W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var _t2 = 0; _t2 < 80; ++_t2) {\n var s = Math.floor(_t2 / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nexport default sha1;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nvar v5 = v35('v5', 0x50, sha1);\nexport default v5;","export default '00000000-0000-0000-0000-000000000000';","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n","'use strict';\n\nvar utils = exports;\nvar BN = require('bn.js');\nvar minAssert = require('minimalistic-assert');\nvar minUtils = require('minimalistic-crypto-utils');\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n\n var ws = 1 << (w + 1);\n var k = num.clone();\n\n for (var i = 0; i < naf.length; i++) {\n var z;\n var mod = k.andln(ws - 1);\n if (k.isOdd()) {\n if (mod > (ws >> 1) - 1)\n z = (ws >> 1) - mod;\n else\n z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n\n naf[i] = z;\n k.iushrn(1);\n }\n\n return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n var jsf = [\n [],\n [],\n ];\n\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n var m8;\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n // First phase\n var m14 = (k1.andln(3) + d1) & 3;\n var m24 = (k2.andln(3) + d2) & 3;\n if (m14 === 3)\n m14 = -1;\n if (m24 === 3)\n m24 = -1;\n var u1;\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n m8 = (k1.andln(7) + d1) & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n jsf[0].push(u1);\n\n var u2;\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n m8 = (k2.andln(7) + d2) & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n jsf[1].push(u2);\n\n // Second phase\n if (2 * d1 === u1 + 1)\n d1 = 1 - d1;\n if (2 * d2 === u2 + 1)\n d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] :\n this[key] = computer.call(this);\n };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new BN(conf.p, 16);\n\n // Use Montgomery, when there is no fast reduction for the prime\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n // Useful for many curves\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n\n // Curve configuration, optional\n this.n = conf.n && new BN(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n // Temporary arrays\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4);\n\n this._bitLength = this.n ? this.n.bitLength() : 0;\n\n // Generalized Greg Maxwell's trick\n var adjustCount = this.n && this.p.div(this.n);\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1, this._bitLength);\n var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3;\n\n // Translate into more windowed form\n var repr = [];\n var j;\n var nafW;\n for (j = 0; j < naf.length; j += doubles.step) {\n nafW = 0;\n for (var l = j + doubles.step - 1; l >= j; l--)\n nafW = (nafW << 1) + naf[l];\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n for (var i = I; i > 0; i--) {\n for (j = 0; j < repr.length; j++) {\n nafW = repr[j];\n if (nafW === i)\n b = b.mixedAdd(doubles.points[j]);\n else if (nafW === -i)\n b = b.mixedAdd(doubles.points[j].neg());\n }\n a = a.add(b);\n }\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4;\n\n // Precompute window\n var nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n var wnd = nafPoints.points;\n\n // Get NAF form\n var naf = getNAF(k, w, this._bitLength);\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = this.jpoint(null, null, null);\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var l = 0; i >= 0 && naf[i] === 0; i--)\n l++;\n if (i >= 0)\n l++;\n acc = acc.dblp(l);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert(z !== 0);\n if (p.type === 'affine') {\n // J +- P\n if (z > 0)\n acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n else\n acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n } else {\n // J +- J\n if (z > 0)\n acc = acc.add(wnd[(z - 1) >> 1]);\n else\n acc = acc.add(wnd[(-z - 1) >> 1].neg());\n }\n }\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n points,\n coeffs,\n len,\n jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3;\n\n // Fill all arrays\n var max = 0;\n var i;\n var j;\n var p;\n for (i = 0; i < len; i++) {\n p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n }\n\n // Comb small window NAFs\n for (i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);\n naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [\n points[a], /* 1 */\n null, /* 3 */\n null, /* 5 */\n points[b], /* 7 */\n ];\n\n // Try to avoid Projective points, if possible\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [\n -3, /* -1 -1 */\n -1, /* -1 0 */\n -5, /* -1 1 */\n -7, /* 0 -1 */\n 0, /* 0 0 */\n 7, /* 0 1 */\n 5, /* 1 -1 */\n 1, /* 1 0 */\n 3, /* 1 1 */\n ];\n\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n for (j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n for (i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0)\n zero = false;\n }\n if (!zero)\n break;\n k++;\n i--;\n }\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n if (i < 0)\n break;\n\n for (j = 0; j < len; j++) {\n var z = tmp[j];\n p;\n if (z === 0)\n continue;\n else if (z > 0)\n p = wnd[j][(z - 1) >> 1];\n else if (z < 0)\n p = wnd[j][(-z - 1) >> 1].neg();\n\n if (p.type === 'affine')\n acc = acc.mixedAdd(p);\n else\n acc = acc.add(p);\n }\n }\n // Zeroify references\n for (i = 0; i < len; i++)\n wnd[i] = null;\n\n if (jacobianResult)\n return acc;\n else\n return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n\n var len = this.p.byteLength();\n\n // uncompressed, hybrid-odd, hybrid-even\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06)\n assert(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert(bytes[bytes.length - 1] % 2 === 1);\n\n var res = this.point(bytes.slice(1, 1 + len),\n bytes.slice(1 + len, 1 + 2 * len));\n\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n\n if (compact)\n return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n return [ 0x04 ].concat(x, this.getY().toArray('be', len));\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed)\n return this;\n\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null,\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed)\n return false;\n\n var doubles = this.precomputed.doubles;\n if (!doubles)\n return false;\n\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n\n var doubles = [ this ];\n var acc = this;\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step: step,\n points: doubles,\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n\n var res = [ this ];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n for (var i = 1; i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd: wnd,\n points: res,\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n for (var i = 0; i < k; i++)\n r = r.dbl();\n return r;\n};\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.assert;\n\nfunction ShortCurve(conf) {\n Base.call(this, 'short', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.tinv = this.two.redInvm();\n\n this.zeroA = this.a.fromRed().cmpn(0) === 0;\n this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n // If the curve is endomorphic, precalculate beta and lambda\n this.endo = this._getEndomorphism(conf);\n this._endoWnafT1 = new Array(4);\n this._endoWnafT2 = new Array(4);\n}\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n // No efficient endomorphism\n if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n return;\n\n // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n var beta;\n var lambda;\n if (conf.beta) {\n beta = new BN(conf.beta, 16).toRed(this.red);\n } else {\n var betas = this._getEndoRoots(this.p);\n // Choose the smallest beta\n beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n beta = beta.toRed(this.red);\n }\n if (conf.lambda) {\n lambda = new BN(conf.lambda, 16);\n } else {\n // Choose the lambda that is matching selected beta\n var lambdas = this._getEndoRoots(this.n);\n if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n lambda = lambdas[0];\n } else {\n lambda = lambdas[1];\n assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n }\n }\n\n // Get basis vectors, used for balanced length-two representation\n var basis;\n if (conf.basis) {\n basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16),\n };\n });\n } else {\n basis = this._getEndoBasis(lambda);\n }\n\n return {\n beta: beta,\n lambda: lambda,\n basis: basis,\n };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n // Find roots of for x^2 + x + 1 in F\n // Root = (-1 +- Sqrt(-3)) / 2\n //\n var red = num === this.p ? this.red : BN.mont(num);\n var tinv = new BN(2).toRed(red).redInvm();\n var ntinv = tinv.redNeg();\n\n var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n var l1 = ntinv.redAdd(s).fromRed();\n var l2 = ntinv.redSub(s).fromRed();\n return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n // aprxSqrt >= sqrt(this.n)\n var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n // 3.74\n // Run EGCD, until r(L + 1) < aprxSqrt\n var u = lambda;\n var v = this.n.clone();\n var x1 = new BN(1);\n var y1 = new BN(0);\n var x2 = new BN(0);\n var y2 = new BN(1);\n\n // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n var a0;\n var b0;\n // First vector\n var a1;\n var b1;\n // Second vector\n var a2;\n var b2;\n\n var prevR;\n var i = 0;\n var r;\n var x;\n while (u.cmpn(0) !== 0) {\n var q = v.div(u);\n r = v.sub(q.mul(u));\n x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n\n if (!a1 && r.cmp(aprxSqrt) < 0) {\n a0 = prevR.neg();\n b0 = x1;\n a1 = r.neg();\n b1 = x;\n } else if (a1 && ++i === 2) {\n break;\n }\n prevR = r;\n\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n }\n a2 = r.neg();\n b2 = x;\n\n var len1 = a1.sqr().add(b1.sqr());\n var len2 = a2.sqr().add(b2.sqr());\n if (len2.cmp(len1) >= 0) {\n a2 = a0;\n b2 = b0;\n }\n\n // Normalize signs\n if (a1.negative) {\n a1 = a1.neg();\n b1 = b1.neg();\n }\n if (a2.negative) {\n a2 = a2.neg();\n b2 = b2.neg();\n }\n\n return [\n { a: a1, b: b1 },\n { a: a2, b: b2 },\n ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n var basis = this.endo.basis;\n var v1 = basis[0];\n var v2 = basis[1];\n\n var c1 = v2.b.mul(k).divRound(this.n);\n var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n var p1 = c1.mul(v1.a);\n var p2 = c2.mul(v2.a);\n var q1 = c1.mul(v1.b);\n var q2 = c2.mul(v2.b);\n\n // Calculate answer\n var k1 = k.sub(p1).sub(p2);\n var k2 = q1.add(q2).neg();\n return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n // XXX Is there any way to tell if the number is odd without converting it\n // to non-red form?\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n if (point.inf)\n return true;\n\n var x = point.x;\n var y = point.y;\n\n var ax = this.a.redMul(x);\n var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n var npoints = this._endoWnafT1;\n var ncoeffs = this._endoWnafT2;\n for (var i = 0; i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]);\n var p = points[i];\n var beta = p._getBeta();\n\n if (split.k1.negative) {\n split.k1.ineg();\n p = p.neg(true);\n }\n if (split.k2.negative) {\n split.k2.ineg();\n beta = beta.neg(true);\n }\n\n npoints[i * 2] = p;\n npoints[i * 2 + 1] = beta;\n ncoeffs[i * 2] = split.k1;\n ncoeffs[i * 2 + 1] = split.k2;\n }\n var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n // Clean-up references to points and coefficients\n for (var j = 0; j < i * 2; j++) {\n npoints[j] = null;\n ncoeffs[j] = null;\n }\n return res;\n };\n\nfunction Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, 'affine');\n if (x === null && y === null) {\n this.x = null;\n this.y = null;\n this.inf = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n // Force redgomery representation when loading from JSON\n if (isRed) {\n this.x.forceRed(this.curve.red);\n this.y.forceRed(this.curve.red);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n this.inf = false;\n }\n}\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n if (!this.curve.endo)\n return;\n\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve;\n var endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta;\n beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul),\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul),\n },\n };\n }\n return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n if (!this.precomputed)\n return [ this.x, this.y ];\n\n return [ this.x, this.y, this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1),\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1),\n },\n } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n if (typeof obj === 'string')\n obj = JSON.parse(obj);\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n\n function obj2point(obj) {\n return curve.point(obj[0], obj[1], red);\n }\n\n var pre = obj[2];\n res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [ res ].concat(pre.doubles.points.map(obj2point)),\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [ res ].concat(pre.naf.points.map(obj2point)),\n },\n };\n return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P = 2P\n if (this.eq(p))\n return this.dbl();\n\n // P + (-P) = O\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n\n // P + Q = O\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n\n var c = this.y.redSub(p.y);\n if (c.cmpn(0) !== 0)\n c = c.redMul(this.x.redSub(p.x).redInvm());\n var nx = c.redSqr().redISub(this.x).redISub(p.x);\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.inf)\n return this;\n\n // 2P = O\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n\n var a = this.curve.a;\n\n var x2 = this.x.redSqr();\n var dyinv = ys1.redInvm();\n var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new BN(k, 16);\n if (this.isInfinity())\n return this;\n else if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else if (this.curve.endo)\n return this.curve._endoWnafMulAdd([ this ], [ k ]);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs, true);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n return this === p ||\n this.inf === p.inf &&\n (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n if (this.inf)\n return this;\n\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed;\n var negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate),\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate),\n },\n };\n }\n return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, 'jacobian');\n if (x === null && y === null && z === null) {\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = new BN(0);\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = new BN(z, 16);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z === this.curve.one;\n}\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n\n var zinv = this.z.redInvm();\n var zinv2 = zinv.redSqr();\n var ax = this.x.redMul(zinv2);\n var ay = this.y.redMul(zinv2).redMul(zinv);\n\n return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 12M + 4S + 7A\n var pz2 = p.z.redSqr();\n var z2 = this.z.redSqr();\n var u1 = this.x.redMul(pz2);\n var u2 = p.x.redMul(z2);\n var s1 = this.y.redMul(pz2.redMul(p.z));\n var s2 = p.y.redMul(z2.redMul(this.z));\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 8M + 3S + 7A\n var z2 = this.z.redSqr();\n var u1 = this.x;\n var u2 = p.x.redMul(z2);\n var s1 = this.y;\n var s2 = p.y.redMul(z2).redMul(this.z);\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n\n var i;\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (i = 0; i < pow; i++)\n r = r.dbl();\n return r;\n }\n\n // 1M + 2S + 1A + N * (4S + 5M + 8A)\n // N = 1 => 6M + 6S + 9A\n var a = this.curve.a;\n var tinv = this.curve.tinv;\n\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n // Reuse results\n var jyd = jy.redAdd(jy);\n for (i = 0; i < pow; i++) {\n var jx2 = jx.redSqr();\n var jyd2 = jyd.redSqr();\n var jyd4 = jyd2.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var t1 = jx.redMul(jyd2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n if (i + 1 < pow)\n jz4 = jz4.redMul(jyd4);\n\n jx = nx;\n jz = nz;\n jyd = dny;\n }\n\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n if (this.curve.zeroA)\n return this._zeroDbl();\n else if (this.curve.threeA)\n return this._threeDbl();\n else\n return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 14A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // T = M ^ 2 - 2*S\n var t = m.redSqr().redISub(s).redISub(s);\n\n // 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2*Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-dbl-2009-l\n // 2M + 5S + 13A\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = B^2\n var c = b.redSqr();\n // D = 2 * ((X1 + B)^2 - A - C)\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n // E = 3 * A\n var e = a.redAdd(a).redIAdd(a);\n // F = E^2\n var f = e.redSqr();\n\n // 8 * C\n var c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8);\n c8 = c8.redIAdd(c8);\n\n // X3 = F - 2 * D\n nx = f.redISub(d).redISub(d);\n // Y3 = E * (D - X3) - 8 * C\n ny = e.redMul(d.redISub(nx)).redISub(c8);\n // Z3 = 2 * Y1 * Z1\n nz = this.y.redMul(this.z);\n nz = nz.redIAdd(nz);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 15A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n // T = M^2 - 2 * S\n var t = m.redSqr().redISub(s).redISub(s);\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2 * Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S\n\n // delta = Z1^2\n var delta = this.z.redSqr();\n // gamma = Y1^2\n var gamma = this.y.redSqr();\n // beta = X1 * gamma\n var beta = this.x.redMul(gamma);\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n // X3 = alpha^2 - 8 * beta\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8);\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n var a = this.curve.a;\n\n // 4M + 6S + 10A\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n var jx2 = jx.redSqr();\n var jy2 = jy.redSqr();\n\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n\n var jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8);\n var nz = jy.redAdd(jy).redMul(jz);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n // 5M + 10S + ...\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // ZZ = Z1^2\n var zz = this.z.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // M = 3 * XX + a * ZZ2; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // MM = M^2\n var mm = m.redSqr();\n // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e);\n e = e.redAdd(e).redIAdd(e);\n e = e.redISub(mm);\n // EE = E^2\n var ee = e.redSqr();\n // T = 16*YYYY\n var t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n // U = (M + E)^2 - MM - EE - T\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n // X3 = 4 * (X1 * EE - 4 * YY * U)\n var yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4);\n yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx);\n nx = nx.redIAdd(nx);\n // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n // Z3 = (Z1 + E)^2 - ZZ - EE\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n k = new BN(k, kbase);\n\n return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n if (p.type === 'affine')\n return this.eq(p.toJ());\n\n if (this === p)\n return true;\n\n // x1 * z2^2 == x2 * z1^2\n var z2 = this.z.redSqr();\n var pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return false;\n\n // y1 * z2^3 == y2 * z1^3\n var z3 = z2.redMul(this.z);\n var pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n var zs = this.z.redSqr();\n var rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(zs);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n};\n\nJPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n","'use strict';\n\nvar curve = exports;\n\ncurve.base = require('./base');\ncurve.short = require('./short');\ncurve.mont = require('./mont');\ncurve.edwards = require('./edwards');\n","'use strict';\n\nvar curves = exports;\n\nvar hash = require('hash.js');\nvar curve = require('./curve');\nvar utils = require('./utils');\n\nvar assert = utils.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new curve.short(options);\n else if (options.type === 'edwards')\n this.curve = new curve.edwards(options);\n else\n this.curve = new curve.mont(options);\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve,\n });\n return curve;\n },\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: hash.sha256,\n gRed: false,\n g: [\n '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811',\n ],\n});\n\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: hash.sha256,\n gRed: false,\n g: [\n 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34',\n ],\n});\n\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: hash.sha256,\n gRed: false,\n g: [\n '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5',\n ],\n});\n\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: hash.sha384,\n gRed: false,\n g: [\n 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n '5502f25d bf55296c 3a545e38 72760ab7',\n '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f',\n ],\n});\n\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: hash.sha512,\n gRed: false,\n g: [\n '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n '3fad0761 353c7086 a272c240 88be9476 9fd16650',\n ],\n});\n\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '9',\n ],\n});\n\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658',\n ],\n});\n\nvar pre;\ntry {\n pre = require('./precomputed/secp256k1');\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: hash.sha256,\n\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3',\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15',\n },\n ],\n\n gRed: false,\n g: [\n '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n pre,\n ],\n});\n","'use strict';\n\nvar hash = require('hash.js');\nvar utils = require('minimalistic-crypto-utils');\nvar assert = require('minimalistic-assert');\n\nfunction HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash;\n this.predResist = !!options.predResist;\n\n this.outLen = this.hash.outSize;\n this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n this._reseed = null;\n this.reseedInterval = null;\n this.K = null;\n this.V = null;\n\n var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n this._init(entropy, nonce, pers);\n}\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n\n this.K = new Array(this.outLen / 8);\n this.V = new Array(this.outLen / 8);\n for (var i = 0; i < this.V.length; i++) {\n this.K[i] = 0x00;\n this.V[i] = 0x01;\n }\n\n this._update(seed);\n this._reseed = 1;\n this.reseedInterval = 0x1000000000000; // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n var kmac = this._hmac()\n .update(this.V)\n .update([ 0x00 ]);\n if (seed)\n kmac = kmac.update(seed);\n this.K = kmac.digest();\n this.V = this._hmac().update(this.V).digest();\n if (!seed)\n return;\n\n this.K = this._hmac()\n .update(this.V)\n .update([ 0x01 ])\n .update(seed)\n .digest();\n this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n // Optional entropy enc\n if (typeof entropyEnc !== 'string') {\n addEnc = add;\n add = entropyEnc;\n entropyEnc = null;\n }\n\n entropy = utils.toArray(entropy, entropyEnc);\n add = utils.toArray(add, addEnc);\n\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._update(entropy.concat(add || []));\n this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error('Reseed is required');\n\n // Optional encoding\n if (typeof enc !== 'string') {\n addEnc = add;\n add = enc;\n enc = null;\n }\n\n // Optional additional data\n if (add) {\n add = utils.toArray(add, addEnc || 'hex');\n this._update(add);\n }\n\n var temp = [];\n while (temp.length < len) {\n this.V = this._hmac().update(this.V).digest();\n temp = temp.concat(this.V);\n }\n\n var res = temp.slice(0, len);\n this._update(add);\n this._reseed++;\n return utils.encode(res, enc);\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction KeyPair(ec, options) {\n this.ec = ec;\n this.priv = null;\n this.pub = null;\n\n // KeyPair(ec, { priv: ..., pub: ... })\n if (options.priv)\n this._importPrivate(options.priv, options.privEnc);\n if (options.pub)\n this._importPublic(options.pub, options.pubEnc);\n}\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n if (pub instanceof KeyPair)\n return pub;\n\n return new KeyPair(ec, {\n pub: pub,\n pubEnc: enc,\n });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n if (priv instanceof KeyPair)\n return priv;\n\n return new KeyPair(ec, {\n priv: priv,\n privEnc: enc,\n });\n};\n\nKeyPair.prototype.validate = function validate() {\n var pub = this.getPublic();\n\n if (pub.isInfinity())\n return { result: false, reason: 'Invalid public key' };\n if (!pub.validate())\n return { result: false, reason: 'Public key is not a point' };\n if (!pub.mul(this.ec.curve.n).isInfinity())\n return { result: false, reason: 'Public key * N != O' };\n\n return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n // compact is optional argument\n if (typeof compact === 'string') {\n enc = compact;\n compact = null;\n }\n\n if (!this.pub)\n this.pub = this.ec.g.mul(this.priv);\n\n if (!enc)\n return this.pub;\n\n return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n if (enc === 'hex')\n return this.priv.toString(16, 2);\n else\n return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n this.priv = new BN(key, enc || 16);\n\n // Ensure that the priv won't be bigger than n, otherwise we may fail\n // in fixed multiplication method\n this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n if (key.x || key.y) {\n // Montgomery points only have an `x` coordinate.\n // Weierstrass/Edwards points on the other hand have both `x` and\n // `y` coordinates.\n if (this.ec.curve.type === 'mont') {\n assert(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' ||\n this.ec.curve.type === 'edwards') {\n assert(key.x && key.y, 'Need both x and y coordinate');\n }\n this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n if(!pub.validate()) {\n assert(pub.validate(), 'public point not validated');\n }\n return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n return '';\n};\n","'use strict';\n\nvar BN = require('bn.js');\n\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n\n if (this._importDER(options, enc))\n return;\n\n assert(options.r && options.s, 'Signature without r or s');\n this.r = new BN(options.r, 16);\n this.s = new BN(options.s, 16);\n if (options.recoveryParam === undefined)\n this.recoveryParam = null;\n else\n this.recoveryParam = options.recoveryParam;\n}\nmodule.exports = Signature;\n\nfunction Position() {\n this.place = 0;\n}\n\nfunction getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 0x80)) {\n return initial;\n }\n var octetLen = initial & 0xf;\n\n // Indefinite length or overflow\n if (octetLen === 0 || octetLen > 4) {\n return false;\n }\n\n var val = 0;\n for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n val <<= 8;\n val |= buf[off];\n val >>>= 0;\n }\n\n // Leading zeroes\n if (val <= 0x7f) {\n return false;\n }\n\n p.place = off;\n return val;\n}\n\nfunction rmPadding(buf) {\n var i = 0;\n var len = buf.length - 1;\n while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n i++;\n }\n if (i === 0) {\n return buf;\n }\n return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position();\n if (data[p.place++] !== 0x30) {\n return false;\n }\n var len = getLength(data, p);\n if (len === false) {\n return false;\n }\n if ((len + p.place) !== data.length) {\n return false;\n }\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var rlen = getLength(data, p);\n if (rlen === false) {\n return false;\n }\n var r = data.slice(p.place, rlen + p.place);\n p.place += rlen;\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var slen = getLength(data, p);\n if (slen === false) {\n return false;\n }\n if (data.length !== slen + p.place) {\n return false;\n }\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0) {\n if (r[1] & 0x80) {\n r = r.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n if (s[0] === 0) {\n if (s[1] & 0x80) {\n s = s.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n\n this.r = new BN(r);\n this.s = new BN(s);\n this.recoveryParam = null;\n\n return true;\n};\n\nfunction constructLength(arr, len) {\n if (len < 0x80) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n arr.push(octets | 0x80);\n while (--octets) {\n arr.push((len >>> (octets << 3)) & 0xff);\n }\n arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n var r = this.r.toArray();\n var s = this.s.toArray();\n\n // Pad values\n if (r[0] & 0x80)\n r = [ 0 ].concat(r);\n // Pad values\n if (s[0] & 0x80)\n s = [ 0 ].concat(s);\n\n r = rmPadding(r);\n s = rmPadding(s);\n\n while (!s[0] && !(s[1] & 0x80)) {\n s = s.slice(1);\n }\n var arr = [ 0x02 ];\n constructLength(arr, r.length);\n arr = arr.concat(r);\n arr.push(0x02);\n constructLength(arr, s.length);\n var backHalf = arr.concat(s);\n var res = [ 0x30 ];\n constructLength(res, backHalf.length);\n res = res.concat(backHalf);\n return utils.encode(res, enc);\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar HmacDRBG = require('hmac-drbg');\nvar utils = require('../utils');\nvar curves = require('../curves');\nvar rand = require('brorand');\nvar assert = utils.assert;\n\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n\n // Shortcut `elliptic.ec(curve-name)`\n if (typeof options === 'string') {\n assert(Object.prototype.hasOwnProperty.call(curves, options),\n 'Unknown curve ' + options);\n\n options = curves[options];\n }\n\n // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n if (options instanceof curves.PresetCurve)\n options = { curve: options };\n\n this.curve = options.curve.curve;\n this.n = this.curve.n;\n this.nh = this.n.ushrn(1);\n this.g = this.curve.g;\n\n // Point on curve\n this.g = options.curve.g;\n this.g.precompute(options.curve.n.bitLength() + 1);\n\n // Hash for function for DRBG\n this.hash = options.hash || options.curve.hash;\n}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n if (!options)\n options = {};\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.n.toArray(),\n });\n\n var bytes = this.n.byteLength();\n var ns2 = this.n.sub(new BN(2));\n for (;;) {\n var priv = new BN(drbg.generate(bytes));\n if (priv.cmp(ns2) > 0)\n continue;\n\n priv.iaddn(1);\n return this.keyFromPrivate(priv);\n }\n};\n\nEC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n if (delta > 0)\n msg = msg.ushrn(delta);\n if (!truncOnly && msg.cmp(this.n) >= 0)\n return msg.sub(this.n);\n else\n return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n if (typeof enc === 'object') {\n options = enc;\n enc = null;\n }\n if (!options)\n options = {};\n\n key = this.keyFromPrivate(key, enc);\n msg = this._truncateToN(new BN(msg, 16));\n\n // Zero-extend key to provide enough entropy\n var bytes = this.n.byteLength();\n var bkey = key.getPrivate().toArray('be', bytes);\n\n // Zero-extend nonce to have the same byte size as N\n var nonce = msg.toArray('be', bytes);\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce: nonce,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n });\n\n // Number of bytes to generate\n var ns1 = this.n.sub(new BN(1));\n\n for (var iter = 0; ; iter++) {\n var k = options.k ?\n options.k(iter) :\n new BN(drbg.generate(this.n.byteLength()));\n k = this._truncateToN(k, true);\n if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n continue;\n\n var kp = this.g.mul(k);\n if (kp.isInfinity())\n continue;\n\n var kpX = kp.getX();\n var r = kpX.umod(this.n);\n if (r.cmpn(0) === 0)\n continue;\n\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n s = s.umod(this.n);\n if (s.cmpn(0) === 0)\n continue;\n\n var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n (kpX.cmp(r) !== 0 ? 2 : 0);\n\n // Use complement of `s`, if it is > `n / 2`\n if (options.canonical && s.cmp(this.nh) > 0) {\n s = this.n.sub(s);\n recoveryParam ^= 1;\n }\n\n return new Signature({ r: r, s: s, recoveryParam: recoveryParam });\n }\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc) {\n msg = this._truncateToN(new BN(msg, 16));\n key = this.keyFromPublic(key, enc);\n signature = new Signature(signature, 'hex');\n\n // Perform primitive values validation\n var r = signature.r;\n var s = signature.s;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n return false;\n if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return false;\n\n // Validate signature\n var sinv = s.invm(this.n);\n var u1 = sinv.mul(msg).umod(this.n);\n var u2 = sinv.mul(r).umod(this.n);\n var p;\n\n if (!this.curve._maxwellTrick) {\n p = this.g.mulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n return p.getX().umod(this.n).cmp(r) === 0;\n }\n\n // NOTE: Greg Maxwell's trick, inspired by:\n // https://git.io/vad3K\n\n p = this.g.jmulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n // Compare `p.x` of Jacobian point with `r`,\n // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n // inverse of `p.z^2`\n return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, 'The recovery param is more than two bits');\n signature = new Signature(signature, enc);\n\n var n = this.n;\n var e = new BN(msg);\n var r = signature.r;\n var s = signature.s;\n\n // A set LSB signifies that the y-coordinate is odd\n var isYOdd = j & 1;\n var isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error('Unable to find sencond key candinate');\n\n // 1.1. Let x = r + jn.\n if (isSecondKey)\n r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n else\n r = this.curve.pointFromX(r, isYOdd);\n\n var rInv = signature.r.invm(n);\n var s1 = n.sub(e).mul(rInv).umod(n);\n var s2 = s.mul(rInv).umod(n);\n\n // 1.6.1 Compute Q = r^-1 (sR - eG)\n // Q = r^-1 (sR + -eG)\n return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n signature = new Signature(signature, enc);\n if (signature.recoveryParam !== null)\n return signature.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch (e) {\n continue;\n }\n\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error('Unable to find valid recovery factor');\n};\n","import _ec from \"elliptic\";\nvar EC = _ec.ec;\nexport { EC };\n//# sourceMappingURL=elliptic.js.map","'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = require('../package.json').version;\nelliptic.utils = require('./elliptic/utils');\nelliptic.rand = require('brorand');\nelliptic.curve = require('./elliptic/curve');\nelliptic.curves = require('./elliptic/curves');\n\n// Protocols\nelliptic.ec = require('./elliptic/ec');\nelliptic.eddsa = require('./elliptic/eddsa');\n","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // 'A' - 'F'\n if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n // '0' - '9'\n } else {\n return (c - 48) & 0xf;\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this.strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is BN v4 instance\n r.strip();\n } else {\n // r is BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Client = void 0;\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));\n\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));\n\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));\n\nvar _websocket = _interopRequireDefault(require(\"./lib/client/websocket.browser\"));\n\nvar _client = _interopRequireDefault(require(\"./lib/client\"));\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2[\"default\"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2[\"default\"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2[\"default\"])(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nvar Client = /*#__PURE__*/function (_CommonClient) {\n (0, _inherits2[\"default\"])(Client, _CommonClient);\n\n var _super = _createSuper(Client);\n\n function Client() {\n var address = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"ws://localhost:8080\";\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$autoconnect = _ref.autoconnect,\n autoconnect = _ref$autoconnect === void 0 ? true : _ref$autoconnect,\n _ref$reconnect = _ref.reconnect,\n reconnect = _ref$reconnect === void 0 ? true : _ref$reconnect,\n _ref$reconnect_interv = _ref.reconnect_interval,\n reconnect_interval = _ref$reconnect_interv === void 0 ? 1000 : _ref$reconnect_interv,\n _ref$max_reconnects = _ref.max_reconnects,\n max_reconnects = _ref$max_reconnects === void 0 ? 5 : _ref$max_reconnects;\n\n var generate_request_id = arguments.length > 2 ? arguments[2] : undefined;\n (0, _classCallCheck2[\"default\"])(this, Client);\n return _super.call(this, _websocket[\"default\"], address, {\n autoconnect: autoconnect,\n reconnect: reconnect,\n reconnect_interval: reconnect_interval,\n max_reconnects: max_reconnects\n }, generate_request_id);\n }\n\n return Client;\n}(_client[\"default\"]);\n\nexports.Client = Client;","'use strict';\n\nconst uuid = require('uuid').v4;\nconst generateRequest = require('../../generateRequest');\n\n/**\n * Constructor for a Jayson Browser Client that does not depend any node.js core libraries\n * @class ClientBrowser\n * @param {Function} callServer Method that calls the server, receives the stringified request and a regular node-style callback\n * @param {Object} [options]\n * @param {Function} [options.reviver] Reviver function for JSON\n * @param {Function} [options.replacer] Replacer function for JSON\n * @param {Number} [options.version=2] JSON-RPC version to use (1|2)\n * @param {Function} [options.generator] Function to use for generating request IDs\n * @param {Boolean} [options.notificationIdNull=false] When true, version 2 requests will set id to null instead of omitting it\n * @return {ClientBrowser}\n */\nconst ClientBrowser = function(callServer, options) {\n if(!(this instanceof ClientBrowser)) {\n return new ClientBrowser(callServer, options);\n }\n\n if (!options) {\n options = {};\n }\n\n this.options = {\n reviver: typeof options.reviver !== 'undefined' ? options.reviver : null,\n replacer: typeof options.replacer !== 'undefined' ? options.replacer : null,\n generator: typeof options.generator !== 'undefined' ? options.generator : function() { return uuid(); },\n version: typeof options.version !== 'undefined' ? options.version : 2,\n notificationIdNull: typeof options.notificationIdNull === 'boolean' ? options.notificationIdNull : false,\n };\n\n this.callServer = callServer;\n};\n\nmodule.exports = ClientBrowser;\n\n/**\n * Creates a request and dispatches it if given a callback.\n * @param {String|Array} method A batch request if passed an Array, or a method name if passed a String\n * @param {Array|Object} [params] Parameters for the method\n * @param {String|Number} [id] Optional id. If undefined an id will be generated. If null it creates a notification request\n * @param {Function} [callback] Request callback. If specified, executes the request rather than only returning it.\n * @throws {TypeError} Invalid parameters\n * @return {Object} JSON-RPC 1.0 or 2.0 compatible request\n */\nClientBrowser.prototype.request = function(method, params, id, callback) {\n const self = this;\n let request = null;\n\n // is this a batch request?\n const isBatch = Array.isArray(method) && typeof params === 'function';\n\n if (this.options.version === 1 && isBatch) {\n throw new TypeError('JSON-RPC 1.0 does not support batching');\n }\n\n // is this a raw request?\n const isRaw = !isBatch && method && typeof method === 'object' && typeof params === 'function';\n\n if(isBatch || isRaw) {\n callback = params;\n request = method;\n } else {\n if(typeof id === 'function') {\n callback = id;\n // specifically undefined because \"null\" is a notification request\n id = undefined;\n }\n\n const hasCallback = typeof callback === 'function';\n\n try {\n request = generateRequest(method, params, id, {\n generator: this.options.generator,\n version: this.options.version,\n notificationIdNull: this.options.notificationIdNull,\n });\n } catch(err) {\n if(hasCallback) {\n return callback(err);\n }\n throw err;\n }\n\n // no callback means we should just return a raw request\n if(!hasCallback) {\n return request;\n }\n\n }\n\n let message;\n try {\n message = JSON.stringify(request, this.options.replacer);\n } catch(err) {\n return callback(err);\n }\n\n this.callServer(message, function(err, response) {\n self._parseResponse(err, response, callback);\n });\n\n // always return the raw request\n return request;\n};\n\n/**\n * Parses a response from a server\n * @param {Object} err Error to pass on that is unrelated to the actual response\n * @param {String} responseText JSON-RPC 1.0 or 2.0 response\n * @param {Function} callback Callback that will receive different arguments depending on the amount of parameters\n * @private\n */\nClientBrowser.prototype._parseResponse = function(err, responseText, callback) {\n if(err) {\n callback(err);\n return;\n }\n\n if(!responseText) {\n // empty response text, assume that is correct because it could be a\n // notification which jayson does not give any body for\n return callback();\n }\n\n let response;\n try {\n response = JSON.parse(responseText, this.options.reviver);\n } catch(err) {\n return callback(err);\n }\n\n if(callback.length === 3) {\n // if callback length is 3, we split callback arguments on error and response\n\n // is batch response?\n if(Array.isArray(response)) {\n\n // neccesary to split strictly on validity according to spec here\n const isError = function(res) {\n return typeof res.error !== 'undefined';\n };\n\n const isNotError = function (res) {\n return !isError(res);\n };\n\n return callback(null, response.filter(isError), response.filter(isNotError));\n \n } else {\n\n // split regardless of validity\n return callback(null, response.error, response.result);\n \n }\n \n }\n\n callback(null, response);\n};\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(3);\nfunction isBrowserHeaders(arg) {\n return typeof arg === \"object\" && typeof arg.headersMap === \"object\" && typeof arg.forEach === \"function\";\n}\nvar BrowserHeaders = (function () {\n function BrowserHeaders(init, options) {\n if (init === void 0) { init = {}; }\n if (options === void 0) { options = { splitValues: false }; }\n var _this = this;\n this.headersMap = {};\n if (init) {\n if (typeof Headers !== \"undefined\" && init instanceof Headers) {\n var keys = util_1.getHeaderKeys(init);\n keys.forEach(function (key) {\n var values = util_1.getHeaderValues(init, key);\n values.forEach(function (value) {\n if (options.splitValues) {\n _this.append(key, util_1.splitHeaderValue(value));\n }\n else {\n _this.append(key, value);\n }\n });\n });\n }\n else if (isBrowserHeaders(init)) {\n init.forEach(function (key, values) {\n _this.append(key, values);\n });\n }\n else if (typeof Map !== \"undefined\" && init instanceof Map) {\n var asMap = init;\n asMap.forEach(function (value, key) {\n _this.append(key, value);\n });\n }\n else if (typeof init === \"string\") {\n this.appendFromString(init);\n }\n else if (typeof init === \"object\") {\n Object.getOwnPropertyNames(init).forEach(function (key) {\n var asObject = init;\n var values = asObject[key];\n if (Array.isArray(values)) {\n values.forEach(function (value) {\n _this.append(key, value);\n });\n }\n else {\n _this.append(key, values);\n }\n });\n }\n }\n }\n BrowserHeaders.prototype.appendFromString = function (str) {\n var pairs = str.split(\"\\r\\n\");\n for (var i = 0; i < pairs.length; i++) {\n var p = pairs[i];\n var index = p.indexOf(\":\");\n if (index > 0) {\n var key = p.substring(0, index).trim();\n var value = p.substring(index + 1).trim();\n this.append(key, value);\n }\n }\n };\n BrowserHeaders.prototype.delete = function (key, value) {\n var normalizedKey = util_1.normalizeName(key);\n if (value === undefined) {\n delete this.headersMap[normalizedKey];\n }\n else {\n var existing = this.headersMap[normalizedKey];\n if (existing) {\n var index = existing.indexOf(value);\n if (index >= 0) {\n existing.splice(index, 1);\n }\n if (existing.length === 0) {\n delete this.headersMap[normalizedKey];\n }\n }\n }\n };\n BrowserHeaders.prototype.append = function (key, value) {\n var _this = this;\n var normalizedKey = util_1.normalizeName(key);\n if (!Array.isArray(this.headersMap[normalizedKey])) {\n this.headersMap[normalizedKey] = [];\n }\n if (Array.isArray(value)) {\n value.forEach(function (arrayValue) {\n _this.headersMap[normalizedKey].push(util_1.normalizeValue(arrayValue));\n });\n }\n else {\n this.headersMap[normalizedKey].push(util_1.normalizeValue(value));\n }\n };\n BrowserHeaders.prototype.set = function (key, value) {\n var normalizedKey = util_1.normalizeName(key);\n if (Array.isArray(value)) {\n var normalized_1 = [];\n value.forEach(function (arrayValue) {\n normalized_1.push(util_1.normalizeValue(arrayValue));\n });\n this.headersMap[normalizedKey] = normalized_1;\n }\n else {\n this.headersMap[normalizedKey] = [util_1.normalizeValue(value)];\n }\n };\n BrowserHeaders.prototype.has = function (key, value) {\n var keyArray = this.headersMap[util_1.normalizeName(key)];\n var keyExists = Array.isArray(keyArray);\n if (!keyExists) {\n return false;\n }\n if (value !== undefined) {\n var normalizedValue = util_1.normalizeValue(value);\n return keyArray.indexOf(normalizedValue) >= 0;\n }\n else {\n return true;\n }\n };\n BrowserHeaders.prototype.get = function (key) {\n var values = this.headersMap[util_1.normalizeName(key)];\n if (values !== undefined) {\n return values.concat();\n }\n return [];\n };\n BrowserHeaders.prototype.forEach = function (callback) {\n var _this = this;\n Object.getOwnPropertyNames(this.headersMap)\n .forEach(function (key) {\n callback(key, _this.headersMap[key]);\n }, this);\n };\n BrowserHeaders.prototype.toHeaders = function () {\n if (typeof Headers !== \"undefined\") {\n var headers_1 = new Headers();\n this.forEach(function (key, values) {\n values.forEach(function (value) {\n headers_1.append(key, value);\n });\n });\n return headers_1;\n }\n else {\n throw new Error(\"Headers class is not defined\");\n }\n };\n return BrowserHeaders;\n}());\nexports.BrowserHeaders = BrowserHeaders;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BrowserHeaders_1 = __webpack_require__(0);\nexports.BrowserHeaders = BrowserHeaders_1.BrowserHeaders;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction iterateHeaders(headers, callback) {\n var iterator = headers[Symbol.iterator]();\n var entry = iterator.next();\n while (!entry.done) {\n callback(entry.value[0]);\n entry = iterator.next();\n }\n}\nexports.iterateHeaders = iterateHeaders;\nfunction iterateHeadersKeys(headers, callback) {\n var iterator = headers.keys();\n var entry = iterator.next();\n while (!entry.done) {\n callback(entry.value);\n entry = iterator.next();\n }\n}\nexports.iterateHeadersKeys = iterateHeadersKeys;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar iterateHeaders_1 = __webpack_require__(2);\nfunction normalizeName(name) {\n if (typeof name !== \"string\") {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError(\"Invalid character in header field name\");\n }\n return name.toLowerCase();\n}\nexports.normalizeName = normalizeName;\nfunction normalizeValue(value) {\n if (typeof value !== \"string\") {\n value = String(value);\n }\n return value;\n}\nexports.normalizeValue = normalizeValue;\nfunction getHeaderValues(headersAsNative, key) {\n var headers = toWindowHeaders(headersAsNative);\n if (headers instanceof Headers && headers.getAll) {\n return headers.getAll(key);\n }\n var getValue = headers.get(key);\n if (getValue && typeof getValue === \"string\") {\n return [getValue];\n }\n return getValue;\n}\nexports.getHeaderValues = getHeaderValues;\nfunction toWindowHeaders(headersAsNative) {\n return headersAsNative;\n}\nfunction getHeaderKeys(headersAsNative) {\n var headers = toWindowHeaders(headersAsNative);\n var asMap = {};\n var keys = [];\n if (headers.keys) {\n iterateHeaders_1.iterateHeadersKeys(headers, function (key) {\n if (!asMap[key]) {\n asMap[key] = true;\n keys.push(key);\n }\n });\n }\n else if (headers.forEach) {\n headers.forEach(function (_, key) {\n if (!asMap[key]) {\n asMap[key] = true;\n keys.push(key);\n }\n });\n }\n else {\n iterateHeaders_1.iterateHeaders(headers, function (entry) {\n var key = entry[0];\n if (!asMap[key]) {\n asMap[key] = true;\n keys.push(key);\n }\n });\n }\n return keys;\n}\nexports.getHeaderKeys = getHeaderKeys;\nfunction splitHeaderValue(str) {\n var values = [];\n var commaSpaceValues = str.split(\", \");\n commaSpaceValues.forEach(function (commaSpaceValue) {\n commaSpaceValue.split(\",\").forEach(function (commaValue) {\n values.push(commaValue);\n });\n });\n return values;\n}\nexports.splitHeaderValue = splitHeaderValue;\n\n\n/***/ })\n/******/ ]);\n});","export default typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n","import isBrowser from './isBrowser';\n\nconst timeoutDuration = (function(){\n const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}());\n\nexport function microtaskDebounce(fn) {\n let called = false\n return () => {\n if (called) {\n return\n }\n called = true\n window.Promise.resolve().then(() => {\n called = false\n fn()\n })\n }\n}\n\nexport function taskDebounce(fn) {\n let scheduled = false;\n return () => {\n if (!scheduled) {\n scheduled = true;\n setTimeout(() => {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nconst supportsMicroTasks = isBrowser && window.Promise\n\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nexport default (supportsMicroTasks\n ? microtaskDebounce\n : taskDebounce);\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n const getType = {};\n return (\n functionToCheck &&\n getType.toString.call(functionToCheck) === '[object Function]'\n );\n}\n","/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nexport default function getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n const window = element.ownerDocument.defaultView;\n const css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n","/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nexport default function getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nexport default function getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body\n case '#document':\n return element.body\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(element);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n","/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nexport default function getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n","import isBrowser from './isBrowser';\n\nconst isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nconst isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nexport default function isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nexport default function getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n const noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n let offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n const nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (\n ['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&\n getStyleComputedProperty(offsetParent, 'position') === 'static'\n ) {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n","/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nexport default function getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n","import isOffsetContainer from './isOffsetContainer';\nimport getRoot from './getRoot';\nimport getOffsetParent from './getOffsetParent';\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nexport default function findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n const order =\n element1.compareDocumentPosition(element2) &\n Node.DOCUMENT_POSITION_FOLLOWING;\n const start = order ? element1 : element2;\n const end = order ? element2 : element1;\n\n // Get common ancestor container\n const range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n const { commonAncestorContainer } = range;\n\n // Both nodes are inside #document\n if (\n (element1 !== commonAncestorContainer &&\n element2 !== commonAncestorContainer) ||\n start.contains(end)\n ) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n const element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n","import getOffsetParent from './getOffsetParent';\n\nexport default function isOffsetContainer(element) {\n const { nodeName } = element;\n if (nodeName === 'BODY') {\n return false;\n }\n return (\n nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element\n );\n}\n","/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nexport default function getScroll(element, side = 'top') {\n const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n const nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n const html = element.ownerDocument.documentElement;\n const scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n","import getScroll from './getScroll';\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nexport default function includeScroll(rect, element, subtract = false) {\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n const modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n","/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nexport default function getBordersSize(styles, axis) {\n const sideA = axis === 'x' ? 'Left' : 'Top';\n const sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return (\n parseFloat(styles[`border${sideA}Width`]) +\n parseFloat(styles[`border${sideB}Width`])\n );\n}\n","import isIE from './isIE';\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(\n body[`offset${axis}`],\n body[`scroll${axis}`],\n html[`client${axis}`],\n html[`offset${axis}`],\n html[`scroll${axis}`],\n isIE(10)\n ? (parseInt(html[`offset${axis}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`]))\n : 0 \n );\n}\n\nexport default function getWindowSizes(document) {\n const body = document.body;\n const html = document.documentElement;\n const computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle),\n };\n}\n","/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nexport default function getClientRect(offsets) {\n return {\n ...offsets,\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height,\n };\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getBordersSize from './getBordersSize';\nimport getWindowSizes from './getWindowSizes';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\nimport isIE from './isIE';\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nexport default function getBoundingClientRect(element) {\n let rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n }\n else {\n rect = element.getBoundingClientRect();\n }\n }\n catch(e){}\n\n const result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n\n // subtract scrollbar size from sizes\n const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n const width =\n sizes.width || element.clientWidth || result.width;\n const height =\n sizes.height || element.clientHeight || result.height;\n\n let horizScrollbar = element.offsetWidth - width;\n let vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n const styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport includeScroll from './includeScroll';\nimport getScrollParent from './getScrollParent';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport runIsIE from './isIE';\nimport getClientRect from './getClientRect';\n\nexport default function getOffsetRectRelativeToArbitraryNode(children, parent, fixedPosition = false) {\n const isIE10 = runIsIE(10);\n const isHTML = parent.nodeName === 'HTML';\n const childrenRect = getBoundingClientRect(children);\n const parentRect = getBoundingClientRect(parent);\n const scrollParent = getScrollParent(children);\n\n const styles = getStyleComputedProperty(parent);\n const borderTopWidth = parseFloat(styles.borderTopWidth);\n const borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if(fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n let offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height,\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n const marginTop = parseFloat(styles.marginTop);\n const marginLeft = parseFloat(styles.marginLeft);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (\n isIE10 && !fixedPosition\n ? parent.contains(scrollParent)\n : parent === scrollParent && scrollParent.nodeName !== 'BODY'\n ) {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n","import getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\n\nexport default function getViewportOffsetRectRelativeToArtbitraryNode(element, excludeScroll = false) {\n const html = element.ownerDocument.documentElement;\n const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n const width = Math.max(html.clientWidth, window.innerWidth || 0);\n const height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n const scrollTop = !excludeScroll ? getScroll(html) : 0;\n const scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n const offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width,\n height,\n };\n\n return getClientRect(offset);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nexport default function isFixed(element) {\n const nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n const parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nexport default function getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n let el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n\n}\n","import getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getReferenceNode from './getReferenceNode';\nimport findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getViewportOffsetRectRelativeToArtbitraryNode from './getViewportOffsetRectRelativeToArtbitraryNode';\nimport getWindowSizes from './getWindowSizes';\nimport isFixed from './isFixed';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nexport default function getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement,\n fixedPosition = false\n) {\n // NOTE: 1 DOM access here\n\n let boundaries = { top: 0, left: 0 };\n const offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport' ) {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n }\n\n else {\n // Handle other cases based on DOM element used as boundaries\n let boundariesNode;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n const offsets = getOffsetRectRelativeToArbitraryNode(\n boundariesNode,\n offsetParent,\n fixedPosition\n );\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n const { height, width } = getWindowSizes(popper.ownerDocument);\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n const isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0; \n boundaries.top += isPaddingNumber ? padding : padding.top || 0; \n boundaries.right -= isPaddingNumber ? padding : padding.right || 0; \n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; \n\n return boundaries;\n}\n","import getBoundaries from '../utils/getBoundaries';\n\nfunction getArea({ width, height }) {\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeAutoPlacement(\n placement,\n refRect,\n popper,\n reference,\n boundariesElement,\n padding = 0\n) {\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n const boundaries = getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement\n );\n\n const rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top,\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height,\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom,\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height,\n },\n };\n\n const sortedAreas = Object.keys(rects)\n .map(key => ({\n key,\n ...rects[key],\n area: getArea(rects[key]),\n }))\n .sort((a, b) => b.area - a.area);\n\n const filteredAreas = sortedAreas.filter(\n ({ width, height }) =>\n width >= popper.clientWidth && height >= popper.clientHeight\n );\n\n const computedPlacement = filteredAreas.length > 0\n ? filteredAreas[0].key\n : sortedAreas[0].key;\n\n const variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? `-${variation}` : '');\n}\n","import findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\nimport getReferenceNode from './getReferenceNode';\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nexport default function getReferenceOffsets(state, popper, reference, fixedPosition = null) {\n const commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nexport default function getOuterSizes(element) {\n const window = element.ownerDocument.defaultView;\n const styles = window.getComputedStyle(element);\n const x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n const y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n const result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x,\n };\n return result;\n}\n","/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nexport default function getOppositePlacement(placement) {\n const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);\n}\n","import getOuterSizes from './getOuterSizes';\nimport getOppositePlacement from './getOppositePlacement';\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nexport default function getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n const popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n const popperOffsets = {\n width: popperRect.width,\n height: popperRect.height,\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n const mainSide = isHoriz ? 'top' : 'left';\n const secondarySide = isHoriz ? 'left' : 'top';\n const measurement = isHoriz ? 'height' : 'width';\n const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] =\n referenceOffsets[mainSide] +\n referenceOffsets[measurement] / 2 -\n popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] =\n referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] =\n referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n","/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n","import isFunction from './isFunction';\nimport findIndex from './findIndex';\nimport getClientRect from '../utils/getClientRect';\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nexport default function runModifiers(modifiers, data, ends) {\n const modifiersToRun = ends === undefined\n ? modifiers\n : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(modifier => {\n if (modifier['function']) { // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n const fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n","import find from './find';\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(cur => cur[prop] === value);\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n const match = find(arr, obj => obj[prop] === value);\n return arr.indexOf(match);\n}\n","import computeAutoPlacement from '../utils/computeAutoPlacement';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nexport default function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n let data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {},\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(\n this.state,\n this.popper,\n this.reference,\n this.options.positionFixed\n );\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(\n this.options.placement,\n data.offsets.reference,\n this.popper,\n this.reference,\n this.options.modifiers.flip.boundariesElement,\n this.options.modifiers.flip.padding\n );\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(\n this.popper,\n data.offsets.reference,\n data.placement\n );\n\n data.offsets.popper.position = this.options.positionFixed\n ? 'fixed'\n : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nexport default function isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(\n ({ name, enabled }) => enabled && name === modifierName\n );\n}\n","/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nexport default function getSupportedPropertyName(property) {\n const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n const upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (let i = 0; i < prefixes.length; i++) {\n const prefix = prefixes[i];\n const toCheck = prefix ? `${prefix}${upperProp}` : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n","import isModifierEnabled from '../utils/isModifierEnabled';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nexport default function destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n","/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nexport default function getWindow(element) {\n const ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n","import getScrollParent from './getScrollParent';\nimport getWindow from './getWindow';\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n const isBody = scrollParent.nodeName === 'BODY';\n const target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(\n getScrollParent(target.parentNode),\n event,\n callback,\n scrollParents\n );\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function setupEventListeners(\n reference,\n options,\n state,\n updateBound\n) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n const scrollElement = getScrollParent(reference);\n attachToScrollParents(\n scrollElement,\n 'scroll',\n state.updateBound,\n state.scrollParents\n );\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n","import setupEventListeners from '../utils/setupEventListeners';\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nexport default function enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(\n this.reference,\n this.options,\n this.state,\n this.scheduleUpdate\n );\n }\n}\n","import removeEventListeners from '../utils/removeEventListeners';\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nexport default function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n","import getWindow from './getWindow';\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(target => {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n","/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nexport default function isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n","import isNumeric from './isNumeric';\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setStyles(element, styles) {\n Object.keys(styles).forEach(prop => {\n let unit = '';\n // add unit if the value is numeric and is one of the following\n if (\n ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==\n -1 &&\n isNumeric(styles[prop])\n ) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n","import getSupportedPropertyName from '../utils/getSupportedPropertyName';\nimport find from '../utils/find';\nimport getOffsetParent from '../utils/getOffsetParent';\nimport getBoundingClientRect from '../utils/getBoundingClientRect';\nimport getRoundedOffsets from '../utils/getRoundedOffsets';\nimport isBrowser from '../utils/isBrowser';\n\nconst isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeStyle(data, options) {\n const { x, y } = options;\n const { popper } = data.offsets;\n\n // Remove this legacy support in Popper.js v2\n const legacyGpuAccelerationOption = find(\n data.instance.modifiers,\n modifier => modifier.name === 'applyStyle'\n ).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn(\n 'WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'\n );\n }\n const gpuAcceleration =\n legacyGpuAccelerationOption !== undefined\n ? legacyGpuAccelerationOption\n : options.gpuAcceleration;\n\n const offsetParent = getOffsetParent(data.instance.popper);\n const offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n const styles = {\n position: popper.position,\n };\n\n const offsets = getRoundedOffsets(\n data,\n window.devicePixelRatio < 2 || !isFirefox\n );\n\n const sideA = x === 'bottom' ? 'top' : 'bottom';\n const sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n const prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n let left, top;\n if (sideA === 'bottom') {\n // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n const invertTop = sideA === 'bottom' ? -1 : 1;\n const invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = `${sideA}, ${sideB}`;\n }\n\n // Attributes\n const attributes = {\n 'x-placement': data.placement,\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = { ...attributes, ...data.attributes };\n data.styles = { ...styles, ...data.styles };\n data.arrowStyles = { ...data.offsets.arrow, ...data.arrowStyles };\n\n return data;\n}\n","import find from './find';\n\n/**\n * Helper used to know if the given modifier depends from another one.
\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nexport default function isModifierRequired(\n modifiers,\n requestingName,\n requestedName\n) {\n const requesting = find(modifiers, ({ name }) => name === requestingName);\n\n const isRequired =\n !!requesting &&\n modifiers.some(modifier => {\n return (\n modifier.name === requestedName &&\n modifier.enabled &&\n modifier.order < requesting.order\n );\n });\n\n if (!isRequired) {\n const requesting = `\\`${requestingName}\\``;\n const requested = `\\`${requestedName}\\``;\n console.warn(\n `${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`\n );\n }\n return isRequired;\n}\n","/**\n * List of accepted placements to use as values of the `placement` option.
\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nexport default [\n 'auto-start',\n 'auto',\n 'auto-end',\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n","import placements from '../methods/placements';\n\n// Get rid of `auto` `auto-start` and `auto-end`\nconst validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nexport default function clockwise(placement, counter = false) {\n const index = validPlacements.indexOf(placement);\n const arr = validPlacements\n .slice(index + 1)\n .concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n","import getOppositePlacement from '../utils/getOppositePlacement';\nimport getOppositeVariation from '../utils/getOppositeVariation';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\nimport getBoundaries from '../utils/getBoundaries';\nimport isModifierEnabled from '../utils/isModifierEnabled';\nimport clockwise from '../utils/clockwise';\n\nconst BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise',\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n options.boundariesElement,\n data.positionFixed\n );\n\n let placement = data.placement.split('-')[0];\n let placementOpposite = getOppositePlacement(placement);\n let variation = data.placement.split('-')[1] || '';\n\n let flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach((step, index) => {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n const popperOffsets = data.offsets.popper;\n const refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n const floor = Math.floor;\n const overlapsRef =\n (placement === 'left' &&\n floor(popperOffsets.right) > floor(refOffsets.left)) ||\n (placement === 'right' &&\n floor(popperOffsets.left) < floor(refOffsets.right)) ||\n (placement === 'top' &&\n floor(popperOffsets.bottom) > floor(refOffsets.top)) ||\n (placement === 'bottom' &&\n floor(popperOffsets.top) < floor(refOffsets.bottom));\n\n const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n const overflowsBottom =\n floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n const overflowsBoundaries =\n (placement === 'left' && overflowsLeft) ||\n (placement === 'right' && overflowsRight) ||\n (placement === 'top' && overflowsTop) ||\n (placement === 'bottom' && overflowsBottom);\n\n // flip the variation if required\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n const flippedVariationByRef =\n !!options.flipVariations &&\n ((isVertical && variation === 'start' && overflowsLeft) ||\n (isVertical && variation === 'end' && overflowsRight) ||\n (!isVertical && variation === 'start' && overflowsTop) ||\n (!isVertical && variation === 'end' && overflowsBottom));\n\n // flips variation if popper content overflows boundaries\n const flippedVariationByContent =\n !!options.flipVariationsByContent &&\n ((isVertical && variation === 'start' && overflowsRight) ||\n (isVertical && variation === 'end' && overflowsLeft) ||\n (!isVertical && variation === 'start' && overflowsBottom) ||\n (!isVertical && variation === 'end' && overflowsTop));\n\n const flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = {\n ...data.offsets.popper,\n ...getPopperOffsets(\n data.instance.popper,\n data.offsets.reference,\n data.placement\n ),\n };\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n","import isNumeric from '../utils/isNumeric';\nimport getClientRect from '../utils/getClientRect';\nimport find from '../utils/find';\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nexport function toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n const split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n const value = +split[1];\n const unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n let element;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n const rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n let size;\n if (unit === 'vh') {\n size = Math.max(\n document.documentElement.clientHeight,\n window.innerHeight || 0\n );\n } else {\n size = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n );\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nexport function parseOffset(\n offset,\n popperOffsets,\n referenceOffsets,\n basePlacement\n) {\n const offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n const fragments = offset.split(/(\\+|\\-)/).map(frag => frag.trim());\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n const divider = fragments.indexOf(\n find(fragments, frag => frag.search(/,|\\s/) !== -1)\n );\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn(\n 'Offsets separated by white space(s) are deprecated, use a comma (,) instead.'\n );\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n const splitRegex = /\\s*,\\s*|\\s+/;\n let ops = divider !== -1\n ? [\n fragments\n .slice(0, divider)\n .concat([fragments[divider].split(splitRegex)[0]]),\n [fragments[divider].split(splitRegex)[1]].concat(\n fragments.slice(divider + 1)\n ),\n ]\n : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map((op, index) => {\n // Most of the units rely on the orientation of the popper\n const measurement = (index === 1 ? !useHeight : useHeight)\n ? 'height'\n : 'width';\n let mergeWithPrevious = false;\n return (\n op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce((a, b) => {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(str => toValue(str, measurement, popperOffsets, referenceOffsets))\n );\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach((op, index) => {\n op.forEach((frag, index2) => {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nexport default function offset(data, { offset }) {\n const { placement, offsets: { popper, reference } } = data;\n const basePlacement = placement.split('-')[0];\n\n let offsets;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n","import applyStyle, { applyStyleOnLoad } from './applyStyle';\nimport computeStyle from './computeStyle';\nimport arrow from './arrow';\nimport flip from './flip';\nimport keepTogether from './keepTogether';\nimport offset from './offset';\nimport preventOverflow from './preventOverflow';\nimport shift from './shift';\nimport hide from './hide';\nimport inner from './inner';\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nexport default {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
\n * It will read the variation of the `placement` property.
\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift,\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0,\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.
\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent',\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether,\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]',\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false,\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner,\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide,\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right',\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined,\n },\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function shift(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n const { reference, popper } = data.offsets;\n const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n const side = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n const shiftOffsets = {\n start: { [side]: reference[side] },\n end: {\n [side]: reference[side] + reference[measurement] - popper[measurement],\n },\n };\n\n data.offsets.popper = { ...popper, ...shiftOffsets[shiftvariation] };\n }\n\n return data;\n}\n","import getOffsetParent from '../utils/getOffsetParent';\nimport getBoundaries from '../utils/getBoundaries';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function preventOverflow(data, options) {\n let boundariesElement =\n options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n const transformProp = getSupportedPropertyName('transform');\n const popperStyles = data.instance.popper.style; // assignment to help minification\n const { top, left, [transformProp]: transform } = popperStyles;\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n boundariesElement,\n data.positionFixed\n );\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n const order = options.priority;\n let popper = data.offsets.popper;\n\n const check = {\n primary(placement) {\n let value = popper[placement];\n if (\n popper[placement] < boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return { [placement]: value };\n },\n secondary(placement) {\n const mainSide = placement === 'right' ? 'left' : 'top';\n let value = popper[mainSide];\n if (\n popper[placement] > boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.min(\n popper[mainSide],\n boundaries[placement] -\n (placement === 'right' ? popper.width : popper.height)\n );\n }\n return { [mainSide]: value };\n },\n };\n\n order.forEach(placement => {\n const side =\n ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = { ...popper, ...check[side](placement) };\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function keepTogether(data) {\n const { popper, reference } = data.offsets;\n const placement = data.placement.split('-')[0];\n const floor = Math.floor;\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const side = isVertical ? 'right' : 'bottom';\n const opSide = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] =\n floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOuterSizes from '../utils/getOuterSizes';\nimport isModifierRequired from '../utils/isModifierRequired';\nimport getStyleComputedProperty from '../utils/getStyleComputedProperty';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n let arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn(\n 'WARNING: `arrow.element` must be child of its popper element!'\n );\n return data;\n }\n }\n\n const placement = data.placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n const len = isVertical ? 'height' : 'width';\n const sideCapitalized = isVertical ? 'Top' : 'Left';\n const side = sideCapitalized.toLowerCase();\n const altSide = isVertical ? 'left' : 'top';\n const opSide = isVertical ? 'bottom' : 'right';\n const arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -=\n popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] +=\n reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n const center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n const css = getStyleComputedProperty(data.instance.popper);\n const popperMarginSide = parseFloat(css[`margin${sideCapitalized}`]);\n const popperBorderSide = parseFloat(css[`border${sideCapitalized}Width`]);\n let sideValue =\n center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {\n [side]: Math.round(sideValue),\n [altSide]: '', // make sure to unset any eventual altSide value from the DOM node\n };\n\n return data;\n}\n","/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nexport default function getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOppositePlacement from '../utils/getOppositePlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function inner(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] =\n reference[basePlacement] -\n (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n","import isModifierRequired from '../utils/isModifierRequired';\nimport find from '../utils/find';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n const refRect = data.offsets.reference;\n const bound = find(\n data.instance.modifiers,\n modifier => modifier.name === 'preventOverflow'\n ).boundaries;\n\n if (\n refRect.bottom < bound.top ||\n refRect.left > bound.right ||\n refRect.top > bound.bottom ||\n refRect.right < bound.left\n ) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n","/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nexport default function getRoundedOffsets(data, shouldRound) {\n const { popper, reference } = data.offsets;\n const { round, floor } = Math;\n const noRound = v => v;\n \n const referenceWidth = round(reference.width);\n const popperWidth = round(popper.width);\n \n const isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n const isVariation = data.placement.indexOf('-') !== -1;\n const sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n const bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n const horizontalToInteger = !shouldRound\n ? noRound\n : isVertical || isVariation || sameWidthParity\n ? round\n : floor;\n const verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(\n bothOddWidth && !isVariation && shouldRound\n ? popper.left - 1\n : popper.left\n ),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right),\n };\n}\n","import setStyles from '../utils/setStyles';\nimport setAttributes from '../utils/setAttributes';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nexport default function applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nexport function applyStyleOnLoad(\n reference,\n popper,\n options,\n modifierOptions,\n state\n) {\n // compute reference element offsets\n const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n const placement = computeAutoPlacement(\n options.placement,\n referenceOffsets,\n popper,\n reference,\n options.modifiers.flip.boundariesElement,\n options.modifiers.flip.padding\n );\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n","/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function(prop) {\n const value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n","import modifiers from '../modifiers/index';\n\n/**\n * Default options provided to Popper.js constructor.
\n * These can be overridden using the `options` argument of Popper.js.
\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nexport default {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: () => {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: () => {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers,\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n","// Utils\nimport debounce from './utils/debounce';\nimport isFunction from './utils/isFunction';\n\n// Methods\nimport update from './methods/update';\nimport destroy from './methods/destroy';\nimport enableEventListeners from './methods/enableEventListeners';\nimport disableEventListeners from './methods/disableEventListeners';\nimport Defaults from './methods/defaults';\nimport placements from './methods/placements';\n\nexport default class Popper {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {Element|referenceObject} reference - The reference element used to position the popper\n * @param {Element} popper - The HTML / XML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n constructor(reference, popper, options = {}) {\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = { ...Popper.Defaults, ...options };\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: [],\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys({\n ...Popper.Defaults.modifiers,\n ...options.modifiers,\n }).forEach(name => {\n this.options.modifiers[name] = {\n // If it's a built-in modifier, use it as base\n ...(Popper.Defaults.modifiers[name] || {}),\n // If there are custom options, override and merge with default ones\n ...(options.modifiers ? options.modifiers[name] : {}),\n };\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers)\n .map(name => ({\n name,\n ...this.options.modifiers[name],\n }))\n // sort the modifiers by order\n .sort((a, b) => a.order - b.order);\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(modifierOptions => {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(\n this.reference,\n this.popper,\n this.options,\n modifierOptions,\n this.state\n );\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n const eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n update() {\n return update.call(this);\n }\n destroy() {\n return destroy.call(this);\n }\n enableEventListeners() {\n return enableEventListeners.call(this);\n }\n disableEventListeners() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n scheduleUpdate = () => requestAnimationFrame(this.update);\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n static Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\n\n static placements = placements;\n\n static Defaults = Defaults;\n}\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n","/*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */\r\n;(function (globalScope) {\r\n 'use strict';\r\n\r\n\r\n /*\r\n * decimal.js-light v2.5.1\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js-light\r\n * Copyright (c) 2020 Michael Mclaughlin \r\n * MIT Expat Licence\r\n */\r\n\r\n\r\n // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n var MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n Decimal = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed during run-time using `Decimal.config`.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`,\r\n // `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -MAX_E\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to MAX_E\r\n\r\n // The natural logarithm of 10.\r\n // 115 digits\r\n LN10: '2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286'\r\n },\r\n\r\n\r\n // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n exponentOutOfRange = decimalError + 'Exponent out of range: ',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n ONE,\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE), // 1286742750677284\r\n\r\n // Decimal.prototype object\r\n P = {};\r\n\r\n\r\n // Decimal prototype methods\r\n\r\n\r\n /*\r\n * absoluteValue abs\r\n * comparedTo cmp\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy idiv\r\n * equals eq\r\n * exponent\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * isInteger isint\r\n * isNegative isneg\r\n * isPositive ispos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * squareRoot sqrt\r\n * times mul\r\n * toDecimalPlaces todp\r\n * toExponential\r\n * toFixed\r\n * toInteger toint\r\n * toNumber\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits tosd\r\n * toString\r\n * valueOf val\r\n */\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value\r\n *\r\n */\r\n P.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this;\r\n\r\n y = new x.constructor(y);\r\n\r\n // Signs differ?\r\n if (x.s !== y.s) return x.s || -y.s;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ x.s < 0 ? 1 : -1;\r\n\r\n xdL = x.d.length;\r\n ydL = y.d.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (x.d[i] !== y.d[i]) return x.d[i] > y.d[i] ^ x.s < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ x.s < 0 ? 1 : -1;\r\n };\r\n\r\n\r\n /*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\n P.decimalPlaces = P.dp = function () {\r\n var x = this,\r\n w = x.d.length - 1,\r\n dp = (w - x.e) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = x.d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) dp--;\r\n\r\n return dp < 0 ? 0 : dp;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, truncated to `precision` significant digits.\r\n *\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(divide(x, new Ctor(y), 0, 1), Ctor.precision);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\n P.equals = P.eq = function (y) {\r\n return !this.cmp(y);\r\n };\r\n\r\n\r\n /*\r\n * Return the (base 10) exponent value of this Decimal (this.e is the base 10000000 exponent).\r\n *\r\n */\r\n P.exponent = function () {\r\n return getBase10Exponent(this);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\n P.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\n P.greaterThanOrEqualTo = P.gte = function (y) {\r\n return this.cmp(y) >= 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\n P.isInteger = P.isint = function () {\r\n return this.e > this.d.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\n P.isNegative = P.isneg = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\n P.isPositive = P.ispos = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is 0, otherwise return false.\r\n *\r\n */\r\n P.isZero = function () {\r\n return this.s === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n };\r\n\r\n\r\n /*\r\n * Return the logarithm of the value of this Decimal to the specified base, truncated to\r\n * `precision` significant digits.\r\n *\r\n * If no base is specified, return log[10](x).\r\n *\r\n * log[base](x) = ln(x) / ln(base)\r\n *\r\n * The maximum error of the result is 1 ulp (unit in the last place).\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\n P.logarithm = P.log = function (base) {\r\n var r,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n wpr = pr + 5;\r\n\r\n // Default base is 10.\r\n if (base === void 0) {\r\n base = new Ctor(10);\r\n } else {\r\n base = new Ctor(base);\r\n\r\n // log[-b](x) = NaN\r\n // log[0](x) = NaN\r\n // log[1](x) = NaN\r\n if (base.s < 1 || base.eq(ONE)) throw Error(decimalError + 'NaN');\r\n }\r\n\r\n // log[b](-x) = NaN\r\n // log[b](0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // log[b](1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n external = false;\r\n r = divide(ln(x, wpr), ln(base, wpr), wpr);\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.minus = P.sub = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? subtract(x, y) : add(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n y = new Ctor(y);\r\n\r\n // x % 0 = NaN\r\n if (!y.s) throw Error(decimalError + 'NaN');\r\n\r\n // Return x if x is 0.\r\n if (!x.s) return round(new Ctor(x), pr);\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n q = divide(x, y, 0, 1).times(y);\r\n external = true;\r\n\r\n return x.minus(q);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.naturalExponential = P.exp = function () {\r\n return exp(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * truncated to `precision` significant digits.\r\n *\r\n */\r\n P.naturalLogarithm = P.ln = function () {\r\n return ln(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\n P.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s || 0;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.plus = P.add = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? add(x, y) : subtract(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\n P.precision = P.sd = function (z) {\r\n var e, sd, w,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n e = getBase10Exponent(x) + 1;\r\n w = x.d.length - 1;\r\n sd = w * LOG_BASE + 1;\r\n w = x.d[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) sd--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = x.d[0]; w >= 10; w /= 10) sd++;\r\n }\r\n\r\n return z && e > sd ? e : sd;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the square root of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var e, n, pr, r, s, t, wpr,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n // Negative or zero?\r\n if (x.s < 1) {\r\n if (!x.s) return new Ctor(0);\r\n\r\n // sqrt(-x) = NaN\r\n throw Error(decimalError + 'NaN');\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(x.d);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n pr = Ctor.precision;\r\n s = wpr = pr + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, wpr + 2)).times(0.5);\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === (n = digitsToString(r.d)).slice(0, wpr)) {\r\n n = n.slice(wpr - 3, wpr + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (s == wpr && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n round(t, pr + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n } else if (n != '9999') {\r\n break;\r\n }\r\n\r\n wpr += 4;\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal times `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n // Return 0 if either is 0.\r\n if (!x.s || !y.s) return new Ctor(0);\r\n\r\n y.s *= x.s;\r\n e = x.e + y.e;\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = e;\r\n\r\n return external ? round(y, Ctor.precision) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toDecimalPlaces = P.todp = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return round(x, dp + getBase10Exponent(x) + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = toString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), dp + 1, rm);\r\n str = toString(x, true, dp + 1);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\n P.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) return toString(x);\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = round(new Ctor(x), dp + getBase10Exponent(x) + 1, rm);\r\n str = toString(y.abs(), false, dp + getBase10Exponent(y) + 1);\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isneg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\n P.toInteger = P.toint = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(new Ctor(x), getBase10Exponent(x) + 1, Ctor.rounding);\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this Decimal converted to a number primitive.\r\n *\r\n */\r\n P.toNumber = function () {\r\n return +this;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`,\r\n * truncated to `precision` significant digits.\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * The maximum error is 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\n P.toPower = P.pow = function (y) {\r\n var e, k, pr, r, sign, yIsInt,\r\n x = this,\r\n Ctor = x.constructor,\r\n guard = 12,\r\n yn = +(y = new Ctor(y));\r\n\r\n // pow(x, 0) = 1\r\n if (!y.s) return new Ctor(ONE);\r\n\r\n x = new Ctor(x);\r\n\r\n // pow(0, y > 0) = 0\r\n // pow(0, y < 0) = Infinity\r\n if (!x.s) {\r\n if (y.s < 1) throw Error(decimalError + 'Infinity');\r\n return x;\r\n }\r\n\r\n // pow(1, y) = 1\r\n if (x.eq(ONE)) return x;\r\n\r\n pr = Ctor.precision;\r\n\r\n // pow(x, 1) = x\r\n if (y.eq(ONE)) return round(x, pr);\r\n\r\n e = y.e;\r\n k = y.d.length - 1;\r\n yIsInt = e >= k;\r\n sign = x.s;\r\n\r\n if (!yIsInt) {\r\n\r\n // pow(x < 0, y non-integer) = NaN\r\n if (sign < 0) throw Error(decimalError + 'NaN');\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n } else if ((k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = new Ctor(ONE);\r\n\r\n // Max k of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n e = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (k % 2) {\r\n r = r.times(x);\r\n truncate(r.d, e);\r\n }\r\n\r\n k = mathfloor(k / 2);\r\n if (k === 0) break;\r\n\r\n x = x.times(x);\r\n truncate(x.d, e);\r\n }\r\n\r\n external = true;\r\n\r\n return y.s < 0 ? new Ctor(ONE).div(r) : round(r, pr);\r\n }\r\n\r\n // Result is negative if x is negative and the last digit of integer y is odd.\r\n sign = sign < 0 && y.d[Math.max(e, k)] & 1 ? -1 : 1;\r\n\r\n x.s = 1;\r\n external = false;\r\n r = y.times(ln(x, pr + guard));\r\n external = true;\r\n r = exp(r);\r\n r.s = sign;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n var e, str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n e = getBase10Exponent(x);\r\n str = toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), sd, rm);\r\n e = getBase10Exponent(x);\r\n str = toString(x, sd <= e || e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toSignificantDigits = P.tosd = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return round(new Ctor(x), sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\n P.toString = P.valueOf = P.val = P.toJSON = function () {\r\n var x = this,\r\n e = getBase10Exponent(x),\r\n Ctor = x.constructor;\r\n\r\n return toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n };\r\n\r\n\r\n // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n /*\r\n * add P.minus, P.plus\r\n * checkInt32 P.todp, P.toExponential, P.toFixed, P.toPrecision, P.tosd\r\n * digitsToString P.log, P.sqrt, P.pow, toString, exp, ln\r\n * divide P.div, P.idiv, P.log, P.mod, P.sqrt, exp, ln\r\n * exp P.exp, P.pow\r\n * getBase10Exponent P.exponent, P.sd, P.toint, P.sqrt, P.todp, P.toFixed, P.toPrecision,\r\n * P.toString, divide, round, toString, exp, ln\r\n * getLn10 P.log, ln\r\n * getZeroString digitsToString, toString\r\n * ln P.log, P.ln, P.pow, exp\r\n * parseDecimal Decimal\r\n * round P.abs, P.idiv, P.log, P.minus, P.mod, P.neg, P.plus, P.toint, P.sqrt,\r\n * P.times, P.todp, P.toExponential, P.toFixed, P.pow, P.toPrecision, P.tosd,\r\n * divide, getLn10, exp, ln\r\n * subtract P.minus, P.plus\r\n * toString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf\r\n * truncate P.pow\r\n *\r\n * Throws: P.log, P.mod, P.sd, P.sqrt, P.pow, checkInt32, divide, round,\r\n * getLn10, exp, ln, parseDecimal, Decimal, config\r\n */\r\n\r\n\r\n function add(x, y) {\r\n var carry, d, e, i, k, len, xd, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // If either is zero...\r\n if (!x.s || !y.s) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!y.s) y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n k = x.e;\r\n e = y.e;\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n }\r\n\r\n\r\n function digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n }\r\n\r\n\r\n var divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % BASE | 0;\r\n carry = temp / BASE | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * BASE + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, dp) {\r\n var cmp, e, i, k, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either 0?\r\n if (!x.s) return new Ctor(x);\r\n if (!y.s) throw Error(decimalError + 'Division by zero');\r\n\r\n e = x.e - y.e;\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n for (i = 0; yd[i] == (xd[i] || 0); ) ++i;\r\n if (yd[i] > (xd[i] || 0)) --e;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n } else if (dp) {\r\n sd = pr + (getBase10Exponent(x) - getBase10Exponent(y)) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) return new Ctor(0);\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / LOG_BASE + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * BASE + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= BASE/2\r\n k = BASE / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k);\r\n xd = multiplyInteger(xd, k);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= BASE / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * BASE + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= BASE) k = BASE - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n\r\n q.e = e;\r\n\r\n return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr);\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of `x` truncated to `sd`\r\n * significant digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n */\r\n function exp(x, sd) {\r\n var denominator, guard, pow, sum, t, wpr,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n if (getBase10Exponent(x) > 16) throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n\r\n // exp(0) = 1\r\n if (!x.s) return new Ctor(ONE);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n while (x.abs().gte(0.1)) {\r\n x = x.times(t); // x = x / 2^5\r\n k += 5;\r\n }\r\n\r\n // Estimate the precision increase necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(ONE);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = round(pow.times(x), wpr);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n while (k--) sum = round(sum.times(sum), wpr);\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n }\r\n }\r\n\r\n\r\n // Calculate the base 10 exponent from the base 1e7 exponent.\r\n function getBase10Exponent(x) {\r\n var e = x.e * LOG_BASE,\r\n w = x.d[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for (; w >= 10; w /= 10) e++;\r\n return e;\r\n }\r\n\r\n\r\n function getLn10(Ctor, sd, pr) {\r\n\r\n if (sd > Ctor.LN10.sd()) {\r\n\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(decimalError + 'LN10 precision limit exceeded');\r\n }\r\n\r\n return round(new Ctor(Ctor.LN10), sd);\r\n }\r\n\r\n\r\n function getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of `x` truncated to `sd` significant\r\n * digits.\r\n *\r\n * ln(n) is non-terminating (n != 1)\r\n *\r\n */\r\n function ln(y, sd) {\r\n var c, c0, denominator, e, numerator, sum, t, wpr, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // ln(-x) = NaN\r\n // ln(0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // ln(1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n if (x.eq(10)) {\r\n if (sd == null) external = true;\r\n return getLn10(Ctor, wpr);\r\n }\r\n\r\n wpr += guard;\r\n Ctor.precision = wpr;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n e = getBase10Exponent(x);\r\n\r\n if (Math.abs(e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = ln(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(x, pr)) : x;\r\n }\r\n\r\n // x is reduced to a value near 1.\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(ONE), x.plus(ONE), wpr);\r\n x2 = round(x.times(x), wpr);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = round(numerator.times(x2), wpr);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n }\r\n\r\n\r\n /*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\n function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Round `x` to `sd` significant digits, using rounding mode `rm` if present (truncate otherwise).\r\n */\r\n function round(x, sd, rm) {\r\n var i, j, k, n, rd, doRound, w, xdi,\r\n xd = x.d;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd which contains the rounding digit, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // n: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (n = 1, k = xd[0]; k >= 10; k /= 10) n++;\r\n i = sd - n;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) return x;\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (n = 1; k >= 10; k /= 10) n++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - n.\r\n j = i - LOG_BASE + n;\r\n }\r\n\r\n if (rm !== void 0) {\r\n k = mathpow(10, n - j - 1);\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / k % 10 | 0;\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k;\r\n\r\n // The expression `w % mathpow(10, n - j - 1)` returns all the digits of w to the right of the\r\n // digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression will give\r\n // 714.\r\n\r\n doRound = rm < 4\r\n ? (rd || doRound) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || doRound || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, n - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n }\r\n\r\n if (sd < 1 || !xd[0]) {\r\n if (doRound) {\r\n k = getBase10Exponent(x);\r\n xd.length = 1;\r\n\r\n // Convert sd to decimal places.\r\n sd = sd - k - 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = mathfloor(-sd / LOG_BASE) || 0;\r\n } else {\r\n xd.length = 1;\r\n\r\n // Zero.\r\n xd[0] = x.e = x.s = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, n - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (doRound) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n if ((xd[0] += k) == BASE) {\r\n xd[0] = 1;\r\n ++x.e;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) {\r\n throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function subtract(x, y) {\r\n var d, e, i, j, k, len, xd, xe, xLTy, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // Return y negated if x is zero.\r\n // Return x if y is zero and x is non-zero.\r\n if (!x.s || !y.s) {\r\n if (y.s) y.s = -y.s;\r\n else y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are non-zero numbers with the same sign.\r\n\r\n e = y.e;\r\n xe = x.e;\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of zeros\r\n // needing to be prepended, but this can be avoided while still ensuring correct rounding by\r\n // limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to xd if shorter.\r\n // Don't add zeros to yd if shorter as subtraction only needs to start at yd length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(0);\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n //return external && xd.length >= pr / LOG_BASE ? round(y, pr) : y;\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function toString(x, isExp, sd) {\r\n var k,\r\n e = getBase10Exponent(x),\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (e < 0 ? 'e' : 'e+') + e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Does not strip trailing zeros.\r\n function truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n }\r\n\r\n\r\n // Decimal methods\r\n\r\n\r\n /*\r\n * clone\r\n * config/set\r\n */\r\n\r\n\r\n /*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\n function clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * value {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(value) {\r\n var x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(value);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (value instanceof Decimal) {\r\n x.s = value.s;\r\n x.e = value.e;\r\n x.d = (value = value.d) ? value.slice() : value;\r\n return;\r\n }\r\n\r\n if (typeof value === 'number') {\r\n\r\n // Reject Infinity/NaN.\r\n if (value * 0 !== 0) {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n if (value > 0) {\r\n x.s = 1;\r\n } else if (value < 0) {\r\n value = -value;\r\n x.s = -1;\r\n } else {\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (value === ~~value && value < 1e7) {\r\n x.e = 0;\r\n x.d = [value];\r\n return;\r\n }\r\n\r\n return parseDecimal(x, value.toString());\r\n } else if (typeof value !== 'string') {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n // Minus sign?\r\n if (value.charCodeAt(0) === 45) {\r\n value = value.slice(1);\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n if (isDecimal.test(value)) parseDecimal(x, value);\r\n else throw Error(invalidArgument + value);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n\r\n Decimal.clone = clone;\r\n Decimal.config = Decimal.set = config;\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'LN10'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n }\r\n\r\n\r\n /*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\n function config(obj) {\r\n if (!obj || typeof obj !== 'object') {\r\n throw Error(decimalError + 'Object expected');\r\n }\r\n var i, p, v,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -1 / 0, 0,\r\n 'toExpPos', 0, 1 / 0\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if ((v = obj[p = ps[i]]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if ((v = obj[p = 'LN10']) !== void 0) {\r\n if (v == Math.LN10) this[p] = new this(v);\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n\r\n // Create and configure initial Decimal constructor.\r\n Decimal = clone(Decimal);\r\n\r\n Decimal['default'] = Decimal.Decimal = Decimal;\r\n\r\n // Internal constant.\r\n ONE = new Decimal(1);\r\n\r\n\r\n // Export.\r\n\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () {\r\n return Decimal;\r\n });\r\n\r\n // Node and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = Decimal;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalScope) {\r\n globalScope = typeof self != 'undefined' && self && self.self == self\r\n ? self : Function('return this')();\r\n }\r\n\r\n globalScope.Decimal = Decimal;\r\n }\r\n})(this);\r\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z\"\n}), 'Settings');\n\nexports.default = _default;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification.\n\nexport default function createBreakpoints(breakpoints) {\n var _breakpoints$values = breakpoints.values,\n values = _breakpoints$values === void 0 ? {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920\n } : _breakpoints$values,\n _breakpoints$unit = breakpoints.unit,\n unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit,\n _breakpoints$step = breakpoints.step,\n step = _breakpoints$step === void 0 ? 5 : _breakpoints$step,\n other = _objectWithoutProperties(breakpoints, [\"values\", \"unit\", \"step\"]);\n\n function up(key) {\n var value = typeof values[key] === 'number' ? values[key] : key;\n return \"@media (min-width:\".concat(value).concat(unit, \")\");\n }\n\n function down(key) {\n var endIndex = keys.indexOf(key) + 1;\n var upperbound = values[keys[endIndex]];\n\n if (endIndex === keys.length) {\n // xl down applies to all sizes\n return up('xs');\n }\n\n var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key;\n return \"@media (max-width:\".concat(value - step / 100).concat(unit, \")\");\n }\n\n function between(start, end) {\n var endIndex = keys.indexOf(end);\n\n if (endIndex === keys.length - 1) {\n return up(start);\n }\n\n return \"@media (min-width:\".concat(typeof values[start] === 'number' ? values[start] : start).concat(unit, \") and \") + \"(max-width:\".concat((endIndex !== -1 && typeof values[keys[endIndex + 1]] === 'number' ? values[keys[endIndex + 1]] : end) - step / 100).concat(unit, \")\");\n }\n\n function only(key) {\n return between(key, key);\n }\n\n var warnedOnce = false;\n\n function width(key) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.warn([\"Material-UI: The `theme.breakpoints.width` utility is deprecated because it's redundant.\", 'Use the `theme.breakpoints.values` instead.'].join('\\n'));\n }\n }\n\n return values[key];\n }\n\n return _extends({\n keys: keys,\n values: values,\n up: up,\n down: down,\n between: between,\n only: only,\n width: width\n }, other);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, spacing, mixins) {\n var _toolbar;\n\n return _extends({\n gutters: function gutters() {\n var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n console.warn(['Material-UI: theme.mixins.gutters() is deprecated.', 'You can use the source of the mixin directly:', \"\\n paddingLeft: theme.spacing(2),\\n paddingRight: theme.spacing(2),\\n [theme.breakpoints.up('sm')]: {\\n paddingLeft: theme.spacing(3),\\n paddingRight: theme.spacing(3),\\n },\\n \"].join('\\n'));\n return _extends({\n paddingLeft: spacing(2),\n paddingRight: spacing(2)\n }, styles, _defineProperty({}, breakpoints.up('sm'), _extends({\n paddingLeft: spacing(3),\n paddingRight: spacing(3)\n }, styles[breakpoints.up('sm')])));\n },\n toolbar: (_toolbar = {\n minHeight: 56\n }, _defineProperty(_toolbar, \"\".concat(breakpoints.up('xs'), \" and (orientation: landscape)\"), {\n minHeight: 48\n }), _defineProperty(_toolbar, breakpoints.up('sm'), {\n minHeight: 64\n }), _toolbar)\n }, mixins);\n}","var common = {\n black: '#000',\n white: '#fff'\n};\nexport default common;","var grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#d5d5d5',\n A200: '#aaaaaa',\n A400: '#303030',\n A700: '#616161'\n};\nexport default grey;","var indigo = {\n 50: '#e8eaf6',\n 100: '#c5cae9',\n 200: '#9fa8da',\n 300: '#7986cb',\n 400: '#5c6bc0',\n 500: '#3f51b5',\n 600: '#3949ab',\n 700: '#303f9f',\n 800: '#283593',\n 900: '#1a237e',\n A100: '#8c9eff',\n A200: '#536dfe',\n A400: '#3d5afe',\n A700: '#304ffe'\n};\nexport default indigo;","var pink = {\n 50: '#fce4ec',\n 100: '#f8bbd0',\n 200: '#f48fb1',\n 300: '#f06292',\n 400: '#ec407a',\n 500: '#e91e63',\n 600: '#d81b60',\n 700: '#c2185b',\n 800: '#ad1457',\n 900: '#880e4f',\n A100: '#ff80ab',\n A200: '#ff4081',\n A400: '#f50057',\n A700: '#c51162'\n};\nexport default pink;","var red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\nexport default red;","var orange = {\n 50: '#fff3e0',\n 100: '#ffe0b2',\n 200: '#ffcc80',\n 300: '#ffb74d',\n 400: '#ffa726',\n 500: '#ff9800',\n 600: '#fb8c00',\n 700: '#f57c00',\n 800: '#ef6c00',\n 900: '#e65100',\n A100: '#ffd180',\n A200: '#ffab40',\n A400: '#ff9100',\n A700: '#ff6d00'\n};\nexport default orange;","var blue = {\n 50: '#e3f2fd',\n 100: '#bbdefb',\n 200: '#90caf9',\n 300: '#64b5f6',\n 400: '#42a5f5',\n 500: '#2196f3',\n 600: '#1e88e5',\n 700: '#1976d2',\n 800: '#1565c0',\n 900: '#0d47a1',\n A100: '#82b1ff',\n A200: '#448aff',\n A400: '#2979ff',\n A700: '#2962ff'\n};\nexport default blue;","var green = {\n 50: '#e8f5e9',\n 100: '#c8e6c9',\n 200: '#a5d6a7',\n 300: '#81c784',\n 400: '#66bb6a',\n 500: '#4caf50',\n 600: '#43a047',\n 700: '#388e3c',\n 800: '#2e7d32',\n 900: '#1b5e20',\n A100: '#b9f6ca',\n A200: '#69f0ae',\n A400: '#00e676',\n A700: '#00c853'\n};\nexport default green;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@material-ui/utils\";\nimport { deepmerge } from '@material-ui/utils';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport indigo from '../colors/indigo';\nimport pink from '../colors/pink';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport green from '../colors/green';\nimport { darken, getContrastRatio, lighten } from './colorManipulator';\nexport var light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.54)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)',\n // Text hints.\n hint: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n default: grey[50]\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nexport var dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n hint: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: grey[800],\n default: '#303030'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\n\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n var tonalOffsetLight = tonalOffset.light || tonalOffset;\n var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\n\nexport default function createPalette(palette) {\n var _palette$primary = palette.primary,\n primary = _palette$primary === void 0 ? {\n light: indigo[300],\n main: indigo[500],\n dark: indigo[700]\n } : _palette$primary,\n _palette$secondary = palette.secondary,\n secondary = _palette$secondary === void 0 ? {\n light: pink.A200,\n main: pink.A400,\n dark: pink.A700\n } : _palette$secondary,\n _palette$error = palette.error,\n error = _palette$error === void 0 ? {\n light: red[300],\n main: red[500],\n dark: red[700]\n } : _palette$error,\n _palette$warning = palette.warning,\n warning = _palette$warning === void 0 ? {\n light: orange[300],\n main: orange[500],\n dark: orange[700]\n } : _palette$warning,\n _palette$info = palette.info,\n info = _palette$info === void 0 ? {\n light: blue[300],\n main: blue[500],\n dark: blue[700]\n } : _palette$info,\n _palette$success = palette.success,\n success = _palette$success === void 0 ? {\n light: green[300],\n main: green[500],\n dark: green[700]\n } : _palette$success,\n _palette$type = palette.type,\n type = _palette$type === void 0 ? 'light' : _palette$type,\n _palette$contrastThre = palette.contrastThreshold,\n contrastThreshold = _palette$contrastThre === void 0 ? 3 : _palette$contrastThre,\n _palette$tonalOffset = palette.tonalOffset,\n tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,\n other = _objectWithoutProperties(palette, [\"primary\", \"secondary\", \"error\", \"warning\", \"info\", \"success\", \"type\", \"contrastThreshold\", \"tonalOffset\"]); // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n\n\n function getContrastText(background) {\n var contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n\n if (process.env.NODE_ENV !== 'production') {\n var contrast = getContrastRatio(background, contrastText);\n\n if (contrast < 3) {\n console.error([\"Material-UI: The contrast ratio of \".concat(contrast, \":1 for \").concat(contrastText, \" on \").concat(background), 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n\n return contrastText;\n }\n\n var augmentColor = function augmentColor(color) {\n var mainShade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;\n var lightShade = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;\n var darkShade = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 700;\n color = _extends({}, color);\n\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n\n if (!color.main) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? \"Material-UI: The color provided to augmentColor(color) is invalid.\\nThe color object needs to have a `main` property or a `\".concat(mainShade, \"` property.\") : _formatMuiErrorMessage(4, mainShade));\n }\n\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? \"Material-UI: The color provided to augmentColor(color) is invalid.\\n`color.main` should be a string, but `\".concat(JSON.stringify(color.main), \"` was provided instead.\\n\\nDid you intend to use one of the following approaches?\\n\\nimport {\\xA0green } from \\\"@material-ui/core/colors\\\";\\n\\nconst theme1 = createTheme({ palette: {\\n primary: green,\\n} });\\n\\nconst theme2 = createTheme({ palette: {\\n primary: { main: green[500] },\\n} });\") : _formatMuiErrorMessage(5, JSON.stringify(color.main)));\n }\n\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n\n return color;\n };\n\n var types = {\n dark: dark,\n light: light\n };\n\n if (process.env.NODE_ENV !== 'production') {\n if (!types[type]) {\n console.error(\"Material-UI: The palette type `\".concat(type, \"` is not supported.\"));\n }\n }\n\n var paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: common,\n // The palette type, can be light or dark.\n type: type,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor(primary),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor(secondary, 'A400', 'A200', 'A700'),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor(error),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor(warning),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor(info),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor(success),\n // The grey colors.\n grey: grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold: contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText: getContrastText,\n // Generate a rich color object.\n augmentColor: augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset: tonalOffset\n }, types[type]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { deepmerge } from '@material-ui/utils';\n\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\n\nvar warnedOnce = false;\n\nfunction roundWithDeprecationWarning(value) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n console.warn(['Material-UI: The `theme.typography.round` helper is deprecated.', 'Head to https://material-ui.com/r/migration-v4/#theme for a migration path.'].join('\\n'));\n warnedOnce = true;\n }\n }\n\n return round(value);\n}\n\nvar caseAllCaps = {\n textTransform: 'uppercase'\n};\nvar defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n/**\n * @see @link{https://material.io/design/typography/the-type-system.html}\n * @see @link{https://material.io/design/typography/understanding-typography.html}\n */\n\nexport default function createTypography(palette, typography) {\n var _ref = typeof typography === 'function' ? typography(palette) : typography,\n _ref$fontFamily = _ref.fontFamily,\n fontFamily = _ref$fontFamily === void 0 ? defaultFontFamily : _ref$fontFamily,\n _ref$fontSize = _ref.fontSize,\n fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,\n _ref$fontWeightLight = _ref.fontWeightLight,\n fontWeightLight = _ref$fontWeightLight === void 0 ? 300 : _ref$fontWeightLight,\n _ref$fontWeightRegula = _ref.fontWeightRegular,\n fontWeightRegular = _ref$fontWeightRegula === void 0 ? 400 : _ref$fontWeightRegula,\n _ref$fontWeightMedium = _ref.fontWeightMedium,\n fontWeightMedium = _ref$fontWeightMedium === void 0 ? 500 : _ref$fontWeightMedium,\n _ref$fontWeightBold = _ref.fontWeightBold,\n fontWeightBold = _ref$fontWeightBold === void 0 ? 700 : _ref$fontWeightBold,\n _ref$htmlFontSize = _ref.htmlFontSize,\n htmlFontSize = _ref$htmlFontSize === void 0 ? 16 : _ref$htmlFontSize,\n allVariants = _ref.allVariants,\n pxToRem2 = _ref.pxToRem,\n other = _objectWithoutProperties(_ref, [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('Material-UI: `fontSize` is required to be a number.');\n }\n\n if (typeof htmlFontSize !== 'number') {\n console.error('Material-UI: `htmlFontSize` is required to be a number.');\n }\n }\n\n var coef = fontSize / 14;\n\n var pxToRem = pxToRem2 || function (size) {\n return \"\".concat(size / htmlFontSize * coef, \"rem\");\n };\n\n var buildVariant = function buildVariant(fontWeight, size, lineHeight, letterSpacing, casing) {\n return _extends({\n fontFamily: fontFamily,\n fontWeight: fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight: lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: \"\".concat(round(letterSpacing / size), \"em\")\n } : {}, casing, allVariants);\n };\n\n var variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)\n };\n return deepmerge(_extends({\n htmlFontSize: htmlFontSize,\n pxToRem: pxToRem,\n round: roundWithDeprecationWarning,\n // TODO v5: remove\n fontFamily: fontFamily,\n fontSize: fontSize,\n fontWeightLight: fontWeightLight,\n fontWeightRegular: fontWeightRegular,\n fontWeightMedium: fontWeightMedium,\n fontWeightBold: fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n\n });\n}","var shadowKeyUmbraOpacity = 0.2;\nvar shadowKeyPenumbraOpacity = 0.14;\nvar shadowAmbientShadowOpacity = 0.12;\n\nfunction createShadow() {\n return [\"\".concat(arguments.length <= 0 ? undefined : arguments[0], \"px \").concat(arguments.length <= 1 ? undefined : arguments[1], \"px \").concat(arguments.length <= 2 ? undefined : arguments[2], \"px \").concat(arguments.length <= 3 ? undefined : arguments[3], \"px rgba(0,0,0,\").concat(shadowKeyUmbraOpacity, \")\"), \"\".concat(arguments.length <= 4 ? undefined : arguments[4], \"px \").concat(arguments.length <= 5 ? undefined : arguments[5], \"px \").concat(arguments.length <= 6 ? undefined : arguments[6], \"px \").concat(arguments.length <= 7 ? undefined : arguments[7], \"px rgba(0,0,0,\").concat(shadowKeyPenumbraOpacity, \")\"), \"\".concat(arguments.length <= 8 ? undefined : arguments[8], \"px \").concat(arguments.length <= 9 ? undefined : arguments[9], \"px \").concat(arguments.length <= 10 ? undefined : arguments[10], \"px \").concat(arguments.length <= 11 ? undefined : arguments[11], \"px rgba(0,0,0,\").concat(shadowAmbientShadowOpacity, \")\")].join(',');\n} // Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\n\n\nvar shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;","var shape = {\n borderRadius: 4\n};\nexport default shape;","import { deepmerge } from '@material-ui/utils';\n\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n\n });\n}\n\nexport default merge;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport PropTypes from 'prop-types';\nimport merge from './merge'; // The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\n\nvar values = {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920\n};\nvar defaultBreakpoints = {\n // Sorted ASC by size. That's important.\n // It can't be configured as it's used statically for propTypes.\n keys: ['xs', 'sm', 'md', 'lg', 'xl'],\n up: function up(key) {\n return \"@media (min-width:\".concat(values[key], \"px)\");\n }\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n if (process.env.NODE_ENV !== 'production') {\n if (!props.theme) {\n console.error('Material-UI: You are calling a style function without a theme value.');\n }\n }\n\n if (Array.isArray(propValue)) {\n var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;\n return propValue.reduce(function (acc, item, index) {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n\n if (_typeof(propValue) === 'object') {\n var _themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;\n\n return Object.keys(propValue).reduce(function (acc, breakpoint) {\n acc[_themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]);\n return acc;\n }, {});\n }\n\n var output = styleFromPropValue(propValue);\n return output;\n}\n\nfunction breakpoints(styleFunction) {\n var newStyleFunction = function newStyleFunction(props) {\n var base = styleFunction(props);\n var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;\n var extended = themeBreakpoints.keys.reduce(function (acc, key) {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction(_extends({\n theme: props.theme\n }, props[key]));\n }\n\n return acc;\n }, null);\n return merge(base, extended);\n };\n\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {\n xs: PropTypes.object,\n sm: PropTypes.object,\n md: PropTypes.object,\n lg: PropTypes.object,\n xl: PropTypes.object\n }) : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl'].concat(_toConsumableArray(styleFunction.filterProps));\n return newStyleFunction;\n}\n\nexport default breakpoints;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nimport merge from './merge';\nimport memoize from './memoize';\nvar properties = {\n m: 'margin',\n p: 'padding'\n};\nvar directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nvar aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n}; // memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\n\nvar getCssProperties = memoize(function (prop) {\n // It's not a shorthand notation.\n if (prop.length > 2) {\n if (aliases[prop]) {\n prop = aliases[prop];\n } else {\n return [prop];\n }\n }\n\n var _prop$split = prop.split(''),\n _prop$split2 = _slicedToArray(_prop$split, 2),\n a = _prop$split2[0],\n b = _prop$split2[1];\n\n var property = properties[a];\n var direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(function (dir) {\n return property + dir;\n }) : [property + direction];\n});\nvar spacingKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY'];\nexport function createUnarySpacing(theme) {\n var themeSpacing = theme.spacing || 8;\n\n if (typeof themeSpacing === 'number') {\n return function (abs) {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(\"Material-UI: Expected spacing argument to be a number, got \".concat(abs, \".\"));\n }\n }\n\n return themeSpacing * abs;\n };\n }\n\n if (Array.isArray(themeSpacing)) {\n return function (abs) {\n if (process.env.NODE_ENV !== 'production') {\n if (abs > themeSpacing.length - 1) {\n console.error([\"Material-UI: The value provided (\".concat(abs, \") overflows.\"), \"The supported values are: \".concat(JSON.stringify(themeSpacing), \".\"), \"\".concat(abs, \" > \").concat(themeSpacing.length - 1, \", you need to add the missing values.\")].join('\\n'));\n }\n }\n\n return themeSpacing[abs];\n };\n }\n\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.error([\"Material-UI: The `theme.spacing` value (\".concat(themeSpacing, \") is invalid.\"), 'It should be a number, an array or a function.'].join('\\n'));\n }\n\n return function () {\n return undefined;\n };\n}\n\nfunction getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n\n var abs = Math.abs(propValue);\n var transformed = transformer(abs);\n\n if (propValue >= 0) {\n return transformed;\n }\n\n if (typeof transformed === 'number') {\n return -transformed;\n }\n\n return \"-\".concat(transformed);\n}\n\nfunction getStyleFromPropValue(cssProperties, transformer) {\n return function (propValue) {\n return cssProperties.reduce(function (acc, cssProperty) {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n };\n}\n\nfunction spacing(props) {\n var theme = props.theme;\n var transformer = createUnarySpacing(theme);\n return Object.keys(props).map(function (prop) {\n // Using a hash computation over an array iteration could be faster, but with only 28 items,\n // it's doesn't worth the bundle size.\n if (spacingKeys.indexOf(prop) === -1) {\n return null;\n }\n\n var cssProperties = getCssProperties(prop);\n var styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n var propValue = props[prop];\n return handleBreakpoints(props, propValue, styleFromPropValue);\n }).reduce(merge, {});\n}\n\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce(function (obj, key) {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nexport default spacing;","export default function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n\n return cache[arg];\n };\n}","import { createUnarySpacing } from '@material-ui/system';\nvar warnOnce;\nexport default function createSpacing() {\n var spacingInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8;\n\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n } // Material Design layouts are visually balanced. Most measurements align to an 8dp grid applied, which aligns both spacing and the overall layout.\n // Smaller components, such as icons and type, can align to a 4dp grid.\n // https://material.io/design/layout/understanding-layout.html#usage\n\n\n var transform = createUnarySpacing({\n spacing: spacingInput\n });\n\n var spacing = function spacing() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(args.length <= 4)) {\n console.error(\"Material-UI: Too many arguments provided, expected between 0 and 4, got \".concat(args.length));\n }\n }\n\n if (args.length === 0) {\n return transform(1);\n }\n\n if (args.length === 1) {\n return transform(args[0]);\n }\n\n return args.map(function (argument) {\n if (typeof argument === 'string') {\n return argument;\n }\n\n var output = transform(argument);\n return typeof output === 'number' ? \"\".concat(output, \"px\") : output;\n }).join(' ');\n }; // Backward compatibility, to remove in v5.\n\n\n Object.defineProperty(spacing, 'unit', {\n get: function get() {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnOnce || process.env.NODE_ENV === 'test') {\n console.error(['Material-UI: theme.spacing.unit usage has been deprecated.', 'It will be removed in v5.', 'You can replace `theme.spacing.unit * y` with `theme.spacing(y)`.', '', 'You can use the `https://github.com/mui-org/material-ui/tree/master/packages/material-ui-codemod/README.md#theme-spacing-api` migration helper to make the process smoother.'].join('\\n'));\n }\n\n warnOnce = true;\n }\n\n return spacingInput;\n }\n });\n spacing.mui = true;\n return spacing;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { deepmerge } from '@material-ui/utils';\nimport createBreakpoints from './createBreakpoints';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\nimport transitions from './transitions';\nimport zIndex from './zIndex';\n\nfunction createTheme() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _options$breakpoints = options.breakpoints,\n breakpointsInput = _options$breakpoints === void 0 ? {} : _options$breakpoints,\n _options$mixins = options.mixins,\n mixinsInput = _options$mixins === void 0 ? {} : _options$mixins,\n _options$palette = options.palette,\n paletteInput = _options$palette === void 0 ? {} : _options$palette,\n spacingInput = options.spacing,\n _options$typography = options.typography,\n typographyInput = _options$typography === void 0 ? {} : _options$typography,\n other = _objectWithoutProperties(options, [\"breakpoints\", \"mixins\", \"palette\", \"spacing\", \"typography\"]);\n\n var palette = createPalette(paletteInput);\n var breakpoints = createBreakpoints(breakpointsInput);\n var spacing = createSpacing(spacingInput);\n var muiTheme = deepmerge({\n breakpoints: breakpoints,\n direction: 'ltr',\n mixins: createMixins(breakpoints, spacing, mixinsInput),\n overrides: {},\n // Inject custom styles\n palette: palette,\n props: {},\n // Provide default props\n shadows: shadows,\n typography: createTypography(palette, typographyInput),\n spacing: spacing,\n shape: shape,\n transitions: transitions,\n zIndex: zIndex\n }, other);\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n muiTheme = args.reduce(function (acc, argument) {\n return deepmerge(acc, argument);\n }, muiTheme);\n\n if (process.env.NODE_ENV !== 'production') {\n var pseudoClasses = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected'];\n\n var traverse = function traverse(node, parentKey) {\n var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var key; // eslint-disable-next-line guard-for-in, no-restricted-syntax\n\n for (key in node) {\n var child = node[key];\n\n if (depth === 1) {\n if (key.indexOf('Mui') === 0 && child) {\n traverse(child, key, depth + 1);\n }\n } else if (pseudoClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n console.error([\"Material-UI: The `\".concat(parentKey, \"` component increases \") + \"the CSS specificity of the `\".concat(key, \"` internal state.\"), 'You can not override it like this: ', JSON.stringify(node, null, 2), '', 'Instead, you need to use the $ruleName syntax:', JSON.stringify({\n root: _defineProperty({}, \"&$\".concat(key), child)\n }, null, 2), '', 'https://material-ui.com/r/pseudo-classes-guide'].join('\\n'));\n } // Remove the style to prevent global conflicts.\n\n\n node[key] = {};\n }\n }\n };\n\n traverse(muiTheme.overrides);\n }\n\n return muiTheme;\n}\n\nvar warnedOnce = false;\nexport function createMuiTheme() {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['Material-UI: the createMuiTheme function was renamed to createTheme.', '', \"You should use `import { createTheme } from '@material-ui/core/styles'`\"].join('\\n'));\n }\n }\n\n return createTheme.apply(void 0, arguments);\n}\nexport default createTheme;","import React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n var theme = React.useContext(ThemeContext);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n\n return theme;\n}","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@material-ui/utils/macros/MuiError.macro` instead.\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code) {\n // Apply babel-plugin-transform-template-literals in loose mode\n // loose mode is safe iff we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n\n /* eslint-disable prefer-template */\n var url = 'https://material-ui.com/production-error/?code=' + code;\n\n for (var i = 1; i < arguments.length; i += 1) {\n // rest params over-transpile for this case\n // eslint-disable-next-line prefer-rest-params\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n\n return 'Minified Material-UI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { chainPropTypes } from '@material-ui/utils';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: theme.typography.pxToRem(24),\n transition: theme.transitions.create('fill', {\n duration: theme.transitions.duration.shorter\n })\n },\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n color: theme.palette.primary.main\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n color: theme.palette.secondary.main\n },\n\n /* Styles applied to the root element if `color=\"action\"`. */\n colorAction: {\n color: theme.palette.action.active\n },\n\n /* Styles applied to the root element if `color=\"error\"`. */\n colorError: {\n color: theme.palette.error.main\n },\n\n /* Styles applied to the root element if `color=\"disabled\"`. */\n colorDisabled: {\n color: theme.palette.action.disabled\n },\n\n /* Styles applied to the root element if `fontSize=\"inherit\"`. */\n fontSizeInherit: {\n fontSize: 'inherit'\n },\n\n /* Styles applied to the root element if `fontSize=\"small\"`. */\n fontSizeSmall: {\n fontSize: theme.typography.pxToRem(20)\n },\n\n /* Styles applied to the root element if `fontSize=\"large\"`. */\n fontSizeLarge: {\n fontSize: theme.typography.pxToRem(35)\n }\n };\n};\nvar SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(props, ref) {\n var children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'inherit' : _props$color,\n _props$component = props.component,\n Component = _props$component === void 0 ? 'svg' : _props$component,\n _props$fontSize = props.fontSize,\n fontSize = _props$fontSize === void 0 ? 'medium' : _props$fontSize,\n htmlColor = props.htmlColor,\n titleAccess = props.titleAccess,\n _props$viewBox = props.viewBox,\n viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,\n other = _objectWithoutProperties(props, [\"children\", \"classes\", \"className\", \"color\", \"component\", \"fontSize\", \"htmlColor\", \"titleAccess\", \"viewBox\"]);\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, className, color !== 'inherit' && classes[\"color\".concat(capitalize(color))], fontSize !== 'default' && fontSize !== 'medium' && classes[\"fontSize\".concat(capitalize(fontSize))]),\n focusable: \"false\",\n viewBox: viewBox,\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, other), children, titleAccess ? /*#__PURE__*/React.createElement(\"title\", null, titleAccess) : null);\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Node passed into the SVG element.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n */\n color: PropTypes.oneOf(['action', 'disabled', 'error', 'inherit', 'primary', 'secondary']),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n */\n fontSize: chainPropTypes(PropTypes.oneOf(['default', 'inherit', 'large', 'medium', 'small']), function (props) {\n var fontSize = props.fontSize;\n\n if (fontSize === 'default') {\n throw new Error('Material-UI: `fontSize=\"default\"` is deprecated. Use `fontSize=\"medium\"` instead.');\n }\n\n return null;\n }),\n\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: PropTypes.string,\n\n /**\n * The shape-rendering attribute. The behavior of the different options is described on the\n * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).\n * If you are having issues with blurry icons you should investigate this property.\n */\n shapeRendering: PropTypes.string,\n\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: PropTypes.string,\n\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n */\n viewBox: PropTypes.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nexport default withStyles(styles, {\n name: 'MuiSvgIcon'\n})(SvgIcon);","export default {\n disabled: false\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *

\n * I'm a fade Transition!\n *
\n * )}\n * \n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","/** @license React v17.0.2\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=require(\"object-assign\"),n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;\nif(\"function\"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w(\"react.element\");p=w(\"react.portal\");exports.Fragment=w(\"react.fragment\");exports.StrictMode=w(\"react.strict_mode\");exports.Profiler=w(\"react.profiler\");q=w(\"react.provider\");r=w(\"react.context\");t=w(\"react.forward_ref\");exports.Suspense=w(\"react.suspense\");u=w(\"react.memo\");v=w(\"react.lazy\")}var x=\"function\"===typeof Symbol&&Symbol.iterator;\nfunction y(a){if(null===a||\"object\"!==typeof a)return null;a=x&&a[x]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}function z(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function B(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var D={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1,!1)});var oa=/[\\-:]([a-z])/g;function pa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(oa,\npa);D[b]=new B(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1,!1)});\nD.xlinkHref=new B(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction qa(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2h||e[g]!==f[h])return\"\\n\"+e[g].replace(\" at new \",\" at \");while(1<=g&&0<=h)}break}}}finally{Oa=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Na(a):\"\"}\nfunction Qa(a){switch(a.tag){case 5:return Na(a.type);case 16:return Na(\"Lazy\");case 13:return Na(\"Suspense\");case 19:return Na(\"SuspenseList\");case 0:case 2:case 15:return a=Pa(a.type,!1),a;case 11:return a=Pa(a.type.render,!1),a;case 22:return a=Pa(a.type._render,!1),a;case 1:return a=Pa(a.type,!0),a;default:return\"\"}}\nfunction Ra(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ua:return\"Fragment\";case ta:return\"Portal\";case xa:return\"Profiler\";case wa:return\"StrictMode\";case Ba:return\"Suspense\";case Ca:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case za:return(a.displayName||\"Context\")+\".Consumer\";case ya:return(a._context.displayName||\"Context\")+\".Provider\";case Aa:var b=a.render;b=b.displayName||b.name||\"\";\nreturn a.displayName||(\"\"!==b?\"ForwardRef(\"+b+\")\":\"ForwardRef\");case Da:return Ra(a.type);case Fa:return Ra(a._render);case Ea:b=a._payload;a=a._init;try{return Ra(a(b))}catch(c){}}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"object\":case \"string\":case \"undefined\":return a;default:return\"\"}}function Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return m({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function $a(a,b){b=b.checked;null!=b&&qa(a,\"checked\",b,!1)}\nfunction ab(a,b){$a(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?bb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&bb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction cb(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction bb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}function db(a){var b=\"\";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function eb(a,b){a=m({children:void 0},b);if(b=db(b.children))a.children=b;return a}\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e=c.length))throw Error(y(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:Sa(c)}}\nfunction ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var kb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction lb(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function mb(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?lb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar nb,ob=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==kb.svg||\"innerHTML\"in a)a.innerHTML=b;else{nb=nb||document.createElement(\"div\");nb.innerHTML=\"\"+b.valueOf().toString()+\"\";for(b=nb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction pb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar qb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(qb).forEach(function(a){rb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qb[b]=qb[a]})});function sb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||qb.hasOwnProperty(a)&&qb[a]?(\"\"+b).trim():b+\"px\"}\nfunction tb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=sb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var ub=m({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction vb(a,b){if(b){if(ub[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(y(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(y(60));if(!(\"object\"===typeof b.dangerouslySetInnerHTML&&\"__html\"in b.dangerouslySetInnerHTML))throw Error(y(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(y(62));}}\nfunction wb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(y(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;ad?0:1<c;c++)b.push(a);return b}\nfunction $c(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Vc(b);a[b]=c}var Vc=Math.clz32?Math.clz32:ad,bd=Math.log,cd=Math.LN2;function ad(a){return 0===a?32:31-(bd(a)/cd|0)|0}var dd=r.unstable_UserBlockingPriority,ed=r.unstable_runWithPriority,fd=!0;function gd(a,b,c,d){Kb||Ib();var e=hd,f=Kb;Kb=!0;try{Hb(e,a,b,c,d)}finally{(Kb=f)||Mb()}}function id(a,b,c,d){ed(dd,hd.bind(null,a,b,c,d))}\nfunction hd(a,b,c,d){if(fd){var e;if((e=0===(b&4))&&0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Ke(c)}}function Me(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Me(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Ne(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Oe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nvar Pe=fa&&\"documentMode\"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Oe(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Je(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Af||(a.current=zf[Af],zf[Af]=null,Af--)}function I(a,b){Af++;zf[Af]=a.current;a.current=b}var Cf={},M=Bf(Cf),N=Bf(!1),Df=Cf;\nfunction Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ff(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Gf(){H(N);H(M)}function Hf(a,b,c){if(M.current!==Cf)throw Error(y(168));I(M,b);I(N,c)}\nfunction If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(y(108,Ra(b)||\"Unknown\",e));return m({},c,d)}function Jf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Cf;Df=M.current;I(M,a);I(N,N.current);return!0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(y(169));c?(a=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=a,H(N),H(M),I(M,a)):H(N);I(N,c)}\nvar Lf=null,Mf=null,Nf=r.unstable_runWithPriority,Of=r.unstable_scheduleCallback,Pf=r.unstable_cancelCallback,Qf=r.unstable_shouldYield,Rf=r.unstable_requestPaint,Sf=r.unstable_now,Tf=r.unstable_getCurrentPriorityLevel,Uf=r.unstable_ImmediatePriority,Vf=r.unstable_UserBlockingPriority,Wf=r.unstable_NormalPriority,Xf=r.unstable_LowPriority,Yf=r.unstable_IdlePriority,Zf={},$f=void 0!==Rf?Rf:function(){},ag=null,bg=null,cg=!1,dg=Sf(),O=1E4>dg?Sf:function(){return Sf()-dg};\nfunction eg(){switch(Tf()){case Uf:return 99;case Vf:return 98;case Wf:return 97;case Xf:return 96;case Yf:return 95;default:throw Error(y(332));}}function fg(a){switch(a){case 99:return Uf;case 98:return Vf;case 97:return Wf;case 96:return Xf;case 95:return Yf;default:throw Error(y(332));}}function gg(a,b){a=fg(a);return Nf(a,b)}function hg(a,b,c){a=fg(a);return Of(a,b,c)}function ig(){if(null!==bg){var a=bg;bg=null;Pf(a)}jg()}\nfunction jg(){if(!cg&&null!==ag){cg=!0;var a=0;try{var b=ag;gg(99,function(){for(;az?(q=u,u=null):q=u.sibling;var n=p(e,u,h[z],k);if(null===n){null===u&&(u=q);break}a&&u&&null===\nn.alternate&&b(e,u);g=f(n,g,z);null===t?l=n:t.sibling=n;t=n;u=q}if(z===h.length)return c(e,u),l;if(null===u){for(;zz?(q=u,u=null):q=u.sibling;var w=p(e,u,n.value,k);if(null===w){null===u&&(u=q);break}a&&u&&null===w.alternate&&b(e,u);g=f(w,g,z);null===t?l=w:t.sibling=w;t=w;u=q}if(n.done)return c(e,u),l;if(null===u){for(;!n.done;z++,n=h.next())n=A(e,n.value,k),null!==n&&(g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);return l}for(u=d(e,u);!n.done;z++,n=h.next())n=C(u,e,z,n.value,k),null!==n&&(a&&null!==n.alternate&&\nu.delete(null===n.key?z:n.key),g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ua&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case sa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ua){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,k.sibling);\nd=e(k,f.props);d.ref=Qg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ua?(d=Xg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Vg(f.type,f.key,f.props,null,a.mode,h),h.ref=Qg(a,d,f),h.return=a,a=h)}return g(a);case ta:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=\nWg(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ug(f,a.mode,h),d.return=a,a=d),g(a);if(Pg(f))return x(a,d,f,h);if(La(f))return w(a,d,f,h);l&&Rg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,Ra(a.type)||\"Component\"));}return c(a,d)}}var Yg=Sg(!0),Zg=Sg(!1),$g={},ah=Bf($g),bh=Bf($g),ch=Bf($g);\nfunction dh(a){if(a===$g)throw Error(y(174));return a}function eh(a,b){I(ch,b);I(bh,a);I(ah,$g);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:mb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=mb(b,a)}H(ah);I(ah,b)}function fh(){H(ah);H(bh);H(ch)}function gh(a){dh(ch.current);var b=dh(ah.current);var c=mb(b,a.type);b!==c&&(I(bh,a),I(ah,c))}function hh(a){bh.current===a&&(H(ah),H(bh))}var P=Bf(0);\nfunction ih(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var jh=null,kh=null,lh=!1;\nfunction mh(a,b){var c=nh(5,null,null,0);c.elementType=\"DELETED\";c.type=\"DELETED\";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function oh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\"\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}\nfunction ph(a){if(lh){var b=kh;if(b){var c=b;if(!oh(a,b)){b=rf(c.nextSibling);if(!b||!oh(a,b)){a.flags=a.flags&-1025|2;lh=!1;jh=a;return}mh(jh,c)}jh=a;kh=rf(b.firstChild)}else a.flags=a.flags&-1025|2,lh=!1,jh=a}}function qh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;jh=a}\nfunction rh(a){if(a!==jh)return!1;if(!lh)return qh(a),lh=!0,!1;var b=a.type;if(5!==a.tag||\"head\"!==b&&\"body\"!==b&&!nf(b,a.memoizedProps))for(b=kh;b;)mh(a,b),b=rf(b.nextSibling);qh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(y(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(\"/$\"===c){if(0===b){kh=rf(a.nextSibling);break a}b--}else\"$\"!==c&&\"$!\"!==c&&\"$?\"!==c||b++}a=a.nextSibling}kh=null}}else kh=jh?rf(a.stateNode.nextSibling):null;return!0}\nfunction sh(){kh=jh=null;lh=!1}var th=[];function uh(){for(var a=0;af))throw Error(y(301));f+=1;T=S=null;b.updateQueue=null;vh.current=Fh;a=c(d,e)}while(zh)}vh.current=Gh;b=null!==S&&null!==S.next;xh=0;T=S=R=null;yh=!1;if(b)throw Error(y(300));return a}function Hh(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===T?R.memoizedState=T=a:T=T.next=a;return T}\nfunction Ih(){if(null===S){var a=R.alternate;a=null!==a?a.memoizedState:null}else a=S.next;var b=null===T?R.memoizedState:T.next;if(null!==b)T=b,S=a;else{if(null===a)throw Error(y(310));S=a;a={memoizedState:S.memoizedState,baseState:S.baseState,baseQueue:S.baseQueue,queue:S.queue,next:null};null===T?R.memoizedState=T=a:T=T.next=a}return T}function Jh(a,b){return\"function\"===typeof b?b(a):b}\nfunction Kh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=S,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.lane;if((xh&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else{var n={lane:l,action:k.action,eagerReducer:k.eagerReducer,\neagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;R.lanes|=l;Dg|=l}k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;He(d,b.memoizedState)||(ug=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction Lh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction Mh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes,a=(xh&a)===a)b._workInProgressVersionPrimary=d,th.push(b);if(a)return c(b._source);th.push(b);throw Error(y(350));}\nfunction Nh(a,b,c,d){var e=U;if(null===e)throw Error(y(349));var f=b._getVersion,g=f(b._source),h=vh.current,k=h.useState(function(){return Mh(e,b,c)}),l=k[1],n=k[0];k=T;var A=a.memoizedState,p=A.refs,C=p.getSnapshot,x=A.source;A=A.subscribe;var w=R;a.memoizedState={refs:p,source:b,subscribe:d};h.useEffect(function(){p.getSnapshot=c;p.setSnapshot=l;var a=f(b._source);if(!He(g,a)){a=c(b._source);He(n,a)||(l(a),a=Ig(w),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d=\ne.entanglements,h=a;0c?98:c,function(){a(!0)});gg(97\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[wf]=b;a[xf]=d;Bi(a,b,!1,!1);b.stateNode=a;g=wb(c,d);switch(c){case \"dialog\":G(\"cancel\",a);G(\"close\",a);\ne=d;break;case \"iframe\":case \"object\":case \"embed\":G(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eJi&&(b.flags|=64,f=!0,Fi(d,!1),b.lanes=33554432)}else{if(!f)if(a=ih(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Fi(d,!0),null===d.tail&&\"hidden\"===d.tailMode&&!g.alternate&&!lh)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*O()-d.renderingStartTime>Ji&&1073741824!==c&&(b.flags|=\n64,f=!0,Fi(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g)}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=O(),c.sibling=null,b=P.current,I(P,f?b&1|2:b&1),c):null;case 23:case 24:return Ki(),null!==a&&null!==a.memoizedState!==(null!==b.memoizedState)&&\"unstable-defer-without-hiding\"!==d.mode&&(b.flags|=4),null}throw Error(y(156,b.tag));}\nfunction Li(a){switch(a.tag){case 1:Ff(a.type)&&Gf();var b=a.flags;return b&4096?(a.flags=b&-4097|64,a):null;case 3:fh();H(N);H(M);uh();b=a.flags;if(0!==(b&64))throw Error(y(285));a.flags=b&-4097|64;return a;case 5:return hh(a),null;case 13:return H(P),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return H(P),null;case 4:return fh(),null;case 10:return rg(a),null;case 23:case 24:return Ki(),null;default:return null}}\nfunction Mi(a,b){try{var c=\"\",d=b;do c+=Qa(d),d=d.return;while(d);var e=c}catch(f){e=\"\\nError generating stack: \"+f.message+\"\\n\"+f.stack}return{value:a,source:b,stack:e}}function Ni(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}var Oi=\"function\"===typeof WeakMap?WeakMap:Map;function Pi(a,b,c){c=zg(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Qi||(Qi=!0,Ri=d);Ni(a,b)};return c}\nfunction Si(a,b,c){c=zg(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if(\"function\"===typeof d){var e=b.value;c.payload=function(){Ni(a,b);return d(e)}}var f=a.stateNode;null!==f&&\"function\"===typeof f.componentDidCatch&&(c.callback=function(){\"function\"!==typeof d&&(null===Ti?Ti=new Set([this]):Ti.add(this),Ni(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:\"\"})});return c}var Ui=\"function\"===typeof WeakSet?WeakSet:Set;\nfunction Vi(a){var b=a.ref;if(null!==b)if(\"function\"===typeof b)try{b(null)}catch(c){Wi(a,c)}else b.current=null}function Xi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:lg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}return;case 3:b.flags&256&&qf(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(y(163));}\nfunction Yi(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{if(3===(a.tag&3)){var d=a.create;a.destroy=d()}a=a.next}while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Zi(c,a),$i(c,a));a=d}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:lg(c.type,b.memoizedProps),a.componentDidUpdate(d,\nb.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&Eg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}Eg(c,b,a)}return;case 5:a=c.stateNode;null===b&&c.flags&4&&mf(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Cc(c))));\nreturn;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(y(163));}\nfunction aj(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d=d.style,\"function\"===typeof d.setProperty?d.setProperty(\"display\",\"none\",\"important\"):d.display=\"none\";else{d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty(\"display\")?e.display:null;d.style.display=sb(\"display\",e)}}else if(6===c.tag)c.stateNode.nodeValue=b?\"\":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===\na)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}}\nfunction bj(a,b){if(Mf&&\"function\"===typeof Mf.onCommitFiberUnmount)try{Mf.onCommitFiberUnmount(Lf,b)}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Zi(b,c);else{d=b;try{e()}catch(f){Wi(d,f)}}c=c.next}while(c!==a)}break;case 1:Vi(b);a=b.stateNode;if(\"function\"===typeof a.componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount()}catch(f){Wi(b,\nf)}break;case 5:Vi(b);break;case 4:cj(a,b)}}function dj(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null}function ej(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction fj(a){a:{for(var b=a.return;null!==b;){if(ej(b))break a;b=b.return}throw Error(y(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(y(161));}c.flags&16&&(pb(b,\"\"),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||ej(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null===\nc.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.flags&2)){c=c.stateNode;break a}}d?gj(a,c,b):hj(a,c,b)}\nfunction gj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=jf));else if(4!==d&&(a=a.child,null!==a))for(gj(a,b,c),a=a.sibling;null!==a;)gj(a,b,c),a=a.sibling}\nfunction hj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(hj(a,b,c),a=a.sibling;null!==a;)hj(a,b,c),a=a.sibling}\nfunction cj(a,b){for(var c=b,d=!1,e,f;;){if(!d){d=c.return;a:for(;;){if(null===d)throw Error(y(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return}d=!0}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(bj(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else{if(k===h)break a;for(;null===k.sibling;){if(null===k.return||k.return===h)break a;k=k.return}k.sibling.return=k.return;k=k.sibling}f?(g=e,h=c.stateNode,\n8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode)}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(bj(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1)}c.sibling.return=c.return;c=c.sibling}}\nfunction ij(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[xf]=d;\"input\"===a&&\"radio\"===d.type&&null!=d.name&&$a(c,d);wb(a,e);b=wb(a,d);for(e=0;ee&&(e=g);c&=~f}c=e;c=O()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>\nc?4320:1960*nj(c/1960))-c;if(10 component higher in the tree to provide a loading indicator or placeholder to display.\")}5!==V&&(V=2);k=Mi(k,h);p=\ng;do{switch(p.tag){case 3:f=k;p.flags|=4096;b&=-b;p.lanes|=b;var J=Pi(p,f,b);Bg(p,J);break a;case 1:f=k;var K=p.type,Q=p.stateNode;if(0===(p.flags&64)&&(\"function\"===typeof K.getDerivedStateFromError||null!==Q&&\"function\"===typeof Q.componentDidCatch&&(null===Ti||!Ti.has(Q)))){p.flags|=4096;b&=-b;p.lanes|=b;var L=Si(p,f,b);Bg(p,L);break a}}p=p.return}while(null!==p)}Zj(c)}catch(va){b=va;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}\nfunction Pj(){var a=oj.current;oj.current=Gh;return null===a?Gh:a}function Tj(a,b){var c=X;X|=16;var d=Pj();U===a&&W===b||Qj(a,b);do try{ak();break}catch(e){Sj(a,e)}while(1);qg();X=c;oj.current=d;if(null!==Y)throw Error(y(261));U=null;W=0;return V}function ak(){for(;null!==Y;)bk(Y)}function Rj(){for(;null!==Y&&!Qf();)bk(Y)}function bk(a){var b=ck(a.alternate,a,qj);a.memoizedProps=a.pendingProps;null===b?Zj(a):Y=b;pj.current=null}\nfunction Zj(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=Gi(c,b,qj);if(null!==c){Y=c;return}c=b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(qj&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1g&&(h=g,g=J,J=h),h=Le(t,J),f=Le(t,g),h&&f&&(1!==v.rangeCount||v.anchorNode!==h.node||v.anchorOffset!==h.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),v.removeAllRanges(),J>g?(v.addRange(q),v.extend(f.node,f.offset)):(q.setEnd(f.node,f.offset),v.addRange(q))))));q=[];for(v=t;v=v.parentNode;)1===v.nodeType&&q.push({element:v,left:v.scrollLeft,top:v.scrollTop});\"function\"===typeof t.focus&&t.focus();for(t=\n0;tO()-jj?Qj(a,0):uj|=c);Mj(a,b)}function lj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===eg()?1:2:(0===Gj&&(Gj=tj),b=Yc(62914560&~Gj),0===b&&(b=4194304)));c=Hg();a=Kj(a,b);null!==a&&($c(a,b,c),Mj(a,c))}var ck;\nck=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||N.current)ug=!0;else if(0!==(c&d))ug=0!==(a.flags&16384)?!0:!1;else{ug=!1;switch(b.tag){case 3:ri(b);sh();break;case 5:gh(b);break;case 1:Ff(b.type)&&Jf(b);break;case 4:eh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;var e=b.type._context;I(mg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return ti(a,b,c);I(P,P.current&1);b=hi(a,b,c);return null!==\nb?b.sibling:null}I(P,P.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Ai(a,b,c);b.flags|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);I(P,P.current);if(d)break;else return null;case 23:case 24:return b.lanes=0,mi(a,b,c)}return hi(a,b,c)}else ug=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=Ef(b,M.current);tg(b,c);e=Ch(null,b,d,a,e,c);b.flags|=1;if(\"object\"===\ntypeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(Ff(d)){var f=!0;Jf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;xg(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Gg(b,d,g,a);e.updater=Kg;b.stateNode=e;e._reactInternals=b;Og(b,d,a,c);b=qi(null,b,d,!0,f,c)}else b.tag=0,fi(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);\na=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=hk(e);a=lg(e,a);switch(f){case 0:b=li(null,b,e,a,c);break a;case 1:b=pi(null,b,e,a,c);break a;case 11:b=gi(null,b,e,a,c);break a;case 14:b=ii(null,b,e,lg(e.type,a),d,c);break a}throw Error(y(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),li(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),pi(a,b,d,e,c);case 3:ri(b);d=b.updateQueue;if(null===a||null===d)throw Error(y(282));\nd=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;yg(a,b);Cg(b,d,null,c);d=b.memoizedState.element;if(d===e)sh(),b=hi(a,b,c);else{e=b.stateNode;if(f=e.hydrate)kh=rf(b.stateNode.containerInfo.firstChild),jh=b,f=lh=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!=a)for(e=0;e=\nE};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;\nfunction T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M)}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else{var b=J(M);null!==b&&g(U,b.startTime-a)}}\nfunction V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if(\"function\"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?O.callback=e:O===J(L)&&K(L);T(b)}else K(L);O=J(L)}if(null!==O)var m=!0;else{var n=J(M);null!==n&&g(U,n.startTime-b);m=!1}return m}finally{O=null,P=c,Q=!1}}var W=k;exports.unstable_IdlePriority=5;\nexports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V))};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)};\nexports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P}var c=P;P=b;try{return a()}finally{P=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=P;P=a;try{return b()}finally{P=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();\"object\"===typeof c&&null!==c?(c=c.delay,c=\"number\"===typeof c&&0d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a};\nexports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","'use strict';\n\nexports.sha1 = require('./sha/1');\nexports.sha224 = require('./sha/224');\nexports.sha256 = require('./sha/256');\nexports.sha384 = require('./sha/384');\nexports.sha512 = require('./sha/512');\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n 0x5A827999, 0x6ED9EBA1,\n 0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1();\n\n BlockHash.call(this);\n this.h = [\n 0x67452301, 0xefcdab89, 0x98badcfe,\n 0x10325476, 0xc3d2e1f0 ];\n this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n\n for(; i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n\n for (i = 0; i < W.length; i++) {\n var s = ~~(i / 20);\n var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d;\n d = c;\n c = rotl32(b, 30);\n b = a;\n a = t;\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar SHA256 = require('./256');\n\nfunction SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224();\n\n SHA256.call(this);\n this.h = [\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n // Just truncate output\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 7), 'big');\n else\n return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n","'use strict';\n\nvar utils = require('../utils');\n\nvar SHA512 = require('./512');\n\nfunction SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384();\n\n SHA512.call(this);\n this.h = [\n 0xcbbb9d5d, 0xc1059ed8,\n 0x629a292a, 0x367cd507,\n 0x9159015a, 0x3070dd17,\n 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31,\n 0x8eb44a87, 0x68581511,\n 0xdb0c2e0d, 0x64f98fa7,\n 0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 12), 'big');\n else\n return utils.split32(this.h.slice(0, 12), 'big');\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar common = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160();\n\n BlockHash.call(this);\n\n this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n var A = this.h[0];\n var B = this.h[1];\n var C = this.h[2];\n var D = this.h[3];\n var E = this.h[4];\n var Ah = A;\n var Bh = B;\n var Ch = C;\n var Dh = D;\n var Eh = E;\n for (var j = 0; j < 80; j++) {\n var T = sum32(\n rotl32(\n sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n s[j]),\n E);\n A = E;\n E = D;\n D = rotl32(C, 10);\n C = B;\n B = T;\n T = sum32(\n rotl32(\n sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n sh[j]),\n Eh);\n Ah = Eh;\n Eh = Dh;\n Dh = rotl32(Ch, 10);\n Ch = Bh;\n Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh);\n this.h[1] = sum32_3(this.h[2], D, Eh);\n this.h[2] = sum32_3(this.h[3], E, Ah);\n this.h[3] = sum32_3(this.h[4], A, Bh);\n this.h[4] = sum32_3(this.h[0], B, Ch);\n this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'little');\n else\n return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n if (j <= 15)\n return x ^ y ^ z;\n else if (j <= 31)\n return (x & y) | ((~x) & z);\n else if (j <= 47)\n return (x | (~y)) ^ z;\n else if (j <= 63)\n return (x & z) | (y & (~z));\n else\n return x ^ (y | (~z));\n}\n\nfunction K(j) {\n if (j <= 15)\n return 0x00000000;\n else if (j <= 31)\n return 0x5a827999;\n else if (j <= 47)\n return 0x6ed9eba1;\n else if (j <= 63)\n return 0x8f1bbcdc;\n else\n return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n if (j <= 15)\n return 0x50a28be6;\n else if (j <= 31)\n return 0x5c4dd124;\n else if (j <= 47)\n return 0x6d703ef3;\n else if (j <= 63)\n return 0x7a6d76e9;\n else\n return 0x00000000;\n}\n\nvar r = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash;\n this.blockSize = hash.blockSize / 8;\n this.outSize = hash.outSize / 8;\n this.inner = null;\n this.outer = null;\n\n this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n // Shorten key, if needed\n if (key.length > this.blockSize)\n key = new this.Hash().update(key).digest();\n assert(key.length <= this.blockSize);\n\n // Add padding to key\n for (var i = key.length; i < this.blockSize; i++)\n key.push(0);\n\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x36;\n this.inner = new this.Hash().update(key);\n\n // 0x36 ^ 0x5c = 0x6a\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x6a;\n this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n this.inner.update(msg, enc);\n return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n this.outer.update(this.inner.digest());\n return this.outer.digest(enc);\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a