edge-currency-accountbased 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/android/src/main/assets/edge-currency-accountbased/1944.chunk.js +4 -0
- package/android/src/main/assets/edge-currency-accountbased/2153.chunk.js +2 -0
- package/android/src/main/assets/edge-currency-accountbased/2821.chunk.js +2 -0
- package/android/src/main/assets/edge-currency-accountbased/2896.chunk.js +35 -0
- package/android/src/main/assets/edge-currency-accountbased/2945.chunk.js +25 -0
- package/android/src/main/assets/edge-currency-accountbased/3491.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/{620.chunk.js → 3620.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/{666.chunk.js → 3666.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/3720.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/{978.chunk.js → 3978.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/4251.chunk.js +4 -0
- package/android/src/main/assets/edge-currency-accountbased/4431.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/4618.chunk.js +20 -0
- package/android/src/main/assets/edge-currency-accountbased/{627.chunk.js → 4627.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/4650.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/{826.chunk.js → 5179.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/{835.chunk.js → 5835.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/5836.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/6266.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/6291.chunk.js +58 -0
- package/android/src/main/assets/edge-currency-accountbased/6341.chunk.js +44 -0
- package/android/src/main/assets/edge-currency-accountbased/7221.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/7428.chunk.js +6 -0
- package/android/src/main/assets/edge-currency-accountbased/{481.chunk.js → 7481.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/7542.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/7786.chunk.js +2 -0
- package/android/src/main/assets/edge-currency-accountbased/8190.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/{689.chunk.js → 8689.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/{726.chunk.js → 8726.chunk.js} +1 -1
- package/android/src/main/assets/edge-currency-accountbased/9068.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-accountbased/{223.chunk.js → 9223.chunk.js} +2 -2
- package/android/src/main/assets/edge-currency-accountbased/9539.chunk.js +10 -0
- package/android/src/main/assets/edge-currency-accountbased/{645.chunk.js → 9645.chunk.js} +6 -6
- package/android/src/main/assets/edge-currency-accountbased/9669.chunk.js +7 -0
- package/android/src/main/assets/edge-currency-accountbased/algorand.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/bnb.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/edge-currency-accountbased.js +2 -18
- package/android/src/main/assets/edge-currency-accountbased/eos.chunk.js +5 -5
- package/android/src/main/assets/edge-currency-accountbased/ethereum.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/filecoin.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/fio.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/hedera.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/polkadot.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/ripple.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/solana.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/stellar.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/tezos.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/tron.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/zcash.chunk.js +2 -2
- package/lib/ethereum/info/avalancheInfo.js +8 -0
- package/lib/ethereum/info/ethereumInfo.js +8 -0
- package/lib/filecoin/FilecoinEngine.js +112 -79
- package/lib/filecoin/Filfox.js +68 -1
- package/lib/filecoin/filecoinInfo.js +8 -3
- package/lib/filecoin/filecoinTypes.js +1 -6
- package/lib/zcash/ZcashEngine.js +11 -9
- package/package.json +1 -1
- package/android/src/main/assets/edge-currency-accountbased/124.chunk.js +0 -35
- package/android/src/main/assets/edge-currency-accountbased/17.chunk.js +0 -58
- package/android/src/main/assets/edge-currency-accountbased/190.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/221.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/298.chunk.js +0 -44
- package/android/src/main/assets/edge-currency-accountbased/431.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/491.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/539.chunk.js +0 -10
- package/android/src/main/assets/edge-currency-accountbased/542.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/618.chunk.js +0 -20
- package/android/src/main/assets/edge-currency-accountbased/650.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/68.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/720.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/786.chunk.js +0 -2
- package/android/src/main/assets/edge-currency-accountbased/836.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/935.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-accountbased/944.chunk.js +0 -4
- package/android/src/main/assets/edge-currency-accountbased/945.chunk.js +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# edge-currency-accountbased
|
|
2
2
|
|
|
3
|
+
## 2.2.5 (2023-09-21)
|
|
4
|
+
|
|
5
|
+
- fixed: Do not crash if BigInt is not present.
|
|
6
|
+
- fixed: Block Filecoin when BigInt is not present.
|
|
7
|
+
|
|
8
|
+
## 2.2.4 (2023-09-08)
|
|
9
|
+
|
|
10
|
+
- fixed: Bug prevent Filecoin spend transactions from being saved in the wallet (by saveTx)
|
|
11
|
+
- fixed: Filecoin network fee query issue
|
|
12
|
+
- changed: Use Filfox exclusively for Filecoin transaction querying
|
|
13
|
+
- fixed: Incorrectly identifying send-to-self transactions as receives from the network
|
|
14
|
+
- added: USDT token to Avalanche
|
|
15
|
+
- added: PYUSD token to Ethereum
|
|
16
|
+
|
|
3
17
|
## 2.2.3 (2023-09-07)
|
|
4
18
|
|
|
5
19
|
- added: Integrate Filfox for Filecoin transaction scanning
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[1944],{75443:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});function v(g){return function(f){var a=g();return a.update(f),r.from(a.digest())}}e.createHashFunction=v},82192:function(K,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=y(75443),v=y(2973);e.keccak224=r.createHashFunction(function(){return v("keccak224")}),e.keccak256=r.createHashFunction(function(){return v("keccak256")}),e.keccak384=r.createHashFunction(function(){return v("keccak384")}),e.keccak512=r.createHashFunction(function(){return v("keccak512")})},2973:function(K,e,y){K.exports=y(71224)(y(66514))},71224:function(K,e,y){const r=y(73867),v=y(48425);K.exports=function(g){const f=r(g),a=v(g);return function(t,l){switch(typeof t=="string"?t.toLowerCase():t){case"keccak224":return new f(1152,448,null,224,l);case"keccak256":return new f(1088,512,null,256,l);case"keccak384":return new f(832,768,null,384,l);case"keccak512":return new f(576,1024,null,512,l);case"sha3-224":return new f(1152,448,6,224,l);case"sha3-256":return new f(1088,512,6,256,l);case"sha3-384":return new f(832,768,6,384,l);case"sha3-512":return new f(576,1024,6,512,l);case"shake128":return new a(1344,256,31,l);case"shake256":return new a(1088,512,31,l);default:throw new Error("Invald algorithm: "+t)}}}},73867:function(K,e,y){var r=y(48764).Buffer;const{Transform:v}=y(88473);K.exports=g=>class cr extends v{constructor(a,t,l,i,u){super(u),this._rate=a,this._capacity=t,this._delimitedSuffix=l,this._hashBitLength=i,this._options=u,this._state=new g,this._state.initialize(a,t),this._finalized=!1}_transform(a,t,l){let i=null;try{this.update(a,t)}catch(u){i=u}l(i)}_flush(a){let t=null;try{this.push(this.digest())}catch(l){t=l}a(t)}update(a,t){if(!r.isBuffer(a)&&typeof a!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return r.isBuffer(a)||(a=r.from(a,t)),this._state.absorb(a),this}digest(a){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return a!==void 0&&(t=t.toString(a)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const a=new cr(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(a._state),a._finalized=this._finalized,a}}},48425:function(K,e,y){var r=y(48764).Buffer;const{Transform:v}=y(88473);K.exports=g=>class lr extends v{constructor(a,t,l,i){super(i),this._rate=a,this._capacity=t,this._delimitedSuffix=l,this._options=i,this._state=new g,this._state.initialize(a,t),this._finalized=!1}_transform(a,t,l){let i=null;try{this.update(a,t)}catch(u){i=u}l(i)}_flush(){}_read(a){this.push(this.squeeze(a))}update(a,t){if(!r.isBuffer(a)&&typeof a!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return r.isBuffer(a)||(a=r.from(a,t)),this._state.absorb(a),this}squeeze(a,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let l=this._state.squeeze(a);return t!==void 0&&(l=l.toString(t)),l}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const a=new lr(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(a._state),a._finalized=this._finalized,a}}},29175:function(K,e){const y=[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];e.p1600=function(r){for(let v=0;v<24;++v){const g=r[0]^r[10]^r[20]^r[30]^r[40],f=r[1]^r[11]^r[21]^r[31]^r[41],a=r[2]^r[12]^r[22]^r[32]^r[42],t=r[3]^r[13]^r[23]^r[33]^r[43],l=r[4]^r[14]^r[24]^r[34]^r[44],i=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],n=r[7]^r[17]^r[27]^r[37]^r[47],o=r[8]^r[18]^r[28]^r[38]^r[48],c=r[9]^r[19]^r[29]^r[39]^r[49];let d=o^(a<<1|t>>>31),x=c^(t<<1|a>>>31);const b=r[0]^d,s=r[1]^x,E=r[10]^d,h=r[11]^x,w=r[20]^d,m=r[21]^x,A=r[30]^d,S=r[31]^x,P=r[40]^d,L=r[41]^x;d=g^(l<<1|i>>>31),x=f^(i<<1|l>>>31);const k=r[2]^d,R=r[3]^x,O=r[12]^d,C=r[13]^x,B=r[22]^d,U=r[23]^x,I=r[32]^d,p=r[33]^x,T=r[42]^d,N=r[43]^x;d=a^(u<<1|n>>>31),x=t^(n<<1|u>>>31);const z=r[4]^d,_=r[5]^x,V=r[14]^d,H=r[15]^x,ze=r[24]^d,_e=r[25]^x,Ve=r[34]^d,He=r[35]^x,Me=r[44]^d,je=r[45]^x;d=l^(o<<1|c>>>31),x=i^(c<<1|o>>>31);const De=r[6]^d,Ze=r[7]^x,We=r[16]^d,Fe=r[17]^x,Ye=r[26]^d,Je=r[27]^x,$e=r[36]^d,Ge=r[37]^x,Xe=r[46]^d,Qe=r[47]^x;d=u^(g<<1|f>>>31),x=n^(f<<1|g>>>31);const qe=r[8]^d,er=r[9]^x,rr=r[18]^d,nr=r[19]^x,tr=r[28]^d,ir=r[29]^x,fr=r[38]^d,ar=r[39]^x,ur=r[48]^d,or=r[49]^x,M=b,j=s,D=h<<4|E>>>28,Z=E<<4|h>>>28,W=w<<3|m>>>29,F=m<<3|w>>>29,Y=S<<9|A>>>23,J=A<<9|S>>>23,$=P<<18|L>>>14,G=L<<18|P>>>14,X=k<<1|R>>>31,Q=R<<1|k>>>31,q=C<<12|O>>>20,ee=O<<12|C>>>20,re=B<<10|U>>>22,ne=U<<10|B>>>22,te=p<<13|I>>>19,ie=I<<13|p>>>19,fe=T<<2|N>>>30,ae=N<<2|T>>>30,ue=_<<30|z>>>2,oe=z<<30|_>>>2,ce=V<<6|H>>>26,le=H<<6|V>>>26,se=_e<<11|ze>>>21,he=ze<<11|_e>>>21,de=Ve<<15|He>>>17,xe=He<<15|Ve>>>17,ve=je<<29|Me>>>3,ye=Me<<29|je>>>3,ge=De<<28|Ze>>>4,we=Ze<<28|De>>>4,me=Fe<<23|We>>>9,be=We<<23|Fe>>>9,Ee=Ye<<25|Je>>>7,Ae=Je<<25|Ye>>>7,Se=$e<<21|Ge>>>11,Ke=Ge<<21|$e>>>11,Pe=Qe<<24|Xe>>>8,ke=Xe<<24|Qe>>>8,Be=qe<<27|er>>>5,Ce=er<<27|qe>>>5,Le=rr<<20|nr>>>12,pe=nr<<20|rr>>>12,Ue=ir<<7|tr>>>25,Re=tr<<7|ir>>>25,Te=fr<<8|ar>>>24,Ie=ar<<8|fr>>>24,Ne=ur<<14|or>>>18,Oe=or<<14|ur>>>18;r[0]=M^~q&se,r[1]=j^~ee&he,r[10]=ge^~Le&W,r[11]=we^~pe&F,r[20]=X^~ce&Ee,r[21]=Q^~le&Ae,r[30]=Be^~D&re,r[31]=Ce^~Z&ne,r[40]=ue^~me&Ue,r[41]=oe^~be&Re,r[2]=q^~se&Se,r[3]=ee^~he&Ke,r[12]=Le^~W&te,r[13]=pe^~F&ie,r[22]=ce^~Ee&Te,r[23]=le^~Ae&Ie,r[32]=D^~re&de,r[33]=Z^~ne&xe,r[42]=me^~Ue&Y,r[43]=be^~Re&J,r[4]=se^~Se&Ne,r[5]=he^~Ke&Oe,r[14]=W^~te&ve,r[15]=F^~ie&ye,r[24]=Ee^~Te&$,r[25]=Ae^~Ie&G,r[34]=re^~de&Pe,r[35]=ne^~xe&ke,r[44]=Ue^~Y&fe,r[45]=Re^~J&ae,r[6]=Se^~Ne&M,r[7]=Ke^~Oe&j,r[16]=te^~ve&ge,r[17]=ie^~ye&we,r[26]=Te^~$&X,r[27]=Ie^~G&Q,r[36]=de^~Pe&Be,r[37]=xe^~ke&Ce,r[46]=Y^~fe&ue,r[47]=J^~ae&oe,r[8]=Ne^~M&q,r[9]=Oe^~j&ee,r[18]=ve^~ge&Le,r[19]=ye^~we&pe,r[28]=$^~X&ce,r[29]=G^~Q&le,r[38]=Pe^~Be&D,r[39]=ke^~Ce&Z,r[48]=fe^~ue&me,r[49]=ae^~oe&be,r[0]^=y[v*2],r[1]^=y[v*2+1]}}},66514:function(K,e,y){var r=y(48764).Buffer;const v=y(29175);function g(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}g.prototype.initialize=function(f,a){for(let t=0;t<50;++t)this.state[t]=0;this.blockSize=f/8,this.count=0,this.squeezing=!1},g.prototype.absorb=function(f){for(let a=0;a<f.length;++a)this.state[~~(this.count/4)]^=f[a]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(v.p1600(this.state),this.count=0)},g.prototype.absorbLastFewBits=function(f){this.state[~~(this.count/4)]^=f<<8*(this.count%4),(f&128)!==0&&this.count===this.blockSize-1&&v.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),v.p1600(this.state),this.count=0,this.squeezing=!0},g.prototype.squeeze=function(f){this.squeezing||this.absorbLastFewBits(1);const a=r.alloc(f);for(let t=0;t<f;++t)a[t]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(v.p1600(this.state),this.count=0);return a},g.prototype.copy=function(f){for(let a=0;a<50;++a)f.state[a]=this.state[a];f.blockSize=this.blockSize,f.count=this.count,f.squeezing=this.squeezing},K.exports=g},53242:function(K,e,y){K.exports=y(39203)(y(25166))},25166:function(K,e,y){const r=y(86266).ec,v=new r("secp256k1"),g=v.curve,f=g.n.constructor;function a(u,n){let o=new f(n);if(o.cmp(g.p)>=0)return null;o=o.toRed(g.red);let c=o.redSqr().redIMul(o).redIAdd(g.b).redSqrt();return u===3!==c.isOdd()&&(c=c.redNeg()),v.keyPair({pub:{x:o,y:c}})}function t(u,n,o){let c=new f(n),d=new f(o);if(c.cmp(g.p)>=0||d.cmp(g.p)>=0||(c=c.toRed(g.red),d=d.toRed(g.red),(u===6||u===7)&&d.isOdd()!==(u===7)))return null;const x=c.redSqr().redIMul(c);return d.redSqr().redISub(x.redIAdd(g.b)).isZero()?v.keyPair({pub:{x:c,y:d}}):null}function l(u){const n=u[0];switch(n){case 2:case 3:return u.length!==33?null:a(n,u.subarray(1,33));case 4:case 6:case 7:return u.length!==65?null:t(n,u.subarray(1,33),u.subarray(33,65));default:return null}}function i(u,n){const o=n.encode(null,u.length===33);for(let c=0;c<u.length;++c)u[c]=o[c]}K.exports={contextRandomize(){return 0},privateKeyVerify(u){const n=new f(u);return n.cmp(g.n)<0&&!n.isZero()?0:1},privateKeyNegate(u){const n=new f(u),o=g.n.sub(n).umod(g.n).toArrayLike(Uint8Array,"be",32);return u.set(o),0},privateKeyTweakAdd(u,n){const o=new f(n);if(o.cmp(g.n)>=0||(o.iadd(new f(u)),o.cmp(g.n)>=0&&o.isub(g.n),o.isZero()))return 1;const c=o.toArrayLike(Uint8Array,"be",32);return u.set(c),0},privateKeyTweakMul(u,n){let o=new f(n);if(o.cmp(g.n)>=0||o.isZero())return 1;o.imul(new f(u)),o.cmp(g.n)>=0&&(o=o.umod(g.n));const c=o.toArrayLike(Uint8Array,"be",32);return u.set(c),0},publicKeyVerify(u){return l(u)===null?1:0},publicKeyCreate(u,n){const o=new f(n);if(o.cmp(g.n)>=0||o.isZero())return 1;const c=v.keyFromPrivate(n).getPublic();return i(u,c),0},publicKeyConvert(u,n){const o=l(n);if(o===null)return 1;const c=o.getPublic();return i(u,c),0},publicKeyNegate(u,n){const o=l(n);if(o===null)return 1;const c=o.getPublic();return c.y=c.y.redNeg(),i(u,c),0},publicKeyCombine(u,n){const o=new Array(n.length);for(let d=0;d<n.length;++d)if(o[d]=l(n[d]),o[d]===null)return 1;let c=o[0].getPublic();for(let d=1;d<o.length;++d)c=c.add(o[d].pub);return c.isInfinity()?2:(i(u,c),0)},publicKeyTweakAdd(u,n,o){const c=l(n);if(c===null)return 1;if(o=new f(o),o.cmp(g.n)>=0)return 2;const d=c.getPublic().add(g.g.mul(o));return d.isInfinity()?2:(i(u,d),0)},publicKeyTweakMul(u,n,o){const c=l(n);if(c===null)return 1;if(o=new f(o),o.cmp(g.n)>=0||o.isZero())return 2;const d=c.getPublic().mul(o);return i(u,d),0},signatureNormalize(u){const n=new f(u.subarray(0,32)),o=new f(u.subarray(32,64));return n.cmp(g.n)>=0||o.cmp(g.n)>=0?1:(o.cmp(v.nh)===1&&u.set(g.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(u,n){const o=n.subarray(0,32),c=n.subarray(32,64);if(new f(o).cmp(g.n)>=0||new f(c).cmp(g.n)>=0)return 1;const{output:d}=u;let x=d.subarray(4,4+33);x[0]=0,x.set(o,1);let b=33,s=0;for(;b>1&&x[s]===0&&!(x[s+1]&128);--b,++s);if(x=x.subarray(s),x[0]&128||b>1&&x[0]===0&&!(x[1]&128))return 1;let E=d.subarray(6+33,6+33+33);E[0]=0,E.set(c,1);let h=33,w=0;for(;h>1&&E[w]===0&&!(E[w+1]&128);--h,++w);return E=E.subarray(w),E[0]&128||h>1&&E[0]===0&&!(E[1]&128)?1:(u.outputlen=6+b+h,d[0]=48,d[1]=u.outputlen-2,d[2]=2,d[3]=x.length,d.set(x,4),d[4+b]=2,d[5+b]=E.length,d.set(E,6+b),0)},signatureImport(u,n){if(n.length<8||n.length>72||n[0]!==48||n[1]!==n.length-2||n[2]!==2)return 1;const o=n[3];if(o===0||5+o>=n.length||n[4+o]!==2)return 1;const c=n[5+o];if(c===0||6+o+c!==n.length||n[4]&128||o>1&&n[4]===0&&!(n[5]&128)||n[o+6]&128||c>1&&n[o+6]===0&&!(n[o+7]&128))return 1;let d=n.subarray(4,4+o);if(d.length===33&&d[0]===0&&(d=d.subarray(1)),d.length>32)return 1;let x=n.subarray(6+o);if(x.length===33&&x[0]===0&&(x=x.slice(1)),x.length>32)throw new Error("S length is too long");let b=new f(d);b.cmp(g.n)>=0&&(b=new f(0));let s=new f(n.subarray(6+o));return s.cmp(g.n)>=0&&(s=new f(0)),u.set(b.toArrayLike(Uint8Array,"be",32),0),u.set(s.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(u,n,o,c,d){if(d){const s=d;d=E=>{const h=s(n,o,null,c,E);if(!(h instanceof Uint8Array&&h.length===32))throw new Error("This is the way");return new f(h)}}const x=new f(o);if(x.cmp(g.n)>=0||x.isZero())return 1;let b;try{b=v.sign(n,o,{canonical:!0,k:d,pers:c})}catch{return 1}return u.signature.set(b.r.toArrayLike(Uint8Array,"be",32),0),u.signature.set(b.s.toArrayLike(Uint8Array,"be",32),32),u.recid=b.recoveryParam,0},ecdsaVerify(u,n,o){const c={r:u.subarray(0,32),s:u.subarray(32,64)},d=new f(c.r),x=new f(c.s);if(d.cmp(g.n)>=0||x.cmp(g.n)>=0)return 1;if(x.cmp(v.nh)===1||d.isZero()||x.isZero())return 3;const b=l(o);if(b===null)return 2;const s=b.getPublic();return v.verify(n,c,s)?0:3},ecdsaRecover(u,n,o,c){const d={r:n.slice(0,32),s:n.slice(32,64)},x=new f(d.r),b=new f(d.s);if(x.cmp(g.n)>=0||b.cmp(g.n)>=0)return 1;if(x.isZero()||b.isZero())return 2;let s;try{s=v.recoverPubKey(c,d,o)}catch{return 2}return i(u,s),0},ecdh(u,n,o,c,d,x,b){const s=l(n);if(s===null)return 1;const E=new f(o);if(E.cmp(g.n)>=0||E.isZero())return 2;const h=s.getPublic().mul(E);if(d===void 0){const w=h.encode(null,!0),m=v.hash().update(w).digest();for(let A=0;A<32;++A)u[A]=m[A]}else{x||(x=new Uint8Array(32));const w=h.getX().toArray("be",32);for(let P=0;P<32;++P)x[P]=w[P];b||(b=new Uint8Array(32));const m=h.getY().toArray("be",32);for(let P=0;P<32;++P)b[P]=m[P];const A=d(x,b,c);if(!(A instanceof Uint8Array&&A.length===u.length))return 2;u.set(A)}return 0}}},39203:function(K){const e={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function y(a,t){if(!a)throw new Error(t)}function r(a,t,l){if(y(t instanceof Uint8Array,`Expected ${a} to be an Uint8Array`),l!==void 0)if(Array.isArray(l)){const i=l.join(", "),u=`Expected ${a} to be an Uint8Array with length [${i}]`;y(l.includes(t.length),u)}else{const i=`Expected ${a} to be an Uint8Array with length ${l}`;y(t.length===l,i)}}function v(a){y(f(a)==="Boolean","Expected compressed to be a Boolean")}function g(a=l=>new Uint8Array(l),t){return typeof a=="function"&&(a=a(t)),r("output",a,t),a}function f(a){return Object.prototype.toString.call(a).slice(8,-1)}K.exports=a=>({contextRandomize(t){switch(y(t===null||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),t!==null&&r("seed",t,32),a.contextRandomize(t)){case 1:throw new Error(e.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(t){return r("private key",t,32),a.privateKeyVerify(t)===0},privateKeyNegate(t){switch(r("private key",t,32),a.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(t,l){switch(r("private key",t,32),r("tweak",l,32),a.privateKeyTweakAdd(t,l)){case 0:return t;case 1:throw new Error(e.TWEAK_ADD)}},privateKeyTweakMul(t,l){switch(r("private key",t,32),r("tweak",l,32),a.privateKeyTweakMul(t,l)){case 0:return t;case 1:throw new Error(e.TWEAK_MUL)}},publicKeyVerify(t){return r("public key",t,[33,65]),a.publicKeyVerify(t)===0},publicKeyCreate(t,l=!0,i){switch(r("private key",t,32),v(l),i=g(i,l?33:65),a.publicKeyCreate(i,t)){case 0:return i;case 1:throw new Error(e.SECKEY_INVALID);case 2:throw new Error(e.PUBKEY_SERIALIZE)}},publicKeyConvert(t,l=!0,i){switch(r("public key",t,[33,65]),v(l),i=g(i,l?33:65),a.publicKeyConvert(i,t)){case 0:return i;case 1:throw new Error(e.PUBKEY_PARSE);case 2:throw new Error(e.PUBKEY_SERIALIZE)}},publicKeyNegate(t,l=!0,i){switch(r("public key",t,[33,65]),v(l),i=g(i,l?33:65),a.publicKeyNegate(i,t)){case 0:return i;case 1:throw new Error(e.PUBKEY_PARSE);case 2:throw new Error(e.IMPOSSIBLE_CASE);case 3:throw new Error(e.PUBKEY_SERIALIZE)}},publicKeyCombine(t,l=!0,i){y(Array.isArray(t),"Expected public keys to be an Array"),y(t.length>0,"Expected public keys array will have more than zero items");for(const u of t)r("public key",u,[33,65]);switch(v(l),i=g(i,l?33:65),a.publicKeyCombine(i,t)){case 0:return i;case 1:throw new Error(e.PUBKEY_PARSE);case 2:throw new Error(e.PUBKEY_COMBINE);case 3:throw new Error(e.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(t,l,i=!0,u){switch(r("public key",t,[33,65]),r("tweak",l,32),v(i),u=g(u,i?33:65),a.publicKeyTweakAdd(u,t,l)){case 0:return u;case 1:throw new Error(e.PUBKEY_PARSE);case 2:throw new Error(e.TWEAK_ADD)}},publicKeyTweakMul(t,l,i=!0,u){switch(r("public key",t,[33,65]),r("tweak",l,32),v(i),u=g(u,i?33:65),a.publicKeyTweakMul(u,t,l)){case 0:return u;case 1:throw new Error(e.PUBKEY_PARSE);case 2:throw new Error(e.TWEAK_MUL)}},signatureNormalize(t){switch(r("signature",t,64),a.signatureNormalize(t)){case 0:return t;case 1:throw new Error(e.SIG_PARSE)}},signatureExport(t,l){r("signature",t,64),l=g(l,72);const i={output:l,outputlen:72};switch(a.signatureExport(i,t)){case 0:return l.slice(0,i.outputlen);case 1:throw new Error(e.SIG_PARSE);case 2:throw new Error(e.IMPOSSIBLE_CASE)}},signatureImport(t,l){switch(r("signature",t),l=g(l,64),a.signatureImport(l,t)){case 0:return l;case 1:throw new Error(e.SIG_PARSE);case 2:throw new Error(e.IMPOSSIBLE_CASE)}},ecdsaSign(t,l,i={},u){r("message",t,32),r("private key",l,32),y(f(i)==="Object","Expected options to be an Object"),i.data!==void 0&&r("options.data",i.data),i.noncefn!==void 0&&y(f(i.noncefn)==="Function","Expected options.noncefn to be a Function"),u=g(u,64);const n={signature:u,recid:null};switch(a.ecdsaSign(n,t,l,i.data,i.noncefn)){case 0:return n;case 1:throw new Error(e.SIGN);case 2:throw new Error(e.IMPOSSIBLE_CASE)}},ecdsaVerify(t,l,i){switch(r("signature",t,64),r("message",l,32),r("public key",i,[33,65]),a.ecdsaVerify(t,l,i)){case 0:return!0;case 3:return!1;case 1:throw new Error(e.SIG_PARSE);case 2:throw new Error(e.PUBKEY_PARSE)}},ecdsaRecover(t,l,i,u=!0,n){switch(r("signature",t,64),y(f(l)==="Number"&&l>=0&&l<=3,"Expected recovery id to be a Number within interval [0, 3]"),r("message",i,32),v(u),n=g(n,u?33:65),a.ecdsaRecover(n,t,l,i)){case 0:return n;case 1:throw new Error(e.SIG_PARSE);case 2:throw new Error(e.RECOVER);case 3:throw new Error(e.IMPOSSIBLE_CASE)}},ecdh(t,l,i={},u){switch(r("public key",t,[33,65]),r("private key",l,32),y(f(i)==="Object","Expected options to be an Object"),i.data!==void 0&&r("options.data",i.data),i.hashfn!==void 0?(y(f(i.hashfn)==="Function","Expected options.hashfn to be a Function"),i.xbuf!==void 0&&r("options.xbuf",i.xbuf,32),i.ybuf!==void 0&&r("options.ybuf",i.ybuf,32),r("output",u)):u=g(u,32),a.ecdh(u,t,l,i.data,i.hashfn,i.xbuf,i.ybuf)){case 0:return u;case 1:throw new Error(e.PUBKEY_PARSE);case 2:throw new Error(e.ECDH)}}})},50949:function(K,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=y(26167);e.HDKey=r},80682:function(K,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=y(12949).ripemd160,v=y(75443);e.ripemd160=v.createHashFunction(function(){return new r})},74237:function(K,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=y(89344),v=y(75443);e.sha256=v.createHashFunction(function(){return new r})},22326:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var v=y(80682),g=y(74237);e.createHmac=y(58355),e.randomBytes=y(61798);var f=function(){function a(t){this.hashFunction=t,this.buffers=[]}return a.prototype.update=function(t){if(!r.isBuffer(t))throw new Error("hdkey-crypto shim is outdated");return this.buffers.push(t),this},a.prototype.digest=function(t){if(t)throw new Error("hdkey-crypto shim is outdated");return this.hashFunction(r.concat(this.buffers))},a}();e.createHash=function(a){if(a==="ripemd160")return new f(v.ripemd160);if(a==="sha256")return new f(g.sha256);throw new Error("hdkey-crypto shim is outdated")}},44863:function(K,e,y){"use strict";function r(v){for(var g in v)e.hasOwnProperty(g)||(e[g]=v[g])}Object.defineProperty(e,"__esModule",{value:!0}),r(y(86454))},26167:function(K,e,y){"use strict";function r(s){return s&&typeof s=="object"&&"default"in s?s.default:s}var v=r(y(69282)),g=r(y(89509)),f=r(y(58334)),a=y(22326),t=y(44863),l=g.Buffer,i=l.from("Bitcoin seed","utf8"),u=2147483648,n=78,o={private:76066276,public:76067358};function c(s){this.versions=s||o,this.depth=0,this.index=0,this._privateKey=null,this._publicKey=null,this.chainCode=null,this._fingerprint=0,this.parentFingerprint=0}Object.defineProperty(c.prototype,"fingerprint",{get:function(){return this._fingerprint}}),Object.defineProperty(c.prototype,"identifier",{get:function(){return this._identifier}}),Object.defineProperty(c.prototype,"pubKeyHash",{get:function(){return this.identifier}}),Object.defineProperty(c.prototype,"privateKey",{get:function(){return this._privateKey},set:function(s){v.equal(s.length,32,"Private key must be 32 bytes."),v(t.privateKeyVerify(s)===!0,"Invalid private key"),this._privateKey=s,this._publicKey=t.publicKeyCreate(s,!0),this._identifier=x(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0)}}),Object.defineProperty(c.prototype,"publicKey",{get:function(){return this._publicKey},set:function(s){v(s.length===33||s.length===65,"Public key must be 33 or 65 bytes."),v(t.publicKeyVerify(s)===!0,"Invalid public key"),this._publicKey=t.publicKeyConvert(s,!0),this._identifier=x(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0),this._privateKey=null}}),Object.defineProperty(c.prototype,"privateExtendedKey",{get:function(){return this._privateKey?f.encode(d(this,this.versions.private,l.concat([l.alloc(1,0),this.privateKey]))):null}}),Object.defineProperty(c.prototype,"publicExtendedKey",{get:function(){return f.encode(d(this,this.versions.public,this.publicKey))}}),c.prototype.derive=function(s){if(s==="m"||s==="M"||s==="m'"||s==="M'")return this;var E=s.split("/"),h=this;return E.forEach(function(w,m){if(m===0){v(/^[mM]{1}/.test(w),'Path must start with "m" or "M"');return}var A=w.length>1&&w[w.length-1]==="'",S=parseInt(w,10);v(S<u,"Invalid index"),A&&(S+=u),h=h.deriveChild(S)}),h},c.prototype.deriveChild=function(s){var E=s>=u,h=l.allocUnsafe(4);h.writeUInt32BE(s,0);var w;if(E){v(this.privateKey,"Could not derive hardened child key");var m=this.privateKey,A=l.alloc(1,0);m=l.concat([A,m]),w=l.concat([m,h])}else w=l.concat([this.publicKey,h]);var S=a.createHmac("sha512",this.chainCode).update(w).digest(),P=S.slice(0,32),L=S.slice(32),k=new c(this.versions);if(this.privateKey)try{k.privateKey=t.privateKeyTweakAdd(this.privateKey,P)}catch{return this.deriveChild(s+1)}else try{k.publicKey=t.publicKeyTweakAdd(this.publicKey,P,!0)}catch{return this.deriveChild(s+1)}return k.chainCode=L,k.depth=this.depth+1,k.parentFingerprint=this.fingerprint,k.index=s,k},c.prototype.sign=function(s){return t.sign(s,this.privateKey).signature},c.prototype.verify=function(s,E){return t.verify(s,E,this.publicKey)},c.prototype.wipePrivateData=function(){return this._privateKey&&a.randomBytes(this._privateKey.length).copy(this._privateKey),this._privateKey=null,this},c.prototype.toJSON=function(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}},c.fromMasterSeed=function(s,E){var h=a.createHmac("sha512",i).update(s).digest(),w=h.slice(0,32),m=h.slice(32),A=new c(E);return A.chainCode=m,A.privateKey=w,A},c.fromExtendedKey=function(s,E){E=E||o;var h=new c(E),w=f.decode(s),m=w.readUInt32BE(0);v(m===E.private||m===E.public,"Version mismatch: does not match private or public"),h.depth=w.readUInt8(4),h.parentFingerprint=w.readUInt32BE(5),h.index=w.readUInt32BE(9),h.chainCode=w.slice(13,45);var A=w.slice(45);return A.readUInt8(0)===0?(v(m===E.private,"Version mismatch: version does not match private"),h.privateKey=A.slice(1)):(v(m===E.public,"Version mismatch: version does not match public"),h.publicKey=A),h},c.fromJSON=function(s){return c.fromExtendedKey(s.xpriv)};function d(s,E,h){var w=l.allocUnsafe(n);w.writeUInt32BE(E,0),w.writeUInt8(s.depth,4);var m=s.depth?s.parentFingerprint:0;return w.writeUInt32BE(m,5),w.writeUInt32BE(s.index,9),s.chainCode.copy(w,13),h.copy(w,45),w}function x(s){var E=a.createHash("sha256").update(s).digest();return a.createHash("ripemd160").update(E).digest()}c.HARDENED_OFFSET=u;var b=c;K.exports=b},90472:function(K,e,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=y(61798);function v(f){return new Promise(function(a,t){r(f,function(l,i){if(l){t(l);return}a(i)})})}e.getRandomBytes=v;function g(f){return r(f)}e.getRandomBytesSync=g},95053:function(K,e,y){"use strict";var r=this&&this.__awaiter||function(u,n,o,c){function d(x){return x instanceof o?x:new o(function(b){b(x)})}return new(o||(o=Promise))(function(x,b){function s(w){try{h(c.next(w))}catch(m){b(m)}}function E(w){try{h(c.throw(w))}catch(m){b(m)}}function h(w){w.done?x(w.value):d(w.value).then(s,E)}h((c=c.apply(u,n||[])).next())})},v=this&&this.__generator||function(u,n){var o={label:0,sent:function(){if(x[0]&1)throw x[1];return x[1]},trys:[],ops:[]},c,d,x,b;return b={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function s(h){return function(w){return E([h,w])}}function E(h){if(c)throw new TypeError("Generator is already executing.");for(;o;)try{if(c=1,d&&(x=h[0]&2?d.return:h[0]?d.throw||((x=d.return)&&x.call(d),0):d.next)&&!(x=x.call(d,h[1])).done)return x;switch(d=0,x&&(h=[h[0]&2,x.value]),h[0]){case 0:case 1:x=h;break;case 4:return o.label++,{value:h[1],done:!1};case 5:o.label++,d=h[1],h=[0];continue;case 7:h=o.ops.pop(),o.trys.pop();continue;default:if(x=o.trys,!(x=x.length>0&&x[x.length-1])&&(h[0]===6||h[0]===2)){o=0;continue}if(h[0]===3&&(!x||h[1]>x[0]&&h[1]<x[3])){o.label=h[1];break}if(h[0]===6&&o.label<x[1]){o.label=x[1],x=h;break}if(x&&o.label<x[2]){o.label=x[2],o.ops.push(h);break}x[2]&&o.ops.pop(),o.trys.pop();continue}h=n.call(u,o)}catch(w){h=[6,w],d=0}finally{c=x=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}};function g(u){for(var n in u)e.hasOwnProperty(n)||(e[n]=u[n])}Object.defineProperty(e,"__esModule",{value:!0});var f=y(53242),a=y(90472),t=32;function l(){return r(this,void 0,void 0,function(){var u;return v(this,function(n){switch(n.label){case 0:return[4,a.getRandomBytes(t)];case 1:return u=n.sent(),f.privateKeyVerify(u)?[2,u]:[3,0];case 2:return[2]}})})}e.createPrivateKey=l;function i(){for(;;){var u=a.getRandomBytesSync(t);if(f.privateKeyVerify(u))return u}}e.createPrivateKeySync=i,g(y(53242))},86454:function(K,e,y){"use strict";var r=y(48764).Buffer,v=this&&this.__importStar||function(c){if(c&&c.__esModule)return c;var d={};if(c!=null)for(var x in c)Object.hasOwnProperty.call(c,x)&&(d[x]=c[x]);return d.default=c,d};Object.defineProperty(e,"__esModule",{value:!0});var g=v(y(53242));function f(c){return g.privateKeyVerify(c)}e.privateKeyVerify=f;function a(c,d){return d===void 0&&(d=!0),r.from(g.publicKeyCreate(c,d))}e.publicKeyCreate=a;function t(c){return g.publicKeyVerify(c)}e.publicKeyVerify=t;function l(c,d){return d===void 0&&(d=!0),r.from(g.publicKeyConvert(c,d))}e.publicKeyConvert=l;function i(c,d){return r.from(g.privateKeyTweakAdd(r.from(c),d))}e.privateKeyTweakAdd=i;function u(c,d,x){return x===void 0&&(x=!0),r.from(g.publicKeyTweakAdd(r.from(c),d,x))}e.publicKeyTweakAdd=u;function n(c,d){var x=g.ecdsaSign(c,d);return{signature:r.from(x.signature),recovery:x.recid}}e.sign=n;function o(c,d,x){return g.ecdsaVerify(d,c,x)}e.verify=o},68142:function(K,e,y){K.exports=y(75437)},75437:function(K,e,y){var r=y(48764).Buffer;const v=y(86589),g=y(13550);var f=function(){};function a(h){return h.startsWith("int[")?"int256"+h.slice(3):h==="int"?"int256":h.startsWith("uint[")?"uint256"+h.slice(4):h==="uint"?"uint256":h.startsWith("fixed[")?"fixed128x128"+h.slice(5):h==="fixed"?"fixed128x128":h.startsWith("ufixed[")?"ufixed128x128"+h.slice(6):h==="ufixed"?"ufixed128x128":h}f.eventID=function(h,w){var m=h+"("+w.map(a).join(",")+")";return v.keccak256(r.from(m))},f.methodID=function(h,w){return f.eventID(h,w).slice(0,4)};function t(h){return parseInt(/^\D+(\d+)$/.exec(h)[1],10)}function l(h){var w=/^\D+(\d+)x(\d+)$/.exec(h);return[parseInt(w[1],10),parseInt(w[2],10)]}function i(h){var w=h.match(/(.*)\[(.*?)\]$/);return w?w[2]===""?"dynamic":parseInt(w[2],10):null}function u(h){var w=typeof h;if(w==="string")return v.isHexPrefixed(h)?new g(v.stripHexPrefix(h),16):new g(h,10);if(w==="number")return new g(h);if(h.toArray)return h;throw new Error("Argument is not a number")}function n(h){var w=/^(\w+)\((.*)\)$/.exec(h);if(w.length!==3)throw new Error("Invalid method signature");var m=/^(.+)\):\((.+)$/.exec(w[2]);if(m!==null&&m.length===3)return{method:w[1],args:m[1].split(","),retargs:m[2].split(",")};var A=w[2].split(",");return A.length===1&&A[0]===""&&(A=[]),{method:w[1],args:A}}function o(h,w){var m,A,S,P;if(h==="address")return o("uint160",u(w));if(h==="bool")return o("uint8",w?1:0);if(h==="string")return o("bytes",r.from(w,"utf8"));if(b(h)){if(typeof w.length>"u")throw new Error("Not an array?");if(m=i(h),m!=="dynamic"&&m!==0&&w.length>m)throw new Error("Elements exceed array size: "+m);S=[],h=h.slice(0,h.lastIndexOf("[")),typeof w=="string"&&(w=JSON.parse(w));for(P in w)S.push(o(h,w[P]));if(m==="dynamic"){var L=o("uint256",w.length);S.unshift(L)}return r.concat(S)}else{if(h==="bytes")return w=r.from(w),S=r.concat([o("uint256",w.length),w]),w.length%32!==0&&(S=r.concat([S,v.zeros(32-w.length%32)])),S;if(h.startsWith("bytes")){if(m=t(h),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);return v.setLengthRight(w,32)}else if(h.startsWith("uint")){if(m=t(h),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(A=u(w),A.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+A.bitLength());if(A<0)throw new Error("Supplied uint is negative");return A.toArrayLike(r,"be",32)}else if(h.startsWith("int")){if(m=t(h),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(A=u(w),A.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+A.bitLength());return A.toTwos(256).toArrayLike(r,"be",32)}else if(h.startsWith("ufixed")){if(m=l(h),A=u(w),A<0)throw new Error("Supplied ufixed is negative");return o("uint256",A.mul(new g(2).pow(new g(m[1]))))}else if(h.startsWith("fixed"))return m=l(h),o("int256",u(w).mul(new g(2).pow(new g(m[1]))))}throw new Error("Unsupported or invalid type: "+h)}function c(h,w,m){typeof h=="string"&&(h=d(h));var A,S,P,L;if(h.name==="address")return c(h.rawType,w,m).toArrayLike(r,"be",20).toString("hex");if(h.name==="bool")return c(h.rawType,w,m).toString()===new g(1).toString();if(h.name==="string"){var k=c(h.rawType,w,m);return r.from(k,"utf8").toString()}else if(h.isArray){for(P=[],A=h.size,h.size==="dynamic"&&(m=c("uint256",w,m).toNumber(),A=c("uint256",w,m).toNumber(),m=m+32),L=0;L<A;L++){var R=c(h.subArray,w,m);P.push(R),m+=h.subArray.memoryUsage}return P}else{if(h.name==="bytes")return m=c("uint256",w,m).toNumber(),A=c("uint256",w,m).toNumber(),w.slice(m+32,m+32+A);if(h.name.startsWith("bytes"))return w.slice(m,m+h.size);if(h.name.startsWith("uint")){if(S=new g(w.slice(m,m+32),16,"be"),S.bitLength()>h.size)throw new Error("Decoded int exceeds width: "+h.size+" vs "+S.bitLength());return S}else if(h.name.startsWith("int")){if(S=new g(w.slice(m,m+32),16,"be").fromTwos(256),S.bitLength()>h.size)throw new Error("Decoded uint exceeds width: "+h.size+" vs "+S.bitLength());return S}else if(h.name.startsWith("ufixed")){if(A=new g(2).pow(new g(h.size[1])),S=c("uint256",w,m),!S.mod(A).isZero())throw new Error("Decimals not supported yet");return S.div(A)}else if(h.name.startsWith("fixed")){if(A=new g(2).pow(new g(h.size[1])),S=c("int256",w,m),!S.mod(A).isZero())throw new Error("Decimals not supported yet");return S.div(A)}}throw new Error("Unsupported or invalid type: "+h.name)}function d(h){var w,m;if(b(h)){w=i(h);var A=h.slice(0,h.lastIndexOf("["));return A=d(A),m={isArray:!0,name:h,size:w,memoryUsage:w==="dynamic"?32:A.memoryUsage*w,subArray:A},m}else{var S;switch(h){case"address":S="uint160";break;case"bool":S="uint8";break;case"string":S="bytes";break}if(m={rawType:S,name:h,memoryUsage:32},h.startsWith("bytes")&&h!=="bytes"||h.startsWith("uint")||h.startsWith("int")?m.size=t(h):(h.startsWith("ufixed")||h.startsWith("fixed"))&&(m.size=l(h)),h.startsWith("bytes")&&h!=="bytes"&&(m.size<1||m.size>32))throw new Error("Invalid bytes<N> width: "+m.size);if((h.startsWith("uint")||h.startsWith("int"))&&(m.size%8||m.size<8||m.size>256))throw new Error("Invalid int/uint<N> width: "+m.size);return m}}function x(h){return h==="string"||h==="bytes"||i(h)==="dynamic"}function b(h){return h.lastIndexOf("]")===h.length-1}f.rawEncode=function(h,w){var m=[],A=[],S=0;h.forEach(function(O){if(b(O)){var C=i(O);C!=="dynamic"?S+=32*C:S+=32}else S+=32});for(var P=0;P<h.length;P++){var L=a(h[P]),k=w[P],R=o(L,k);x(L)?(m.push(o("uint256",S)),A.push(R),S+=R.length):m.push(R)}return r.concat(m.concat(A))},f.rawDecode=function(h,w){var m=[];w=r.from(w);for(var A=0,S=0;S<h.length;S++){var P=a(h[S]),L=d(P,w,A),k=c(L,w,A);A+=L.memoryUsage,m.push(k)}return m},f.simpleEncode=function(h){var w=Array.prototype.slice.call(arguments).slice(1),m=n(h);if(w.length!==m.args.length)throw new Error("Argument count mismatch");return r.concat([f.methodID(m.method,m.args),f.rawEncode(m.args,w)])},f.simpleDecode=function(h,w){var m=n(h);if(!m.retargs)throw new Error("No return values in method");return f.rawDecode(m.retargs,w)};function s(h,w){return h.startsWith("address")||h.startsWith("bytes")?"0x"+w.toString("hex"):w.toString()}f.stringify=function(h,w){var m=[];for(var A in h){var S=h[A],P=w[A];/^[^\[]+\[.*\]$/.test(S)?P=P.map(function(L){return s(S,L)}).join(", "):P=s(S,P),m.push(P)}return m},f.solidityHexValue=function(h,w,m){var A,S;if(b(h)){var P=h.replace(/\[.*?\]/,"");if(!b(P)){var L=i(h);if(L!=="dynamic"&&L!==0&&w.length>L)throw new Error("Elements exceed array size: "+L)}var k=w.map(function(C){return f.solidityHexValue(P,C,256)});return r.concat(k)}else{if(h==="bytes")return w;if(h==="string")return r.from(w,"utf8");if(h==="bool"){m=m||8;var R=Array(m/4).join("0");return r.from(w?R+"1":R+"0","hex")}else if(h==="address"){var O=20;return m&&(O=m/8),v.setLengthLeft(w,O)}else if(h.startsWith("bytes")){if(A=t(h),A<1||A>32)throw new Error("Invalid bytes<N> width: "+A);return v.setLengthRight(w,A)}else if(h.startsWith("uint")){if(A=t(h),A%8||A<8||A>256)throw new Error("Invalid uint<N> width: "+A);if(S=u(w),S.bitLength()>A)throw new Error("Supplied uint exceeds width: "+A+" vs "+S.bitLength());return m=m||A,S.toArrayLike(r,"be",m/8)}else if(h.startsWith("int")){if(A=t(h),A%8||A<8||A>256)throw new Error("Invalid int<N> width: "+A);if(S=u(w),S.bitLength()>A)throw new Error("Supplied int exceeds width: "+A+" vs "+S.bitLength());return m=m||A,S.toTwos(A).toArrayLike(r,"be",m/8)}else throw new Error("Unsupported or invalid type: "+h)}},f.solidityPack=function(h,w){if(h.length!==w.length)throw new Error("Number of types are not matching the values");for(var m=[],A=0;A<h.length;A++){var S=a(h[A]),P=w[A];m.push(f.solidityHexValue(S,P,null))}return r.concat(m)},f.soliditySHA3=function(h,w){return v.keccak256(f.solidityPack(h,w))},f.soliditySHA256=function(h,w){return v.sha256(f.solidityPack(h,w))},f.solidityRIPEMD160=function(h,w){return v.ripemd160(f.solidityPack(h,w),!0)};function E(h){return h>="0"&&h<="9"}f.fromSerpent=function(h){for(var w=[],m=0;m<h.length;m++){var A=h[m];if(A==="s")w.push("bytes");else if(A==="b"){for(var S="bytes",P=m+1;P<h.length&&E(h[P]);)S+=h[P]-"0",P++;m=P-1,w.push(S)}else if(A==="i")w.push("int256");else if(A==="a")w.push("int256[]");else throw new Error("Unsupported or invalid type: "+A)}return w},f.toSerpent=function(h){for(var w=[],m=0;m<h.length;m++){var A=h[m];if(A==="bytes")w.push("s");else if(A.startsWith("bytes"))w.push("b"+t(A));else if(A==="int256")w.push("i");else if(A==="int256[]")w.push("a");else throw new Error("Unsupported or invalid type: "+A)}return w.join("")},K.exports=f},30248:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.importPublic=e.privateToPublic=e.privateToAddress=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.isPrecompiled=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isZeroAddress=e.isValidAddress=e.zeroAddress=void 0;var v=y(69282),g=y(80884),f=y(83230),a=y(13550),t=y(77124),l=y(91550);e.zeroAddress=function(){var i=20,u=t.zeros(i);return t.bufferToHex(u)},e.isValidAddress=function(i){return/^0x[0-9a-fA-F]{40}$/.test(i)},e.isZeroAddress=function(i){var u=e.zeroAddress();return u===t.addHexPrefix(i)},e.toChecksumAddress=function(i,u){i=g.stripHexPrefix(i).toLowerCase();for(var n=u!==void 0?u.toString()+"0x":"",o=l.keccak(n+i).toString("hex"),c="0x",d=0;d<i.length;d++)parseInt(o[d],16)>=8?c+=i[d].toUpperCase():c+=i[d];return c},e.isValidChecksumAddress=function(i,u){return e.isValidAddress(i)&&e.toChecksumAddress(i,u)===i},e.generateAddress=function(i,u){i=t.toBuffer(i);var n=new a(u);return n.isZero()?l.rlphash([i,null]).slice(-20):l.rlphash([i,r.from(n.toArray())]).slice(-20)},e.generateAddress2=function(i,u,n){var o=t.toBuffer(i),c=t.toBuffer(u),d=t.toBuffer(n);v(o.length===20),v(c.length===32);var x=l.keccak256(r.concat([r.from("ff","hex"),o,c,l.keccak256(d)]));return x.slice(-20)},e.isPrecompiled=function(i){var u=t.unpad(i);return u.length===1&&u[0]>=1&&u[0]<=8},e.isValidPrivate=function(i){return f.privateKeyVerify(i)},e.isValidPublic=function(i,u){return u===void 0&&(u=!1),i.length===64?f.publicKeyVerify(r.concat([r.from([4]),i])):u?f.publicKeyVerify(i):!1},e.pubToAddress=function(i,u){return u===void 0&&(u=!1),i=t.toBuffer(i),u&&i.length!==64&&(i=f.publicKeyConvert(i,!1).slice(1)),v(i.length===64),l.keccak(i).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToAddress=function(i){return e.publicToAddress(e.privateToPublic(i))},e.privateToPublic=function(i){return i=t.toBuffer(i),f.publicKeyCreate(i,!1).slice(1)},e.importPublic=function(i){return i=t.toBuffer(i),i.length!==64&&(i=f.publicKeyConvert(i,!1).slice(1)),i}},77124:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.stripZeros=e.unpad=e.setLengthRight=e.setLength=e.setLengthLeft=e.zeros=void 0;var v=y(80884),g=y(13550);e.zeros=function(f){return r.allocUnsafe(f).fill(0)},e.setLengthLeft=function(f,a,t){t===void 0&&(t=!1);var l=e.zeros(a);return f=e.toBuffer(f),t?f.length<a?(f.copy(l),l):f.slice(0,a):f.length<a?(f.copy(l,a-f.length),l):f.slice(-a)},e.setLength=e.setLengthLeft,e.setLengthRight=function(f,a){return e.setLength(f,a,!0)},e.unpad=function(f){f=v.stripHexPrefix(f);for(var a=f[0];f.length>0&&a.toString()==="0";)f=f.slice(1),a=f[0];return f},e.stripZeros=e.unpad,e.toBuffer=function(f){if(!r.isBuffer(f))if(Array.isArray(f))f=r.from(f);else if(typeof f=="string")if(v.isHexString(f))f=r.from(v.padToEven(v.stripHexPrefix(f)),"hex");else throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+f);else if(typeof f=="number")f=v.intToBuffer(f);else if(f==null)f=r.allocUnsafe(0);else if(g.isBN(f))f=f.toArrayLike(r);else if(f.toArray)f=r.from(f.toArray());else throw new Error("invalid type");return f},e.bufferToInt=function(f){return new g(e.toBuffer(f)).toNumber()},e.bufferToHex=function(f){return f=e.toBuffer(f),"0x"+f.toString("hex")},e.fromSigned=function(f){return new g(f).fromTwos(256)},e.toUnsigned=function(f){return r.from(f.toTwos(256).toArray())},e.addHexPrefix=function(f){return typeof f!="string"||v.isHexPrefixed(f)?f:"0x"+f},e.baToJSON=function(f){if(r.isBuffer(f))return"0x"+f.toString("hex");if(f instanceof Array){for(var a=[],t=0;t<f.length;t++)a.push(e.baToJSON(f[t]));return a}}},46649:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;var v=y(13550);e.MAX_INTEGER=new v("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new v("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=r.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=r.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=r.from(e.KECCAK256_RLP_S,"hex")},91550:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160=e.sha256=e.keccak256=e.keccak=void 0;var v=y(82192),g=v.keccak224,f=v.keccak384,a=v.keccak256,t=v.keccak512,l=y(23482),i=y(80884),u=y(51675),n=y(77124);e.keccak=function(o,c){switch(c===void 0&&(c=256),typeof o=="string"&&!i.isHexString(o)?o=r.from(o,"utf8"):o=n.toBuffer(o),c||(c=256),c){case 224:return g(o);case 256:return a(o);case 384:return f(o);case 512:return t(o);default:throw new Error("Invald algorithm: keccak"+c)}},e.keccak256=function(o){return e.keccak(o)},e.sha256=function(o){return o=n.toBuffer(o),l("sha256").update(o).digest()},e.ripemd160=function(o,c){o=n.toBuffer(o);var d=l("rmd160").update(o).digest();return c===!0?n.setLength(d,32):d},e.rlphash=function(o){return e.keccak(u.encode(o))}},86589:function(K,e,y){"use strict";var r=this&&this.__createBinding||(Object.create?function(l,i,u,n){n===void 0&&(n=u),Object.defineProperty(l,n,{enumerable:!0,get:function(){return i[u]}})}:function(l,i,u,n){n===void 0&&(n=u),l[n]=i[u]}),v=this&&this.__exportStar||function(l,i){for(var u in l)u!=="default"&&!i.hasOwnProperty(u)&&r(i,l,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=e.rlp=e.BN=void 0;var g=y(83230);e.secp256k1=g;var f=y(80884),a=y(13550);e.BN=a;var t=y(51675);e.rlp=t,Object.assign(e,f),v(y(46649),e),v(y(30248),e),v(y(91550),e),v(y(86232),e),v(y(77124),e),v(y(81113),e)},81113:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;var v=y(69282),g=y(80884),f=y(51675),a=y(77124);e.defineProperties=function(t,l,i){if(t.raw=[],t._fields=[],t.toJSON=function(n){if(n===void 0&&(n=!1),n){var o={};return t._fields.forEach(function(c){o[c]="0x"+t[c].toString("hex")}),o}return a.baToJSON(t.raw)},t.serialize=function(){return f.encode(t.raw)},l.forEach(function(n,o){t._fields.push(n.name);function c(){return t.raw[o]}function d(x){x=a.toBuffer(x),x.toString("hex")==="00"&&!n.allowZero&&(x=r.allocUnsafe(0)),n.allowLess&&n.length?(x=a.stripZeros(x),v(n.length>=x.length,"The field "+n.name+" must not have more "+n.length+" bytes")):!(n.allowZero&&x.length===0)&&n.length&&v(n.length===x.length,"The field "+n.name+" must have byte length of "+n.length),t.raw[o]=x}Object.defineProperty(t,n.name,{enumerable:!0,configurable:!0,get:c,set:d}),n.default&&(t[n.name]=n.default),n.alias&&Object.defineProperty(t,n.alias,{enumerable:!1,configurable:!0,set:d,get:c})}),i)if(typeof i=="string"&&(i=r.from(g.stripHexPrefix(i),"hex")),r.isBuffer(i)&&(i=f.decode(i)),Array.isArray(i)){if(i.length>t._fields.length)throw new Error("wrong number of fields in data");i.forEach(function(n,o){t[t._fields[o]]=a.toBuffer(n)})}else if(typeof i=="object"){var u=Object.keys(i);l.forEach(function(n){u.indexOf(n.name)!==-1&&(t[n.name]=i[n.name]),u.indexOf(n.alias)!==-1&&(t[n.alias]=i[n.alias])})}else throw new Error("invalid data")}},83230:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.ecdhUnsafe=e.ecdh=e.recover=e.verify=e.sign=e.signatureImportLax=e.signatureImport=e.signatureExport=e.signatureNormalize=e.publicKeyCombine=e.publicKeyTweakMul=e.publicKeyTweakAdd=e.publicKeyVerify=e.publicKeyConvert=e.publicKeyCreate=e.privateKeyTweakMul=e.privateKeyTweakAdd=e.privateKeyModInverse=e.privateKeyNegate=e.privateKeyImport=e.privateKeyExport=e.privateKeyVerify=void 0;var v=y(95053),g=y(78427),f=y(33646);e.privateKeyVerify=function(a){return a.length!==32?!1:v.privateKeyVerify(Uint8Array.from(a))},e.privateKeyExport=function(a,t){if(a.length!==32)throw new RangeError("private key length is invalid");var l=g.privateKeyExport(a,t);return f.privateKeyExport(a,l,t)},e.privateKeyImport=function(a){if(a=f.privateKeyImport(a),a!==null&&a.length===32&&e.privateKeyVerify(a))return a;throw new Error("couldn't import from DER format")},e.privateKeyNegate=function(a){return r.from(v.privateKeyNegate(Uint8Array.from(a)))},e.privateKeyModInverse=function(a){if(a.length!==32)throw new Error("private key length is invalid");return r.from(g.privateKeyModInverse(Uint8Array.from(a)))},e.privateKeyTweakAdd=function(a,t){return r.from(v.privateKeyTweakAdd(Uint8Array.from(a),t))},e.privateKeyTweakMul=function(a,t){return r.from(v.privateKeyTweakMul(Uint8Array.from(a),Uint8Array.from(t)))},e.publicKeyCreate=function(a,t){return r.from(v.publicKeyCreate(Uint8Array.from(a),t))},e.publicKeyConvert=function(a,t){return r.from(v.publicKeyConvert(Uint8Array.from(a),t))},e.publicKeyVerify=function(a){return a.length!==33&&a.length!==65?!1:v.publicKeyVerify(Uint8Array.from(a))},e.publicKeyTweakAdd=function(a,t,l){return r.from(v.publicKeyTweakAdd(Uint8Array.from(a),Uint8Array.from(t),l))},e.publicKeyTweakMul=function(a,t,l){return r.from(v.publicKeyTweakMul(Uint8Array.from(a),Uint8Array.from(t),l))},e.publicKeyCombine=function(a,t){var l=[];return a.forEach(function(i){l.push(Uint8Array.from(i))}),r.from(v.publicKeyCombine(l,t))},e.signatureNormalize=function(a){return r.from(v.signatureNormalize(Uint8Array.from(a)))},e.signatureExport=function(a){return r.from(v.signatureExport(Uint8Array.from(a)))},e.signatureImport=function(a){return r.from(v.signatureImport(Uint8Array.from(a)))},e.signatureImportLax=function(a){if(a.length===0)throw new RangeError("signature length is invalid");var t=f.signatureImportLax(a);if(t===null)throw new Error("couldn't parse DER signature");return g.signatureImport(t)},e.sign=function(a,t,l){if(l===null)throw new TypeError("options should be an Object");var i=void 0;if(l){if(i={},l.data===null)throw new TypeError("options.data should be a Buffer");if(l.data){if(l.data.length!=32)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(l.data)}if(l.noncefn===null)throw new TypeError("options.noncefn should be a Function");l.noncefn&&(i.noncefn=function(n,o,c,d,x){var b=c!=null?r.from(c):null,s=d!=null?r.from(d):null,E=r.from("");return l.noncefn&&(E=l.noncefn(r.from(n),r.from(o),b,s,x)),new Uint8Array(E)})}var u=v.ecdsaSign(Uint8Array.from(a),Uint8Array.from(t),i);return{signature:r.from(u.signature),recovery:u.recid}},e.verify=function(a,t,l){return v.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(a),l)},e.recover=function(a,t,l,i){return r.from(v.ecdsaRecover(Uint8Array.from(t),l,Uint8Array.from(a),i))},e.ecdh=function(a,t){return r.from(v.ecdh(Uint8Array.from(a),Uint8Array.from(t),{}))},e.ecdhUnsafe=function(a,t,l){if(a.length!==33&&a.length!==65)throw new RangeError("public key length is invalid");if(t.length!==32)throw new RangeError("private key length is invalid");return r.from(g.ecdhUnsafe(Uint8Array.from(a),Uint8Array.from(t),l))}},33646:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var v=r.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),g=r.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e.privateKeyExport=function(f,a,t){t===void 0&&(t=!0);var l=r.from(t?v:g);return f.copy(l,t?8:9),a.copy(l,t?181:214),l},e.privateKeyImport=function(f){var a=f.length,t=0;if(a<t+1||f[t]!==48||(t+=1,a<t+1||!(f[t]&128)))return null;var l=f[t]&127;if(t+=1,l<1||l>2||a<t+l)return null;var i=f[t+l-1]|(l>1?f[t+l-2]<<8:0);return t+=l,a<t+i||a<t+3||f[t]!==2||f[t+1]!==1||f[t+2]!==1||(t+=3,a<t+2||f[t]!==4||f[t+1]>32||a<t+2+f[t+1])?null:f.slice(t+2,t+2+f[t+1])},e.signatureImportLax=function(f){var a=r.alloc(32,0),t=r.alloc(32,0),l=f.length,i=0;if(f[i++]!==48)return null;var u=f[i++];if(u&128&&(i+=u-128,i>l)||f[i++]!==2)return null;var n=f[i++];if(n&128){if(u=n-128,i+u>l)return null;for(;u>0&&f[i]===0;i+=1,u-=1);for(n=0;u>0;i+=1,u-=1)n=(n<<8)+f[i]}if(n>l-i)return null;var o=i;if(i+=n,f[i++]!==2)return null;var c=f[i++];if(c&128){if(u=c-128,i+u>l)return null;for(;u>0&&f[i]===0;i+=1,u-=1);for(c=0;u>0;i+=1,u-=1)c=(c<<8)+f[i]}if(c>l-i)return null;var d=i;for(i+=c;n>0&&f[o]===0;n-=1,o+=1);if(n>32)return null;var x=f.slice(o,o+n);for(x.copy(a,32-x.length);c>0&&f[d]===0;c-=1,d+=1);if(c>32)return null;var b=f.slice(d,d+c);return b.copy(t,32-b.length),{r:a,s:t}}},78427:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var v=y(13550),g=y(86266).ec,f=new g("secp256k1"),a=f.curve;e.privateKeyExport=function(l,i){i===void 0&&(i=!0);var u=new v(l);if(u.ucmp(a.n)>=0)throw new Error("couldn't export to DER format");var n=f.g.mul(u);return t(n.getX(),n.getY(),i)},e.privateKeyModInverse=function(l){var i=new v(l);if(i.ucmp(a.n)>=0||i.isZero())throw new Error("private key range is invalid");return i.invm(a.n).toArrayLike(r,"be",32)},e.signatureImport=function(l){var i=new v(l.r);i.ucmp(a.n)>=0&&(i=new v(0));var u=new v(l.s);return u.ucmp(a.n)>=0&&(u=new v(0)),r.concat([i.toArrayLike(r,"be",32),u.toArrayLike(r,"be",32)])},e.ecdhUnsafe=function(l,i,u){u===void 0&&(u=!0);var n=f.keyFromPublic(l),o=new v(i);if(o.ucmp(a.n)>=0||o.isZero())throw new Error("scalar was invalid (zero or overflow)");var c=n.pub.mul(o);return t(c.getX(),c.getY(),u)};var t=function(l,i,u){var n;return u?(n=r.alloc(33),n[0]=i.isOdd()?3:2,l.toArrayLike(r,"be",32).copy(n,1)):(n=r.alloc(65),n[0]=4,l.toArrayLike(r,"be",32).copy(n,1),i.toArrayLike(r,"be",32).copy(n,33)),n}},86232:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var v=y(83230),g=y(13550),f=y(77124),a=y(91550);e.ecsign=function(i,u,n){var o=v.sign(i,u),c=o.recovery,d={r:o.signature.slice(0,32),s:o.signature.slice(32,64),v:n?c+(n*2+35):c+27};return d},e.ecrecover=function(i,u,n,o,c){var d=r.concat([f.setLength(n,32),f.setLength(o,32)],64),x=t(u,c);if(!l(x))throw new Error("Invalid signature v value");var b=v.recover(i,d,x);return v.publicKeyConvert(b,!1).slice(1)},e.toRpcSig=function(i,u,n,o){var c=t(i,o);if(!l(c))throw new Error("Invalid signature v value");return f.bufferToHex(r.concat([f.setLengthLeft(u,32),f.setLengthLeft(n,32),f.toBuffer(i)]))},e.fromRpcSig=function(i){var u=f.toBuffer(i);if(u.length!==65)throw new Error("Invalid signature length");var n=u[64];return n<27&&(n+=27),{v:n,r:u.slice(0,32),s:u.slice(32,64)}},e.isValidSignature=function(i,u,n,o,c){o===void 0&&(o=!0);var d=new g("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),x=new g("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(u.length!==32||n.length!==32||!l(t(i,c)))return!1;var b=new g(u),s=new g(n);return!(b.isZero()||b.gt(x)||s.isZero()||s.gt(x)||o&&s.cmp(d)===1)},e.hashPersonalMessage=function(i){var u=r.from(`Ethereum Signed Message:
|
|
2
|
+
`+i.length.toString(),"utf-8");return a.keccak(r.concat([u,i]))};function t(i,u){return u?i-(2*u+35):i-27}function l(i){return i===0||i===1}},21964:function(K,e,y){"use strict";var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},v=y(95811),g=y(17221),f=y(69282),a=y(51675),t=y(13550),l=y(23482),i=y(89509).Buffer;Object.assign(e,y(80884)),e.MAX_INTEGER=new t("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new t("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.SHA3_NULL_S=e.KECCAK256_NULL_S,e.KECCAK256_NULL=i.from(e.KECCAK256_NULL_S,"hex"),e.SHA3_NULL=e.KECCAK256_NULL,e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.SHA3_RLP_ARRAY_S=e.KECCAK256_RLP_ARRAY_S,e.KECCAK256_RLP_ARRAY=i.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.SHA3_RLP_ARRAY=e.KECCAK256_RLP_ARRAY,e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.SHA3_RLP_S=e.KECCAK256_RLP_S,e.KECCAK256_RLP=i.from(e.KECCAK256_RLP_S,"hex"),e.SHA3_RLP=e.KECCAK256_RLP,e.BN=t,e.rlp=a,e.secp256k1=g,e.zeros=function(n){return i.allocUnsafe(n).fill(0)},e.zeroAddress=function(){var n=20,o=e.zeros(n);return e.bufferToHex(o)},e.setLengthLeft=e.setLength=function(n,o,c){var d=e.zeros(o);return n=e.toBuffer(n),c?n.length<o?(n.copy(d),d):n.slice(0,o):n.length<o?(n.copy(d,o-n.length),d):n.slice(-o)},e.setLengthRight=function(n,o){return e.setLength(n,o,!0)},e.unpad=e.stripZeros=function(n){n=e.stripHexPrefix(n);for(var o=n[0];n.length>0&&o.toString()==="0";)n=n.slice(1),o=n[0];return n},e.toBuffer=function(n){if(!i.isBuffer(n))if(Array.isArray(n))n=i.from(n);else if(typeof n=="string")e.isHexString(n)?n=i.from(e.padToEven(e.stripHexPrefix(n)),"hex"):n=i.from(n);else if(typeof n=="number")n=e.intToBuffer(n);else if(n==null)n=i.allocUnsafe(0);else if(t.isBN(n))n=n.toArrayLike(i);else if(n.toArray)n=i.from(n.toArray());else throw new Error("invalid type");return n},e.bufferToInt=function(n){return new t(e.toBuffer(n)).toNumber()},e.bufferToHex=function(n){return n=e.toBuffer(n),"0x"+n.toString("hex")},e.fromSigned=function(n){return new t(n).fromTwos(256)},e.toUnsigned=function(n){return i.from(n.toTwos(256).toArray())},e.keccak=function(n,o){return n=e.toBuffer(n),o||(o=256),v("keccak"+o).update(n).digest()},e.keccak256=function(n){return e.keccak(n)},e.sha3=e.keccak,e.sha256=function(n){return n=e.toBuffer(n),l("sha256").update(n).digest()},e.ripemd160=function(n,o){n=e.toBuffer(n);var c=l("rmd160").update(n).digest();return o===!0?e.setLength(c,32):c},e.rlphash=function(n){return e.keccak(a.encode(n))},e.isValidPrivate=function(n){return g.privateKeyVerify(n)},e.isValidPublic=function(n,o){return n.length===64?g.publicKeyVerify(i.concat([i.from([4]),n])):o?g.publicKeyVerify(n):!1},e.pubToAddress=e.publicToAddress=function(n,o){return n=e.toBuffer(n),o&&n.length!==64&&(n=g.publicKeyConvert(n,!1).slice(1)),f(n.length===64),e.keccak(n).slice(-20)};var u=e.privateToPublic=function(n){return n=e.toBuffer(n),g.publicKeyCreate(n,!1).slice(1)};e.importPublic=function(n){return n=e.toBuffer(n),n.length!==64&&(n=g.publicKeyConvert(n,!1).slice(1)),n},e.ecsign=function(n,o){var c=g.sign(n,o),d={};return d.r=c.signature.slice(0,32),d.s=c.signature.slice(32,64),d.v=c.recovery+27,d},e.hashPersonalMessage=function(n){var o=e.toBuffer(`Ethereum Signed Message:
|
|
3
|
+
`+n.length.toString());return e.keccak(i.concat([o,n]))},e.ecrecover=function(n,o,c,d){var x=i.concat([e.setLength(c,32),e.setLength(d,32)],64),b=o-27;if(b!==0&&b!==1)throw new Error("Invalid signature v value");var s=g.recover(n,x,b);return g.publicKeyConvert(s,!1).slice(1)},e.toRpcSig=function(n,o,c){if(n!==27&&n!==28)throw new Error("Invalid recovery id");return e.bufferToHex(i.concat([e.setLengthLeft(o,32),e.setLengthLeft(c,32),e.toBuffer(n-27)]))},e.fromRpcSig=function(n){if(n=e.toBuffer(n),n.length!==65)throw new Error("Invalid signature length");var o=n[64];return o<27&&(o+=27),{v:o,r:n.slice(0,32),s:n.slice(32,64)}},e.privateToAddress=function(n){return e.publicToAddress(u(n))},e.isValidAddress=function(n){return/^0x[0-9a-fA-F]{40}$/.test(n)},e.isZeroAddress=function(n){var o=e.zeroAddress();return o===e.addHexPrefix(n)},e.toChecksumAddress=function(n){n=e.stripHexPrefix(n).toLowerCase();for(var o=e.keccak(n).toString("hex"),c="0x",d=0;d<n.length;d++)parseInt(o[d],16)>=8?c+=n[d].toUpperCase():c+=n[d];return c},e.isValidChecksumAddress=function(n){return e.isValidAddress(n)&&e.toChecksumAddress(n)===n},e.generateAddress=function(n,o){return n=e.toBuffer(n),o=new t(o),o.isZero()?o=null:o=i.from(o.toArray()),e.rlphash([n,o]).slice(-20)},e.isPrecompiled=function(n){var o=e.unpad(n);return o.length===1&&o[0]>=1&&o[0]<=8},e.addHexPrefix=function(n){return typeof n!="string"||e.isHexPrefixed(n)?n:"0x"+n},e.isValidSignature=function(n,o,c,d){var x=new t("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),b=new t("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return!(o.length!==32||c.length!==32||n!==27&&n!==28||(o=new t(o),c=new t(c),o.isZero()||o.gt(b)||c.isZero()||c.gt(b))||d===!1&&new t(c).cmp(x)===1)},e.baToJSON=function(n){if(i.isBuffer(n))return"0x"+n.toString("hex");if(n instanceof Array){for(var o=[],c=0;c<n.length;c++)o.push(e.baToJSON(n[c]));return o}},e.defineProperties=function(n,o,c){if(n.raw=[],n._fields=[],n.toJSON=function(x){if(x){var b={};return n._fields.forEach(function(s){b[s]="0x"+n[s].toString("hex")}),b}return e.baToJSON(this.raw)},n.serialize=function(){return a.encode(n.raw)},o.forEach(function(x,b){n._fields.push(x.name);function s(){return n.raw[b]}function E(h){h=e.toBuffer(h),h.toString("hex")==="00"&&!x.allowZero&&(h=i.allocUnsafe(0)),x.allowLess&&x.length?(h=e.stripZeros(h),f(x.length>=h.length,"The field "+x.name+" must not have more "+x.length+" bytes")):!(x.allowZero&&h.length===0)&&x.length&&f(x.length===h.length,"The field "+x.name+" must have byte length of "+x.length),n.raw[b]=h}Object.defineProperty(n,x.name,{enumerable:!0,configurable:!0,get:s,set:E}),x.default&&(n[x.name]=x.default),x.alias&&Object.defineProperty(n,x.alias,{enumerable:!1,configurable:!0,set:E,get:s})}),c)if(typeof c=="string"&&(c=i.from(e.stripHexPrefix(c),"hex")),i.isBuffer(c)&&(c=a.decode(c)),Array.isArray(c)){if(c.length>n._fields.length)throw new Error("wrong number of fields in data");c.forEach(function(x,b){n[n._fields[b]]=e.toBuffer(x)})}else if((typeof c>"u"?"undefined":r(c))==="object"){var d=Object.keys(c);o.forEach(function(x){d.indexOf(x.name)!==-1&&(n[x.name]=c[x.name]),d.indexOf(x.alias)!==-1&&(n[x.alias]=c[x.alias])})}else throw new Error("invalid data")}},48367:function(K,e,y){"use strict";var r=y(50949),v=r.HDKey,g=y(37217);function f(){}function a(t){var l=new f;return l._hdkey=t,l}f.fromMasterSeed=function(t){return a(v.fromMasterSeed(t))},f.fromExtendedKey=function(t){return a(v.fromExtendedKey(t))},f.prototype.privateExtendedKey=function(){if(!this._hdkey.privateExtendedKey)throw new Error("This is a public key only wallet");return this._hdkey.privateExtendedKey},f.prototype.publicExtendedKey=function(){return this._hdkey.publicExtendedKey},f.prototype.derivePath=function(t){return a(this._hdkey.derive(t))},f.prototype.deriveChild=function(t){return a(this._hdkey.deriveChild(t))},f.prototype.getWallet=function(){return this._hdkey._privateKey?g.fromPrivateKey(this._hdkey._privateKey):g.fromPublicKey(this._hdkey._publicKey,!0)},K.exports=f},37217:function(K,e,y){"use strict";var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},v=y(89509).Buffer,g=y(79692),f=y(55835),a=y(61798),t=y(9084),l=y(71171),i=y(58334);function u(c,d){if(!c)throw new Error(d||"Assertion failed")}function n(c,d){return v.concat([c.update(d),c.final()])}var o=function(d,x){if(d&&x)throw new Error("Cannot supply both a private and a public key to the constructor");if(d&&!g.isValidPrivate(d))throw new Error("Private key does not satisfy the curve requirements (ie. it is invalid)");if(x&&!g.isValidPublic(x))throw new Error("Invalid public key");this._privKey=d,this._pubKey=x};Object.defineProperty(o.prototype,"privKey",{get:function(){return u(this._privKey,"This is a public key only wallet"),this._privKey}}),Object.defineProperty(o.prototype,"pubKey",{get:function(){return this._pubKey||(this._pubKey=g.privateToPublic(this.privKey)),this._pubKey}}),o.generate=function(c){if(c)for(var d=new g.BN("088f924eeceeda7fe92e1f5b0fffffffffffffff",16);;){var x=a(32);if(new g.BN(g.privateToAddress(x)).lte(d))return new o(x)}else return new o(a(32))},o.generateVanityAddress=function(c){for((typeof c>"u"?"undefined":r(c))!=="object"&&(c=new RegExp(c));;){var d=a(32),x=g.privateToAddress(d);if(c.test(x.toString("hex")))return new o(d)}},o.prototype.getPrivateKey=function(){return this.privKey},o.prototype.getPrivateKeyString=function(){return g.bufferToHex(this.getPrivateKey())},o.prototype.getPublicKey=function(){return this.pubKey},o.prototype.getPublicKeyString=function(){return g.bufferToHex(this.getPublicKey())},o.prototype.getAddress=function(){return g.publicToAddress(this.pubKey)},o.prototype.getAddressString=function(){return g.bufferToHex(this.getAddress())},o.prototype.getChecksumAddressString=function(){return g.toChecksumAddress(this.getAddressString())},o.prototype.toV3=function(c,d){u(this._privKey,"This is a public key only wallet"),d=d||{};var x=d.salt||a(32),b=d.iv||a(16),s,E=d.kdf||"scrypt",h={dklen:d.dklen||32,salt:x.toString("hex")};if(E==="pbkdf2")h.c=d.c||262144,h.prf="hmac-sha256",s=f.pbkdf2Sync(v.from(c),x,h.c,h.dklen,"sha256");else if(E==="scrypt")h.n=d.n||262144,h.r=d.r||8,h.p=d.p||1,s=t(v.from(c),x,h.n,h.r,h.p,h.dklen);else throw new Error("Unsupported kdf");var w=f.createCipheriv(d.cipher||"aes-128-ctr",s.slice(0,16),b);if(!w)throw new Error("Unsupported cipher");var m=n(w,this.privKey),A=g.keccak256(v.concat([s.slice(16,32),v.from(m,"hex")]));return{version:3,id:l({random:d.uuid||a(16)}),address:this.getAddress().toString("hex"),crypto:{ciphertext:m.toString("hex"),cipherparams:{iv:b.toString("hex")},cipher:d.cipher||"aes-128-ctr",kdf:E,kdfparams:h,mac:A.toString("hex")}}},o.prototype.getV3Filename=function(c){var d=c?new Date(c):new Date;return["UTC--",d.toJSON().replace(/:/g,"-"),"--",this.getAddress().toString("hex")].join("")},o.prototype.toV3String=function(c,d){return JSON.stringify(this.toV3(c,d))},o.fromPublicKey=function(c,d){return d&&(c=g.importPublic(c)),new o(null,c)},o.fromExtendedPublicKey=function(c){return u(c.slice(0,4)==="xpub","Not an extended public key"),c=i.decode(c).slice(45),o.fromPublicKey(c,!0)},o.fromPrivateKey=function(c){return new o(c)},o.fromExtendedPrivateKey=function(c){u(c.slice(0,4)==="xprv","Not an extended private key");var d=i.decode(c);return u(d[45]===0,"Invalid extended private key"),o.fromPrivateKey(d.slice(46))},o.fromV1=function(c,d){u(typeof d=="string");var x=(typeof c>"u"?"undefined":r(c))==="object"?c:JSON.parse(c);if(x.Version!=="1")throw new Error("Not a V1 wallet");if(x.Crypto.KeyHeader.Kdf!=="scrypt")throw new Error("Unsupported key derivation scheme");var b=x.Crypto.KeyHeader.KdfParams,s=t(v.from(d),v.from(x.Crypto.Salt,"hex"),b.N,b.R,b.P,b.DkLen),E=v.from(x.Crypto.CipherText,"hex"),h=g.keccak256(v.concat([s.slice(16,32),E]));if(h.toString("hex")!==x.Crypto.MAC)throw new Error("Key derivation failed - possibly wrong passphrase");var w=f.createDecipheriv("aes-128-cbc",g.keccak256(s.slice(0,16)).slice(0,16),v.from(x.Crypto.IV,"hex")),m=n(w,E);return new o(m)},o.fromV3=function(c,d,x){u(typeof d=="string");var b=(typeof c>"u"?"undefined":r(c))==="object"?c:JSON.parse(x?c.toLowerCase():c);if(b.version!==3)throw new Error("Not a V3 wallet");var s,E;if(b.crypto.kdf==="scrypt")E=b.crypto.kdfparams,s=t(v.from(d),v.from(E.salt,"hex"),E.n,E.r,E.p,E.dklen);else if(b.crypto.kdf==="pbkdf2"){if(E=b.crypto.kdfparams,E.prf!=="hmac-sha256")throw new Error("Unsupported parameters to PBKDF2");s=f.pbkdf2Sync(v.from(d),v.from(E.salt,"hex"),E.c,E.dklen,"sha256")}else throw new Error("Unsupported key derivation scheme");var h=v.from(b.crypto.ciphertext,"hex"),w=g.keccak256(v.concat([s.slice(16,32),h]));if(w.toString("hex")!==b.crypto.mac)throw new Error("Key derivation failed - possibly wrong passphrase");var m=f.createDecipheriv(b.crypto.cipher,s.slice(0,16),v.from(b.crypto.cipherparams.iv,"hex")),A=n(m,h);return new o(A)},o.fromEthSale=function(c,d){u(typeof d=="string");var x=(typeof c>"u"?"undefined":r(c))==="object"?c:JSON.parse(c),b=v.from(x.encseed,"hex"),s=f.pbkdf2Sync(d,d,2e3,32,"sha256").slice(0,16),E=f.createDecipheriv("aes-128-cbc",s,b.slice(0,16)),h=n(E,b.slice(16)),w=new o(g.keccak256(h));if(w.getAddress().toString("hex")!==x.ethaddr)throw new Error("Decoded key mismatch - possibly wrong passphrase");return w},K.exports=o},69637:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.importPublic=e.privateToPublic=e.privateToAddress=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.isPrecompiled=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isZeroAddress=e.isValidAddress=e.zeroAddress=void 0;var v=y(69282),g=y(80884),f=y(50208),a=y(13550),t=y(74820),l=y(20106);e.zeroAddress=function(){var i=20,u=t.zeros(i);return t.bufferToHex(u)},e.isValidAddress=function(i){return/^0x[0-9a-fA-F]{40}$/.test(i)},e.isZeroAddress=function(i){var u=e.zeroAddress();return u===t.addHexPrefix(i)},e.toChecksumAddress=function(i,u){i=g.stripHexPrefix(i).toLowerCase();for(var n=u!==void 0?u.toString()+"0x":"",o=l.keccak(n+i).toString("hex"),c="0x",d=0;d<i.length;d++)parseInt(o[d],16)>=8?c+=i[d].toUpperCase():c+=i[d];return c},e.isValidChecksumAddress=function(i,u){return e.isValidAddress(i)&&e.toChecksumAddress(i,u)===i},e.generateAddress=function(i,u){i=t.toBuffer(i);var n=new a(u);return n.isZero()?l.rlphash([i,null]).slice(-20):l.rlphash([i,r.from(n.toArray())]).slice(-20)},e.generateAddress2=function(i,u,n){var o=t.toBuffer(i),c=t.toBuffer(u),d=t.toBuffer(n);v(o.length===20),v(c.length===32);var x=l.keccak256(r.concat([r.from("ff","hex"),o,c,l.keccak256(d)]));return x.slice(-20)},e.isPrecompiled=function(i){var u=t.unpad(i);return u.length===1&&u[0]>=1&&u[0]<=8},e.isValidPrivate=function(i){return f.privateKeyVerify(i)},e.isValidPublic=function(i,u){return u===void 0&&(u=!1),i.length===64?f.publicKeyVerify(r.concat([r.from([4]),i])):u?f.publicKeyVerify(i):!1},e.pubToAddress=function(i,u){return u===void 0&&(u=!1),i=t.toBuffer(i),u&&i.length!==64&&(i=f.publicKeyConvert(i,!1).slice(1)),v(i.length===64),l.keccak(i).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToAddress=function(i){return e.publicToAddress(e.privateToPublic(i))},e.privateToPublic=function(i){return i=t.toBuffer(i),f.publicKeyCreate(i,!1).slice(1)},e.importPublic=function(i){return i=t.toBuffer(i),i.length!==64&&(i=f.publicKeyConvert(i,!1).slice(1)),i}},74820:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.stripZeros=e.unpad=e.setLengthRight=e.setLength=e.setLengthLeft=e.zeros=void 0;var v=y(80884),g=y(13550);e.zeros=function(f){return r.allocUnsafe(f).fill(0)},e.setLengthLeft=function(f,a,t){t===void 0&&(t=!1);var l=e.zeros(a);return f=e.toBuffer(f),t?f.length<a?(f.copy(l),l):f.slice(0,a):f.length<a?(f.copy(l,a-f.length),l):f.slice(-a)},e.setLength=e.setLengthLeft,e.setLengthRight=function(f,a){return e.setLength(f,a,!0)},e.unpad=function(f){f=v.stripHexPrefix(f);for(var a=f[0];f.length>0&&a.toString()==="0";)f=f.slice(1),a=f[0];return f},e.stripZeros=e.unpad,e.toBuffer=function(f){if(!r.isBuffer(f))if(Array.isArray(f))f=r.from(f);else if(typeof f=="string")if(v.isHexString(f))f=r.from(v.padToEven(v.stripHexPrefix(f)),"hex");else throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+f);else if(typeof f=="number")f=v.intToBuffer(f);else if(f==null)f=r.allocUnsafe(0);else if(g.isBN(f))f=f.toArrayLike(r);else if(f.toArray)f=r.from(f.toArray());else throw new Error("invalid type");return f},e.bufferToInt=function(f){return new g(e.toBuffer(f)).toNumber()},e.bufferToHex=function(f){return f=e.toBuffer(f),"0x"+f.toString("hex")},e.fromSigned=function(f){return new g(f).fromTwos(256)},e.toUnsigned=function(f){return r.from(f.toTwos(256).toArray())},e.addHexPrefix=function(f){return typeof f!="string"||v.isHexPrefixed(f)?f:"0x"+f},e.baToJSON=function(f){if(r.isBuffer(f))return"0x"+f.toString("hex");if(f instanceof Array){for(var a=[],t=0;t<f.length;t++)a.push(e.baToJSON(f[t]));return a}}},98026:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;var v=y(13550);e.MAX_INTEGER=new v("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new v("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=r.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=r.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=r.from(e.KECCAK256_RLP_S,"hex")},20106:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160=e.sha256=e.keccak256=e.keccak=void 0;var v=y(82192),g=v.keccak224,f=v.keccak384,a=v.keccak256,t=v.keccak512,l=y(23482),i=y(80884),u=y(51675),n=y(74820);e.keccak=function(o,c){switch(c===void 0&&(c=256),typeof o=="string"&&!i.isHexString(o)?o=r.from(o,"utf8"):o=n.toBuffer(o),c||(c=256),c){case 224:return g(o);case 256:return a(o);case 384:return f(o);case 512:return t(o);default:throw new Error("Invald algorithm: keccak"+c)}},e.keccak256=function(o){return e.keccak(o)},e.sha256=function(o){return o=n.toBuffer(o),l("sha256").update(o).digest()},e.ripemd160=function(o,c){o=n.toBuffer(o);var d=l("rmd160").update(o).digest();return c===!0?n.setLength(d,32):d},e.rlphash=function(o){return e.keccak(u.encode(o))}},79692:function(K,e,y){"use strict";var r=this&&this.__createBinding||(Object.create?function(l,i,u,n){n===void 0&&(n=u),Object.defineProperty(l,n,{enumerable:!0,get:function(){return i[u]}})}:function(l,i,u,n){n===void 0&&(n=u),l[n]=i[u]}),v=this&&this.__exportStar||function(l,i){for(var u in l)u!=="default"&&!i.hasOwnProperty(u)&&r(i,l,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=e.rlp=e.BN=void 0;var g=y(50208);e.secp256k1=g;var f=y(80884),a=y(13550);e.BN=a;var t=y(51675);e.rlp=t,Object.assign(e,f),v(y(98026),e),v(y(69637),e),v(y(20106),e),v(y(35922),e),v(y(74820),e),v(y(60032),e)},60032:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;var v=y(69282),g=y(80884),f=y(51675),a=y(74820);e.defineProperties=function(t,l,i){if(t.raw=[],t._fields=[],t.toJSON=function(n){if(n===void 0&&(n=!1),n){var o={};return t._fields.forEach(function(c){o[c]="0x"+t[c].toString("hex")}),o}return a.baToJSON(t.raw)},t.serialize=function(){return f.encode(t.raw)},l.forEach(function(n,o){t._fields.push(n.name);function c(){return t.raw[o]}function d(x){x=a.toBuffer(x),x.toString("hex")==="00"&&!n.allowZero&&(x=r.allocUnsafe(0)),n.allowLess&&n.length?(x=a.stripZeros(x),v(n.length>=x.length,"The field "+n.name+" must not have more "+n.length+" bytes")):!(n.allowZero&&x.length===0)&&n.length&&v(n.length===x.length,"The field "+n.name+" must have byte length of "+n.length),t.raw[o]=x}Object.defineProperty(t,n.name,{enumerable:!0,configurable:!0,get:c,set:d}),n.default&&(t[n.name]=n.default),n.alias&&Object.defineProperty(t,n.alias,{enumerable:!1,configurable:!0,set:d,get:c})}),i)if(typeof i=="string"&&(i=r.from(g.stripHexPrefix(i),"hex")),r.isBuffer(i)&&(i=f.decode(i)),Array.isArray(i)){if(i.length>t._fields.length)throw new Error("wrong number of fields in data");i.forEach(function(n,o){t[t._fields[o]]=a.toBuffer(n)})}else if(typeof i=="object"){var u=Object.keys(i);l.forEach(function(n){u.indexOf(n.name)!==-1&&(t[n.name]=i[n.name]),u.indexOf(n.alias)!==-1&&(t[n.alias]=i[n.alias])})}else throw new Error("invalid data")}},50208:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.ecdhUnsafe=e.ecdh=e.recover=e.verify=e.sign=e.signatureImportLax=e.signatureImport=e.signatureExport=e.signatureNormalize=e.publicKeyCombine=e.publicKeyTweakMul=e.publicKeyTweakAdd=e.publicKeyVerify=e.publicKeyConvert=e.publicKeyCreate=e.privateKeyTweakMul=e.privateKeyTweakAdd=e.privateKeyModInverse=e.privateKeyNegate=e.privateKeyImport=e.privateKeyExport=e.privateKeyVerify=void 0;var v=y(95053),g=y(86158),f=y(35894);e.privateKeyVerify=function(a){return a.length!==32?!1:v.privateKeyVerify(Uint8Array.from(a))},e.privateKeyExport=function(a,t){if(a.length!==32)throw new RangeError("private key length is invalid");var l=g.privateKeyExport(a,t);return f.privateKeyExport(a,l,t)},e.privateKeyImport=function(a){if(a=f.privateKeyImport(a),a!==null&&a.length===32&&e.privateKeyVerify(a))return a;throw new Error("couldn't import from DER format")},e.privateKeyNegate=function(a){return r.from(v.privateKeyNegate(Uint8Array.from(a)))},e.privateKeyModInverse=function(a){if(a.length!==32)throw new Error("private key length is invalid");return r.from(g.privateKeyModInverse(Uint8Array.from(a)))},e.privateKeyTweakAdd=function(a,t){return r.from(v.privateKeyTweakAdd(Uint8Array.from(a),t))},e.privateKeyTweakMul=function(a,t){return r.from(v.privateKeyTweakMul(Uint8Array.from(a),Uint8Array.from(t)))},e.publicKeyCreate=function(a,t){return r.from(v.publicKeyCreate(Uint8Array.from(a),t))},e.publicKeyConvert=function(a,t){return r.from(v.publicKeyConvert(Uint8Array.from(a),t))},e.publicKeyVerify=function(a){return a.length!==33&&a.length!==65?!1:v.publicKeyVerify(Uint8Array.from(a))},e.publicKeyTweakAdd=function(a,t,l){return r.from(v.publicKeyTweakAdd(Uint8Array.from(a),Uint8Array.from(t),l))},e.publicKeyTweakMul=function(a,t,l){return r.from(v.publicKeyTweakMul(Uint8Array.from(a),Uint8Array.from(t),l))},e.publicKeyCombine=function(a,t){var l=[];return a.forEach(function(i){l.push(Uint8Array.from(i))}),r.from(v.publicKeyCombine(l,t))},e.signatureNormalize=function(a){return r.from(v.signatureNormalize(Uint8Array.from(a)))},e.signatureExport=function(a){return r.from(v.signatureExport(Uint8Array.from(a)))},e.signatureImport=function(a){return r.from(v.signatureImport(Uint8Array.from(a)))},e.signatureImportLax=function(a){if(a.length===0)throw new RangeError("signature length is invalid");var t=f.signatureImportLax(a);if(t===null)throw new Error("couldn't parse DER signature");return g.signatureImport(t)},e.sign=function(a,t,l){if(l===null)throw new TypeError("options should be an Object");var i=void 0;if(l){if(i={},l.data===null)throw new TypeError("options.data should be a Buffer");if(l.data){if(l.data.length!=32)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(l.data)}if(l.noncefn===null)throw new TypeError("options.noncefn should be a Function");l.noncefn&&(i.noncefn=function(n,o,c,d,x){var b=c!=null?r.from(c):null,s=d!=null?r.from(d):null,E=r.from("");return l.noncefn&&(E=l.noncefn(r.from(n),r.from(o),b,s,x)),new Uint8Array(E)})}var u=v.ecdsaSign(Uint8Array.from(a),Uint8Array.from(t),i);return{signature:r.from(u.signature),recovery:u.recid}},e.verify=function(a,t,l){return v.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(a),l)},e.recover=function(a,t,l,i){return r.from(v.ecdsaRecover(Uint8Array.from(t),l,Uint8Array.from(a),i))},e.ecdh=function(a,t){return r.from(v.ecdh(Uint8Array.from(a),Uint8Array.from(t),{}))},e.ecdhUnsafe=function(a,t,l){if(a.length!==33&&a.length!==65)throw new RangeError("public key length is invalid");if(t.length!==32)throw new RangeError("private key length is invalid");return r.from(g.ecdhUnsafe(Uint8Array.from(a),Uint8Array.from(t),l))}},35894:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var v=r.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),g=r.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e.privateKeyExport=function(f,a,t){t===void 0&&(t=!0);var l=r.from(t?v:g);return f.copy(l,t?8:9),a.copy(l,t?181:214),l},e.privateKeyImport=function(f){var a=f.length,t=0;if(a<t+1||f[t]!==48||(t+=1,a<t+1||!(f[t]&128)))return null;var l=f[t]&127;if(t+=1,l<1||l>2||a<t+l)return null;var i=f[t+l-1]|(l>1?f[t+l-2]<<8:0);return t+=l,a<t+i||a<t+3||f[t]!==2||f[t+1]!==1||f[t+2]!==1||(t+=3,a<t+2||f[t]!==4||f[t+1]>32||a<t+2+f[t+1])?null:f.slice(t+2,t+2+f[t+1])},e.signatureImportLax=function(f){var a=r.alloc(32,0),t=r.alloc(32,0),l=f.length,i=0;if(f[i++]!==48)return null;var u=f[i++];if(u&128&&(i+=u-128,i>l)||f[i++]!==2)return null;var n=f[i++];if(n&128){if(u=n-128,i+u>l)return null;for(;u>0&&f[i]===0;i+=1,u-=1);for(n=0;u>0;i+=1,u-=1)n=(n<<8)+f[i]}if(n>l-i)return null;var o=i;if(i+=n,f[i++]!==2)return null;var c=f[i++];if(c&128){if(u=c-128,i+u>l)return null;for(;u>0&&f[i]===0;i+=1,u-=1);for(c=0;u>0;i+=1,u-=1)c=(c<<8)+f[i]}if(c>l-i)return null;var d=i;for(i+=c;n>0&&f[o]===0;n-=1,o+=1);if(n>32)return null;var x=f.slice(o,o+n);for(x.copy(a,32-x.length);c>0&&f[d]===0;c-=1,d+=1);if(c>32)return null;var b=f.slice(d,d+c);return b.copy(t,32-b.length),{r:a,s:t}}},86158:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var v=y(13550),g=y(86266).ec,f=new g("secp256k1"),a=f.curve;e.privateKeyExport=function(l,i){i===void 0&&(i=!0);var u=new v(l);if(u.ucmp(a.n)>=0)throw new Error("couldn't export to DER format");var n=f.g.mul(u);return t(n.getX(),n.getY(),i)},e.privateKeyModInverse=function(l){var i=new v(l);if(i.ucmp(a.n)>=0||i.isZero())throw new Error("private key range is invalid");return i.invm(a.n).toArrayLike(r,"be",32)},e.signatureImport=function(l){var i=new v(l.r);i.ucmp(a.n)>=0&&(i=new v(0));var u=new v(l.s);return u.ucmp(a.n)>=0&&(u=new v(0)),r.concat([i.toArrayLike(r,"be",32),u.toArrayLike(r,"be",32)])},e.ecdhUnsafe=function(l,i,u){u===void 0&&(u=!0);var n=f.keyFromPublic(l),o=new v(i);if(o.ucmp(a.n)>=0||o.isZero())throw new Error("scalar was invalid (zero or overflow)");var c=n.pub.mul(o);return t(c.getX(),c.getY(),u)};var t=function(l,i,u){var n;return u?(n=r.alloc(33),n[0]=i.isOdd()?3:2,l.toArrayLike(r,"be",32).copy(n,1)):(n=r.alloc(65),n[0]=4,l.toArrayLike(r,"be",32).copy(n,1),i.toArrayLike(r,"be",32).copy(n,33)),n}},35922:function(K,e,y){"use strict";var r=y(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var v=y(50208),g=y(13550),f=y(74820),a=y(20106);e.ecsign=function(i,u,n){var o=v.sign(i,u),c=o.recovery,d={r:o.signature.slice(0,32),s:o.signature.slice(32,64),v:n?c+(n*2+35):c+27};return d},e.ecrecover=function(i,u,n,o,c){var d=r.concat([f.setLength(n,32),f.setLength(o,32)],64),x=t(u,c);if(!l(x))throw new Error("Invalid signature v value");var b=v.recover(i,d,x);return v.publicKeyConvert(b,!1).slice(1)},e.toRpcSig=function(i,u,n,o){var c=t(i,o);if(!l(c))throw new Error("Invalid signature v value");return f.bufferToHex(r.concat([f.setLengthLeft(u,32),f.setLengthLeft(n,32),f.toBuffer(i)]))},e.fromRpcSig=function(i){var u=f.toBuffer(i);if(u.length!==65)throw new Error("Invalid signature length");var n=u[64];return n<27&&(n+=27),{v:n,r:u.slice(0,32),s:u.slice(32,64)}},e.isValidSignature=function(i,u,n,o,c){o===void 0&&(o=!0);var d=new g("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),x=new g("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(u.length!==32||n.length!==32||!l(t(i,c)))return!1;var b=new g(u),s=new g(n);return!(b.isZero()||b.gt(x)||s.isZero()||s.gt(x)||o&&s.cmp(d)===1)},e.hashPersonalMessage=function(i){var u=r.from(`Ethereum Signed Message:
|
|
4
|
+
`+i.length.toString(),"utf-8");return a.keccak(r.concat([u,i]))};function t(i,u){return u?i-(2*u+35):i-27}function l(i){return i===0||i===1}},80884:function(K,e,y){"use strict";var r=y(48764).Buffer,v=y(23944),g=y(49604);function f(b){var s=b;if(typeof s!="string")throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof s+", while padToEven.");return s.length%2&&(s="0"+s),s}function a(b){var s=b.toString(16);return"0x"+s}function t(b){var s=a(b);return new r(f(s.slice(2)),"hex")}function l(b){if(typeof b!="string")throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof b+"'.");return r.byteLength(b,"utf8")}function i(b,s,E){if(Array.isArray(b)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof b+"'");if(Array.isArray(s)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof s+"'");return s[Boolean(E)&&"some"||"every"](function(h){return b.indexOf(h)>=0})}function u(b){var s=new r(f(g(b).replace(/^0+|0+$/g,"")),"hex");return s.toString("utf8")}function n(b){var s="",E=0,h=b.length;for(b.substring(0,2)==="0x"&&(E=2);E<h;E+=2){var w=parseInt(b.substr(E,2),16);s+=String.fromCharCode(w)}return s}function o(b){var s=new r(b,"utf8");return"0x"+f(s.toString("hex")).replace(/^0+|0+$/g,"")}function c(b){for(var s="",E=0;E<b.length;E++){var h=b.charCodeAt(E),w=h.toString(16);s+=w.length<2?"0"+w:w}return"0x"+s}function d(b,s,E){if(!Array.isArray(b))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof b+"'");if(typeof s!="string")throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof s+"'.");for(var h=[],w=0;w<b.length;w++){var m=b[w][s];if(E&&!m)m="";else if(typeof m!="string")throw new Error("invalid abi");h.push(m)}return h}function x(b,s){return!(typeof b!="string"||!b.match(/^0x[0-9A-Fa-f]*$/)||s&&b.length!==2+2*s)}K.exports={arrayContainsArray:i,intToBuffer:t,getBinarySize:l,isHexPrefixed:v,stripHexPrefix:g,padToEven:f,intToHex:a,fromAscii:c,fromUtf8:o,toAscii:n,toUtf8:u,getKeys:d,isHexString:x}},23944:function(K){K.exports=function(y){if(typeof y!="string")throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof y+", while checking isHexPrefixed.");return y.slice(0,2)==="0x"}},95811:function(K,e,y){"use strict";K.exports=y(26066)(y(79653))},26066:function(K,e,y){"use strict";var r=y(37016),v=y(5675);K.exports=function(g){var f=r(g),a=v(g);return function(t,l){var i=typeof t=="string"?t.toLowerCase():t;switch(i){case"keccak224":return new f(1152,448,null,224,l);case"keccak256":return new f(1088,512,null,256,l);case"keccak384":return new f(832,768,null,384,l);case"keccak512":return new f(576,1024,null,512,l);case"sha3-224":return new f(1152,448,6,224,l);case"sha3-256":return new f(1088,512,6,256,l);case"sha3-384":return new f(832,768,6,384,l);case"sha3-512":return new f(576,1024,6,512,l);case"shake128":return new a(1344,256,31,l);case"shake256":return new a(1088,512,31,l);default:throw new Error("Invald algorithm: "+t)}}}},37016:function(K,e,y){"use strict";var r=y(89509).Buffer,v=y(42830).Transform,g=y(35717);K.exports=function(f){function a(t,l,i,u,n){v.call(this,n),this._rate=t,this._capacity=l,this._delimitedSuffix=i,this._hashBitLength=u,this._options=n,this._state=new f,this._state.initialize(t,l),this._finalized=!1}return g(a,v),a.prototype._transform=function(t,l,i){var u=null;try{this.update(t,l)}catch(n){u=n}i(u)},a.prototype._flush=function(t){var l=null;try{this.push(this.digest())}catch(i){l=i}t(l)},a.prototype.update=function(t,l){if(!r.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return r.isBuffer(t)||(t=r.from(t,l)),this._state.absorb(t),this},a.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var l=this._state.squeeze(this._hashBitLength/8);return t!==void 0&&(l=l.toString(t)),this._resetState(),l},a.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},a.prototype._clone=function(){var t=new a(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},a}},5675:function(K,e,y){"use strict";var r=y(89509).Buffer,v=y(42830).Transform,g=y(35717);K.exports=function(f){function a(t,l,i,u){v.call(this,u),this._rate=t,this._capacity=l,this._delimitedSuffix=i,this._options=u,this._state=new f,this._state.initialize(t,l),this._finalized=!1}return g(a,v),a.prototype._transform=function(t,l,i){var u=null;try{this.update(t,l)}catch(n){u=n}i(u)},a.prototype._flush=function(){},a.prototype._read=function(t){this.push(this.squeeze(t))},a.prototype.update=function(t,l){if(!r.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return r.isBuffer(t)||(t=r.from(t,l)),this._state.absorb(t),this},a.prototype.squeeze=function(t,l){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var i=this._state.squeeze(t);return l!==void 0&&(i=i.toString(l)),i},a.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},a.prototype._clone=function(){var t=new a(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},a}},34040:function(K,e){"use strict";var y=[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];e.p1600=function(r){for(var v=0;v<24;++v){var g=r[0]^r[10]^r[20]^r[30]^r[40],f=r[1]^r[11]^r[21]^r[31]^r[41],a=r[2]^r[12]^r[22]^r[32]^r[42],t=r[3]^r[13]^r[23]^r[33]^r[43],l=r[4]^r[14]^r[24]^r[34]^r[44],i=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],n=r[7]^r[17]^r[27]^r[37]^r[47],o=r[8]^r[18]^r[28]^r[38]^r[48],c=r[9]^r[19]^r[29]^r[39]^r[49],d=o^(a<<1|t>>>31),x=c^(t<<1|a>>>31),b=r[0]^d,s=r[1]^x,E=r[10]^d,h=r[11]^x,w=r[20]^d,m=r[21]^x,A=r[30]^d,S=r[31]^x,P=r[40]^d,L=r[41]^x;d=g^(l<<1|i>>>31),x=f^(i<<1|l>>>31);var k=r[2]^d,R=r[3]^x,O=r[12]^d,C=r[13]^x,B=r[22]^d,U=r[23]^x,I=r[32]^d,p=r[33]^x,T=r[42]^d,N=r[43]^x;d=a^(u<<1|n>>>31),x=t^(n<<1|u>>>31);var z=r[4]^d,_=r[5]^x,V=r[14]^d,H=r[15]^x,ze=r[24]^d,_e=r[25]^x,Ve=r[34]^d,He=r[35]^x,Me=r[44]^d,je=r[45]^x;d=l^(o<<1|c>>>31),x=i^(c<<1|o>>>31);var De=r[6]^d,Ze=r[7]^x,We=r[16]^d,Fe=r[17]^x,Ye=r[26]^d,Je=r[27]^x,$e=r[36]^d,Ge=r[37]^x,Xe=r[46]^d,Qe=r[47]^x;d=u^(g<<1|f>>>31),x=n^(f<<1|g>>>31);var qe=r[8]^d,er=r[9]^x,rr=r[18]^d,nr=r[19]^x,tr=r[28]^d,ir=r[29]^x,fr=r[38]^d,ar=r[39]^x,ur=r[48]^d,or=r[49]^x,M=b,j=s,D=h<<4|E>>>28,Z=E<<4|h>>>28,W=w<<3|m>>>29,F=m<<3|w>>>29,Y=S<<9|A>>>23,J=A<<9|S>>>23,$=P<<18|L>>>14,G=L<<18|P>>>14,X=k<<1|R>>>31,Q=R<<1|k>>>31,q=C<<12|O>>>20,ee=O<<12|C>>>20,re=B<<10|U>>>22,ne=U<<10|B>>>22,te=p<<13|I>>>19,ie=I<<13|p>>>19,fe=T<<2|N>>>30,ae=N<<2|T>>>30,ue=_<<30|z>>>2,oe=z<<30|_>>>2,ce=V<<6|H>>>26,le=H<<6|V>>>26,se=_e<<11|ze>>>21,he=ze<<11|_e>>>21,de=Ve<<15|He>>>17,xe=He<<15|Ve>>>17,ve=je<<29|Me>>>3,ye=Me<<29|je>>>3,ge=De<<28|Ze>>>4,we=Ze<<28|De>>>4,me=Fe<<23|We>>>9,be=We<<23|Fe>>>9,Ee=Ye<<25|Je>>>7,Ae=Je<<25|Ye>>>7,Se=$e<<21|Ge>>>11,Ke=Ge<<21|$e>>>11,Pe=Qe<<24|Xe>>>8,ke=Xe<<24|Qe>>>8,Be=qe<<27|er>>>5,Ce=er<<27|qe>>>5,Le=rr<<20|nr>>>12,pe=nr<<20|rr>>>12,Ue=ir<<7|tr>>>25,Re=tr<<7|ir>>>25,Te=fr<<8|ar>>>24,Ie=ar<<8|fr>>>24,Ne=ur<<14|or>>>18,Oe=or<<14|ur>>>18;r[0]=M^~q&se,r[1]=j^~ee&he,r[10]=ge^~Le&W,r[11]=we^~pe&F,r[20]=X^~ce&Ee,r[21]=Q^~le&Ae,r[30]=Be^~D&re,r[31]=Ce^~Z&ne,r[40]=ue^~me&Ue,r[41]=oe^~be&Re,r[2]=q^~se&Se,r[3]=ee^~he&Ke,r[12]=Le^~W&te,r[13]=pe^~F&ie,r[22]=ce^~Ee&Te,r[23]=le^~Ae&Ie,r[32]=D^~re&de,r[33]=Z^~ne&xe,r[42]=me^~Ue&Y,r[43]=be^~Re&J,r[4]=se^~Se&Ne,r[5]=he^~Ke&Oe,r[14]=W^~te&ve,r[15]=F^~ie&ye,r[24]=Ee^~Te&$,r[25]=Ae^~Ie&G,r[34]=re^~de&Pe,r[35]=ne^~xe&ke,r[44]=Ue^~Y&fe,r[45]=Re^~J&ae,r[6]=Se^~Ne&M,r[7]=Ke^~Oe&j,r[16]=te^~ve&ge,r[17]=ie^~ye&we,r[26]=Te^~$&X,r[27]=Ie^~G&Q,r[36]=de^~Pe&Be,r[37]=xe^~ke&Ce,r[46]=Y^~fe&ue,r[47]=J^~ae&oe,r[8]=Ne^~M&q,r[9]=Oe^~j&ee,r[18]=ve^~ge&Le,r[19]=ye^~we&pe,r[28]=$^~X&ce,r[29]=G^~Q&le,r[38]=Pe^~Be&D,r[39]=ke^~Ce&Z,r[48]=fe^~ue&me,r[49]=ae^~oe&be,r[0]^=y[v*2],r[1]^=y[v*2+1]}}},79653:function(K,e,y){"use strict";var r=y(89509).Buffer,v=y(34040);function g(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}g.prototype.initialize=function(f,a){for(var t=0;t<50;++t)this.state[t]=0;this.blockSize=f/8,this.count=0,this.squeezing=!1},g.prototype.absorb=function(f){for(var a=0;a<f.length;++a)this.state[~~(this.count/4)]^=f[a]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(v.p1600(this.state),this.count=0)},g.prototype.absorbLastFewBits=function(f){this.state[~~(this.count/4)]^=f<<8*(this.count%4),(f&128)!==0&&this.count===this.blockSize-1&&v.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),v.p1600(this.state),this.count=0,this.squeezing=!0},g.prototype.squeeze=function(f){this.squeezing||this.absorbLastFewBits(1);for(var a=r.alloc(f),t=0;t<f;++t)a[t]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(v.p1600(this.state),this.count=0);return a},g.prototype.copy=function(f){for(var a=0;a<50;++a)f.state[a]=this.state[a];f.blockSize=this.blockSize,f.count=this.count,f.squeezing=this.squeezing},K.exports=g},51675:function(K,e,y){"use strict";var r=y(48764).Buffer,v=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLength=e.decode=e.encode=void 0;var g=v(y(13550));function f(s){if(Array.isArray(s)){for(var E=[],h=0;h<s.length;h++)E.push(f(s[h]));var w=r.concat(E);return r.concat([t(w.length,192),w])}else{var m=b(s);return m.length===1&&m[0]<128?m:r.concat([t(m.length,128),m])}}e.encode=f;function a(s,E){if(s[0]==="0"&&s[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(s,E)}function t(s,E){if(s<56)return r.from([s+E]);var h=c(s),w=h.length/2,m=c(E+55+w);return r.from(m+h,"hex")}function l(s,E){if(E===void 0&&(E=!1),!s||s.length===0)return r.from([]);var h=b(s),w=u(h);if(E)return w;if(w.remainder.length!==0)throw new Error("invalid remainder");return w.data}e.decode=l;function i(s){if(!s||s.length===0)return r.from([]);var E=b(s),h=E[0];if(h<=127)return E.length;if(h<=183)return h-127;if(h<=191)return h-182;if(h<=247)return h-191;var w=h-246,m=a(E.slice(1,w).toString("hex"),16);return w+m}e.getLength=i;function u(s){var E,h,w,m,A,S=[],P=s[0];if(P<=127)return{data:s.slice(0,1),remainder:s.slice(1)};if(P<=183){if(E=P-127,P===128?w=r.from([]):w=s.slice(1,E),E===2&&w[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:w,remainder:s.slice(E)}}else if(P<=191){if(h=P-182,s.length-1<h)throw new Error("invalid RLP: not enough bytes for string length");if(E=a(s.slice(1,h).toString("hex"),16),E<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(w=s.slice(h,E+h),w.length<E)throw new Error("invalid RLP: not enough bytes for string");return{data:w,remainder:s.slice(E+h)}}else if(P<=247){for(E=P-191,m=s.slice(1,E);m.length;)A=u(m),S.push(A.data),m=A.remainder;return{data:S,remainder:s.slice(E)}}else{h=P-246,E=a(s.slice(1,h).toString("hex"),16);var L=h+E;if(L>s.length)throw new Error("invalid rlp: total length is larger than the data");if(m=s.slice(h,L),m.length===0)throw new Error("invalid rlp, List has a invalid length");for(;m.length;)A=u(m),S.push(A.data),m=A.remainder;return{data:S,remainder:s.slice(L)}}}function n(s){return s.slice(0,2)==="0x"}function o(s){return typeof s!="string"?s:n(s)?s.slice(2):s}function c(s){if(s<0)throw new Error("Invalid integer as argument, must be unsigned!");var E=s.toString(16);return E.length%2?"0"+E:E}function d(s){return s.length%2?"0"+s:s}function x(s){var E=c(s);return r.from(E,"hex")}function b(s){if(!r.isBuffer(s)){if(typeof s=="string")return n(s)?r.from(d(o(s)),"hex"):r.from(s);if(typeof s=="number"||typeof s=="bigint")return s?x(s):r.from([]);if(s==null)return r.from([]);if(s instanceof Uint8Array)return r.from(s);if(g.default.isBN(s))return r.from(s.toArray());throw new Error("invalid type")}return s}},9084:function(K,e,y){var r=y(48764).Buffer,v=y(25632).pbkdf2Sync,g=2147483647;function f(t,l,i,u,n,o,c){if(i===0||(i&i-1)!==0)throw Error("N must be > 0 and a power of 2");if(i>g/128/u)throw Error("Parameter N is too large");if(u>g/128/n)throw Error("Parameter r is too large");var d=new r(256*u),x=new r(128*u*i),b=new Int32Array(16),s=new Int32Array(16),E=new r(64),h=v(t,l,1,n*128*u,"sha256"),w;if(c){var m=n*i*2,A=0;w=function(){++A,A%1e3===0&&c({current:A,total:m,percent:A/m*100})}}for(var S=0;S<n;S++)P(h,S*128*u,u,i,x,d);return v(t,h,1,o,"sha256");function P(C,B,U,I,p,T){var N=0,z=128*U,_;for(C.copy(T,N,B,B+z),_=0;_<I;_++)T.copy(p,_*z,N,N+z),L(T,N,z,U),w&&w();for(_=0;_<I;_++){var V=N+(2*U-1)*64,H=T.readUInt32LE(V)&I-1;O(p,H*z,T,N,z),L(T,N,z,U),w&&w()}T.copy(C,B,N,N+z)}function L(C,B,U,I){var p;for(a(C,B+(2*I-1)*64,E,0,64),p=0;p<2*I;p++)O(C,p*64,E,0,64),R(E),a(E,0,C,U+p*64,64);for(p=0;p<I;p++)a(C,U+p*2*64,C,B+p*64,64);for(p=0;p<I;p++)a(C,U+(p*2+1)*64,C,B+(p+I)*64,64)}function k(C,B){return C<<B|C>>>32-B}function R(C){var B;for(B=0;B<16;B++)b[B]=(C[B*4+0]&255)<<0,b[B]|=(C[B*4+1]&255)<<8,b[B]|=(C[B*4+2]&255)<<16,b[B]|=(C[B*4+3]&255)<<24;for(a(b,0,s,0,16),B=8;B>0;B-=2)s[4]^=k(s[0]+s[12],7),s[8]^=k(s[4]+s[0],9),s[12]^=k(s[8]+s[4],13),s[0]^=k(s[12]+s[8],18),s[9]^=k(s[5]+s[1],7),s[13]^=k(s[9]+s[5],9),s[1]^=k(s[13]+s[9],13),s[5]^=k(s[1]+s[13],18),s[14]^=k(s[10]+s[6],7),s[2]^=k(s[14]+s[10],9),s[6]^=k(s[2]+s[14],13),s[10]^=k(s[6]+s[2],18),s[3]^=k(s[15]+s[11],7),s[7]^=k(s[3]+s[15],9),s[11]^=k(s[7]+s[3],13),s[15]^=k(s[11]+s[7],18),s[1]^=k(s[0]+s[3],7),s[2]^=k(s[1]+s[0],9),s[3]^=k(s[2]+s[1],13),s[0]^=k(s[3]+s[2],18),s[6]^=k(s[5]+s[4],7),s[7]^=k(s[6]+s[5],9),s[4]^=k(s[7]+s[6],13),s[5]^=k(s[4]+s[7],18),s[11]^=k(s[10]+s[9],7),s[8]^=k(s[11]+s[10],9),s[9]^=k(s[8]+s[11],13),s[10]^=k(s[9]+s[8],18),s[12]^=k(s[15]+s[14],7),s[13]^=k(s[12]+s[15],9),s[14]^=k(s[13]+s[12],13),s[15]^=k(s[14]+s[13],18);for(B=0;B<16;++B)b[B]=s[B]+b[B];for(B=0;B<16;B++){var U=B*4;C[U+0]=b[B]>>0&255,C[U+1]=b[B]>>8&255,C[U+2]=b[B]>>16&255,C[U+3]=b[B]>>24&255}}function O(C,B,U,I,p){for(var T=0;T<p;T++)U[I+T]^=C[B+T]}}function a(t,l,i,u,n){if(r.isBuffer(t)&&r.isBuffer(i))t.copy(i,u,l,l+n);else for(;n--;)i[u++]=t[l++]}K.exports=f},49604:function(K,e,y){var r=y(23944);K.exports=function(g){return typeof g!="string"?g:r(g)?g.slice(2):g}}}]);
|