text: /*! For license information please see 0xcert-wanchain.min.js.LICENSE.txt */
  (()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=d(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=d(e,c,e.length,t),c=0;c<s;c++)h*=t;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],h=[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 f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d<n;d++){for(var c=u>>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a<o;a++)d[a]=0}else{for(a=0;a<o-i;a++)d[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[o-a-1]=s}return d},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.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 r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,d=0,c=0|s[0],h=8191&c,l=c>>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],g=8191&y,A=y>>>13,O=0|s[4],I=8191&O,T=O>>>13,b=0|s[5],w=8191&b,R=b>>>13,N=0|s[6],P=8191&N,M=N>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,j=0|s[9],G=8191&j,U=j>>>13,F=0|a[0],K=8191&F,B=F>>>13,V=0|a[1],Y=8191&V,z=V>>>13,X=0|a[2],H=8191&X,W=X>>>13,$=0|a[3],Z=8191&$,q=$>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,K))|0)+((8191&(i=(i=Math.imul(h,B))+Math.imul(l,K)|0))<<13)|0;d=((o=Math.imul(l,B))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,B))+Math.imul(v,K)|0,o=Math.imul(v,B);var me=(d+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,Y)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,K),i=(i=Math.imul(m,B))+Math.imul(E,K)|0,o=Math.imul(E,B),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,z)|0;var Ee=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,B))+Math.imul(A,K)|0,o=Math.imul(A,B),n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,Z)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,B))+Math.imul(T,K)|0,o=Math.imul(T,B),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,q)|0;var ge=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,B))+Math.imul(R,K)|0,o=Math.imul(R,B),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var Ae=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,B))+Math.imul(M,K)|0,o=Math.imul(M,B),n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Oe=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,B))+Math.imul(x,K)|0,o=Math.imul(x,B),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,z)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,z)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Ie=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,B))+Math.imul(k,K)|0,o=Math.imul(k,B),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(G,K),i=(i=Math.imul(G,B))+Math.imul(U,K)|0,o=Math.imul(U,B),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,q)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var be=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(G,Y),i=(i=Math.imul(G,z))+Math.imul(U,Y)|0,o=Math.imul(U,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,de)|0,n=n+Math.imul(m,he)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,le)|0;var we=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,W))+Math.imul(U,H)|0,o=Math.imul(U,W),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,le)|0;var Re=(d+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ve)|0)+Math.imul(E,pe)|0))<<13)|0;d=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(U,Z)|0,o=Math.imul(U,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,de)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var Ne=(d+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(A,pe)|0))<<13)|0;d=((o=o+Math.imul(A,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Pe=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(G,re),i=(i=Math.imul(G,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,le)|0;var Me=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(R,pe)|0))<<13)|0;d=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(G,oe),i=(i=Math.imul(G,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(M,pe)|0))<<13)|0;d=((o=o+Math.imul(M,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(G,ue),i=(i=Math.imul(G,de))+Math.imul(U,ue)|0,o=Math.imul(U,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(G,he),i=(i=Math.imul(G,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(G,pe))|0)+((8191&(i=(i=Math.imul(G,ve))+Math.imul(U,pe)|0))<<13)|0;return d=((o=Math.imul(U,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=me,u[2]=Ee,u[3]=ye,u[4]=ge,u[5]=Ae,u[6]=Oe,u[7]=Ie,u[8]=Te,u[9]=be,u[10]=we,u[11]=Re,u[12]=Ne,u[13]=Pe,u[14]=Me,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),d=Math.max(0,o-e.length+1);d<=u;d++){var c=o-d,h=(0|e.words[c])*(0|t.words[d]),l=67108863&h;a=67108863&(l=l+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t),r},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},_.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},_.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=u,l=d,f=0;f<s;f++){var p=r[c+f],v=n[c+f],_=r[c+f+s],m=n[c+f+s],E=h*_-l*m;m=h*m+l*_,_=E,r[c+f]=p+_,n[c+f]=v+m,r[c+f+s]=p-_,n[c+f+s]=v-m,f!==a&&(E=u*h-d*l,l=u*l+d*h,h=E)}},_.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},_.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},_.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},_.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},_.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},_.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),d=new Array(n),c=new Array(n),h=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,d,n),this.transform(s,o,a,u,n,i),this.transform(d,o,c,h,n,i);for(var f=0;f<n;f++){var p=a[f]*c[f]-u[f]*h[f];u[f]=a[f]*h[f]+u[f]*c[f],a[f]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var d=0;d<s;d++)u.words[d]=this.words[d];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,d=0;d<this.length;d++)this.words[d]=this.words[d+s];else this.words[0]=0,this.length=1;var c=0;for(d=this.length-1;d>=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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},o.prototype.isubn=function(e){if(n("number"==typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(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 E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}E.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(y,E),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(g,E),i(A,E),i(O,E),O.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new g;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return m[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_<p);var m=this.pow(h,new o(1).iushln(p-_-1));l=l.redMul(m),h=m.redSqr(),f=f.redMul(h),p=_}return l},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,I),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,b,w,R,N,P,M,S,D,x,L,C,k,j,G,U,F,K,B,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,G=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,b=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=b^~R&P,e[11]=w^~N&M,e[20]=C^~j&U,e[21]=k^~G&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~P&S,e[13]=N^~M&D,e[22]=j^~U&K,e[23]=G^~F&B,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=P^~S&x,e[15]=M^~D&L,e[24]=U^~K&V,e[25]=F^~B&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&b,e[17]=D^~L&w,e[26]=K^~V&C,e[27]=B^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~b&R,e[19]=L^~w&N,e[28]=V^~C&j,e[29]=Y^~k&G,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a<u;a+=2)s.push(parseInt(i.slice(a,a+2),16))}else s=i;return((e,i)=>{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f<a;){if(e.reset)for(e.reset=!1,u[0]=e.block,_=1;_<c+1;++_)u[_]=0;if("string"!=typeof i)for(_=e.start;f<a&&_<d;++f)u[_>>2]|=i[f]<<n[3&_++];else for(_=e.start;f<a&&_<d;++f)(s=i.charCodeAt(f))<128?u[_>>2]|=s<<n[3&_++]:s<2048?(u[_>>2]|=(192|s>>6)<<n[3&_++],u[_>>2]|=(128|63&s)<<n[3&_++]):s<55296||s>=57344?(u[_>>2]|=(224|s>>12)<<n[3&_++],u[_>>2]|=(128|s>>6&63)<<n[3&_++],u[_>>2]|=(128|63&s)<<n[3&_++]):(s=65536+((1023&s)<<10|1023&i.charCodeAt(++f)),u[_>>2]|=(240|s>>18)<<n[3&_++],u[_>>2]|=(128|s>>12&63)<<n[3&_++],u[_>>2]|=(128|s>>6&63)<<n[3&_++],u[_>>2]|=(128|63&s)<<n[3&_++]);if(e.lastByteIndex=_,_>=d){for(e.start=_-d,e.block=u[c],_=0;_<c;++_)l[_]^=u[_];o(l),e.reset=!0}else e.start=_}if(u[(_=e.lastByteIndex)>>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_<c+1;++_)u[_]=0;for(u[c-1]|=2147483648,_=0;_<c;++_)l[_]^=u[_];o(l);for(var p,v="",_=0,m=0;m<h;){for(_=0;_<c&&m<h;++_,++m)p=l[_],v+=t[p>>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];m%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),e<r&&s("missing argument"+n,t.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];d("warn",e)}t.setLogLevel=function(e){var t=a[e];null!=t?u=t:c("invliad log level - "+e)},t.warn=c,t.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];d("info",e)}},4164:(e,t,r)=>{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new g(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new g(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new g(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n<u.length;++n){var i=u[n];r[i]=d(e,t,i)}return r},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:a,createMethod:h},{name:"sha3",padding:[6,1536,393216,100663296],bits:a,createMethod:h},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(e,t){var r=c(e,t,"hex");r.create=function(r){return new g(e,t,r)},r.update=function(e,t){return r.create(t).update(e)};for(var n=0;n<u.length;++n){var i=u[n];r[i]=c(e,t,i)}return r}}],f={},p=[],v=0;v<l.length;++v)for(var _=l[v],m=_.bits,E=0;E<m.length;++E){var y=_.name+"_"+m[E];p.push(y),f[y]=_.createMethod(m[E],_.padding)}function g(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}g.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d<i;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<u+1;++r)s[r]=0;if(t)for(r=this.start;d<i&&r<a;++d)s[r>>2]|=e[d]<<o[3&r++];else for(r=this.start;d<i&&r<a;++d)(n=e.charCodeAt(d))<128?s[r>>2]|=n<<o[3&r++]:n<2048?(s[r>>2]|=(192|n>>6)<<o[3&r++],s[r>>2]|=(128|63&n)<<o[3&r++]):n<55296||n>=57344?(s[r>>2]|=(224|n>>12)<<o[3&r++],s[r>>2]|=(128|n>>6&63)<<o[3&r++],s[r>>2]|=(128|63&n)<<o[3&r++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++d)),s[r>>2]|=(240|n>>18)<<o[3&r++],s[r>>2]|=(128|n>>12&63)<<o[3&r++],s[r>>2]|=(128|n>>6&63)<<o[3&r++],s[r>>2]|=(128|63&n)<<o[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=s[u],r=0;r<u;++r)c[r]^=s[r];A(c),this.reset=!0}else this.start=r}return this},g.prototype.finalize=function(){var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];A(n)},g.prototype.toString=g.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,s=0,a=0,u="";a<n;){for(s=0;s<t&&a<n;++s,++a)e=r[s],u+=i[e>>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(A(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)u[s]=r[o];s%t==0&&A(r)}return i&&(u[o]=r[o],e=e.slice(0,a)),e},g.prototype.buffer=g.prototype.arrayBuffer,g.prototype.digest=g.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&A(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var A=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,b,w,R,N,P,M,S,D,x,L,C,k,j,G,U,F,K,B,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,G=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,b=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=b^~R&P,e[11]=w^~N&M,e[20]=C^~j&U,e[21]=k^~G&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~P&S,e[13]=N^~M&D,e[22]=j^~U&K,e[23]=G^~F&B,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=P^~S&x,e[15]=M^~D&L,e[24]=U^~K&V,e[25]=F^~B&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&b,e[17]=D^~L&w,e[26]=K^~V&C,e[27]=B^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~b&R,e[19]=L^~w&N,e[28]=V^~C&j,e[29]=Y^~k&G,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v<p.length;++v)t[p[v]]=f[p[v]]}()},861:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=r(3850),a=o(r(6666)),u=r(2990),d=r(2069),c=r(2453),h=r(9469),l=r(589),f=new RegExp(/^bytes([0-9]*)$/),p=new RegExp(/^(u?int)([0-9]*)$/),v=new RegExp(/^(.*)\[([0-9]*)\]$/);t.defaultCoerceFunc=function(e,t){var r=e.match(p);return r&&parseInt(r[2])<=48?t.toNumber():t};var _=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function E(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}function y(e,t){var r=e;function n(e){throw new Error('unexpected character "'+r[e]+'" at position '+e+' in "'+r+'"')}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,s=0;s<e.length;s++){var a=e[s];switch(a){case"(":o.state.allowParams||n(s),o.state.allowType=!1,o.type=E(o.type),o.components=[{type:"",name:"",parent:o,state:{allowType:!0}}],o=o.components[0];break;case")":delete o.state,t&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=E(o.type);var u=o;(o=o.parent)||n(s),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,t&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=E(o.type);var d={type:"",name:"",parent:o.parent,state:{allowType:!0}};o.parent.components.push(d),delete o.parent,o=d;break;case" ":o.state.allowType&&""!==o.type&&(o.type=E(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&(t&&"indexed"===o.name?(o.indexed=!0,o.name=""):o.state.allowName=!1);break;case"[":o.state.allowArray||n(s),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(s),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:n(s)}}if(o.parent)throw new Error("unexpected eof");return delete i.state,t&&"indexed"===o.name&&(o.indexed=!0,o.name=""),i.type=E(i.type),i}function g(e){return F(t.defaultCoerceFunc,e).type}t.parseParamType=function(e){return y(e,!0)},t.formatParamType=g,t.formatSignature=function(e){return e.name+"("+e.inputs.map((function(e){return g(e)})).join(",")+")"},t.parseSignature=function(e){if("string"==typeof e)return"event "===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(e){var t={anonymous:!1,inputs:[],name:"",type:"event"},r=e.match(_);if(!r)throw new Error("invalid event: "+e);if(t.name=r[1].trim(),G(r[2]).forEach((function(e){(e=y(e,!0)).indexed=!!e.indexed,t.inputs.push(e)})),r[3].split(" ").forEach((function(e){switch(e){case"anonymous":t.anonymous=!0;break;case"":break;default:a.info("unknown modifier: "+e)}})),t.name&&!t.name.match(m))throw new Error('invalid identifier: "'+t.name+'"');return t}(e.substring(6).trim()):("function "===e.substring(0,9)&&(e=e.substring(9)),function(e){var t={constant:!1,gas:null,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},r=e.split("@");if(1!==r.length){if(r.length>2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(m))throw new Error('invalid identifier: "'+n[1]+'"');if(G(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";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:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");G(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var A=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},O=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(A),I=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(A),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length<t+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:c.hexlify(e.slice(t,t+32))});var r=32-this.size,n=d.bigNumberify(e.slice(t+r,t+32));return n=this.signed?n.fromTwos(8*this.size):n.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,n)}},t}(A),b=new T((function(e,t){return t}),32,!1,"none"),w=function(e){function t(t,r){return e.call(this,t,"bool","bool",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return b.encode(e?1:0)},t.prototype.decode=function(e,t){try{var r=b.decode(e,t)}catch(e){throw"insufficient data for uint256 type"===e.reason&&a.throwError("insufficient data for boolean type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:e.value}),e}return{consumed:r.consumed,value:this.coerceFunc("bool",!r.value.isZero())}},t}(A),R=function(e){function t(t,r,n){var i=this,o="bytes"+r;return(i=e.call(this,t,o,o,n,!1)||this).length=r,i}return i(t,e),t.prototype.encode=function(e){var t=new Uint8Array(32);try{var r=c.arrayify(e);if(r.length!==this.length)throw new Error("incorrect data length");t.set(r)}catch(t){a.throwError("invalid "+this.name+" value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t.value||e})}return t},t.prototype.decode=function(e,t){return e.length<t+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:c.hexlify(e.slice(t,t+32))}),{consumed:32,value:this.coerceFunc(this.name,c.hexlify(e.slice(t,t+this.length)))}},t}(A),N=function(e){function t(t,r){return e.call(this,t,"address","address",r,!1)||this}return i(t,e),t.prototype.encode=function(e){var t=new Uint8Array(32);try{t.set(c.arrayify(u.getAddress(e)),12)}catch(t){a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:e})}return t},t.prototype.decode=function(e,t){return e.length<t+32&&a.throwError("insufficient data for address type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:c.hexlify(e.slice(t,t+32))}),{consumed:32,value:this.coerceFunc("address",u.getAddress(c.hexlify(e.slice(t+12,t+32))))}},t}(A);function P(e){var t=32*Math.ceil(e.length/32),r=new Uint8Array(t-e.length);return c.concat([b.encode(e.length),e,r])}function M(e,t,r){e.length<t+32&&a.throwError("insufficient data for dynamicBytes length",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:c.hexlify(e.slice(t,t+32))});var n=b.decode(e,t).value;try{n=n.toNumber()}catch(e){a.throwError("dynamic bytes count too large",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:n.toString()})}return e.length<t+32+n&&a.throwError("insufficient data for dynamicBytes type",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:c.hexlify(e.slice(t,t+32+n))}),{consumed:32+32*Math.ceil(n/32),value:e.slice(t+32,t+32+n)}}var S=function(e){function t(t,r){return e.call(this,t,"bytes","bytes",r,!0)||this}return i(t,e),t.prototype.encode=function(e){try{return P(c.arrayify(e))}catch(e){a.throwError("invalid bytes value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:e.value})}return null},t.prototype.decode=function(e,t){var r=M(e,t,this.localName);return r.value=this.coerceFunc("bytes",c.hexlify(r.value)),r},t}(A),D=function(e){function t(t,r){return e.call(this,t,"string","string",r,!0)||this}return i(t,e),t.prototype.encode=function(e){return"string"!=typeof e&&a.throwError("invalid string value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:e}),P(h.toUtf8Bytes(e))},t.prototype.decode=function(e,t){var r=M(e,t,this.localName);return r.value=this.coerceFunc("string",h.toUtf8String(r.value)),r},t}(A);function x(e){return 32*Math.ceil(e/32)}function L(e,t){if(Array.isArray(t));else if(t&&"object"==typeof t){var r=[];e.forEach((function(e){r.push(t[e.localName])})),t=r}else a.throwError("invalid tuple value",a.INVALID_ARGUMENT,{coderType:"tuple",value:t});e.length!==t.length&&a.throwError("types/value length mismatch",a.INVALID_ARGUMENT,{coderType:"tuple",value:t});var n=[];e.forEach((function(e,r){n.push({dynamic:e.dynamic,value:e.encode(t[r])})}));var i=0,o=0;n.forEach((function(e){e.dynamic?(i+=32,o+=x(e.value.length)):i+=x(e.value.length)}));var s=0,u=i,d=new Uint8Array(i+o);return n.forEach((function(e){e.dynamic?(d.set(b.encode(u),s),s+=32,d.set(e.value,u),u+=x(e.value.length)):(d.set(e.value,s),s+=x(e.value.length))})),d}function C(e,t,r){var n=r,i=0,o=[];return e.forEach((function(e){if(e.dynamic){var s=b.decode(t,r);(a=e.decode(t,n+s.value.toNumber())).consumed=s.consumed}else var a=e.decode(t,r);null!=a.value&&o.push(a.value),r+=a.consumed,i+=a.consumed})),e.forEach((function(e,t){var r=e.localName;r&&("length"===r&&(r="_length"),null==o[r]&&(o[r]=o[t]))})),{value:o,consumed:i}}var k=function(e){function t(t,r,n,i){var o=this,s=r.type+"["+(n>=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=b.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<e.length;i++)n.push(this.coder);return c.concat([r,L(n,e)])},t.prototype.decode=function(e,t){var r=0,n=this.length;if(-1===n){try{var i=b.decode(e,t)}catch(e){a.throwError("insufficient data for dynamic array length",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e.value})}try{n=i.value.toNumber()}catch(e){a.throwError("array count too large",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:i.value.toString()})}r+=i.consumed,t+=i.consumed}for(var o=[],s=0;s<n;s++)o.push(new O(this.coder));var u=C(o,e,t);return u.consumed+=r,u.value=this.coerceFunc(this.type,u.value),u},t}(A),j=function(e){function t(t,r,n){var i=this,o=!1,s=[];r.forEach((function(e){e.dynamic&&(o=!0),s.push(e.type)}));var a="tuple("+s.join(",")+")";return(i=e.call(this,t,"tuple",a,n,o)||this).coders=r,i}return i(t,e),t.prototype.encode=function(e){return L(this.coders,e)},t.prototype.decode=function(e,t){var r=C(this.coders,e,t);return r.value=this.coerceFunc(this.type,r.value),r},t}(A);function G(e){e=e.trim();for(var t=[],r="",n=0,i=0;i<e.length;i++){var o=e[i];if(","===o&&0===n)t.push(r),r="";else if(r+=o,"("===o)n++;else if(")"===o&&-1==--n)throw new Error("unbalanced parenthsis")}return r&&t.push(r),t}var U={address:N,bool:w,string:D,bytes:S};function F(e,t){var r,n=U[t.type];if(n)return new n(e,t.name);if(r=t.type.match(p))return(0===(i=parseInt(r[2]||"256"))||i>256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new R(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new j(e,n,r)}(e,t.components,t.name):""===t.type?new I(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var K=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new j(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new j(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=K,t.defaultAbiCoder=new K},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t<e.length;t++){var r=e[t];if(r<0||r>=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n<e.length;n+=2)r.push(parseInt(e.substr(n,2),16));return s(new Uint8Array(r))}return a(e)?s(new Uint8Array(e)):(i.throwError("invalid arrayify value",null,{arg:"value",value:e,type:typeof e}),null)}function d(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=u(e[n]);t.push(i),r+=i.length}var o=new Uint8Array(r),a=0;for(n=0;n<t.length;n++)o.set(t[n],a),a+=t[n].length;return s(o)}function c(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}t.isHexable=o,t.isArrayish=a,t.arrayify=u,t.concat=d,t.stripZeros=function(e){var t=u(e);if(0===t.length)return t;for(var r=0;0===t[r];)r++;return r&&(t=t.slice(r)),t},t.padZeros=function(e,t){if(t<(e=u(e)).length)throw new Error("cannot pad");var r=new Uint8Array(t);return r.set(e,t-e.length),s(r)},t.isHexString=c;var h="0123456789abcdef";function l(e){if(o(e))return e.toHexString();if("number"==typeof e){e<0&&i.throwError("cannot hexlify negative value",i.INVALID_ARGUMENT,{arg:"value",value:e}),e>=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s<e.length;s++){var u=e[s];n.push(h[(240&u)>>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;i<r;i++)n=256*n+e[t+i];return n}function s(e){if(Array.isArray(e)){var t=[];return e.forEach((function(e){t=t.concat(s(e))})),t.length<=55?(t.unshift(192+t.length),t):((r=i(t.length)).unshift(247+r.length),r.concat(t))}var r,o=Array.prototype.slice.call(n.arrayify(e));return 1===o.length&&o[0]<=127?o:o.length<=55?(o.unshift(128+o.length),o):((r=i(o.length)).unshift(183+r.length),r.concat(o))}function a(e,t,r,n){for(var i=[];r<t+1+n;){var o=u(e,r);if(i.push(o.result),(r+=o.consumed)>t+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i<e.length;i++){var a=e.charCodeAt(i);if(a<128)r.push(a);else if(a<2048)r.push(a>>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n<e.length;){var i=e[n++];if(i>>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n<e.length&&e[n]>>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d<o;d++){var c=e[n];if(128!=(192&c)){u=null;break}u=u<<6|63&c,n++}if(null!==u)if(u<=a){if(!t)throw new Error("invalid utf8 byte sequence; overlong")}else if(u>1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.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 r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r<d;++r)n(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},5736:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Cert=void 0;const i=r(2461),o=r(5353),s=r(7077);class a{constructor(e){this.schema=e.schema,this.merkle=new i.Merkle(Object.assign({hasher:e=>n(this,void 0,void 0,(function*(){return o.sha(256,s.toString(e))})),noncer:e=>n(this,void 0,void 0,(function*(){return o.sha(256,e.join("."))}))},e))}static getInstance(e){return new a(e)}identify(e){return n(this,void 0,void 0,(function*(){return o.sha(256,JSON.stringify(!1!==e?this.sortSchema(this.schema):this.schema))}))}notarize(e){return n(this,void 0,void 0,(function*(){const t=this.buildSchemaProps(e),r=yield this.buildCompoundProps(t);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(r)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}expose(e,t){const r={};return t.forEach((t=>{const n=s.readPath(t,e);s.writePath(t,n,r)})),JSON.parse(JSON.stringify(r))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=this.buildSchemaProps(e),n=yield this.buildCompoundProps(r);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(n,t)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}calculate(e,t){return n(this,void 0,void 0,(function*(){try{return this.checkDataInclusion(e,t.data)?this.imprintRecipes(t.data):null}catch(e){return null}}))}imprint(e){return n(this,void 0,void 0,(function*(){return this.notarize(e).then((e=>e.data[0].nodes[0].hash)).catch((()=>null))}))}buildSchemaProps(e,t=this.schema,r=[]){if("array"===t.type){const n=(e||[]).map(((e,n)=>this.buildSchemaProps(e,t.items,[...r,n]))).reduce(((e,t)=>e.concat(t)),[]);return n.length>0?n:[this.buildSchemaProps(void 0,{},[...r])]}return"object"===t.type?Object.keys(t.properties).sort().map((n=>{const i=this.buildSchemaProps((e||{})[n],t.properties[n],[...r,n]);return-1===["object","array"].indexOf(t.properties[n].type)?[i]:i})).reduce(((e,t)=>e.concat(t)),[]):{path:r,value:e,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(e){return n(this,void 0,void 0,(function*(){e=[...e];const t=this.buildPropGroups(e),r=Object.keys(t).sort(((e,t)=>e>t?-1:1)).filter((e=>""!==e));for(const n of r){const r=t[n],i=[...e.filter((e=>e.group===n))].sort(((e,t)=>e.key>t.key?1:-1)).map((e=>e.value)),o=yield this.merkle.notarize(i,r);e.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return e.sort(((e,t)=>e.key>t.key?1:-1))}))}buildRecipes(e,t=null){return n(this,void 0,void 0,(function*(){const r=t?s.stepPaths(t).map((e=>e.join("."))):null,i={};return e.forEach((e=>i[e.group]=e.path.slice(0,-1))),Promise.all(Object.keys(i).map((t=>n(this,void 0,void 0,(function*(){const n=e.filter((e=>e.group===t)).map((e=>e.value));let o=yield this.merkle.notarize(n,i[t]);if(r){const n=e.filter((e=>e.group===t)).map(((e,t)=>-1===r.indexOf(e.key)?-1:t)).filter((e=>-1!==e));o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[t].join(".")))return{path:i[t],values:o.values,nodes:o.nodes,key:i[t].join("."),group:i[t].slice(0,-1).join(".")}}))))).then((e=>e.filter((e=>!!e))))}))}checkDataInclusion(e,t){const r=this.buildSchemaProps(e);t=s.cloneObject(t).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e)));for(const n of r){const r=s.readPath(n.path,e);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=t.find((e=>e.key===i));if(!o)return!1;const a=this.getPathIndexes(n.path).pop(),u=o.values.find((e=>e.index===a));if(void 0!==u&&u.value!==r)return!1}return!0}imprintRecipes(e){return n(this,void 0,void 0,(function*(){if(0===e.length)return this.getEmptyImprint();e=s.cloneObject(e).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e))).sort(((e,t)=>e.path.length>t.path.length?-1:1));for(const t of e){const r=yield this.merkle.imprint(t).catch((()=>""));t.nodes.unshift({index:0,hash:r});const n=t.path.slice(0,-1).join("."),i=t.path.slice(0,-1),o=this.getPathIndexes(t.path).slice(-1).pop(),s=e.find((e=>e.key===n));s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const t=e.find((e=>""===e.key));return t?t.nodes.find((e=>0===e.index)).hash:this.getEmptyImprint()}))}getPathIndexes(e){const t=[];let r=this.schema;for(const n of e)"array"===r.type?(t.push(n),r=r.items):"object"===r.type?(t.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):t.push(void 0);return t}getEmptyImprint(){return n(this,void 0,void 0,(function*(){return this.merkle.notarize([]).then((e=>e.nodes[0].hash))}))}buildPropGroups(e){const t={};return e.map((e=>{const t=[];return e.path.map((e=>(t.push(e),[...t])))})).reduce(((e,t)=>e.concat(t)),[]).forEach((e=>t[e.slice(0,-1).join(".")]=e.slice(0,-1))),t}sortSchema(e){return Object.keys(e).sort().reduce(((t,r)=>(Array.isArray(e[r])?t[r]=e[r].sort():"object"==typeof e[r]?t[r]=this.sortSchema(e[r]):t[r]=e[r],t)),{})}}t.Cert=a},3377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9230:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5736),t),i(r(3377),t)},7077:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writePath=t.readPath=t.stepPaths=t.cloneObject=t.toString=void 0,t.toString=function(e){try{return null==e?"":`${e}`}catch(e){return""}},t.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},t.stepPaths=function(e){const t={"":[]};return e.forEach((e=>{const r=[];e.forEach((e=>{r.push(e),t[r.join(".")]=[...r]}))})),Object.keys(t).sort().map((e=>t[e]))},t.readPath=function e(t,r){try{return Array.isArray(t)?0===t.length?r:e(t.slice(1),r[t[0]]):void 0}catch(e){return}},t.writePath=function(e,t,r={}){let n=r=r||{};for(let r=0;r<e.length;r++){const i=e[r],o=e[r+1];void 0===o?n[i]=t:("number"==typeof o&&void 0===n[i]?n[i]=[]:void 0===n[i]&&(n[i]={}),n=n[i])}return JSON.parse(JSON.stringify(r))}},6428:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const i=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),d=r(8260),c=r(8943),h=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),m=r(4583),E=r(5421),y=r(2513),g=r(1999),A=r(1741),O=r(3206),I=r(8661),T=r(195),b=r(8548),w=r(4977),R=r(5289),N=r(1066),P=r(4373),M=r(7877);t.AssetLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getAbilities(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),g.default(this,e)}))}getApprovedAccount(e){return n(this,void 0,void 0,(function*(){return O.default(this,e)}))}getAssetAccount(e){return n(this,void 0,void 0,(function*(){return T.default(this,e)}))}getAsset(e){return n(this,void 0,void 0,(function*(){return I.default(this,e)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),w.default(this,e)}))}getCapabilities(){return n(this,void 0,void 0,(function*(){return R.default(this)}))}getInfo(){return n(this,void 0,void 0,(function*(){return N.default(this)}))}getAssetIdAt(e){return n(this,void 0,void 0,(function*(){return b.default(this,e)}))}getAccountAssetIdAt(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),A.default(this,e,t)}))}isApprovedAccount(e,t){return n(this,void 0,void 0,(function*(){return(t=this._provider.encoder.normalizeAddress(t))===(yield O.default(this,e))}))}isTransferable(){return n(this,void 0,void 0,(function*(){return M.default(this)}))}approveAccount(e,t){return n(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),s.default(this,t,e)}))}disapproveAccount(e){return n(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",e)}))}grantAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),c.default(this,e,o.getBitfieldFromAbilities(t))}))}setAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),p.default(this,e,o.getBitfieldFromAbilities(t))}))}createAsset(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.receiverId);return a.default(this,t,e.id,`0x${e.imprint}`)}))}destroyAsset(e){return n(this,void 0,void 0,(function*(){return d.default(this,e)}))}revokeAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),h.default(this,e,o.getBitfieldFromAbilities(t))}))}revokeAsset(e){return n(this,void 0,void 0,(function*(){return l.default(this,e)}))}transferAsset(e){return n(this,void 0,void 0,(function*(){e.senderId||(e.senderId=this.provider.accountId);const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(e.receiverId)?m.default(this,t,r,e.id):f.default(this,t,r,e.id,e.data)}))}enableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(e,t){return n(this,void 0,void 0,(function*(){return y.default(this,e,`0x${t.imprint}`)}))}update(e){return n(this,void 0,void 0,(function*(){return E.default(this,e.uriPrefix,e.uriPostfix)}))}approveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!0)}))}disapproveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!1)}))}isApprovedOperator(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),P.default(this,e,t)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:i.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(6428),t),i(r(365),t),i(r(5378),t)},5378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),m=r(8634),E=r(7045),y=r(5636),g=r(6075),A=r(8608),O=r(1785),I=r(7461),T=r(2746),b=r(3924),w=r(5434),R=r(6651),N=r(8453),P=r(9085),M=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),j=r(1399),G=r(9156),U=r(3022),F=r(9669),K=r(7734),B=r(4909),V=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?N.default(this,e):R.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):U.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),m.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),E.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=V.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case V.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=V.ProxyId.NFTOKEN_TRANSFER);break;case V.ProxyKind.CREATE_ASSET:t=V.ProxyId.XCERT_CREATE;break;case V.ProxyKind.DESTROY_ASSET:t=V.ProxyId.XCERT_BURN;break;case V.ProxyKind.MANAGE_ABILITIES:t=V.ProxyId.MANAGE_ABILITIES;break;case V.ProxyKind.TRANSFER_TOKEN:t=V.ProxyId.TOKEN_TRANSFER;break;case V.ProxyKind.UPDATE_ASSET:t=V.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return b.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),j.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r<e.signers.length;r++)e.signers[r]=t.encoder.normalizeAddress(e.signers[r]);return e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind==s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER?e.actions.forEach((e=>{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started<this._provider.mutationTimeout?this._timer=setTimeout(this.loopUntilCompleted.bind(this),this._speed):this.emit(o.MutationEvent.ERROR,new Error("Mutation has timed out"))}))}getTransactionObject(){return n(this,void 0,void 0,(function*(){return(yield this._provider.post({method:"eth_getTransactionByHash",params:[this.id]})).result}))}getTransactionReceipt(){return n(this,void 0,void 0,(function*(){return(yield this._provider.post({method:"eth_getTransactionReceipt",params:[this.id]})).result}))}getLastBlock(){return n(this,void 0,void 0,(function*(){const e=yield this._provider.post({method:"eth_blockNumber"});return parseInt(e.result)}))}parseLogs(){return n(this,void 0,void 0,(function*(){try{this._logs=[];const e=this._context.getContext();if(!e)return;(yield this.getTransactionReceipt()).logs.forEach((t=>{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t}},7170:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r<e.length;r++)t+=e.charCodeAt(r).toString(16);return t}},9555:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8218:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),d=r(6512),c=r(7061),h=r(3919),l=r(8926),f=r(2328);t.ValueLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),h.default(this,e,t)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),l.default(this,e)}))}getInfo(){return n(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(e,t,r){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t),r=this._provider.encoder.normalizeAddress(r);const n=yield h.default(this,t,r);return o.bigNumberify(n).gte(o.bigNumberify(e))}))}approveValue(e,t){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t);const r=yield this.getApprovedValue(this.provider.accountId,t);if(!o.bigNumberify(e).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,t,e)}))}disapproveValue(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),a.default(this,e,"0")}))}transferValue(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return e.senderId?c.default(this,t,r,e.value):d.default(this,r,e.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8218),t)},646:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1225:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=["string","string","uint8","uint256"];t.default=function(e,{name:t,symbol:r,decimals:a,supply:u}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.valueLedgerSource)).TokenMock.evm.bytecode.object,d={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(s,[t,r,a,u]).substr(2)}`},c=yield e.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e,c.result)}))}},7061:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},6512:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa9059cbb"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3919:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xdd62ed3e"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},8926:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},2328:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],decimals:t[2],supply:t[3]}}))}},5836:function(e,t){"use strict";var r,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Merkle=t.MerkleHasherPosition=void 0,function(e){e[e.VALUE=0]="VALUE",e[e.LEAF=1]="LEAF",e[e.NODE=2]="NODE"}(r=t.MerkleHasherPosition||(t.MerkleHasherPosition={})),t.Merkle=class{constructor(e){this._options=Object.assign({hasher:e=>e,noncer:()=>""},e)}hash(e,t,r){return this._options.hasher(e,t,r)}nonce(e){return this._options.noncer(e)}notarize(e,t=[]){return n(this,void 0,void 0,(function*(){const n=[...e],i=[],o=yield this._options.noncer([...t,n.length]),s=[yield this._options.hasher(o,[...t,n.length],r.NODE)];for(let e=n.length-1;e>=0;e--){const o=s[0];i.unshift(yield this._options.noncer([...t,e]));const a=yield this._options.hasher(n[e],[...t,e],r.VALUE);s.unshift(yield this._options.hasher(`${a}${i[0]}`,[...t,e],r.LEAF));const u=s[0];s.unshift(yield this._options.hasher(`${u}${o}`,[...t,e],r.NODE))}return{values:n.map(((e,t)=>({index:t,value:e,nonce:i[t]}))),nodes:s.map(((e,t)=>({index:t,hash:e})))}}))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=Math.max(...t.map((e=>e+1)),0),n=[],i=[e.nodes.find((e=>e.index===2*r))];for(let o=r-1;o>=0;o--)-1!==t.indexOf(o)?n.unshift(e.values.find((e=>e.index===o))):i.unshift(e.nodes.find((e=>e.index===2*o+1)));return{values:n,nodes:i}}))}imprint(e){return n(this,void 0,void 0,(function*(){const t=[...yield Promise.all(e.values.map(((e,t)=>n(this,void 0,void 0,(function*(){const n=yield this._options.hasher(e.value,[t],r.VALUE);return{index:2*e.index+1,hash:yield this._options.hasher(`${n}${e.nonce}`,[t],r.LEAF),value:e.value}}))))),...e.nodes];for(let e=Math.max(...t.map((e=>e.index+1)),0)-1;e>=0;e-=2){const n=t.find((t=>t.index===e)),i=t.find((t=>t.index===e-1));n&&i&&t.unshift({index:e-2,hash:yield this._options.hasher(`${i.hash}${n.hash}`,[e],r.NODE)})}const i=t.find((e=>0===e.index));return i?i.hash:null}))}}},2461:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5836),t)},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},2895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const n=r(5291);class i extends n.AssetLedger{}t.AssetLedger=i},7745:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(5291);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(2895),t)},2792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const n=r(8344);class i extends n.Gateway{}t.Gateway=i},2086:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyKind=t.AssetLedgerDeployOrder=t.FixedActionsOrder=t.SignedFixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.ActionsOrderActionKind=void 0;var o=r(8344);Object.defineProperty(t,"ActionsOrderActionKind",{enumerable:!0,get:function(){return o.ActionsOrderActionKind}}),Object.defineProperty(t,"DynamicActionsOrder",{enumerable:!0,get:function(){return o.DynamicActionsOrder}}),Object.defineProperty(t,"SignedDynamicActionsOrder",{enumerable:!0,get:function(){return o.SignedDynamicActionsOrder}}),Object.defineProperty(t,"SignedFixedActionsOrder",{enumerable:!0,get:function(){return o.SignedFixedActionsOrder}}),Object.defineProperty(t,"FixedActionsOrder",{enumerable:!0,get:function(){return o.FixedActionsOrder}}),Object.defineProperty(t,"AssetLedgerDeployOrder",{enumerable:!0,get:function(){return o.AssetLedgerDeployOrder}}),Object.defineProperty(t,"ProxyKind",{enumerable:!0,get:function(){return o.ProxyKind}}),i(r(2792),t)},1277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const n=r(5508);class i extends n.ValueLedger{}t.ValueLedger=i},765:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1277),t)},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}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.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(9230),r(7745),r(2086),r(765))})();