@gardenfi/utils 2.5.3-beta.7 → 2.5.3-beta.8

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/dist/index112.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index154.cjs"),i=require("./index78.cjs"),s=require("./index211.cjs");function u(r,{docsPath:o,...e}){const t=(()=>{const n=s.getNodeError(r,e);return n instanceof c.UnknownNodeError?r:n})();return new i.TransactionExecutionError(t,{docsPath:o,...e})}exports.getTransactionError=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index154.cjs"),i=require("./index78.cjs"),s=require("./index209.cjs");function u(r,{docsPath:o,...e}){const t=(()=>{const n=s.getNodeError(r,e);return n instanceof c.UnknownNodeError?r:n})();return new i.TransactionExecutionError(t,{docsPath:o,...e})}exports.getTransactionError=u;
package/dist/index112.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UnknownNodeError as c } from "./index154.js";
2
2
  import { TransactionExecutionError as i } from "./index78.js";
3
- import { getNodeError as u } from "./index211.js";
3
+ import { getNodeError as u } from "./index209.js";
4
4
  function s(r, { docsPath: t, ...o }) {
5
5
  const e = (() => {
6
6
  const n = u(r, o);
package/dist/index183.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index228.cjs"),c=require("./index229.cjs"),A=BigInt(0),u=BigInt(1),H=BigInt(2),L=BigInt(7),S=BigInt(256),T=BigInt(113),O=[],y=[],w=[];for(let n=0,t=u,s=1,i=0;n<24;n++){[s,i]=[i,(2*s+3*i)%5],O.push(2*(5*i+s)),y.push((n+1)*(n+2)/2%64);let o=A;for(let r=0;r<7;r++)t=(t<<u^(t>>L)*T)%S,t&H&&(o^=u<<(u<<BigInt(r))-u);w.push(o)}const _=f.split(w,!0),F=_[0],X=_[1],I=(n,t,s)=>s>32?f.rotlBH(n,t,s):f.rotlSH(n,t,s),x=(n,t,s)=>s>32?f.rotlBL(n,t,s):f.rotlSL(n,t,s);function b(n,t=24){const s=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let e=0;e<10;e++)s[e]=n[e]^n[e+10]^n[e+20]^n[e+30]^n[e+40];for(let e=0;e<10;e+=2){const h=(e+8)%10,l=(e+2)%10,p=s[l],a=s[l+1],g=I(p,a,1)^s[h],B=x(p,a,1)^s[h+1];for(let d=0;d<50;d+=10)n[e+d]^=g,n[e+d+1]^=B}let o=n[2],r=n[3];for(let e=0;e<24;e++){const h=y[e],l=I(o,r,h),p=x(o,r,h),a=O[e];o=n[a],r=n[a+1],n[a]=l,n[a+1]=p}for(let e=0;e<50;e+=10){for(let h=0;h<10;h++)s[h]=n[e+h];for(let h=0;h<10;h++)n[e+h]^=~s[(h+2)%10]&s[(h+4)%10]}n[0]^=F[i],n[1]^=X[i]}c.clean(s)}class k extends c.Hash{constructor(t,s,i,o=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=s,this.outputLen=i,this.enableXOF=o,this.rounds=r,c.anumber(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=c.u32(this.state)}clone(){return this._cloneInto()}keccak(){c.swap32IfBE(this.state32),b(this.state32,this.rounds),c.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){c.aexists(this),t=c.toBytes(t),c.abytes(t);const{blockLen:s,state:i}=this,o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let h=0;h<e;h++)i[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:i,blockLen:o}=this;t[i]^=s,s&128&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){c.aexists(this,!1),c.abytes(t),this.finish();const s=this.state,{blockLen:i}=this;for(let o=0,r=t.length;o<r;){this.posOut>=i&&this.keccak();const e=Math.min(i-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return c.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(c.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,c.clean(this.state)}_cloneInto(t){const{blockLen:s,suffix:i,outputLen:o,rounds:r,enableXOF:e}=this;return t||(t=new k(s,i,o,e,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=i,t.outputLen=o,t.enableXOF=e,t.destroyed=this.destroyed,t}}const m=(n,t,s)=>c.createHasher(()=>new k(t,n,s)),E=m(1,136,256/8);exports.Keccak=k;exports.keccakP=b;exports.keccak_256=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index232.cjs"),c=require("./index233.cjs"),A=BigInt(0),u=BigInt(1),H=BigInt(2),L=BigInt(7),S=BigInt(256),T=BigInt(113),O=[],y=[],w=[];for(let n=0,t=u,s=1,i=0;n<24;n++){[s,i]=[i,(2*s+3*i)%5],O.push(2*(5*i+s)),y.push((n+1)*(n+2)/2%64);let o=A;for(let r=0;r<7;r++)t=(t<<u^(t>>L)*T)%S,t&H&&(o^=u<<(u<<BigInt(r))-u);w.push(o)}const _=f.split(w,!0),F=_[0],X=_[1],I=(n,t,s)=>s>32?f.rotlBH(n,t,s):f.rotlSH(n,t,s),x=(n,t,s)=>s>32?f.rotlBL(n,t,s):f.rotlSL(n,t,s);function b(n,t=24){const s=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let e=0;e<10;e++)s[e]=n[e]^n[e+10]^n[e+20]^n[e+30]^n[e+40];for(let e=0;e<10;e+=2){const h=(e+8)%10,l=(e+2)%10,p=s[l],a=s[l+1],g=I(p,a,1)^s[h],B=x(p,a,1)^s[h+1];for(let d=0;d<50;d+=10)n[e+d]^=g,n[e+d+1]^=B}let o=n[2],r=n[3];for(let e=0;e<24;e++){const h=y[e],l=I(o,r,h),p=x(o,r,h),a=O[e];o=n[a],r=n[a+1],n[a]=l,n[a+1]=p}for(let e=0;e<50;e+=10){for(let h=0;h<10;h++)s[h]=n[e+h];for(let h=0;h<10;h++)n[e+h]^=~s[(h+2)%10]&s[(h+4)%10]}n[0]^=F[i],n[1]^=X[i]}c.clean(s)}class k extends c.Hash{constructor(t,s,i,o=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=s,this.outputLen=i,this.enableXOF=o,this.rounds=r,c.anumber(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=c.u32(this.state)}clone(){return this._cloneInto()}keccak(){c.swap32IfBE(this.state32),b(this.state32,this.rounds),c.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){c.aexists(this),t=c.toBytes(t),c.abytes(t);const{blockLen:s,state:i}=this,o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let h=0;h<e;h++)i[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:i,blockLen:o}=this;t[i]^=s,s&128&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){c.aexists(this,!1),c.abytes(t),this.finish();const s=this.state,{blockLen:i}=this;for(let o=0,r=t.length;o<r;){this.posOut>=i&&this.keccak();const e=Math.min(i-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return c.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(c.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,c.clean(this.state)}_cloneInto(t){const{blockLen:s,suffix:i,outputLen:o,rounds:r,enableXOF:e}=this;return t||(t=new k(s,i,o,e,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=i,t.outputLen=o,t.enableXOF=e,t.destroyed=this.destroyed,t}}const m=(n,t,s)=>c.createHasher(()=>new k(t,n,s)),E=m(1,136,256/8);exports.Keccak=k;exports.keccakP=b;exports.keccak_256=E;
package/dist/index183.js CHANGED
@@ -1,5 +1,5 @@
1
- import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index228.js";
2
- import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index229.js";
1
+ import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index232.js";
2
+ import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index233.js";
3
3
  const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
4
  for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
5
  [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
package/dist/index184.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index230.cjs"),s=e.sha256;exports.sha256=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index228.cjs"),s=e.sha256;exports.sha256=s;
package/dist/index184.js CHANGED
@@ -1,4 +1,4 @@
1
- import { sha256 as s } from "./index230.js";
1
+ import { sha256 as s } from "./index228.js";
2
2
  const o = s;
3
3
  export {
4
4
  o as sha256
package/dist/index185.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index231.cjs"),r=require("./index232.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index229.cjs"),r=require("./index230.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
package/dist/index185.js CHANGED
@@ -1,5 +1,5 @@
1
- import { hashSignature as t } from "./index231.js";
2
- import { toSignature as o } from "./index232.js";
1
+ import { hashSignature as t } from "./index229.js";
2
+ import { toSignature as o } from "./index230.js";
3
3
  function a(r) {
4
4
  return t(o(r));
5
5
  }
package/dist/index194.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index230.cjs"),C=require("./index234.cjs"),n=require("./index235.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(0),M=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function N(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,m=n.pow2(_,d,f)*_%f,S=n.pow2(m,i,f)*I%f,P=n.pow2(S,e,f)*c%f,v=n.pow2(P,s,f)*B%f,E=n.pow2(v,r,f)*o%f,q=n.pow2(E,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:N}),O=C.createCurve({a:G,b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},F.sha256);exports.secp256k1=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index228.cjs"),C=require("./index234.cjs"),n=require("./index235.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(0),M=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function N(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,m=n.pow2(_,d,f)*_%f,S=n.pow2(m,i,f)*I%f,P=n.pow2(S,e,f)*c%f,v=n.pow2(P,s,f)*B%f,E=n.pow2(v,r,f)*o%f,q=n.pow2(E,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:N}),O=C.createCurve({a:G,b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},F.sha256);exports.secp256k1=O;
package/dist/index194.js CHANGED
@@ -1,4 +1,4 @@
1
- import { sha256 as C } from "./index230.js";
1
+ import { sha256 as C } from "./index228.js";
2
2
  import { createCurve as G } from "./index234.js";
3
3
  import { Field as N, mod as k, pow2 as t } from "./index235.js";
4
4
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
package/dist/index209.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index241.cjs"),f=require("./index242.cjs");function l(t,i={}){const{signed:n,size:e}=i,o=BigInt(t);let r;e?n?r=(1n<<BigInt(e)*8n-1n)-1n:r=2n**(BigInt(e)*8n)-1n:typeof t=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const u=typeof r=="bigint"&&n?-r-1n:0;if(r&&o>r||o<u){const s=typeof t=="bigint"?"n":"";throw new d({max:r?`${r}${s}`:void 0,min:`${u}${s}`,signed:n,size:e,value:`${t}${s}`})}const a=`0x${(n&&o<0?(1n<<BigInt(e*8))+BigInt(o):o).toString(16)}`;return e?c(a,e):a}function c(t,i){return f.pad(t,{dir:"left",size:i})}class d extends g.BaseError{constructor({max:i,min:n,signed:e,size:o,value:r}){super(`Number \`${r}\` is not in safe${o?` ${o*8}-bit`:""}${e?" signed":" unsigned"} integer range ${i?`(\`${n}\` to \`${i}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class b extends g.BaseError{constructor({size:i,targetSize:n,type:e}){super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}exports.IntegerOutOfRangeError=d;exports.SizeExceedsPaddingSizeError=b;exports.fromNumber=l;exports.padLeft=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./index154.cjs");function s(n,e){const t=(n.details||"").toLowerCase(),i=n instanceof c.BaseError?n.walk(r=>(r==null?void 0:r.code)===o.ExecutionRevertedError.code):n;return i instanceof c.BaseError?new o.ExecutionRevertedError({cause:n,message:i.details}):o.ExecutionRevertedError.nodeMessage.test(t)?new o.ExecutionRevertedError({cause:n,message:n.details}):o.FeeCapTooHighError.nodeMessage.test(t)?new o.FeeCapTooHighError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.FeeCapTooLowError.nodeMessage.test(t)?new o.FeeCapTooLowError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.NonceTooHighError.nodeMessage.test(t)?new o.NonceTooHighError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceTooLowError.nodeMessage.test(t)?new o.NonceTooLowError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceMaxValueError.nodeMessage.test(t)?new o.NonceMaxValueError({cause:n,nonce:e==null?void 0:e.nonce}):o.InsufficientFundsError.nodeMessage.test(t)?new o.InsufficientFundsError({cause:n}):o.IntrinsicGasTooHighError.nodeMessage.test(t)?new o.IntrinsicGasTooHighError({cause:n,gas:e==null?void 0:e.gas}):o.IntrinsicGasTooLowError.nodeMessage.test(t)?new o.IntrinsicGasTooLowError({cause:n,gas:e==null?void 0:e.gas}):o.TransactionTypeNotSupportedError.nodeMessage.test(t)?new o.TransactionTypeNotSupportedError({cause:n}):o.TipAboveFeeCapError.nodeMessage.test(t)?new o.TipAboveFeeCapError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new o.UnknownNodeError({cause:n})}exports.getNodeError=s;
package/dist/index209.js CHANGED
@@ -1,49 +1,27 @@
1
- import { BaseError as f } from "./index241.js";
2
- import { pad as g } from "./index242.js";
3
- function m(t, i = {}) {
4
- const { signed: r, size: e } = i, o = BigInt(t);
5
- let n;
6
- e ? r ? n = (1n << BigInt(e) * 8n - 1n) - 1n : n = 2n ** (BigInt(e) * 8n) - 1n : typeof t == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
7
- const u = typeof n == "bigint" && r ? -n - 1n : 0;
8
- if (n && o > n || o < u) {
9
- const s = typeof t == "bigint" ? "n" : "";
10
- throw new d({
11
- max: n ? `${n}${s}` : void 0,
12
- min: `${u}${s}`,
13
- signed: r,
14
- size: e,
15
- value: `${t}${s}`
16
- });
17
- }
18
- const a = `0x${(r && o < 0 ? (1n << BigInt(e * 8)) + BigInt(o) : o).toString(16)}`;
19
- return e ? c(a, e) : a;
20
- }
21
- function c(t, i) {
22
- return g(t, { dir: "left", size: i });
23
- }
24
- class d extends f {
25
- constructor({ max: i, min: r, signed: e, size: o, value: n }) {
26
- super(`Number \`${n}\` is not in safe${o ? ` ${o * 8}-bit` : ""}${e ? " signed" : " unsigned"} integer range ${i ? `(\`${r}\` to \`${i}\`)` : `(above \`${r}\`)`}`), Object.defineProperty(this, "name", {
27
- enumerable: !0,
28
- configurable: !0,
29
- writable: !0,
30
- value: "Hex.IntegerOutOfRangeError"
31
- });
32
- }
33
- }
34
- class p extends f {
35
- constructor({ size: i, targetSize: r, type: e }) {
36
- super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
37
- enumerable: !0,
38
- configurable: !0,
39
- writable: !0,
40
- value: "Hex.SizeExceedsPaddingSizeError"
41
- });
42
- }
1
+ import { BaseError as c } from "./index35.js";
2
+ import { ExecutionRevertedError as t, FeeCapTooHighError as u, FeeCapTooLowError as d, NonceTooHighError as a, NonceTooLowError as f, NonceMaxValueError as w, InsufficientFundsError as r, IntrinsicGasTooHighError as E, IntrinsicGasTooLowError as m, TransactionTypeNotSupportedError as x, TipAboveFeeCapError as F, UnknownNodeError as M } from "./index154.js";
3
+ function P(o, e) {
4
+ const n = (o.details || "").toLowerCase(), s = o instanceof c ? o.walk((i) => (i == null ? void 0 : i.code) === t.code) : o;
5
+ return s instanceof c ? new t({
6
+ cause: o,
7
+ message: s.details
8
+ }) : t.nodeMessage.test(n) ? new t({
9
+ cause: o,
10
+ message: o.details
11
+ }) : u.nodeMessage.test(n) ? new u({
12
+ cause: o,
13
+ maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
14
+ }) : d.nodeMessage.test(n) ? new d({
15
+ cause: o,
16
+ maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
17
+ }) : a.nodeMessage.test(n) ? new a({ cause: o, nonce: e == null ? void 0 : e.nonce }) : f.nodeMessage.test(n) ? new f({ cause: o, nonce: e == null ? void 0 : e.nonce }) : w.nodeMessage.test(n) ? new w({ cause: o, nonce: e == null ? void 0 : e.nonce }) : r.nodeMessage.test(n) ? new r({ cause: o }) : E.nodeMessage.test(n) ? new E({ cause: o, gas: e == null ? void 0 : e.gas }) : m.nodeMessage.test(n) ? new m({ cause: o, gas: e == null ? void 0 : e.gas }) : x.nodeMessage.test(n) ? new x({ cause: o }) : F.nodeMessage.test(n) ? new F({
18
+ cause: o,
19
+ maxFeePerGas: e == null ? void 0 : e.maxFeePerGas,
20
+ maxPriorityFeePerGas: e == null ? void 0 : e.maxPriorityFeePerGas
21
+ }) : new M({
22
+ cause: o
23
+ });
43
24
  }
44
25
  export {
45
- d as IntegerOutOfRangeError,
46
- p as SizeExceedsPaddingSizeError,
47
- m as fromNumber,
48
- c as padLeft
26
+ P as getNodeError
49
27
  };
package/dist/index210.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index209.cjs");function r(e){return{address:e.address,amount:o.fromNumber(e.amount),index:o.fromNumber(e.index),validatorIndex:o.fromNumber(e.validatorIndex)}}exports.toRpc=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index241.cjs"),f=require("./index242.cjs");function l(t,i={}){const{signed:n,size:e}=i,o=BigInt(t);let r;e?n?r=(1n<<BigInt(e)*8n-1n)-1n:r=2n**(BigInt(e)*8n)-1n:typeof t=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const u=typeof r=="bigint"&&n?-r-1n:0;if(r&&o>r||o<u){const s=typeof t=="bigint"?"n":"";throw new d({max:r?`${r}${s}`:void 0,min:`${u}${s}`,signed:n,size:e,value:`${t}${s}`})}const a=`0x${(n&&o<0?(1n<<BigInt(e*8))+BigInt(o):o).toString(16)}`;return e?c(a,e):a}function c(t,i){return f.pad(t,{dir:"left",size:i})}class d extends g.BaseError{constructor({max:i,min:n,signed:e,size:o,value:r}){super(`Number \`${r}\` is not in safe${o?` ${o*8}-bit`:""}${e?" signed":" unsigned"} integer range ${i?`(\`${n}\` to \`${i}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class b extends g.BaseError{constructor({size:i,targetSize:n,type:e}){super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}exports.IntegerOutOfRangeError=d;exports.SizeExceedsPaddingSizeError=b;exports.fromNumber=l;exports.padLeft=c;
package/dist/index210.js CHANGED
@@ -1,12 +1,49 @@
1
- import { fromNumber as e } from "./index209.js";
2
- function r(o) {
3
- return {
4
- address: o.address,
5
- amount: e(o.amount),
6
- index: e(o.index),
7
- validatorIndex: e(o.validatorIndex)
8
- };
1
+ import { BaseError as f } from "./index241.js";
2
+ import { pad as g } from "./index242.js";
3
+ function m(t, i = {}) {
4
+ const { signed: r, size: e } = i, o = BigInt(t);
5
+ let n;
6
+ e ? r ? n = (1n << BigInt(e) * 8n - 1n) - 1n : n = 2n ** (BigInt(e) * 8n) - 1n : typeof t == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
7
+ const u = typeof n == "bigint" && r ? -n - 1n : 0;
8
+ if (n && o > n || o < u) {
9
+ const s = typeof t == "bigint" ? "n" : "";
10
+ throw new d({
11
+ max: n ? `${n}${s}` : void 0,
12
+ min: `${u}${s}`,
13
+ signed: r,
14
+ size: e,
15
+ value: `${t}${s}`
16
+ });
17
+ }
18
+ const a = `0x${(r && o < 0 ? (1n << BigInt(e * 8)) + BigInt(o) : o).toString(16)}`;
19
+ return e ? c(a, e) : a;
20
+ }
21
+ function c(t, i) {
22
+ return g(t, { dir: "left", size: i });
23
+ }
24
+ class d extends f {
25
+ constructor({ max: i, min: r, signed: e, size: o, value: n }) {
26
+ super(`Number \`${n}\` is not in safe${o ? ` ${o * 8}-bit` : ""}${e ? " signed" : " unsigned"} integer range ${i ? `(\`${r}\` to \`${i}\`)` : `(above \`${r}\`)`}`), Object.defineProperty(this, "name", {
27
+ enumerable: !0,
28
+ configurable: !0,
29
+ writable: !0,
30
+ value: "Hex.IntegerOutOfRangeError"
31
+ });
32
+ }
33
+ }
34
+ class p extends f {
35
+ constructor({ size: i, targetSize: r, type: e }) {
36
+ super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
37
+ enumerable: !0,
38
+ configurable: !0,
39
+ writable: !0,
40
+ value: "Hex.SizeExceedsPaddingSizeError"
41
+ });
42
+ }
9
43
  }
10
44
  export {
11
- r as toRpc
45
+ d as IntegerOutOfRangeError,
46
+ p as SizeExceedsPaddingSizeError,
47
+ m as fromNumber,
48
+ c as padLeft
12
49
  };
package/dist/index211.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./index154.cjs");function s(n,e){const t=(n.details||"").toLowerCase(),i=n instanceof c.BaseError?n.walk(r=>(r==null?void 0:r.code)===o.ExecutionRevertedError.code):n;return i instanceof c.BaseError?new o.ExecutionRevertedError({cause:n,message:i.details}):o.ExecutionRevertedError.nodeMessage.test(t)?new o.ExecutionRevertedError({cause:n,message:n.details}):o.FeeCapTooHighError.nodeMessage.test(t)?new o.FeeCapTooHighError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.FeeCapTooLowError.nodeMessage.test(t)?new o.FeeCapTooLowError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.NonceTooHighError.nodeMessage.test(t)?new o.NonceTooHighError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceTooLowError.nodeMessage.test(t)?new o.NonceTooLowError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceMaxValueError.nodeMessage.test(t)?new o.NonceMaxValueError({cause:n,nonce:e==null?void 0:e.nonce}):o.InsufficientFundsError.nodeMessage.test(t)?new o.InsufficientFundsError({cause:n}):o.IntrinsicGasTooHighError.nodeMessage.test(t)?new o.IntrinsicGasTooHighError({cause:n,gas:e==null?void 0:e.gas}):o.IntrinsicGasTooLowError.nodeMessage.test(t)?new o.IntrinsicGasTooLowError({cause:n,gas:e==null?void 0:e.gas}):o.TransactionTypeNotSupportedError.nodeMessage.test(t)?new o.TransactionTypeNotSupportedError({cause:n}):o.TipAboveFeeCapError.nodeMessage.test(t)?new o.TipAboveFeeCapError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new o.UnknownNodeError({cause:n})}exports.getNodeError=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index210.cjs");function r(e){return{address:e.address,amount:o.fromNumber(e.amount),index:o.fromNumber(e.index),validatorIndex:o.fromNumber(e.validatorIndex)}}exports.toRpc=r;
package/dist/index211.js CHANGED
@@ -1,27 +1,12 @@
1
- import { BaseError as c } from "./index35.js";
2
- import { ExecutionRevertedError as t, FeeCapTooHighError as u, FeeCapTooLowError as d, NonceTooHighError as a, NonceTooLowError as f, NonceMaxValueError as w, InsufficientFundsError as r, IntrinsicGasTooHighError as E, IntrinsicGasTooLowError as m, TransactionTypeNotSupportedError as x, TipAboveFeeCapError as F, UnknownNodeError as M } from "./index154.js";
3
- function P(o, e) {
4
- const n = (o.details || "").toLowerCase(), s = o instanceof c ? o.walk((i) => (i == null ? void 0 : i.code) === t.code) : o;
5
- return s instanceof c ? new t({
6
- cause: o,
7
- message: s.details
8
- }) : t.nodeMessage.test(n) ? new t({
9
- cause: o,
10
- message: o.details
11
- }) : u.nodeMessage.test(n) ? new u({
12
- cause: o,
13
- maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
14
- }) : d.nodeMessage.test(n) ? new d({
15
- cause: o,
16
- maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
17
- }) : a.nodeMessage.test(n) ? new a({ cause: o, nonce: e == null ? void 0 : e.nonce }) : f.nodeMessage.test(n) ? new f({ cause: o, nonce: e == null ? void 0 : e.nonce }) : w.nodeMessage.test(n) ? new w({ cause: o, nonce: e == null ? void 0 : e.nonce }) : r.nodeMessage.test(n) ? new r({ cause: o }) : E.nodeMessage.test(n) ? new E({ cause: o, gas: e == null ? void 0 : e.gas }) : m.nodeMessage.test(n) ? new m({ cause: o, gas: e == null ? void 0 : e.gas }) : x.nodeMessage.test(n) ? new x({ cause: o }) : F.nodeMessage.test(n) ? new F({
18
- cause: o,
19
- maxFeePerGas: e == null ? void 0 : e.maxFeePerGas,
20
- maxPriorityFeePerGas: e == null ? void 0 : e.maxPriorityFeePerGas
21
- }) : new M({
22
- cause: o
23
- });
1
+ import { fromNumber as e } from "./index210.js";
2
+ function r(o) {
3
+ return {
4
+ address: o.address,
5
+ amount: e(o.amount),
6
+ index: e(o.index),
7
+ validatorIndex: e(o.validatorIndex)
8
+ };
24
9
  }
25
10
  export {
26
- P as getNodeError
11
+ r as toRpc
27
12
  };
package/dist/index228.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=BigInt(2**32-1),c=BigInt(32);function u(t,o=!1){return o?{h:Number(t&l),l:Number(t>>c&l)}:{h:Number(t>>c&l)|0,l:Number(t&l)|0}}function B(t,o=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let e=0;e<r;e++){const{h:f,l:s}=u(t[e],o);[n[e],i[e]]=[f,s]}return[n,i]}const g=(t,o,r)=>t<<r|o>>>32-r,m=(t,o,r)=>o<<r|t>>>32-r,S=(t,o,r)=>o<<r-32|t>>>64-r,a=(t,o,r)=>t<<r-32|o>>>64-r;exports.fromBig=u;exports.rotlBH=S;exports.rotlBL=a;exports.rotlSH=g;exports.rotlSL=m;exports.split=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index237.cjs"),x=require("./index233.cjs"),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),f=new Uint32Array(64);class u extends e.HashMD{constructor(o=32){super(64,o,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:o,B:h,C:s,D:a,E:r,F:b,G:c,H:i}=this;return[o,h,s,a,r,b,c,i]}set(o,h,s,a,r,b,c,i){this.A=o|0,this.B=h|0,this.C=s|0,this.D=a|0,this.E=r|0,this.F=b|0,this.G=c|0,this.H=i|0}process(o,h){for(let t=0;t<16;t++,h+=4)f[t]=o.getUint32(h,!1);for(let t=16;t<64;t++){const H=f[t-15],d=f[t-2],S=x.rotr(H,7)^x.rotr(H,18)^H>>>3,l=x.rotr(d,17)^x.rotr(d,19)^d>>>10;f[t]=l+f[t-7]+S+f[t-16]|0}let{A:s,B:a,C:r,D:b,E:c,F:i,G:n,H:A}=this;for(let t=0;t<64;t++){const H=x.rotr(c,6)^x.rotr(c,11)^x.rotr(c,25),d=A+H+e.Chi(c,i,n)+_[t]+f[t]|0,l=(x.rotr(s,2)^x.rotr(s,13)^x.rotr(s,22))+e.Maj(s,a,r)|0;A=n,n=i,i=c,c=b+d|0,b=r,r=a,a=s,s=d+l|0}s=s+this.A|0,a=a+this.B|0,r=r+this.C|0,b=b+this.D|0,c=c+this.E|0,i=i+this.F|0,n=n+this.G|0,A=A+this.H|0,this.set(s,a,r,b,c,i,n,A)}roundClean(){x.clean(f)}destroy(){this.set(0,0,0,0,0,0,0,0),x.clean(this.buffer)}}const I=x.createHasher(()=>new u);exports.SHA256=u;exports.sha256=I;
package/dist/index228.js CHANGED
@@ -1,22 +1,106 @@
1
- const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
2
- function s(t, r = !1) {
3
- return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
4
- }
5
- function h(t, r = !1) {
6
- const n = t.length;
7
- let l = new Uint32Array(n), c = new Uint32Array(n);
8
- for (let e = 0; e < n; e++) {
9
- const { h: u, l: f } = s(t[e], r);
10
- [l[e], c[e]] = [u, f];
1
+ import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index237.js";
2
+ import { createHasher as u, clean as C, rotr as i } from "./index233.js";
3
+ const B = /* @__PURE__ */ Uint32Array.from([
4
+ 1116352408,
5
+ 1899447441,
6
+ 3049323471,
7
+ 3921009573,
8
+ 961987163,
9
+ 1508970993,
10
+ 2453635748,
11
+ 2870763221,
12
+ 3624381080,
13
+ 310598401,
14
+ 607225278,
15
+ 1426881987,
16
+ 1925078388,
17
+ 2162078206,
18
+ 2614888103,
19
+ 3248222580,
20
+ 3835390401,
21
+ 4022224774,
22
+ 264347078,
23
+ 604807628,
24
+ 770255983,
25
+ 1249150122,
26
+ 1555081692,
27
+ 1996064986,
28
+ 2554220882,
29
+ 2821834349,
30
+ 2952996808,
31
+ 3210313671,
32
+ 3336571891,
33
+ 3584528711,
34
+ 113926993,
35
+ 338241895,
36
+ 666307205,
37
+ 773529912,
38
+ 1294757372,
39
+ 1396182291,
40
+ 1695183700,
41
+ 1986661051,
42
+ 2177026350,
43
+ 2456956037,
44
+ 2730485921,
45
+ 2820302411,
46
+ 3259730800,
47
+ 3345764771,
48
+ 3516065817,
49
+ 3600352804,
50
+ 4094571909,
51
+ 275423344,
52
+ 430227734,
53
+ 506948616,
54
+ 659060556,
55
+ 883997877,
56
+ 958139571,
57
+ 1322822218,
58
+ 1537002063,
59
+ 1747873779,
60
+ 1955562222,
61
+ 2024104815,
62
+ 2227730452,
63
+ 2361852424,
64
+ 2428436474,
65
+ 2756734187,
66
+ 3204031479,
67
+ 3329325298
68
+ ]), h = /* @__PURE__ */ new Uint32Array(64);
69
+ class E extends D {
70
+ constructor(o = 32) {
71
+ super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
72
+ }
73
+ get() {
74
+ const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
75
+ return [o, r, t, s, a, f, c, e];
76
+ }
77
+ // prettier-ignore
78
+ set(o, r, t, s, a, f, c, e) {
79
+ this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
80
+ }
81
+ process(o, r) {
82
+ for (let x = 0; x < 16; x++, r += 4)
83
+ h[x] = o.getUint32(r, !1);
84
+ for (let x = 16; x < 64; x++) {
85
+ const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
86
+ h[x] = l + h[x - 7] + m + h[x - 16] | 0;
87
+ }
88
+ let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
89
+ for (let x = 0; x < 64; x++) {
90
+ const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
91
+ A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
92
+ }
93
+ t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
94
+ }
95
+ roundClean() {
96
+ C(h);
97
+ }
98
+ destroy() {
99
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
11
100
  }
12
- return [l, c];
13
101
  }
14
- const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
102
+ const y = /* @__PURE__ */ u(() => new E());
15
103
  export {
16
- s as fromBig,
17
- B as rotlBH,
18
- a as rotlBL,
19
- m as rotlSH,
20
- A as rotlSL,
21
- h as split
104
+ E as SHA256,
105
+ y as sha256
22
106
  };
package/dist/index229.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index238.cjs");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function s(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function u(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function f(t,...e){if(!s(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function h(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");u(t.outputLen),u(t.blockLen)}function g(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function b(t,e){f(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function d(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function m(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function B(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function x(t,e){return t<<32-e|t>>>e}const a=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function y(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function p(t){for(let e=0;e<t.length;e++)t[e]=y(t[e]);return t}const E=a?t=>t:p;function l(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function w(t){return typeof t=="string"&&(t=l(t)),f(t),t}function A(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];f(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const c=t[n];r.set(c,i),i+=c.length}return r}class U{}function L(t){const e=n=>t().update(w(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function H(t=32){if(o.crypto&&typeof o.crypto.getRandomValues=="function")return o.crypto.getRandomValues(new Uint8Array(t));if(o.crypto&&typeof o.crypto.randomBytes=="function")return Uint8Array.from(o.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}exports.Hash=U;exports.abytes=f;exports.aexists=g;exports.ahash=h;exports.anumber=u;exports.aoutput=b;exports.byteSwap=y;exports.byteSwap32=p;exports.clean=m;exports.concatBytes=A;exports.createHasher=L;exports.createView=B;exports.isBytes=s;exports.isLE=a;exports.randomBytes=H;exports.rotr=x;exports.swap32IfBE=E;exports.toBytes=w;exports.u32=d;exports.utf8ToBytes=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index159.cjs"),r=require("./index169.cjs"),c=e=>r.keccak256(t.toBytes(e));function n(e){return c(e)}exports.hashSignature=n;
package/dist/index229.js CHANGED
@@ -1,111 +1,9 @@
1
- import { crypto as o } from "./index238.js";
2
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
- function s(e) {
4
- return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
5
- }
6
- function c(e) {
7
- if (!Number.isSafeInteger(e) || e < 0)
8
- throw new Error("positive integer expected, got " + e);
9
- }
10
- function i(e, ...t) {
11
- if (!s(e))
12
- throw new Error("Uint8Array expected");
13
- if (t.length > 0 && !t.includes(e.length))
14
- throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
15
- }
16
- function g(e) {
17
- if (typeof e != "function" || typeof e.create != "function")
18
- throw new Error("Hash should be wrapped by utils.createHasher");
19
- c(e.outputLen), c(e.blockLen);
20
- }
21
- function d(e, t = !0) {
22
- if (e.destroyed)
23
- throw new Error("Hash instance has been destroyed");
24
- if (t && e.finished)
25
- throw new Error("Hash#digest() has already been called");
26
- }
27
- function b(e, t) {
28
- i(e);
29
- const r = t.outputLen;
30
- if (e.length < r)
31
- throw new Error("digestInto() expects output buffer of length at least " + r);
32
- }
33
- function m(e) {
34
- return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
35
- }
36
- function x(...e) {
37
- for (let t = 0; t < e.length; t++)
38
- e[t].fill(0);
39
- }
40
- function A(e) {
41
- return new DataView(e.buffer, e.byteOffset, e.byteLength);
42
- }
43
- function E(e, t) {
44
- return e << 32 - t | e >>> t;
45
- }
46
- const a = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
47
- function l(e) {
48
- return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
49
- }
50
- function y(e) {
51
- for (let t = 0; t < e.length; t++)
52
- e[t] = l(e[t]);
53
- return e;
54
- }
55
- const U = a ? (e) => e : y;
56
- function p(e) {
57
- if (typeof e != "string")
58
- throw new Error("string expected");
59
- return new Uint8Array(new TextEncoder().encode(e));
60
- }
61
- function w(e) {
62
- return typeof e == "string" && (e = p(e)), i(e), e;
63
- }
64
- function B(...e) {
65
- let t = 0;
66
- for (let n = 0; n < e.length; n++) {
67
- const f = e[n];
68
- i(f), t += f.length;
69
- }
70
- const r = new Uint8Array(t);
71
- for (let n = 0, f = 0; n < e.length; n++) {
72
- const u = e[n];
73
- r.set(u, f), f += u.length;
74
- }
75
- return r;
76
- }
77
- class L {
78
- }
79
- function H(e) {
80
- const t = (n) => e().update(w(n)).digest(), r = e();
81
- return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = () => e(), t;
82
- }
83
- function V(e = 32) {
84
- if (o && typeof o.getRandomValues == "function")
85
- return o.getRandomValues(new Uint8Array(e));
86
- if (o && typeof o.randomBytes == "function")
87
- return Uint8Array.from(o.randomBytes(e));
88
- throw new Error("crypto.getRandomValues must be defined");
1
+ import { toBytes as o } from "./index159.js";
2
+ import { keccak256 as r } from "./index169.js";
3
+ const e = (t) => r(o(t));
4
+ function c(t) {
5
+ return e(t);
89
6
  }
90
7
  export {
91
- L as Hash,
92
- i as abytes,
93
- d as aexists,
94
- g as ahash,
95
- c as anumber,
96
- b as aoutput,
97
- l as byteSwap,
98
- y as byteSwap32,
99
- x as clean,
100
- B as concatBytes,
101
- H as createHasher,
102
- A as createView,
103
- s as isBytes,
104
- a as isLE,
105
- V as randomBytes,
106
- E as rotr,
107
- U as swap32IfBE,
108
- w as toBytes,
109
- m as u32,
110
- p as utf8ToBytes
8
+ c as hashSignature
111
9
  };
package/dist/index230.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index237.cjs"),x=require("./index229.cjs"),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),f=new Uint32Array(64);class u extends e.HashMD{constructor(o=32){super(64,o,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:o,B:h,C:s,D:a,E:r,F:b,G:c,H:i}=this;return[o,h,s,a,r,b,c,i]}set(o,h,s,a,r,b,c,i){this.A=o|0,this.B=h|0,this.C=s|0,this.D=a|0,this.E=r|0,this.F=b|0,this.G=c|0,this.H=i|0}process(o,h){for(let t=0;t<16;t++,h+=4)f[t]=o.getUint32(h,!1);for(let t=16;t<64;t++){const H=f[t-15],d=f[t-2],S=x.rotr(H,7)^x.rotr(H,18)^H>>>3,l=x.rotr(d,17)^x.rotr(d,19)^d>>>10;f[t]=l+f[t-7]+S+f[t-16]|0}let{A:s,B:a,C:r,D:b,E:c,F:i,G:n,H:A}=this;for(let t=0;t<64;t++){const H=x.rotr(c,6)^x.rotr(c,11)^x.rotr(c,25),d=A+H+e.Chi(c,i,n)+_[t]+f[t]|0,l=(x.rotr(s,2)^x.rotr(s,13)^x.rotr(s,22))+e.Maj(s,a,r)|0;A=n,n=i,i=c,c=b+d|0,b=r,r=a,a=s,s=d+l|0}s=s+this.A|0,a=a+this.B|0,r=r+this.C|0,b=b+this.D|0,c=c+this.E|0,i=i+this.F|0,n=n+this.G|0,A=A+this.H|0,this.set(s,a,r,b,c,i,n,A)}roundClean(){x.clean(f)}destroy(){this.set(0,0,0,0,0,0,0,0),x.clean(this.buffer)}}const I=x.createHasher(()=>new u);exports.SHA256=u;exports.sha256=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index231.cjs"),n=require("./index214.cjs"),i=t=>{const r=typeof t=="string"?t:n.formatAbiItem(t);return e.normalizeSignature(r)};exports.toSignature=i;
package/dist/index230.js CHANGED
@@ -1,106 +1,9 @@
1
- import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index237.js";
2
- import { createHasher as u, clean as C, rotr as i } from "./index229.js";
3
- const B = /* @__PURE__ */ Uint32Array.from([
4
- 1116352408,
5
- 1899447441,
6
- 3049323471,
7
- 3921009573,
8
- 961987163,
9
- 1508970993,
10
- 2453635748,
11
- 2870763221,
12
- 3624381080,
13
- 310598401,
14
- 607225278,
15
- 1426881987,
16
- 1925078388,
17
- 2162078206,
18
- 2614888103,
19
- 3248222580,
20
- 3835390401,
21
- 4022224774,
22
- 264347078,
23
- 604807628,
24
- 770255983,
25
- 1249150122,
26
- 1555081692,
27
- 1996064986,
28
- 2554220882,
29
- 2821834349,
30
- 2952996808,
31
- 3210313671,
32
- 3336571891,
33
- 3584528711,
34
- 113926993,
35
- 338241895,
36
- 666307205,
37
- 773529912,
38
- 1294757372,
39
- 1396182291,
40
- 1695183700,
41
- 1986661051,
42
- 2177026350,
43
- 2456956037,
44
- 2730485921,
45
- 2820302411,
46
- 3259730800,
47
- 3345764771,
48
- 3516065817,
49
- 3600352804,
50
- 4094571909,
51
- 275423344,
52
- 430227734,
53
- 506948616,
54
- 659060556,
55
- 883997877,
56
- 958139571,
57
- 1322822218,
58
- 1537002063,
59
- 1747873779,
60
- 1955562222,
61
- 2024104815,
62
- 2227730452,
63
- 2361852424,
64
- 2428436474,
65
- 2756734187,
66
- 3204031479,
67
- 3329325298
68
- ]), h = /* @__PURE__ */ new Uint32Array(64);
69
- class E extends D {
70
- constructor(o = 32) {
71
- super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
72
- }
73
- get() {
74
- const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
75
- return [o, r, t, s, a, f, c, e];
76
- }
77
- // prettier-ignore
78
- set(o, r, t, s, a, f, c, e) {
79
- this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
80
- }
81
- process(o, r) {
82
- for (let x = 0; x < 16; x++, r += 4)
83
- h[x] = o.getUint32(r, !1);
84
- for (let x = 16; x < 64; x++) {
85
- const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
86
- h[x] = l + h[x - 7] + m + h[x - 16] | 0;
87
- }
88
- let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
89
- for (let x = 0; x < 64; x++) {
90
- const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
91
- A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
92
- }
93
- t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
94
- }
95
- roundClean() {
96
- C(h);
97
- }
98
- destroy() {
99
- this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
100
- }
101
- }
102
- const y = /* @__PURE__ */ u(() => new E());
1
+ import { normalizeSignature as o } from "./index231.js";
2
+ import { formatAbiItem as n } from "./index214.js";
3
+ const m = (r) => {
4
+ const t = typeof r == "string" ? r : n(r);
5
+ return o(t);
6
+ };
103
7
  export {
104
- E as SHA256,
105
- y as sha256
8
+ m as toSignature
106
9
  };
package/dist/index231.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index159.cjs"),r=require("./index169.cjs"),c=e=>r.keccak256(t.toBytes(e));function n(e){return c(e)}exports.hashSignature=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index35.cjs");function a(r){let l=!0,i="",o=0,t="",u=!1;for(let n=0;n<r.length;n++){const e=r[n];if(["(",")",","].includes(e)&&(l=!0),e==="("&&o++,e===")"&&o--,!!l){if(o===0){if(e===" "&&["event","function",""].includes(t))t="";else if(t+=e,e===")"){u=!0;break}continue}if(e===" "){r[n-1]!==","&&i!==","&&i!==",("&&(i="",l=!1);continue}t+=e,i+=e}}if(!u)throw new f.BaseError("Unable to normalize signature.");return t}exports.normalizeSignature=a;
package/dist/index231.js CHANGED
@@ -1,9 +1,29 @@
1
- import { toBytes as o } from "./index159.js";
2
- import { keccak256 as r } from "./index169.js";
3
- const e = (t) => r(o(t));
4
- function c(t) {
5
- return e(t);
1
+ import { BaseError as u } from "./index35.js";
2
+ function a(r) {
3
+ let l = !0, i = "", f = 0, t = "", o = !1;
4
+ for (let n = 0; n < r.length; n++) {
5
+ const e = r[n];
6
+ if (["(", ")", ","].includes(e) && (l = !0), e === "(" && f++, e === ")" && f--, !!l) {
7
+ if (f === 0) {
8
+ if (e === " " && ["event", "function", ""].includes(t))
9
+ t = "";
10
+ else if (t += e, e === ")") {
11
+ o = !0;
12
+ break;
13
+ }
14
+ continue;
15
+ }
16
+ if (e === " ") {
17
+ r[n - 1] !== "," && i !== "," && i !== ",(" && (i = "", l = !1);
18
+ continue;
19
+ }
20
+ t += e, i += e;
21
+ }
22
+ }
23
+ if (!o)
24
+ throw new u("Unable to normalize signature.");
25
+ return t;
6
26
  }
7
27
  export {
8
- c as hashSignature
28
+ a as normalizeSignature
9
29
  };
package/dist/index232.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index233.cjs"),n=require("./index214.cjs"),i=t=>{const r=typeof t=="string"?t:n.formatAbiItem(t);return e.normalizeSignature(r)};exports.toSignature=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=BigInt(2**32-1),c=BigInt(32);function u(t,o=!1){return o?{h:Number(t&l),l:Number(t>>c&l)}:{h:Number(t>>c&l)|0,l:Number(t&l)|0}}function B(t,o=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let e=0;e<r;e++){const{h:f,l:s}=u(t[e],o);[n[e],i[e]]=[f,s]}return[n,i]}const g=(t,o,r)=>t<<r|o>>>32-r,m=(t,o,r)=>o<<r|t>>>32-r,S=(t,o,r)=>o<<r-32|t>>>64-r,a=(t,o,r)=>t<<r-32|o>>>64-r;exports.fromBig=u;exports.rotlBH=S;exports.rotlBL=a;exports.rotlSH=g;exports.rotlSL=m;exports.split=B;
package/dist/index232.js CHANGED
@@ -1,9 +1,22 @@
1
- import { normalizeSignature as o } from "./index233.js";
2
- import { formatAbiItem as n } from "./index214.js";
3
- const m = (r) => {
4
- const t = typeof r == "string" ? r : n(r);
5
- return o(t);
6
- };
1
+ const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
2
+ function s(t, r = !1) {
3
+ return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
4
+ }
5
+ function h(t, r = !1) {
6
+ const n = t.length;
7
+ let l = new Uint32Array(n), c = new Uint32Array(n);
8
+ for (let e = 0; e < n; e++) {
9
+ const { h: u, l: f } = s(t[e], r);
10
+ [l[e], c[e]] = [u, f];
11
+ }
12
+ return [l, c];
13
+ }
14
+ const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
7
15
  export {
8
- m as toSignature
16
+ s as fromBig,
17
+ B as rotlBH,
18
+ a as rotlBL,
19
+ m as rotlSH,
20
+ A as rotlSL,
21
+ h as split
9
22
  };
package/dist/index233.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index35.cjs");function a(r){let l=!0,i="",o=0,t="",u=!1;for(let n=0;n<r.length;n++){const e=r[n];if(["(",")",","].includes(e)&&(l=!0),e==="("&&o++,e===")"&&o--,!!l){if(o===0){if(e===" "&&["event","function",""].includes(t))t="";else if(t+=e,e===")"){u=!0;break}continue}if(e===" "){r[n-1]!==","&&i!==","&&i!==",("&&(i="",l=!1);continue}t+=e,i+=e}}if(!u)throw new f.BaseError("Unable to normalize signature.");return t}exports.normalizeSignature=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index238.cjs");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function s(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function u(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function f(t,...e){if(!s(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function h(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");u(t.outputLen),u(t.blockLen)}function g(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function b(t,e){f(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function d(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function m(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function B(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function x(t,e){return t<<32-e|t>>>e}const a=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function y(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function p(t){for(let e=0;e<t.length;e++)t[e]=y(t[e]);return t}const E=a?t=>t:p;function l(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function w(t){return typeof t=="string"&&(t=l(t)),f(t),t}function A(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];f(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const c=t[n];r.set(c,i),i+=c.length}return r}class U{}function L(t){const e=n=>t().update(w(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function H(t=32){if(o.crypto&&typeof o.crypto.getRandomValues=="function")return o.crypto.getRandomValues(new Uint8Array(t));if(o.crypto&&typeof o.crypto.randomBytes=="function")return Uint8Array.from(o.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}exports.Hash=U;exports.abytes=f;exports.aexists=g;exports.ahash=h;exports.anumber=u;exports.aoutput=b;exports.byteSwap=y;exports.byteSwap32=p;exports.clean=m;exports.concatBytes=A;exports.createHasher=L;exports.createView=B;exports.isBytes=s;exports.isLE=a;exports.randomBytes=H;exports.rotr=x;exports.swap32IfBE=E;exports.toBytes=w;exports.u32=d;exports.utf8ToBytes=l;
package/dist/index233.js CHANGED
@@ -1,29 +1,111 @@
1
- import { BaseError as u } from "./index35.js";
2
- function a(r) {
3
- let l = !0, i = "", f = 0, t = "", o = !1;
4
- for (let n = 0; n < r.length; n++) {
5
- const e = r[n];
6
- if (["(", ")", ","].includes(e) && (l = !0), e === "(" && f++, e === ")" && f--, !!l) {
7
- if (f === 0) {
8
- if (e === " " && ["event", "function", ""].includes(t))
9
- t = "";
10
- else if (t += e, e === ")") {
11
- o = !0;
12
- break;
13
- }
14
- continue;
15
- }
16
- if (e === " ") {
17
- r[n - 1] !== "," && i !== "," && i !== ",(" && (i = "", l = !1);
18
- continue;
19
- }
20
- t += e, i += e;
21
- }
1
+ import { crypto as o } from "./index238.js";
2
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ function s(e) {
4
+ return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
5
+ }
6
+ function c(e) {
7
+ if (!Number.isSafeInteger(e) || e < 0)
8
+ throw new Error("positive integer expected, got " + e);
9
+ }
10
+ function i(e, ...t) {
11
+ if (!s(e))
12
+ throw new Error("Uint8Array expected");
13
+ if (t.length > 0 && !t.includes(e.length))
14
+ throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
15
+ }
16
+ function g(e) {
17
+ if (typeof e != "function" || typeof e.create != "function")
18
+ throw new Error("Hash should be wrapped by utils.createHasher");
19
+ c(e.outputLen), c(e.blockLen);
20
+ }
21
+ function d(e, t = !0) {
22
+ if (e.destroyed)
23
+ throw new Error("Hash instance has been destroyed");
24
+ if (t && e.finished)
25
+ throw new Error("Hash#digest() has already been called");
26
+ }
27
+ function b(e, t) {
28
+ i(e);
29
+ const r = t.outputLen;
30
+ if (e.length < r)
31
+ throw new Error("digestInto() expects output buffer of length at least " + r);
32
+ }
33
+ function m(e) {
34
+ return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
35
+ }
36
+ function x(...e) {
37
+ for (let t = 0; t < e.length; t++)
38
+ e[t].fill(0);
39
+ }
40
+ function A(e) {
41
+ return new DataView(e.buffer, e.byteOffset, e.byteLength);
42
+ }
43
+ function E(e, t) {
44
+ return e << 32 - t | e >>> t;
45
+ }
46
+ const a = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
47
+ function l(e) {
48
+ return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
49
+ }
50
+ function y(e) {
51
+ for (let t = 0; t < e.length; t++)
52
+ e[t] = l(e[t]);
53
+ return e;
54
+ }
55
+ const U = a ? (e) => e : y;
56
+ function p(e) {
57
+ if (typeof e != "string")
58
+ throw new Error("string expected");
59
+ return new Uint8Array(new TextEncoder().encode(e));
60
+ }
61
+ function w(e) {
62
+ return typeof e == "string" && (e = p(e)), i(e), e;
63
+ }
64
+ function B(...e) {
65
+ let t = 0;
66
+ for (let n = 0; n < e.length; n++) {
67
+ const f = e[n];
68
+ i(f), t += f.length;
22
69
  }
23
- if (!o)
24
- throw new u("Unable to normalize signature.");
25
- return t;
70
+ const r = new Uint8Array(t);
71
+ for (let n = 0, f = 0; n < e.length; n++) {
72
+ const u = e[n];
73
+ r.set(u, f), f += u.length;
74
+ }
75
+ return r;
76
+ }
77
+ class L {
78
+ }
79
+ function H(e) {
80
+ const t = (n) => e().update(w(n)).digest(), r = e();
81
+ return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = () => e(), t;
82
+ }
83
+ function V(e = 32) {
84
+ if (o && typeof o.getRandomValues == "function")
85
+ return o.getRandomValues(new Uint8Array(e));
86
+ if (o && typeof o.randomBytes == "function")
87
+ return Uint8Array.from(o.randomBytes(e));
88
+ throw new Error("crypto.getRandomValues must be defined");
26
89
  }
27
90
  export {
28
- a as normalizeSignature
91
+ L as Hash,
92
+ i as abytes,
93
+ d as aexists,
94
+ g as ahash,
95
+ c as anumber,
96
+ b as aoutput,
97
+ l as byteSwap,
98
+ y as byteSwap32,
99
+ x as clean,
100
+ B as concatBytes,
101
+ H as createHasher,
102
+ A as createView,
103
+ s as isBytes,
104
+ a as isLE,
105
+ V as randomBytes,
106
+ E as rotr,
107
+ U as swap32IfBE,
108
+ w as toBytes,
109
+ m as u32,
110
+ p as utf8ToBytes
29
111
  };
package/dist/index234.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index236.cjs"),s=require("./index229.cjs"),o=require("./index244.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function c(e){return{hash:e,hmac:(r,...t)=>a.hmac(e,r,s.concatBytes(...t)),randomBytes:s.randomBytes}}function u(e,r){const t=n=>o.weierstrass({...e,...c(n)});return{...t(r),create:t}}exports.createCurve=u;exports.getHash=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index236.cjs"),s=require("./index233.cjs"),o=require("./index244.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function c(e){return{hash:e,hmac:(r,...t)=>a.hmac(e,r,s.concatBytes(...t)),randomBytes:s.randomBytes}}function u(e,r){const t=n=>o.weierstrass({...e,...c(n)});return{...t(r),create:t}}exports.createCurve=u;exports.getHash=c;
package/dist/index234.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { hmac as c } from "./index236.js";
2
- import { randomBytes as m, concatBytes as n } from "./index229.js";
2
+ import { randomBytes as m, concatBytes as n } from "./index233.js";
3
3
  import { weierstrass as a } from "./index244.js";
4
4
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5
5
  function i(r) {
package/dist/index235.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index229.cjs"),a=require("./index245.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d=BigInt(0),f=BigInt(1),h=BigInt(2),K=BigInt(3),I=BigInt(4),L=BigInt(5),T=BigInt(8);function g(t,n){const o=t%n;return o>=d?o:n+o}function Q(t,n,o){let r=t;for(;n-- >d;)r*=r,r%=o;return r}function B(t,n){if(t===d)throw new Error("invert: expected non-zero number");if(n<=d)throw new Error("invert: expected positive modulus, got "+n);let o=g(t,n),r=n,s=d,l=f;for(;o!==d;){const c=r/o,e=r%o,i=s-l*c;r=o,o=e,s=l,l=i}if(r!==f)throw new Error("invert: does not exist");return g(s,n)}function x(t,n){const o=(t.ORDER+f)/I,r=t.pow(n,o);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}function V(t,n){const o=(t.ORDER-L)/T,r=t.mul(n,h),s=t.pow(r,o),l=t.mul(n,s),u=t.mul(t.mul(l,h),s),c=t.mul(l,t.sub(u,t.ONE));if(!t.eql(t.sqr(c),n))throw new Error("Cannot find square root");return c}function _(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let n=t-f,o=0;for(;n%h===d;)n/=h,o++;let r=h;const s=Z(t);for(;y(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return x;let l=s.pow(r,n);const u=(n+f)/h;return function(e,i){if(e.is0(i))return i;if(y(e,i)!==1)throw new Error("Cannot find square root");let w=o,v=e.mul(e.ONE,l),b=e.pow(i,n),E=e.pow(i,u);for(;!e.eql(b,e.ONE);){if(e.is0(b))return e.ZERO;let q=1,m=e.sqr(b);for(;!e.eql(m,e.ONE);)if(q++,m=e.sqr(m),q===w)throw new Error("Cannot find square root");const z=f<<BigInt(w-q-1),S=e.pow(v,z);w=q,v=e.sqr(S),b=e.mul(b,v),E=e.mul(E,S)}return E}}function M(t){return t%I===K?x:t%T===L?V:_(t)}const Y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function k(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},o=Y.reduce((r,s)=>(r[s]="function",r),n);return a.validateObject(t,o)}function O(t,n,o){if(o<d)throw new Error("invalid exponent, negatives unsupported");if(o===d)return t.ONE;if(o===f)return n;let r=t.ONE,s=n;for(;o>d;)o&f&&(r=t.mul(r,s)),s=t.sqr(s),o>>=f;return r}function A(t,n,o=!1){const r=new Array(n.length).fill(o?t.ZERO:void 0),s=n.reduce((u,c,e)=>t.is0(c)?u:(r[e]=u,t.mul(u,c)),t.ONE),l=t.inv(s);return n.reduceRight((u,c,e)=>t.is0(c)?u:(r[e]=t.mul(u,r[e]),t.mul(u,c)),l),r}function y(t,n){const o=(t.ORDER-f)/h,r=t.pow(n,o),s=t.eql(r,t.ONE),l=t.eql(r,t.ZERO),u=t.eql(r,t.neg(t.ONE));if(!s&&!l&&!u)throw new Error("invalid Legendre symbol result");return s?1:l?0:-1}function C(t,n){n!==void 0&&H.anumber(n);const o=n!==void 0?n:t.toString(2).length,r=Math.ceil(o/8);return{nBitLength:o,nByteLength:r}}function Z(t,n,o=!1,r={}){if(t<=d)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:s,nByteLength:l}=C(t,n);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const c=Object.freeze({ORDER:t,isLE:o,BITS:s,BYTES:l,MASK:a.bitMask(s),ZERO:d,ONE:f,create:e=>g(e,t),isValid:e=>{if(typeof e!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof e);return d<=e&&e<t},is0:e=>e===d,isOdd:e=>(e&f)===f,neg:e=>g(-e,t),eql:(e,i)=>e===i,sqr:e=>g(e*e,t),add:(e,i)=>g(e+i,t),sub:(e,i)=>g(e-i,t),mul:(e,i)=>g(e*i,t),pow:(e,i)=>O(c,e,i),div:(e,i)=>g(e*B(i,t),t),sqrN:e=>e*e,addN:(e,i)=>e+i,subN:(e,i)=>e-i,mulN:(e,i)=>e*i,inv:e=>B(e,t),sqrt:r.sqrt||(e=>(u||(u=M(t)),u(c,e))),toBytes:e=>o?a.numberToBytesLE(e,l):a.numberToBytesBE(e,l),fromBytes:e=>{if(e.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+e.length);return o?a.bytesToNumberLE(e):a.bytesToNumberBE(e)},invertBatch:e=>A(c,e),cmov:(e,i,w)=>w?i:e});return Object.freeze(c)}function N(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const n=t.toString(2).length;return Math.ceil(n/8)}function j(t){const n=N(t);return n+Math.ceil(n/2)}function P(t,n,o=!1){const r=t.length,s=N(n),l=j(n);if(r<16||r<l||r>1024)throw new Error("expected "+l+"-1024 bytes of input, got "+r);const u=o?a.bytesToNumberLE(t):a.bytesToNumberBE(t),c=g(u,n-f)+f;return o?a.numberToBytesLE(c,s):a.numberToBytesBE(c,s)}exports.Field=Z;exports.FpInvertBatch=A;exports.FpLegendre=y;exports.FpPow=O;exports.FpSqrt=M;exports.getFieldBytesLength=N;exports.getMinHashLength=j;exports.invert=B;exports.mapHashToField=P;exports.mod=g;exports.nLength=C;exports.pow2=Q;exports.tonelliShanks=_;exports.validateField=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index233.cjs"),a=require("./index245.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d=BigInt(0),f=BigInt(1),h=BigInt(2),K=BigInt(3),I=BigInt(4),L=BigInt(5),T=BigInt(8);function g(t,n){const o=t%n;return o>=d?o:n+o}function Q(t,n,o){let r=t;for(;n-- >d;)r*=r,r%=o;return r}function B(t,n){if(t===d)throw new Error("invert: expected non-zero number");if(n<=d)throw new Error("invert: expected positive modulus, got "+n);let o=g(t,n),r=n,s=d,l=f;for(;o!==d;){const c=r/o,e=r%o,i=s-l*c;r=o,o=e,s=l,l=i}if(r!==f)throw new Error("invert: does not exist");return g(s,n)}function x(t,n){const o=(t.ORDER+f)/I,r=t.pow(n,o);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}function V(t,n){const o=(t.ORDER-L)/T,r=t.mul(n,h),s=t.pow(r,o),l=t.mul(n,s),u=t.mul(t.mul(l,h),s),c=t.mul(l,t.sub(u,t.ONE));if(!t.eql(t.sqr(c),n))throw new Error("Cannot find square root");return c}function _(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let n=t-f,o=0;for(;n%h===d;)n/=h,o++;let r=h;const s=Z(t);for(;y(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return x;let l=s.pow(r,n);const u=(n+f)/h;return function(e,i){if(e.is0(i))return i;if(y(e,i)!==1)throw new Error("Cannot find square root");let w=o,v=e.mul(e.ONE,l),b=e.pow(i,n),E=e.pow(i,u);for(;!e.eql(b,e.ONE);){if(e.is0(b))return e.ZERO;let q=1,m=e.sqr(b);for(;!e.eql(m,e.ONE);)if(q++,m=e.sqr(m),q===w)throw new Error("Cannot find square root");const z=f<<BigInt(w-q-1),S=e.pow(v,z);w=q,v=e.sqr(S),b=e.mul(b,v),E=e.mul(E,S)}return E}}function M(t){return t%I===K?x:t%T===L?V:_(t)}const Y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function k(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},o=Y.reduce((r,s)=>(r[s]="function",r),n);return a.validateObject(t,o)}function O(t,n,o){if(o<d)throw new Error("invalid exponent, negatives unsupported");if(o===d)return t.ONE;if(o===f)return n;let r=t.ONE,s=n;for(;o>d;)o&f&&(r=t.mul(r,s)),s=t.sqr(s),o>>=f;return r}function A(t,n,o=!1){const r=new Array(n.length).fill(o?t.ZERO:void 0),s=n.reduce((u,c,e)=>t.is0(c)?u:(r[e]=u,t.mul(u,c)),t.ONE),l=t.inv(s);return n.reduceRight((u,c,e)=>t.is0(c)?u:(r[e]=t.mul(u,r[e]),t.mul(u,c)),l),r}function y(t,n){const o=(t.ORDER-f)/h,r=t.pow(n,o),s=t.eql(r,t.ONE),l=t.eql(r,t.ZERO),u=t.eql(r,t.neg(t.ONE));if(!s&&!l&&!u)throw new Error("invalid Legendre symbol result");return s?1:l?0:-1}function C(t,n){n!==void 0&&H.anumber(n);const o=n!==void 0?n:t.toString(2).length,r=Math.ceil(o/8);return{nBitLength:o,nByteLength:r}}function Z(t,n,o=!1,r={}){if(t<=d)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:s,nByteLength:l}=C(t,n);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const c=Object.freeze({ORDER:t,isLE:o,BITS:s,BYTES:l,MASK:a.bitMask(s),ZERO:d,ONE:f,create:e=>g(e,t),isValid:e=>{if(typeof e!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof e);return d<=e&&e<t},is0:e=>e===d,isOdd:e=>(e&f)===f,neg:e=>g(-e,t),eql:(e,i)=>e===i,sqr:e=>g(e*e,t),add:(e,i)=>g(e+i,t),sub:(e,i)=>g(e-i,t),mul:(e,i)=>g(e*i,t),pow:(e,i)=>O(c,e,i),div:(e,i)=>g(e*B(i,t),t),sqrN:e=>e*e,addN:(e,i)=>e+i,subN:(e,i)=>e-i,mulN:(e,i)=>e*i,inv:e=>B(e,t),sqrt:r.sqrt||(e=>(u||(u=M(t)),u(c,e))),toBytes:e=>o?a.numberToBytesLE(e,l):a.numberToBytesBE(e,l),fromBytes:e=>{if(e.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+e.length);return o?a.bytesToNumberLE(e):a.bytesToNumberBE(e)},invertBatch:e=>A(c,e),cmov:(e,i,w)=>w?i:e});return Object.freeze(c)}function N(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const n=t.toString(2).length;return Math.ceil(n/8)}function j(t){const n=N(t);return n+Math.ceil(n/2)}function P(t,n,o=!1){const r=t.length,s=N(n),l=j(n);if(r<16||r<l||r>1024)throw new Error("expected "+l+"-1024 bytes of input, got "+r);const u=o?a.bytesToNumberLE(t):a.bytesToNumberBE(t),c=g(u,n-f)+f;return o?a.numberToBytesLE(c,s):a.numberToBytesBE(c,s)}exports.Field=Z;exports.FpInvertBatch=A;exports.FpLegendre=y;exports.FpPow=O;exports.FpSqrt=M;exports.getFieldBytesLength=N;exports.getMinHashLength=j;exports.invert=B;exports.mapHashToField=P;exports.mod=g;exports.nLength=C;exports.pow2=Q;exports.tonelliShanks=_;exports.validateField=k;
package/dist/index235.js CHANGED
@@ -1,4 +1,4 @@
1
- import { anumber as C } from "./index229.js";
1
+ import { anumber as C } from "./index233.js";
2
2
  import { numberToBytesLE as I, numberToBytesBE as y, bitMask as Z, bytesToNumberLE as S, bytesToNumberBE as x, validateObject as z } from "./index245.js";
3
3
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4
4
  const d = BigInt(0), f = BigInt(1), g = /* @__PURE__ */ BigInt(2), j = /* @__PURE__ */ BigInt(3), L = /* @__PURE__ */ BigInt(4), _ = /* @__PURE__ */ BigInt(5), T = /* @__PURE__ */ BigInt(8);
package/dist/index236.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index229.cjs");class r extends i.Hash{constructor(t,h){super(),this.finished=!1,this.destroyed=!1,i.ahash(t);const n=i.toBytes(h);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const a=this.blockLen,e=new Uint8Array(a);e.set(n.length>a?t.create().update(n).digest():n);for(let s=0;s<e.length;s++)e[s]^=54;this.iHash.update(e),this.oHash=t.create();for(let s=0;s<e.length;s++)e[s]^=106;this.oHash.update(e),i.clean(e)}update(t){return i.aexists(this),this.iHash.update(t),this}digestInto(t){i.aexists(this),i.abytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:h,iHash:n,finished:a,destroyed:e,blockLen:s,outputLen:d}=this;return t=t,t.finished=a,t.destroyed=e,t.blockLen=s,t.outputLen=d,t.oHash=h._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const c=(o,t,h)=>new r(o,t).update(h).digest();c.create=(o,t)=>new r(o,t);exports.HMAC=r;exports.hmac=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index233.cjs");class r extends i.Hash{constructor(t,h){super(),this.finished=!1,this.destroyed=!1,i.ahash(t);const n=i.toBytes(h);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const a=this.blockLen,e=new Uint8Array(a);e.set(n.length>a?t.create().update(n).digest():n);for(let s=0;s<e.length;s++)e[s]^=54;this.iHash.update(e),this.oHash=t.create();for(let s=0;s<e.length;s++)e[s]^=106;this.oHash.update(e),i.clean(e)}update(t){return i.aexists(this),this.iHash.update(t),this}digestInto(t){i.aexists(this),i.abytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:h,iHash:n,finished:a,destroyed:e,blockLen:s,outputLen:d}=this;return t=t,t.finished=a,t.destroyed=e,t.blockLen=s,t.outputLen=d,t.oHash=h._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const c=(o,t,h)=>new r(o,t).update(h).digest();c.create=(o,t)=>new r(o,t);exports.HMAC=r;exports.hmac=c;
package/dist/index236.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Hash as d, ahash as u, toBytes as H, clean as l, aexists as a, abytes as p } from "./index229.js";
1
+ import { Hash as d, ahash as u, toBytes as H, clean as l, aexists as a, abytes as p } from "./index233.js";
2
2
  class r extends d {
3
3
  constructor(t, i) {
4
4
  super(), this.finished = !1, this.destroyed = !1, u(t);
package/dist/index237.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index229.cjs");function p(o,t,s,i){if(typeof o.setBigUint64=="function")return o.setBigUint64(t,s,i);const n=BigInt(32),r=BigInt(4294967295),e=Number(s>>n&r),h=Number(s&r),u=i?4:0,l=i?0:4;o.setUint32(t+u,e,i),o.setUint32(t+l,h,i)}function g(o,t,s){return o&t^~o&s}function b(o,t,s){return o&t^o&s^t&s}class d extends f.Hash{constructor(t,s,i,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=s,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=f.createView(this.buffer)}update(t){f.aexists(this),t=f.toBytes(t),f.abytes(t);const{view:s,buffer:i,blockLen:n}=this,r=t.length;for(let e=0;e<r;){const h=Math.min(n-this.pos,r-e);if(h===n){const u=f.createView(t);for(;n<=r-e;e+=n)this.process(u,e);continue}i.set(t.subarray(e,e+h),this.pos),this.pos+=h,e+=h,this.pos===n&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){f.aexists(this),f.aoutput(t,this),this.finished=!0;const{buffer:s,view:i,blockLen:n,isLE:r}=this;let{pos:e}=this;s[e++]=128,f.clean(this.buffer.subarray(e)),this.padOffset>n-e&&(this.process(i,0),e=0);for(let c=e;c<n;c++)s[c]=0;p(i,n-8,BigInt(this.length*8),r),this.process(i,0);const h=f.createView(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,a=this.get();if(l>a.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c<l;c++)h.setUint32(4*c,a[c],r)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const i=t.slice(0,s);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:i,length:n,finished:r,destroyed:e,pos:h}=this;return t.destroyed=e,t.finished=r,t.length=n,t.pos=h,n%s&&t.buffer.set(i),t}clone(){return this._cloneInto()}}const w=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);exports.Chi=g;exports.HashMD=d;exports.Maj=b;exports.SHA256_IV=w;exports.setBigUint64=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index233.cjs");function p(o,t,s,i){if(typeof o.setBigUint64=="function")return o.setBigUint64(t,s,i);const n=BigInt(32),r=BigInt(4294967295),e=Number(s>>n&r),h=Number(s&r),u=i?4:0,l=i?0:4;o.setUint32(t+u,e,i),o.setUint32(t+l,h,i)}function g(o,t,s){return o&t^~o&s}function b(o,t,s){return o&t^o&s^t&s}class d extends f.Hash{constructor(t,s,i,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=s,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=f.createView(this.buffer)}update(t){f.aexists(this),t=f.toBytes(t),f.abytes(t);const{view:s,buffer:i,blockLen:n}=this,r=t.length;for(let e=0;e<r;){const h=Math.min(n-this.pos,r-e);if(h===n){const u=f.createView(t);for(;n<=r-e;e+=n)this.process(u,e);continue}i.set(t.subarray(e,e+h),this.pos),this.pos+=h,e+=h,this.pos===n&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){f.aexists(this),f.aoutput(t,this),this.finished=!0;const{buffer:s,view:i,blockLen:n,isLE:r}=this;let{pos:e}=this;s[e++]=128,f.clean(this.buffer.subarray(e)),this.padOffset>n-e&&(this.process(i,0),e=0);for(let c=e;c<n;c++)s[c]=0;p(i,n-8,BigInt(this.length*8),r),this.process(i,0);const h=f.createView(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,a=this.get();if(l>a.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c<l;c++)h.setUint32(4*c,a[c],r)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const i=t.slice(0,s);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:i,length:n,finished:r,destroyed:e,pos:h}=this;return t.destroyed=e,t.finished=r,t.length=n,t.pos=h,n%s&&t.buffer.set(i),t}clone(){return this._cloneInto()}}const w=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);exports.Chi=g;exports.HashMD=d;exports.Maj=b;exports.SHA256_IV=w;exports.setBigUint64=p;
package/dist/index237.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index229.js";
1
+ import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index233.js";
2
2
  function y(o, t, s, n) {
3
3
  if (typeof o.setBigUint64 == "function")
4
4
  return o.setBigUint64(t, s, n);
package/dist/index242.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index209.cjs");function d(r,i={}){const{dir:n,size:e=32}=i;if(e===0)return r;const t=r.replace("0x","");if(t.length>e*2)throw new a.SizeExceedsPaddingSizeError({size:Math.ceil(t.length/2),targetSize:e,type:"Hex"});return`0x${t[n==="right"?"padEnd":"padStart"](e*2,"0")}`}exports.pad=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index210.cjs");function d(r,i={}){const{dir:n,size:e=32}=i;if(e===0)return r;const t=r.replace("0x","");if(t.length>e*2)throw new a.SizeExceedsPaddingSizeError({size:Math.ceil(t.length/2),targetSize:e,type:"Hex"});return`0x${t[n==="right"?"padEnd":"padStart"](e*2,"0")}`}exports.pad=d;
package/dist/index242.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SizeExceedsPaddingSizeError as a } from "./index209.js";
1
+ import { SizeExceedsPaddingSizeError as a } from "./index210.js";
2
2
  function o(r, i = {}) {
3
3
  const { dir: n, size: e = 32 } = i;
4
4
  if (e === 0)
package/dist/index31.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index209.cjs"),a=require("./index210.cjs");function i(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:e.fromNumber(t.gasLimit)},...typeof t.number=="bigint"&&{number:e.fromNumber(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:e.fromNumber(t.prevRandao)},...typeof t.time=="bigint"&&{time:e.fromNumber(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(a.toRpc)}}}exports.toRpc=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index210.cjs"),a=require("./index211.cjs");function i(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:e.fromNumber(t.gasLimit)},...typeof t.number=="bigint"&&{number:e.fromNumber(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:e.fromNumber(t.prevRandao)},...typeof t.time=="bigint"&&{time:e.fromNumber(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(a.toRpc)}}}exports.toRpc=i;
package/dist/index31.js CHANGED
@@ -1,5 +1,5 @@
1
- import { fromNumber as a } from "./index209.js";
2
- import { toRpc as e } from "./index210.js";
1
+ import { fromNumber as a } from "./index210.js";
2
+ import { toRpc as e } from "./index211.js";
3
3
  function n(t) {
4
4
  return {
5
5
  ...typeof t.baseFeePerGas == "bigint" && {
package/dist/index43.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index37.cjs"),u=require("./index154.cjs"),i=require("./index211.cjs");function l(r,{docsPath:t,...e}){const n=(()=>{const o=i.getNodeError(r,e);return o instanceof u.UnknownNodeError?r:o})();return new c.CallExecutionError(n,{docsPath:t,...e})}exports.getCallError=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index37.cjs"),u=require("./index154.cjs"),i=require("./index209.cjs");function l(r,{docsPath:t,...e}){const n=(()=>{const o=i.getNodeError(r,e);return o instanceof u.UnknownNodeError?r:o})();return new c.CallExecutionError(n,{docsPath:t,...e})}exports.getCallError=l;
package/dist/index43.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CallExecutionError as c } from "./index37.js";
2
2
  import { UnknownNodeError as i } from "./index154.js";
3
- import { getNodeError as u } from "./index211.js";
3
+ import { getNodeError as u } from "./index209.js";
4
4
  function a(r, { docsPath: t, ...o }) {
5
5
  const e = (() => {
6
6
  const n = u(r, o);
package/dist/index63.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index152.cjs"),i=require("./index154.cjs"),u=require("./index211.cjs");function a(e,{docsPath:o,...r}){const n=(()=>{const t=u.getNodeError(e,r);return t instanceof i.UnknownNodeError?e:t})();return new s.EstimateGasExecutionError(n,{docsPath:o,...r})}exports.getEstimateGasError=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index152.cjs"),i=require("./index154.cjs"),u=require("./index209.cjs");function a(e,{docsPath:o,...r}){const n=(()=>{const t=u.getNodeError(e,r);return t instanceof i.UnknownNodeError?e:t})();return new s.EstimateGasExecutionError(n,{docsPath:o,...r})}exports.getEstimateGasError=a;
package/dist/index63.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EstimateGasExecutionError as i } from "./index152.js";
2
2
  import { UnknownNodeError as m } from "./index154.js";
3
- import { getNodeError as s } from "./index211.js";
3
+ import { getNodeError as s } from "./index209.js";
4
4
  function a(r, { docsPath: e, ...o }) {
5
5
  const n = (() => {
6
6
  const t = s(r, o);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/utils",
3
- "version": "2.5.3-beta.7",
3
+ "version": "2.5.3-beta.8",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",