@argent/x-shared 1.78.6 → 1.78.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.
Files changed (28) hide show
  1. package/dist/.ts-temp/tsconfig.tsbuildinfo +1 -1
  2. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.cjs +1 -1
  3. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.js +0 -1
  4. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.cjs +1 -1
  5. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.js +0 -1
  6. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.cjs +1 -1
  7. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.js +0 -1
  8. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.cjs +1 -1
  9. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.js +0 -1
  10. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.cjs +1 -1
  11. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.js +0 -1
  12. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.cjs +1 -1
  13. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.js +0 -1
  14. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.cjs +1 -1
  15. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js +0 -1
  16. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.cjs +1 -1
  17. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.js +0 -1
  18. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.cjs +1 -1
  19. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.js +0 -1
  20. package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.cjs +1 -7
  21. package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.js +0 -7
  22. package/dist/src/tokens/service/types/backend.model.cjs +1 -1
  23. package/dist/src/tokens/service/types/backend.model.d.ts +3 -0
  24. package/dist/src/tokens/service/types/backend.model.js +15 -14
  25. package/dist/src/tokens/service/types/defiPosition.model.d.ts +6 -0
  26. package/dist/src/tokens/service/types/unclaimedRewards.model.d.ts +2 -0
  27. package/dist/src/tokens/service/types/webToken.model.d.ts +1 -0
  28. package/package.json +9 -9
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.cjs"),t=require("../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.cjs");require("./abstract/weierstrass.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function o(e){return{hash:e,hmac:(r,...c)=>n.hmac(e,r,t.concatBytes(...c)),randomBytes:t.randomBytes}}exports.getHash=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.cjs"),t=require("../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.cjs");require("./abstract/weierstrass.cjs");function o(e){return{hash:e,hmac:(r,...c)=>n.hmac(e,r,t.concatBytes(...c)),randomBytes:t.randomBytes}}exports.getHash=o;
@@ -1,7 +1,6 @@
1
1
  import { hmac as m } from "../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.js";
2
2
  import { randomBytes as c, concatBytes as e } from "../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js";
3
3
  import "./abstract/weierstrass.js";
4
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5
4
  function p(t) {
6
5
  return {
7
6
  hash: t,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./modular.cjs"),m=require("./utils.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const O=BigInt(0),u=BigInt(1);function A(o,p){const w=(t,e)=>{const n=e.negate();return t?n:e},g=t=>{const e=Math.ceil(p/t)+1,n=2**(t-1);return{windows:e,windowSize:n}};return{constTimeNegate:w,unsafeLadder(t,e){let n=o.ZERO,a=t;for(;e>O;)e&u&&(n=n.add(a)),a=a.double(),e>>=u;return n},precomputeWindow(t,e){const{windows:n,windowSize:a}=g(e),s=[];let i=t,d=i;for(let c=0;c<n;c++){d=i,s.push(d);for(let l=1;l<a;l++)d=d.add(i),s.push(d);i=d.double()}return s},wNAF(t,e,n){const{windows:a,windowSize:s}=g(t);let i=o.ZERO,d=o.BASE;const c=BigInt(2**t-1),l=2**t,B=BigInt(t);for(let f=0;f<a;f++){const h=f*s;let r=Number(n&c);n>>=B,r>s&&(r-=l,n+=u);const N=h,S=h+Math.abs(r)-1,F=f%2!==0,I=r<0;r===0?d=d.add(w(F,e[N])):i=i.add(w(I,e[S]))}return{p:i,f:d}},wNAFCached(t,e,n,a){const s=t._WINDOW_SIZE||1;let i=e.get(t);return i||(i=this.precomputeWindow(t,s),s!==1&&e.set(t,a(i))),this.wNAF(s,i,n)}}}function y(o){return b.validateField(o.Fp),m.validateObject(o,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...b.nLength(o.n,o.nBitLength),...o,p:o.Fp.ORDER})}exports.validateBasic=y;exports.wNAF=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./modular.cjs"),m=require("./utils.cjs");const O=BigInt(0),u=BigInt(1);function A(o,p){const w=(t,e)=>{const n=e.negate();return t?n:e},g=t=>{const e=Math.ceil(p/t)+1,n=2**(t-1);return{windows:e,windowSize:n}};return{constTimeNegate:w,unsafeLadder(t,e){let n=o.ZERO,a=t;for(;e>O;)e&u&&(n=n.add(a)),a=a.double(),e>>=u;return n},precomputeWindow(t,e){const{windows:n,windowSize:a}=g(e),s=[];let i=t,d=i;for(let c=0;c<n;c++){d=i,s.push(d);for(let l=1;l<a;l++)d=d.add(i),s.push(d);i=d.double()}return s},wNAF(t,e,n){const{windows:a,windowSize:s}=g(t);let i=o.ZERO,d=o.BASE;const c=BigInt(2**t-1),l=2**t,B=BigInt(t);for(let f=0;f<a;f++){const h=f*s;let r=Number(n&c);n>>=B,r>s&&(r-=l,n+=u);const N=h,S=h+Math.abs(r)-1,F=f%2!==0,I=r<0;r===0?d=d.add(w(F,e[N])):i=i.add(w(I,e[S]))}return{p:i,f:d}},wNAFCached(t,e,n,a){const s=t._WINDOW_SIZE||1;let i=e.get(t);return i||(i=this.precomputeWindow(t,s),s!==1&&e.set(t,a(i))),this.wNAF(s,i,n)}}}function y(o){return b.validateField(o.Fp),m.validateObject(o,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...b.nLength(o.n,o.nBitLength),...o,p:o.Fp.ORDER})}exports.validateBasic=y;exports.wNAF=A;
@@ -1,6 +1,5 @@
1
1
  import { validateField as F, nLength as S } from "./modular.js";
2
2
  import { validateObject as O } from "./utils.js";
3
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4
3
  const A = BigInt(0), g = BigInt(1);
5
4
  function z(i, u) {
6
5
  const l = (t, n) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./utils.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const f=BigInt(0),u=BigInt(1),h=BigInt(2),M=BigInt(3),b=BigInt(4),y=BigInt(5),m=BigInt(8);BigInt(9);BigInt(16);function a(e,o){const n=e%o;return n>=f?n:o+n}function T(e,o,n){if(n<=f||o<f)throw new Error("Expected power/modulo > 0");if(n===u)return f;let r=u;for(;o>f;)o&u&&(r=r*e%n),e=e*e%n,o>>=u;return r}function N(e,o){if(e===f||o<=f)throw new Error(`invert: expected positive integers, got n=${e} mod=${o}`);let n=a(e,o),r=o,s=f,c=u;for(;n!==f;){const i=r/n,t=r%n,l=s-c*i;r=n,n=t,s=c,c=l}if(r!==u)throw new Error("invert: does not exist");return a(s,o)}function L(e){const o=(e-u)/h;let n,r,s;for(n=e-u,r=0;n%h===f;n/=h,r++);for(s=h;s<e&&T(s,o,e)!==e-u;s++);if(r===1){const d=(e+u)/b;return function(t,l){const w=t.pow(l,d);if(!t.eql(t.sqr(w),l))throw new Error("Cannot find square root");return w}}const c=(n+u)/h;return function(i,t){if(i.pow(t,o)===i.neg(i.ONE))throw new Error("Cannot find square root");let l=r,w=i.pow(i.mul(i.ONE,s),n),v=i.pow(t,c),q=i.pow(t,n);for(;!i.eql(q,i.ONE);){if(i.eql(q,i.ZERO))return i.ZERO;let B=1;for(let E=i.sqr(q);B<l&&!i.eql(E,i.ONE);B++)E=i.sqr(E);const I=i.pow(w,u<<BigInt(l-B-1));w=i.sqr(I),v=i.mul(v,I),q=i.mul(q,w),l=B}return v}}function x(e){if(e%b===M){const o=(e+u)/b;return function(r,s){const c=r.pow(s,o);if(!r.eql(r.sqr(c),s))throw new Error("Cannot find square root");return c}}if(e%m===y){const o=(e-y)/m;return function(r,s){const c=r.mul(s,h),d=r.pow(c,o),i=r.mul(s,d),t=r.mul(r.mul(i,h),d),l=r.mul(i,r.sub(t,r.ONE));if(!r.eql(r.sqr(l),s))throw new Error("Cannot find square root");return l}}return L(e)}const C=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function j(e){const o={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=C.reduce((r,s)=>(r[s]="function",r),o);return g.validateObject(e,n)}function _(e,o,n){if(n<f)throw new Error("Expected power > 0");if(n===f)return e.ONE;if(n===u)return o;let r=e.ONE,s=o;for(;n>f;)n&u&&(r=e.mul(r,s)),s=e.sqr(s),n>>=u;return r}function $(e,o){const n=new Array(o.length),r=o.reduce((c,d,i)=>e.is0(d)?c:(n[i]=c,e.mul(c,d)),e.ONE),s=e.inv(r);return o.reduceRight((c,d,i)=>e.is0(d)?c:(n[i]=e.mul(c,n[i]),e.mul(c,d)),s),n}function S(e,o){const n=o!==void 0?o:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function k(e,o,n=!1,r={}){if(e<=f)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:c}=S(e,o);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const d=x(e),i=Object.freeze({ORDER:e,BITS:s,BYTES:c,MASK:g.bitMask(s),ZERO:f,ONE:u,create:t=>a(t,e),isValid:t=>{if(typeof t!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof t}`);return f<=t&&t<e},is0:t=>t===f,isOdd:t=>(t&u)===u,neg:t=>a(-t,e),eql:(t,l)=>t===l,sqr:t=>a(t*t,e),add:(t,l)=>a(t+l,e),sub:(t,l)=>a(t-l,e),mul:(t,l)=>a(t*l,e),pow:(t,l)=>_(i,t,l),div:(t,l)=>a(t*N(l,e),e),sqrN:t=>t*t,addN:(t,l)=>t+l,subN:(t,l)=>t-l,mulN:(t,l)=>t*l,inv:t=>N(t,e),sqrt:r.sqrt||(t=>d(i,t)),invertBatch:t=>$(i,t),cmov:(t,l,w)=>w?l:t,toBytes:t=>n?g.numberToBytesLE(t,c):g.numberToBytesBE(t,c),fromBytes:t=>{if(t.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${t.length}`);return n?g.bytesToNumberLE(t):g.bytesToNumberBE(t)}});return Object.freeze(i)}function O(e,o,n=!1){e=g.ensureBytes("privateHash",e);const r=e.length,s=S(o).nByteLength+8;if(s<24||r<s||r>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${r}`);const c=n?g.bytesToNumberLE(e):g.bytesToNumberBE(e);return a(c,o-u)+u}exports.Field=k;exports.FpInvertBatch=$;exports.FpPow=_;exports.FpSqrt=x;exports.hashToPrivateScalar=O;exports.invert=N;exports.mod=a;exports.nLength=S;exports.pow=T;exports.tonelliShanks=L;exports.validateField=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./utils.cjs");const f=BigInt(0),u=BigInt(1),h=BigInt(2),M=BigInt(3),b=BigInt(4),y=BigInt(5),m=BigInt(8);BigInt(9);BigInt(16);function a(e,o){const n=e%o;return n>=f?n:o+n}function T(e,o,n){if(n<=f||o<f)throw new Error("Expected power/modulo > 0");if(n===u)return f;let r=u;for(;o>f;)o&u&&(r=r*e%n),e=e*e%n,o>>=u;return r}function N(e,o){if(e===f||o<=f)throw new Error(`invert: expected positive integers, got n=${e} mod=${o}`);let n=a(e,o),r=o,s=f,c=u;for(;n!==f;){const i=r/n,t=r%n,l=s-c*i;r=n,n=t,s=c,c=l}if(r!==u)throw new Error("invert: does not exist");return a(s,o)}function L(e){const o=(e-u)/h;let n,r,s;for(n=e-u,r=0;n%h===f;n/=h,r++);for(s=h;s<e&&T(s,o,e)!==e-u;s++);if(r===1){const d=(e+u)/b;return function(t,l){const w=t.pow(l,d);if(!t.eql(t.sqr(w),l))throw new Error("Cannot find square root");return w}}const c=(n+u)/h;return function(i,t){if(i.pow(t,o)===i.neg(i.ONE))throw new Error("Cannot find square root");let l=r,w=i.pow(i.mul(i.ONE,s),n),v=i.pow(t,c),q=i.pow(t,n);for(;!i.eql(q,i.ONE);){if(i.eql(q,i.ZERO))return i.ZERO;let B=1;for(let E=i.sqr(q);B<l&&!i.eql(E,i.ONE);B++)E=i.sqr(E);const I=i.pow(w,u<<BigInt(l-B-1));w=i.sqr(I),v=i.mul(v,I),q=i.mul(q,w),l=B}return v}}function x(e){if(e%b===M){const o=(e+u)/b;return function(r,s){const c=r.pow(s,o);if(!r.eql(r.sqr(c),s))throw new Error("Cannot find square root");return c}}if(e%m===y){const o=(e-y)/m;return function(r,s){const c=r.mul(s,h),d=r.pow(c,o),i=r.mul(s,d),t=r.mul(r.mul(i,h),d),l=r.mul(i,r.sub(t,r.ONE));if(!r.eql(r.sqr(l),s))throw new Error("Cannot find square root");return l}}return L(e)}const C=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function j(e){const o={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=C.reduce((r,s)=>(r[s]="function",r),o);return g.validateObject(e,n)}function _(e,o,n){if(n<f)throw new Error("Expected power > 0");if(n===f)return e.ONE;if(n===u)return o;let r=e.ONE,s=o;for(;n>f;)n&u&&(r=e.mul(r,s)),s=e.sqr(s),n>>=u;return r}function $(e,o){const n=new Array(o.length),r=o.reduce((c,d,i)=>e.is0(d)?c:(n[i]=c,e.mul(c,d)),e.ONE),s=e.inv(r);return o.reduceRight((c,d,i)=>e.is0(d)?c:(n[i]=e.mul(c,n[i]),e.mul(c,d)),s),n}function S(e,o){const n=o!==void 0?o:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function k(e,o,n=!1,r={}){if(e<=f)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:c}=S(e,o);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const d=x(e),i=Object.freeze({ORDER:e,BITS:s,BYTES:c,MASK:g.bitMask(s),ZERO:f,ONE:u,create:t=>a(t,e),isValid:t=>{if(typeof t!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof t}`);return f<=t&&t<e},is0:t=>t===f,isOdd:t=>(t&u)===u,neg:t=>a(-t,e),eql:(t,l)=>t===l,sqr:t=>a(t*t,e),add:(t,l)=>a(t+l,e),sub:(t,l)=>a(t-l,e),mul:(t,l)=>a(t*l,e),pow:(t,l)=>_(i,t,l),div:(t,l)=>a(t*N(l,e),e),sqrN:t=>t*t,addN:(t,l)=>t+l,subN:(t,l)=>t-l,mulN:(t,l)=>t*l,inv:t=>N(t,e),sqrt:r.sqrt||(t=>d(i,t)),invertBatch:t=>$(i,t),cmov:(t,l,w)=>w?l:t,toBytes:t=>n?g.numberToBytesLE(t,c):g.numberToBytesBE(t,c),fromBytes:t=>{if(t.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${t.length}`);return n?g.bytesToNumberLE(t):g.bytesToNumberBE(t)}});return Object.freeze(i)}function O(e,o,n=!1){e=g.ensureBytes("privateHash",e);const r=e.length,s=S(o).nByteLength+8;if(s<24||r<s||r>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${r}`);const c=n?g.bytesToNumberLE(e):g.bytesToNumberBE(e);return a(c,o-u)+u}exports.Field=k;exports.FpInvertBatch=$;exports.FpPow=_;exports.FpSqrt=x;exports.hashToPrivateScalar=O;exports.invert=N;exports.mod=a;exports.nLength=S;exports.pow=T;exports.tonelliShanks=L;exports.validateField=j;
@@ -1,5 +1,4 @@
1
1
  import { numberToBytesLE as L, numberToBytesBE as T, bitMask as _, bytesToNumberLE as y, bytesToNumberBE as m, ensureBytes as $, validateObject as C } from "./utils.js";
2
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
2
  const f = BigInt(0), u = BigInt(1), w = BigInt(2), M = BigInt(3), E = BigInt(4), b = BigInt(5), I = BigInt(8);
4
3
  BigInt(9);
5
4
  BigInt(16);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./modular.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function c(r){const{Fp:e}=r;h.validateField(e);for(const n of["t","roundsFull","roundsPartial"])if(typeof r[n]!="number"||!Number.isSafeInteger(r[n]))throw new Error(`Poseidon: invalid param ${n}=${r[n]} (${typeof r[n]})`);if(r.reversePartialPowIdx!==void 0&&typeof r.reversePartialPowIdx!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${r.reversePartialPowIdx}`);let t=r.sboxPower;if(t===void 0&&(t=5),typeof t!="number"||!Number.isSafeInteger(t))throw new Error(`Poseidon wrong sboxPower=${t}`);const f=BigInt(t);let u=n=>h.FpPow(e,n,f);if(t===3?u=n=>e.mul(e.sqrN(n),n):t===5&&(u=n=>e.mul(e.sqrN(e.sqrN(n)),n)),r.roundsFull%2!==0)throw new Error(`Poseidon roundsFull is not even: ${r.roundsFull}`);const w=r.roundsFull+r.roundsPartial;if(!Array.isArray(r.roundConstants)||r.roundConstants.length!==w)throw new Error("Poseidon: wrong round constants");const l=r.roundConstants.map(n=>{if(!Array.isArray(n)||n.length!==r.t)throw new Error(`Poseidon wrong round constants: ${n}`);return n.map(d=>{if(typeof d!="bigint"||!e.isValid(d))throw new Error(`Poseidon wrong round constant=${d}`);return e.create(d)})});if(!Array.isArray(r.mds)||r.mds.length!==r.t)throw new Error("Poseidon: wrong MDS matrix");const P=r.mds.map(n=>{if(!Array.isArray(n)||n.length!==r.t)throw new Error(`Poseidon MDS matrix row: ${n}`);return n.map(d=>{if(typeof d!="bigint")throw new Error(`Poseidon MDS matrix value=${d}`);return e.create(d)})});return Object.freeze({...r,rounds:w,sboxFn:u,roundConstants:l,mds:P})}function b(r){const{t:e,Fp:t,rounds:f,sboxFn:u,reversePartialPowIdx:w}=c(r),l=Math.floor(r.roundsFull/2),P=w?e-1:0,n=(a,i,s)=>(a=a.map((o,m)=>t.add(o,r.roundConstants[s][m])),i?a=a.map(o=>u(o)):a[P]=u(a[P]),a=r.mds.map(o=>o.reduce((m,g,y)=>t.add(m,t.mulN(g,a[y])),t.ZERO)),a),d=function(i){if(!Array.isArray(i)||i.length!==e)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${e})`);i=i.map(o=>{if(typeof o!="bigint")throw new Error(`Poseidon: wrong value=${o} (${typeof o})`);return t.create(o)});let s=0;for(let o=0;o<l;o++)i=n(i,!0,s++);for(let o=0;o<r.roundsPartial;o++)i=n(i,!1,s++);for(let o=0;o<l;o++)i=n(i,!0,s++);if(s!==f)throw new Error(`Poseidon: wrong number of rounds: last round=${s}, total=${f}`);return i};return d.roundConstants=r.roundConstants,d}exports.poseidon=b;exports.validateOpts=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./modular.cjs");function c(r){const{Fp:e}=r;h.validateField(e);for(const n of["t","roundsFull","roundsPartial"])if(typeof r[n]!="number"||!Number.isSafeInteger(r[n]))throw new Error(`Poseidon: invalid param ${n}=${r[n]} (${typeof r[n]})`);if(r.reversePartialPowIdx!==void 0&&typeof r.reversePartialPowIdx!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${r.reversePartialPowIdx}`);let t=r.sboxPower;if(t===void 0&&(t=5),typeof t!="number"||!Number.isSafeInteger(t))throw new Error(`Poseidon wrong sboxPower=${t}`);const f=BigInt(t);let u=n=>h.FpPow(e,n,f);if(t===3?u=n=>e.mul(e.sqrN(n),n):t===5&&(u=n=>e.mul(e.sqrN(e.sqrN(n)),n)),r.roundsFull%2!==0)throw new Error(`Poseidon roundsFull is not even: ${r.roundsFull}`);const w=r.roundsFull+r.roundsPartial;if(!Array.isArray(r.roundConstants)||r.roundConstants.length!==w)throw new Error("Poseidon: wrong round constants");const l=r.roundConstants.map(n=>{if(!Array.isArray(n)||n.length!==r.t)throw new Error(`Poseidon wrong round constants: ${n}`);return n.map(d=>{if(typeof d!="bigint"||!e.isValid(d))throw new Error(`Poseidon wrong round constant=${d}`);return e.create(d)})});if(!Array.isArray(r.mds)||r.mds.length!==r.t)throw new Error("Poseidon: wrong MDS matrix");const P=r.mds.map(n=>{if(!Array.isArray(n)||n.length!==r.t)throw new Error(`Poseidon MDS matrix row: ${n}`);return n.map(d=>{if(typeof d!="bigint")throw new Error(`Poseidon MDS matrix value=${d}`);return e.create(d)})});return Object.freeze({...r,rounds:w,sboxFn:u,roundConstants:l,mds:P})}function b(r){const{t:e,Fp:t,rounds:f,sboxFn:u,reversePartialPowIdx:w}=c(r),l=Math.floor(r.roundsFull/2),P=w?e-1:0,n=(a,i,s)=>(a=a.map((o,m)=>t.add(o,r.roundConstants[s][m])),i?a=a.map(o=>u(o)):a[P]=u(a[P]),a=r.mds.map(o=>o.reduce((m,g,y)=>t.add(m,t.mulN(g,a[y])),t.ZERO)),a),d=function(i){if(!Array.isArray(i)||i.length!==e)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${e})`);i=i.map(o=>{if(typeof o!="bigint")throw new Error(`Poseidon: wrong value=${o} (${typeof o})`);return t.create(o)});let s=0;for(let o=0;o<l;o++)i=n(i,!0,s++);for(let o=0;o<r.roundsPartial;o++)i=n(i,!1,s++);for(let o=0;o<l;o++)i=n(i,!0,s++);if(s!==f)throw new Error(`Poseidon: wrong number of rounds: last round=${s}, total=${f}`);return i};return d.roundConstants=r.roundConstants,d}exports.poseidon=b;exports.validateOpts=c;
@@ -1,5 +1,4 @@
1
1
  import { validateField as c, FpPow as y } from "./modular.js";
2
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
2
  function b(r) {
4
3
  const { Fp: e } = r;
5
4
  c(e);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const p=BigInt(0),y=BigInt(1),v=BigInt(2),g=t=>t instanceof Uint8Array,U=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function w(t){if(!g(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=U[t[r]];return e}function B(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function h(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function b(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(t.length%2)throw new Error("hex string is invalid: unpadded "+t.length);const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=r*2,o=t.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("invalid byte sequence");e[r]=i}return e}function $(t){return h(w(t))}function A(t){if(!g(t))throw new Error("Uint8Array expected");return h(w(Uint8Array.from(t).reverse()))}const E=(t,e)=>b(t.toString(16).padStart(e*2,"0")),I=(t,e)=>E(t,e).reverse(),N=t=>b(B(t));function S(t,e,r){let n;if(typeof e=="string")try{n=b(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(g(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(`${t} expected ${r} bytes, got ${o}`);return n}function T(...t){const e=new Uint8Array(t.reduce((n,o)=>n+o.length,0));let r=0;return t.forEach(n=>{if(!g(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function H(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function k(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}function O(t){let e;for(e=0;t>p;t>>=y,e+=1);return e}const j=(t,e)=>t>>BigInt(e)&y,V=(t,e,r)=>t|(r?y:p)<<BigInt(e),F=t=>(v<<BigInt(t-1))-y,d=t=>new Uint8Array(t),m=t=>Uint8Array.from(t);function M(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=d(t),o=d(t),i=0;const c=()=>{n.fill(1),o.fill(0),i=0},u=(...s)=>r(o,n,...s),f=(s=d())=>{o=u(m([0]),s),n=u(),s.length!==0&&(o=u(m([1]),s),n=u())},x=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let s=0;const a=[];for(;s<e;){n=u();const l=n.slice();a.push(l),s+=n.length}return T(...a)};return(s,a)=>{c(),f(s);let l;for(;!(l=a(x()));)f();return c(),l}}const _={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function q(t,e,r={}){const n=(o,i,c)=>{const u=_[i];if(typeof u!="function")throw new Error(`Invalid validator "${i}", expected function`);const f=t[o];if(!(c&&f===void 0)&&!u(f,t))throw new Error(`Invalid param ${String(o)}=${f} (${typeof f}), expected ${i}`)};for(const[o,i]of Object.entries(e))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return t}exports.bitGet=j;exports.bitLen=O;exports.bitMask=F;exports.bitSet=V;exports.bytesToHex=w;exports.bytesToNumberBE=$;exports.bytesToNumberLE=A;exports.concatBytes=T;exports.createHmacDrbg=M;exports.ensureBytes=S;exports.equalBytes=H;exports.hexToBytes=b;exports.hexToNumber=h;exports.numberToBytesBE=E;exports.numberToBytesLE=I;exports.numberToHexUnpadded=B;exports.numberToVarBytesBE=N;exports.utf8ToBytes=k;exports.validateObject=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=BigInt(0),y=BigInt(1),v=BigInt(2),g=t=>t instanceof Uint8Array,U=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function w(t){if(!g(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=U[t[r]];return e}function B(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function h(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function b(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(t.length%2)throw new Error("hex string is invalid: unpadded "+t.length);const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=r*2,o=t.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("invalid byte sequence");e[r]=i}return e}function $(t){return h(w(t))}function A(t){if(!g(t))throw new Error("Uint8Array expected");return h(w(Uint8Array.from(t).reverse()))}const E=(t,e)=>b(t.toString(16).padStart(e*2,"0")),I=(t,e)=>E(t,e).reverse(),N=t=>b(B(t));function S(t,e,r){let n;if(typeof e=="string")try{n=b(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(g(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(`${t} expected ${r} bytes, got ${o}`);return n}function T(...t){const e=new Uint8Array(t.reduce((n,o)=>n+o.length,0));let r=0;return t.forEach(n=>{if(!g(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function H(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function k(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}function O(t){let e;for(e=0;t>p;t>>=y,e+=1);return e}const j=(t,e)=>t>>BigInt(e)&y,V=(t,e,r)=>t|(r?y:p)<<BigInt(e),F=t=>(v<<BigInt(t-1))-y,d=t=>new Uint8Array(t),m=t=>Uint8Array.from(t);function M(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=d(t),o=d(t),i=0;const c=()=>{n.fill(1),o.fill(0),i=0},u=(...s)=>r(o,n,...s),f=(s=d())=>{o=u(m([0]),s),n=u(),s.length!==0&&(o=u(m([1]),s),n=u())},x=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let s=0;const a=[];for(;s<e;){n=u();const l=n.slice();a.push(l),s+=n.length}return T(...a)};return(s,a)=>{c(),f(s);let l;for(;!(l=a(x()));)f();return c(),l}}const _={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function q(t,e,r={}){const n=(o,i,c)=>{const u=_[i];if(typeof u!="function")throw new Error(`Invalid validator "${i}", expected function`);const f=t[o];if(!(c&&f===void 0)&&!u(f,t))throw new Error(`Invalid param ${String(o)}=${f} (${typeof f}), expected ${i}`)};for(const[o,i]of Object.entries(e))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return t}exports.bitGet=j;exports.bitLen=O;exports.bitMask=F;exports.bitSet=V;exports.bytesToHex=w;exports.bytesToNumberBE=$;exports.bytesToNumberLE=A;exports.concatBytes=T;exports.createHmacDrbg=M;exports.ensureBytes=S;exports.equalBytes=H;exports.hexToBytes=b;exports.hexToNumber=h;exports.numberToBytesBE=E;exports.numberToBytesLE=I;exports.numberToHexUnpadded=B;exports.numberToVarBytesBE=N;exports.utf8ToBytes=k;exports.validateObject=q;
@@ -1,4 +1,3 @@
1
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
1
  const h = BigInt(0), g = BigInt(1), B = BigInt(2), y = (t) => t instanceof Uint8Array, $ = Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
3
2
  function b(t) {
4
3
  if (!y(t))
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./modular.cjs"),m=require("./utils.cjs"),et=require("./curve.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function at(v){const n=et.validateBasic(v);m.validateObject(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:x,a:O}=n;if(t){if(!x.eql(O,x.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:ct,hexToBytes:ut}=m,$={Err:class extends Error{constructor(n=""){super(n)}},_parseInt(v){const{Err:n}=$;if(v.length<2||v[0]!==2)throw new n("Invalid signature integer tag");const t=v[1],x=v.subarray(2,t+2);if(!t||x.length!==t)throw new n("Invalid signature integer: wrong length");if(x[0]&128)throw new n("Invalid signature integer: negative");if(x[0]===0&&!(x[1]&128))throw new n("Invalid signature integer: unnecessary leading zero");return{d:ct(x),l:v.subarray(t+2)}},toSig(v){const{Err:n}=$,t=typeof v=="string"?ut(v):v;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let x=t.length;if(x<2||t[0]!=48)throw new n("Invalid signature tag");if(t[1]!==x-2)throw new n("Invalid signature: incorrect length");const{d:O,l:T}=$._parseInt(t.subarray(2)),{d:F,l:R}=$._parseInt(T);if(R.length)throw new n("Invalid signature: left bytes after parsing");return{r:O,s:F}},hexFromSig(v){const n=S=>Number.parseInt(S[0],16)&8?"00"+S:S,t=S=>{const V=S.toString(16);return V.length&1?`0${V}`:V},x=n(t(v.s)),O=n(t(v.r)),T=x.length/2,F=O.length/2,R=t(T),L=t(F);return`30${t(F+T+4)}02${L}${O}02${R}${x}`}},P=BigInt(0),U=BigInt(1);BigInt(2);const ot=BigInt(3);BigInt(4);function it(v){const n=at(v),{Fp:t}=n,x=n.toBytes||((y,r,i)=>{const o=r.toAffine();return m.concatBytes(Uint8Array.from([4]),t.toBytes(o.x),t.toBytes(o.y))}),O=n.fromBytes||(y=>{const r=y.subarray(1),i=t.fromBytes(r.subarray(0,t.BYTES)),o=t.fromBytes(r.subarray(t.BYTES,2*t.BYTES));return{x:i,y:o}});function T(y){const{a:r,b:i}=n,o=t.sqr(y),u=t.mul(o,y);return t.add(t.add(u,t.mul(y,r)),i)}if(!t.eql(t.sqr(n.Gy),T(n.Gx)))throw new Error("bad generator point: equation left != right");function F(y){return typeof y=="bigint"&&P<y&&y<n.n}function R(y){if(!F(y))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function L(y){const{allowedPrivateKeyLengths:r,nByteLength:i,wrapPrivateKey:o,n:u}=n;if(r&&typeof y!="bigint"){if(y instanceof Uint8Array&&(y=m.bytesToHex(y)),typeof y!="string"||!r.includes(y.length))throw new Error("Invalid key");y=y.padStart(i*2,"0")}let f;try{f=typeof y=="bigint"?y:m.bytesToNumberBE(m.ensureBytes("private key",y,i))}catch{throw new Error(`private key must be ${i} bytes, hex or bigint, not ${typeof y}`)}return o&&(f=_.mod(f,u)),R(f),f}const S=new Map;function V(y){if(!(y instanceof w))throw new Error("ProjectivePoint expected")}class w{constructor(r,i,o){if(this.px=r,this.py=i,this.pz=o,r==null||!t.isValid(r))throw new Error("x required");if(i==null||!t.isValid(i))throw new Error("y required");if(o==null||!t.isValid(o))throw new Error("z required")}static fromAffine(r){const{x:i,y:o}=r||{};if(!r||!t.isValid(i)||!t.isValid(o))throw new Error("invalid affine point");if(r instanceof w)throw new Error("projective point not allowed");const u=f=>t.eql(f,t.ZERO);return u(i)&&u(o)?w.ZERO:new w(i,o,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(r){const i=t.invertBatch(r.map(o=>o.pz));return r.map((o,u)=>o.toAffine(i[u])).map(w.fromAffine)}static fromHex(r){const i=w.fromAffine(O(m.ensureBytes("pointHex",r)));return i.assertValidity(),i}static fromPrivateKey(r){return w.BASE.multiply(L(r))}_setWindowSize(r){this._WINDOW_SIZE=r,S.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:r,y:i}=this.toAffine();if(!t.isValid(r)||!t.isValid(i))throw new Error("bad point: x or y not FE");const o=t.sqr(i),u=T(r);if(!t.eql(o,u))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:r}=this.toAffine();if(t.isOdd)return!t.isOdd(r);throw new Error("Field doesn't support isOdd")}equals(r){V(r);const{px:i,py:o,pz:u}=this,{px:f,py:g,pz:h}=r,a=t.eql(t.mul(i,h),t.mul(f,u)),c=t.eql(t.mul(o,h),t.mul(g,u));return a&&c}negate(){return new w(this.px,t.neg(this.py),this.pz)}double(){const{a:r,b:i}=n,o=t.mul(i,ot),{px:u,py:f,pz:g}=this;let h=t.ZERO,a=t.ZERO,c=t.ZERO,d=t.mul(u,u),q=t.mul(f,f),B=t.mul(g,g),p=t.mul(u,f);return p=t.add(p,p),c=t.mul(u,g),c=t.add(c,c),h=t.mul(r,c),a=t.mul(o,B),a=t.add(h,a),h=t.sub(q,a),a=t.add(q,a),a=t.mul(h,a),h=t.mul(p,h),c=t.mul(o,c),B=t.mul(r,B),p=t.sub(d,B),p=t.mul(r,p),p=t.add(p,c),c=t.add(d,d),d=t.add(c,d),d=t.add(d,B),d=t.mul(d,p),a=t.add(a,d),B=t.mul(f,g),B=t.add(B,B),d=t.mul(B,p),h=t.sub(h,d),c=t.mul(B,q),c=t.add(c,c),c=t.add(c,c),new w(h,a,c)}add(r){V(r);const{px:i,py:o,pz:u}=this,{px:f,py:g,pz:h}=r;let a=t.ZERO,c=t.ZERO,d=t.ZERO;const q=n.a,B=t.mul(n.b,ot);let p=t.mul(i,f),N=t.mul(o,g),Z=t.mul(u,h),H=t.add(i,o),e=t.add(f,g);H=t.mul(H,e),e=t.add(p,N),H=t.sub(H,e),e=t.add(i,u);let s=t.add(f,h);return e=t.mul(e,s),s=t.add(p,Z),e=t.sub(e,s),s=t.add(o,u),a=t.add(g,h),s=t.mul(s,a),a=t.add(N,Z),s=t.sub(s,a),d=t.mul(q,e),a=t.mul(B,Z),d=t.add(a,d),a=t.sub(N,d),d=t.add(N,d),c=t.mul(a,d),N=t.add(p,p),N=t.add(N,p),Z=t.mul(q,Z),e=t.mul(B,e),N=t.add(N,Z),Z=t.sub(p,Z),Z=t.mul(q,Z),e=t.add(e,Z),p=t.mul(N,e),c=t.add(c,p),p=t.mul(s,e),a=t.mul(H,a),a=t.sub(a,p),p=t.mul(H,N),d=t.mul(s,d),d=t.add(d,p),new w(a,c,d)}subtract(r){return this.add(r.negate())}is0(){return this.equals(w.ZERO)}wNAF(r){return C.wNAFCached(this,S,r,i=>{const o=t.invertBatch(i.map(u=>u.pz));return i.map((u,f)=>u.toAffine(o[f])).map(w.fromAffine)})}multiplyUnsafe(r){const i=w.ZERO;if(r===P)return i;if(R(r),r===U)return this;const{endo:o}=n;if(!o)return C.unsafeLadder(this,r);let{k1neg:u,k1:f,k2neg:g,k2:h}=o.splitScalar(r),a=i,c=i,d=this;for(;f>P||h>P;)f&U&&(a=a.add(d)),h&U&&(c=c.add(d)),d=d.double(),f>>=U,h>>=U;return u&&(a=a.negate()),g&&(c=c.negate()),c=new w(t.mul(c.px,o.beta),c.py,c.pz),a.add(c)}multiply(r){R(r);let i=r,o,u;const{endo:f}=n;if(f){const{k1neg:g,k1:h,k2neg:a,k2:c}=f.splitScalar(i);let{p:d,f:q}=this.wNAF(h),{p:B,f:p}=this.wNAF(c);d=C.constTimeNegate(g,d),B=C.constTimeNegate(a,B),B=new w(t.mul(B.px,f.beta),B.py,B.pz),o=d.add(B),u=q.add(p)}else{const{p:g,f:h}=this.wNAF(i);o=g,u=h}return w.normalizeZ([o,u])[0]}multiplyAndAddUnsafe(r,i,o){const u=w.BASE,f=(h,a)=>a===P||a===U||!h.equals(u)?h.multiplyUnsafe(a):h.multiply(a),g=f(this,i).add(f(r,o));return g.is0()?void 0:g}toAffine(r){const{px:i,py:o,pz:u}=this,f=this.is0();r==null&&(r=f?t.ONE:t.inv(u));const g=t.mul(i,r),h=t.mul(o,r),a=t.mul(u,r);if(f)return{x:t.ZERO,y:t.ZERO};if(!t.eql(a,t.ONE))throw new Error("invZ was invalid");return{x:g,y:h}}isTorsionFree(){const{h:r,isTorsionFree:i}=n;if(r===U)return!0;if(i)return i(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:r,clearCofactor:i}=n;return r===U?this:i?i(w,this):this.multiplyUnsafe(n.h)}toRawBytes(r=!0){return this.assertValidity(),x(w,this,r)}toHex(r=!0){return m.bytesToHex(this.toRawBytes(r))}}w.BASE=new w(n.Gx,n.Gy,t.ONE),w.ZERO=new w(t.ZERO,t.ONE,t.ZERO);const W=n.nBitLength,C=et.wNAF(w,n.endo?Math.ceil(W/2):W);return{CURVE:n,ProjectivePoint:w,normPrivateKeyToScalar:L,weierstrassEquation:T,isWithinCurveOrder:F}}function lt(v){const n=et.validateBasic(v);return m.validateObject(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function ft(v){const n=lt(v),{Fp:t,n:x}=n,O=t.BYTES+1,T=2*t.BYTES+1;function F(e){return P<e&&e<t.ORDER}function R(e){return _.mod(e,x)}function L(e){return _.invert(e,x)}const{ProjectivePoint:S,normPrivateKeyToScalar:V,weierstrassEquation:w,isWithinCurveOrder:W}=it({...n,toBytes(e,s,l){const b=s.toAffine(),E=t.toBytes(b.x),A=m.concatBytes;return l?A(Uint8Array.from([s.hasEvenY()?2:3]),E):A(Uint8Array.from([4]),E,t.toBytes(b.y))},fromBytes(e){const s=e.length,l=e[0],b=e.subarray(1);if(s===O&&(l===2||l===3)){const E=m.bytesToNumberBE(b);if(!F(E))throw new Error("Point is not on curve");const A=w(E);let z=t.sqrt(A);const I=(z&U)===U;return(l&1)===1!==I&&(z=t.neg(z)),{x:E,y:z}}else if(s===T&&l===4){const E=t.fromBytes(b.subarray(0,t.BYTES)),A=t.fromBytes(b.subarray(t.BYTES,2*t.BYTES));return{x:E,y:A}}else throw new Error(`Point of length ${s} was invalid. Expected ${O} compressed bytes or ${T} uncompressed bytes`)}}),C=e=>m.bytesToHex(m.numberToBytesBE(e,n.nByteLength));function y(e){const s=x>>U;return e>s}function r(e){return y(e)?R(-e):e}const i=(e,s,l)=>m.bytesToNumberBE(e.slice(s,l));class o{constructor(s,l,b){this.r=s,this.s=l,this.recovery=b,this.assertValidity()}static fromCompact(s){const l=n.nByteLength;return s=m.ensureBytes("compactSignature",s,l*2),new o(i(s,0,l),i(s,l,2*l))}static fromDER(s){const{r:l,s:b}=$.toSig(m.ensureBytes("DER",s));return new o(l,b)}assertValidity(){if(!W(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!W(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(s){return new o(this.r,this.s,s)}recoverPublicKey(s){const{r:l,s:b,recovery:E}=this,A=c(m.ensureBytes("msgHash",s));if(E==null||![0,1,2,3].includes(E))throw new Error("recovery id invalid");const z=E===2||E===3?l+n.n:l;if(z>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const I=(E&1)===0?"02":"03",D=S.fromHex(I+C(z)),j=L(z),X=R(-A*j),Q=R(b*j),K=S.BASE.multiplyAndAddUnsafe(D,X,Q);if(!K)throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new o(this.r,R(-this.s),this.recovery):this}toDERRawBytes(){return m.hexToBytes(this.toDERHex())}toDERHex(){return $.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return m.hexToBytes(this.toCompactHex())}toCompactHex(){return C(this.r)+C(this.s)}}const u={isValidPrivateKey(e){try{return V(e),!0}catch{return!1}},normPrivateKeyToScalar:V,randomPrivateKey:()=>{const e=n.randomBytes(t.BYTES+8),s=_.hashToPrivateScalar(e,x);return m.numberToBytesBE(s,n.nByteLength)},precompute(e=8,s=S.BASE){return s._setWindowSize(e),s.multiply(BigInt(3)),s}};function f(e,s=!0){return S.fromPrivateKey(e).toRawBytes(s)}function g(e){const s=e instanceof Uint8Array,l=typeof e=="string",b=(s||l)&&e.length;return s?b===O||b===T:l?b===2*O||b===2*T:e instanceof S}function h(e,s,l=!0){if(g(e))throw new Error("first arg must be private key");if(!g(s))throw new Error("second arg must be public key");return S.fromHex(s).multiply(V(e)).toRawBytes(l)}const a=n.bits2int||function(e){const s=m.bytesToNumberBE(e),l=e.length*8-n.nBitLength;return l>0?s>>BigInt(l):s},c=n.bits2int_modN||function(e){return R(a(e))},d=m.bitMask(n.nBitLength);function q(e){if(typeof e!="bigint")throw new Error("bigint expected");if(!(P<=e&&e<d))throw new Error(`bigint expected < 2^${n.nBitLength}`);return m.numberToBytesBE(e,n.nByteLength)}function B(e,s,l=p){if(["recovered","canonical"].some(k=>k in l))throw new Error("sign() legacy options not supported");const{hash:b,randomBytes:E}=n;let{lowS:A,prehash:z,extraEntropy:I}=l;A==null&&(A=!0),e=m.ensureBytes("msgHash",e),z&&(e=m.ensureBytes("prehashed msgHash",b(e)));const D=c(e),j=V(s),X=[q(j),q(D)];if(I!=null){const k=I===!0?E(t.BYTES):I;X.push(m.ensureBytes("extraEntropy",k,t.BYTES))}const Q=m.concatBytes(...X),K=D;function tt(k){const G=a(k);if(!W(G))return;const rt=L(G),Y=S.BASE.multiply(G).toAffine(),M=R(Y.x);if(M===P)return;const J=R(rt*R(K+M*j));if(J===P)return;let nt=(Y.x===M?0:2)|Number(Y.y&U),st=J;return A&&y(J)&&(st=r(J),nt^=1),new o(M,st,nt)}return{seed:Q,k2sig:tt}}const p={lowS:n.lowS,prehash:!1},N={lowS:n.lowS,prehash:!1};function Z(e,s,l=p){const{seed:b,k2sig:E}=B(e,s,l);return m.createHmacDrbg(n.hash.outputLen,n.nByteLength,n.hmac)(b,E)}S.BASE._setWindowSize(8);function H(e,s,l,b=N){const E=e;if(s=m.ensureBytes("msgHash",s),l=m.ensureBytes("publicKey",l),"strict"in b)throw new Error("options.strict was renamed to lowS");const{lowS:A,prehash:z}=b;let I,D;try{if(typeof E=="string"||E instanceof Uint8Array)try{I=o.fromDER(E)}catch(Y){if(!(Y instanceof $.Err))throw Y;I=o.fromCompact(E)}else if(typeof E=="object"&&typeof E.r=="bigint"&&typeof E.s=="bigint"){const{r:Y,s:M}=E;I=new o(Y,M)}else throw new Error("PARSE");D=S.fromHex(l)}catch(Y){if(Y.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(A&&I.hasHighS())return!1;z&&(s=n.hash(s));const{r:j,s:X}=I,Q=c(s),K=L(X),tt=R(Q*K),k=R(j*K),G=S.BASE.multiplyAndAddUnsafe(D,tt,k)?.toAffine();return G?R(G.x)===j:!1}return{CURVE:n,getPublicKey:f,getSharedSecret:h,sign:Z,verify:H,ProjectivePoint:S,Signature:o,utils:u}}exports.DER=$;exports.weierstrass=ft;exports.weierstrassPoints=it;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./modular.cjs"),m=require("./utils.cjs"),et=require("./curve.cjs");function at(v){const n=et.validateBasic(v);m.validateObject(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:x,a:O}=n;if(t){if(!x.eql(O,x.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:ct,hexToBytes:ut}=m,$={Err:class extends Error{constructor(n=""){super(n)}},_parseInt(v){const{Err:n}=$;if(v.length<2||v[0]!==2)throw new n("Invalid signature integer tag");const t=v[1],x=v.subarray(2,t+2);if(!t||x.length!==t)throw new n("Invalid signature integer: wrong length");if(x[0]&128)throw new n("Invalid signature integer: negative");if(x[0]===0&&!(x[1]&128))throw new n("Invalid signature integer: unnecessary leading zero");return{d:ct(x),l:v.subarray(t+2)}},toSig(v){const{Err:n}=$,t=typeof v=="string"?ut(v):v;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let x=t.length;if(x<2||t[0]!=48)throw new n("Invalid signature tag");if(t[1]!==x-2)throw new n("Invalid signature: incorrect length");const{d:O,l:T}=$._parseInt(t.subarray(2)),{d:F,l:R}=$._parseInt(T);if(R.length)throw new n("Invalid signature: left bytes after parsing");return{r:O,s:F}},hexFromSig(v){const n=S=>Number.parseInt(S[0],16)&8?"00"+S:S,t=S=>{const V=S.toString(16);return V.length&1?`0${V}`:V},x=n(t(v.s)),O=n(t(v.r)),T=x.length/2,F=O.length/2,R=t(T),L=t(F);return`30${t(F+T+4)}02${L}${O}02${R}${x}`}},P=BigInt(0),U=BigInt(1);BigInt(2);const ot=BigInt(3);BigInt(4);function it(v){const n=at(v),{Fp:t}=n,x=n.toBytes||((y,r,i)=>{const o=r.toAffine();return m.concatBytes(Uint8Array.from([4]),t.toBytes(o.x),t.toBytes(o.y))}),O=n.fromBytes||(y=>{const r=y.subarray(1),i=t.fromBytes(r.subarray(0,t.BYTES)),o=t.fromBytes(r.subarray(t.BYTES,2*t.BYTES));return{x:i,y:o}});function T(y){const{a:r,b:i}=n,o=t.sqr(y),u=t.mul(o,y);return t.add(t.add(u,t.mul(y,r)),i)}if(!t.eql(t.sqr(n.Gy),T(n.Gx)))throw new Error("bad generator point: equation left != right");function F(y){return typeof y=="bigint"&&P<y&&y<n.n}function R(y){if(!F(y))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function L(y){const{allowedPrivateKeyLengths:r,nByteLength:i,wrapPrivateKey:o,n:u}=n;if(r&&typeof y!="bigint"){if(y instanceof Uint8Array&&(y=m.bytesToHex(y)),typeof y!="string"||!r.includes(y.length))throw new Error("Invalid key");y=y.padStart(i*2,"0")}let f;try{f=typeof y=="bigint"?y:m.bytesToNumberBE(m.ensureBytes("private key",y,i))}catch{throw new Error(`private key must be ${i} bytes, hex or bigint, not ${typeof y}`)}return o&&(f=_.mod(f,u)),R(f),f}const S=new Map;function V(y){if(!(y instanceof w))throw new Error("ProjectivePoint expected")}class w{constructor(r,i,o){if(this.px=r,this.py=i,this.pz=o,r==null||!t.isValid(r))throw new Error("x required");if(i==null||!t.isValid(i))throw new Error("y required");if(o==null||!t.isValid(o))throw new Error("z required")}static fromAffine(r){const{x:i,y:o}=r||{};if(!r||!t.isValid(i)||!t.isValid(o))throw new Error("invalid affine point");if(r instanceof w)throw new Error("projective point not allowed");const u=f=>t.eql(f,t.ZERO);return u(i)&&u(o)?w.ZERO:new w(i,o,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(r){const i=t.invertBatch(r.map(o=>o.pz));return r.map((o,u)=>o.toAffine(i[u])).map(w.fromAffine)}static fromHex(r){const i=w.fromAffine(O(m.ensureBytes("pointHex",r)));return i.assertValidity(),i}static fromPrivateKey(r){return w.BASE.multiply(L(r))}_setWindowSize(r){this._WINDOW_SIZE=r,S.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:r,y:i}=this.toAffine();if(!t.isValid(r)||!t.isValid(i))throw new Error("bad point: x or y not FE");const o=t.sqr(i),u=T(r);if(!t.eql(o,u))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:r}=this.toAffine();if(t.isOdd)return!t.isOdd(r);throw new Error("Field doesn't support isOdd")}equals(r){V(r);const{px:i,py:o,pz:u}=this,{px:f,py:g,pz:h}=r,a=t.eql(t.mul(i,h),t.mul(f,u)),c=t.eql(t.mul(o,h),t.mul(g,u));return a&&c}negate(){return new w(this.px,t.neg(this.py),this.pz)}double(){const{a:r,b:i}=n,o=t.mul(i,ot),{px:u,py:f,pz:g}=this;let h=t.ZERO,a=t.ZERO,c=t.ZERO,d=t.mul(u,u),q=t.mul(f,f),B=t.mul(g,g),p=t.mul(u,f);return p=t.add(p,p),c=t.mul(u,g),c=t.add(c,c),h=t.mul(r,c),a=t.mul(o,B),a=t.add(h,a),h=t.sub(q,a),a=t.add(q,a),a=t.mul(h,a),h=t.mul(p,h),c=t.mul(o,c),B=t.mul(r,B),p=t.sub(d,B),p=t.mul(r,p),p=t.add(p,c),c=t.add(d,d),d=t.add(c,d),d=t.add(d,B),d=t.mul(d,p),a=t.add(a,d),B=t.mul(f,g),B=t.add(B,B),d=t.mul(B,p),h=t.sub(h,d),c=t.mul(B,q),c=t.add(c,c),c=t.add(c,c),new w(h,a,c)}add(r){V(r);const{px:i,py:o,pz:u}=this,{px:f,py:g,pz:h}=r;let a=t.ZERO,c=t.ZERO,d=t.ZERO;const q=n.a,B=t.mul(n.b,ot);let p=t.mul(i,f),N=t.mul(o,g),Z=t.mul(u,h),H=t.add(i,o),e=t.add(f,g);H=t.mul(H,e),e=t.add(p,N),H=t.sub(H,e),e=t.add(i,u);let s=t.add(f,h);return e=t.mul(e,s),s=t.add(p,Z),e=t.sub(e,s),s=t.add(o,u),a=t.add(g,h),s=t.mul(s,a),a=t.add(N,Z),s=t.sub(s,a),d=t.mul(q,e),a=t.mul(B,Z),d=t.add(a,d),a=t.sub(N,d),d=t.add(N,d),c=t.mul(a,d),N=t.add(p,p),N=t.add(N,p),Z=t.mul(q,Z),e=t.mul(B,e),N=t.add(N,Z),Z=t.sub(p,Z),Z=t.mul(q,Z),e=t.add(e,Z),p=t.mul(N,e),c=t.add(c,p),p=t.mul(s,e),a=t.mul(H,a),a=t.sub(a,p),p=t.mul(H,N),d=t.mul(s,d),d=t.add(d,p),new w(a,c,d)}subtract(r){return this.add(r.negate())}is0(){return this.equals(w.ZERO)}wNAF(r){return C.wNAFCached(this,S,r,i=>{const o=t.invertBatch(i.map(u=>u.pz));return i.map((u,f)=>u.toAffine(o[f])).map(w.fromAffine)})}multiplyUnsafe(r){const i=w.ZERO;if(r===P)return i;if(R(r),r===U)return this;const{endo:o}=n;if(!o)return C.unsafeLadder(this,r);let{k1neg:u,k1:f,k2neg:g,k2:h}=o.splitScalar(r),a=i,c=i,d=this;for(;f>P||h>P;)f&U&&(a=a.add(d)),h&U&&(c=c.add(d)),d=d.double(),f>>=U,h>>=U;return u&&(a=a.negate()),g&&(c=c.negate()),c=new w(t.mul(c.px,o.beta),c.py,c.pz),a.add(c)}multiply(r){R(r);let i=r,o,u;const{endo:f}=n;if(f){const{k1neg:g,k1:h,k2neg:a,k2:c}=f.splitScalar(i);let{p:d,f:q}=this.wNAF(h),{p:B,f:p}=this.wNAF(c);d=C.constTimeNegate(g,d),B=C.constTimeNegate(a,B),B=new w(t.mul(B.px,f.beta),B.py,B.pz),o=d.add(B),u=q.add(p)}else{const{p:g,f:h}=this.wNAF(i);o=g,u=h}return w.normalizeZ([o,u])[0]}multiplyAndAddUnsafe(r,i,o){const u=w.BASE,f=(h,a)=>a===P||a===U||!h.equals(u)?h.multiplyUnsafe(a):h.multiply(a),g=f(this,i).add(f(r,o));return g.is0()?void 0:g}toAffine(r){const{px:i,py:o,pz:u}=this,f=this.is0();r==null&&(r=f?t.ONE:t.inv(u));const g=t.mul(i,r),h=t.mul(o,r),a=t.mul(u,r);if(f)return{x:t.ZERO,y:t.ZERO};if(!t.eql(a,t.ONE))throw new Error("invZ was invalid");return{x:g,y:h}}isTorsionFree(){const{h:r,isTorsionFree:i}=n;if(r===U)return!0;if(i)return i(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:r,clearCofactor:i}=n;return r===U?this:i?i(w,this):this.multiplyUnsafe(n.h)}toRawBytes(r=!0){return this.assertValidity(),x(w,this,r)}toHex(r=!0){return m.bytesToHex(this.toRawBytes(r))}}w.BASE=new w(n.Gx,n.Gy,t.ONE),w.ZERO=new w(t.ZERO,t.ONE,t.ZERO);const W=n.nBitLength,C=et.wNAF(w,n.endo?Math.ceil(W/2):W);return{CURVE:n,ProjectivePoint:w,normPrivateKeyToScalar:L,weierstrassEquation:T,isWithinCurveOrder:F}}function lt(v){const n=et.validateBasic(v);return m.validateObject(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function ft(v){const n=lt(v),{Fp:t,n:x}=n,O=t.BYTES+1,T=2*t.BYTES+1;function F(e){return P<e&&e<t.ORDER}function R(e){return _.mod(e,x)}function L(e){return _.invert(e,x)}const{ProjectivePoint:S,normPrivateKeyToScalar:V,weierstrassEquation:w,isWithinCurveOrder:W}=it({...n,toBytes(e,s,l){const b=s.toAffine(),E=t.toBytes(b.x),A=m.concatBytes;return l?A(Uint8Array.from([s.hasEvenY()?2:3]),E):A(Uint8Array.from([4]),E,t.toBytes(b.y))},fromBytes(e){const s=e.length,l=e[0],b=e.subarray(1);if(s===O&&(l===2||l===3)){const E=m.bytesToNumberBE(b);if(!F(E))throw new Error("Point is not on curve");const A=w(E);let z=t.sqrt(A);const I=(z&U)===U;return(l&1)===1!==I&&(z=t.neg(z)),{x:E,y:z}}else if(s===T&&l===4){const E=t.fromBytes(b.subarray(0,t.BYTES)),A=t.fromBytes(b.subarray(t.BYTES,2*t.BYTES));return{x:E,y:A}}else throw new Error(`Point of length ${s} was invalid. Expected ${O} compressed bytes or ${T} uncompressed bytes`)}}),C=e=>m.bytesToHex(m.numberToBytesBE(e,n.nByteLength));function y(e){const s=x>>U;return e>s}function r(e){return y(e)?R(-e):e}const i=(e,s,l)=>m.bytesToNumberBE(e.slice(s,l));class o{constructor(s,l,b){this.r=s,this.s=l,this.recovery=b,this.assertValidity()}static fromCompact(s){const l=n.nByteLength;return s=m.ensureBytes("compactSignature",s,l*2),new o(i(s,0,l),i(s,l,2*l))}static fromDER(s){const{r:l,s:b}=$.toSig(m.ensureBytes("DER",s));return new o(l,b)}assertValidity(){if(!W(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!W(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(s){return new o(this.r,this.s,s)}recoverPublicKey(s){const{r:l,s:b,recovery:E}=this,A=c(m.ensureBytes("msgHash",s));if(E==null||![0,1,2,3].includes(E))throw new Error("recovery id invalid");const z=E===2||E===3?l+n.n:l;if(z>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const I=(E&1)===0?"02":"03",D=S.fromHex(I+C(z)),j=L(z),X=R(-A*j),Q=R(b*j),K=S.BASE.multiplyAndAddUnsafe(D,X,Q);if(!K)throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new o(this.r,R(-this.s),this.recovery):this}toDERRawBytes(){return m.hexToBytes(this.toDERHex())}toDERHex(){return $.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return m.hexToBytes(this.toCompactHex())}toCompactHex(){return C(this.r)+C(this.s)}}const u={isValidPrivateKey(e){try{return V(e),!0}catch{return!1}},normPrivateKeyToScalar:V,randomPrivateKey:()=>{const e=n.randomBytes(t.BYTES+8),s=_.hashToPrivateScalar(e,x);return m.numberToBytesBE(s,n.nByteLength)},precompute(e=8,s=S.BASE){return s._setWindowSize(e),s.multiply(BigInt(3)),s}};function f(e,s=!0){return S.fromPrivateKey(e).toRawBytes(s)}function g(e){const s=e instanceof Uint8Array,l=typeof e=="string",b=(s||l)&&e.length;return s?b===O||b===T:l?b===2*O||b===2*T:e instanceof S}function h(e,s,l=!0){if(g(e))throw new Error("first arg must be private key");if(!g(s))throw new Error("second arg must be public key");return S.fromHex(s).multiply(V(e)).toRawBytes(l)}const a=n.bits2int||function(e){const s=m.bytesToNumberBE(e),l=e.length*8-n.nBitLength;return l>0?s>>BigInt(l):s},c=n.bits2int_modN||function(e){return R(a(e))},d=m.bitMask(n.nBitLength);function q(e){if(typeof e!="bigint")throw new Error("bigint expected");if(!(P<=e&&e<d))throw new Error(`bigint expected < 2^${n.nBitLength}`);return m.numberToBytesBE(e,n.nByteLength)}function B(e,s,l=p){if(["recovered","canonical"].some(k=>k in l))throw new Error("sign() legacy options not supported");const{hash:b,randomBytes:E}=n;let{lowS:A,prehash:z,extraEntropy:I}=l;A==null&&(A=!0),e=m.ensureBytes("msgHash",e),z&&(e=m.ensureBytes("prehashed msgHash",b(e)));const D=c(e),j=V(s),X=[q(j),q(D)];if(I!=null){const k=I===!0?E(t.BYTES):I;X.push(m.ensureBytes("extraEntropy",k,t.BYTES))}const Q=m.concatBytes(...X),K=D;function tt(k){const G=a(k);if(!W(G))return;const rt=L(G),Y=S.BASE.multiply(G).toAffine(),M=R(Y.x);if(M===P)return;const J=R(rt*R(K+M*j));if(J===P)return;let nt=(Y.x===M?0:2)|Number(Y.y&U),st=J;return A&&y(J)&&(st=r(J),nt^=1),new o(M,st,nt)}return{seed:Q,k2sig:tt}}const p={lowS:n.lowS,prehash:!1},N={lowS:n.lowS,prehash:!1};function Z(e,s,l=p){const{seed:b,k2sig:E}=B(e,s,l);return m.createHmacDrbg(n.hash.outputLen,n.nByteLength,n.hmac)(b,E)}S.BASE._setWindowSize(8);function H(e,s,l,b=N){const E=e;if(s=m.ensureBytes("msgHash",s),l=m.ensureBytes("publicKey",l),"strict"in b)throw new Error("options.strict was renamed to lowS");const{lowS:A,prehash:z}=b;let I,D;try{if(typeof E=="string"||E instanceof Uint8Array)try{I=o.fromDER(E)}catch(Y){if(!(Y instanceof $.Err))throw Y;I=o.fromCompact(E)}else if(typeof E=="object"&&typeof E.r=="bigint"&&typeof E.s=="bigint"){const{r:Y,s:M}=E;I=new o(Y,M)}else throw new Error("PARSE");D=S.fromHex(l)}catch(Y){if(Y.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(A&&I.hasHighS())return!1;z&&(s=n.hash(s));const{r:j,s:X}=I,Q=c(s),K=L(X),tt=R(Q*K),k=R(j*K),G=S.BASE.multiplyAndAddUnsafe(D,tt,k)?.toAffine();return G?R(G.x)===j:!1}return{CURVE:n,getPublicKey:f,getSharedSecret:h,sign:Z,verify:H,ProjectivePoint:S,Signature:o,utils:u}}exports.DER=$;exports.weierstrass=ft;exports.weierstrassPoints=it;
@@ -2,7 +2,6 @@ import { mod as ut, hashToPrivateScalar as dt, invert as ht } from "./modular.js
2
2
  import * as mt from "./utils.js";
3
3
  import { bytesToNumberBE as _, bitMask as yt, validateObject as lt, concatBytes as et, numberToBytesBE as rt, ensureBytes as Y, bytesToHex as nt, hexToBytes as at, createHmacDrbg as pt } from "./utils.js";
4
4
  import { validateBasic as ft, wNAF as wt } from "./curve.js";
5
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
6
5
  function Et(B) {
7
6
  const n = ft(B);
8
7
  lt(n, {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./crypto.cjs");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const s=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!s)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(t,r)=>r.toString(16).padStart(2,"0"));function y(t){if(typeof t!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}function f(t){if(typeof t=="string"&&(t=y(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}function u(...t){if(!t.every(e=>e instanceof Uint8Array))throw new Error("Uint8Array list expected");if(t.length===1)return t[0];const r=t.reduce((e,n)=>e+n.length,0),i=new Uint8Array(r);for(let e=0,n=0;e<t.length;e++){const c=t[e];i.set(c,n),n+=c.length}return i}class p{clone(){return this._cloneInto()}}function l(t=32){if(o.crypto&&typeof o.crypto.getRandomValues=="function")return o.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}exports.Hash=p;exports.concatBytes=u;exports.isLE=s;exports.randomBytes=l;exports.toBytes=f;exports.utf8ToBytes=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./crypto.cjs");const s=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!s)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(t,r)=>r.toString(16).padStart(2,"0"));function y(t){if(typeof t!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}function f(t){if(typeof t=="string"&&(t=y(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}function u(...t){if(!t.every(e=>e instanceof Uint8Array))throw new Error("Uint8Array list expected");if(t.length===1)return t[0];const r=t.reduce((e,n)=>e+n.length,0),i=new Uint8Array(r);for(let e=0,n=0;e<t.length;e++){const c=t[e];i.set(c,n),n+=c.length}return i}class p{clone(){return this._cloneInto()}}function l(t=32){if(o.crypto&&typeof o.crypto.getRandomValues=="function")return o.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}exports.Hash=p;exports.concatBytes=u;exports.isLE=s;exports.randomBytes=l;exports.toBytes=f;exports.utf8ToBytes=y;
@@ -1,5 +1,4 @@
1
1
  import { crypto as o } from "./crypto.js";
2
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
2
  const c = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
4
3
  if (!c)
5
4
  throw new Error("Non little-endian hardware is not supported");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));function f(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}const s=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),y=(t,e)=>t<<32-e|t>>>e,r=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!r)throw new Error("Non little-endian hardware is not supported");function o(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function i(t){if(typeof t=="string"&&(t=o(t)),!f(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class w{clone(){return this._cloneInto()}}function p(t){const e=c=>t().update(i(c)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}exports.Hash=w;exports.createView=s;exports.isLE=r;exports.rotr=y;exports.toBytes=i;exports.u32=u;exports.utf8ToBytes=o;exports.wrapConstructor=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));function f(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}const s=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),y=(t,e)=>t<<32-e|t>>>e,r=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!r)throw new Error("Non little-endian hardware is not supported");function o(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function i(t){if(typeof t=="string"&&(t=o(t)),!f(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class w{clone(){return this._cloneInto()}}function p(t){const e=c=>t().update(i(c)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}exports.Hash=w;exports.createView=s;exports.isLE=r;exports.rotr=y;exports.toBytes=i;exports.u32=u;exports.utf8ToBytes=o;exports.wrapConstructor=p;
@@ -1,4 +1,3 @@
1
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
1
  const u = (t) => new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
3
2
  function o(t) {
4
3
  return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function u(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function p(e,t=""){if(!Number.isSafeInteger(e)||e<0){const n=t&&`"${t}" `;throw new Error(`${n}expected integer >0, got ${e}`)}}function i(e,t,n=""){const r=u(e),o=e?.length;if(!r||t!==void 0){const y=n&&`"${n}" `,x="",d=r?`length=${o}`:`type=${typeof e}`;throw new Error(y+"expected Uint8Array"+x+", got "+d)}return e}function b(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function g(e,t){i(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function h(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function w(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function l(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function A(e,t){return e<<32-t|e>>>t}const s=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function c(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function a(e){for(let t=0;t<e.length;t++)e[t]=c(e[t]);return e}const L=s?e=>e:a,m=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",E=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function H(e){if(i(e),m)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=E[e[n]];return t}function U(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function S(e,t={}){const n=(o,f)=>e(f).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}const B=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});exports.abytes=i;exports.aexists=b;exports.anumber=p;exports.aoutput=g;exports.byteSwap=c;exports.byteSwap32=a;exports.bytesToHex=H;exports.clean=w;exports.createHasher=S;exports.createView=l;exports.isBytes=u;exports.isLE=s;exports.oidNist=B;exports.rotr=A;exports.swap32IfBE=L;exports.u32=h;exports.utf8ToBytes=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function p(e,t=""){if(!Number.isSafeInteger(e)||e<0){const n=t&&`"${t}" `;throw new Error(`${n}expected integer >0, got ${e}`)}}function i(e,t,n=""){const r=u(e),o=e?.length;if(!r||t!==void 0){const y=n&&`"${n}" `,x="",d=r?`length=${o}`:`type=${typeof e}`;throw new Error(y+"expected Uint8Array"+x+", got "+d)}return e}function b(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function g(e,t){i(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function h(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function w(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function l(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function A(e,t){return e<<32-t|e>>>t}const s=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function c(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function a(e){for(let t=0;t<e.length;t++)e[t]=c(e[t]);return e}const L=s?e=>e:a,m=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",E=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function H(e){if(i(e),m)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=E[e[n]];return t}function U(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function S(e,t={}){const n=(o,f)=>e(f).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}const B=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});exports.abytes=i;exports.aexists=b;exports.anumber=p;exports.aoutput=g;exports.byteSwap=c;exports.byteSwap32=a;exports.bytesToHex=H;exports.clean=w;exports.createHasher=S;exports.createView=l;exports.isBytes=u;exports.isLE=s;exports.oidNist=B;exports.rotr=A;exports.swap32IfBE=L;exports.u32=h;exports.utf8ToBytes=U;
@@ -1,4 +1,3 @@
1
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
1
  function x(e) {
3
2
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
4
3
  }
@@ -1,7 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("../../../../../_virtual/numeral2.cjs");/*! @preserve
2
- * numeral.js
3
- * version : 2.0.6
4
- * author : Adam Draper
5
- * license : MIT
6
- * http://adamwdraper.github.com/Numeral-js/
7
- */var O=B.__module.exports,P;function L(){return P||(P=1,(function(S){(function(n,m){S.exports?S.exports=m():n.numeral=m()})(O,function(){var n,m,E="2.0.6",_={},N={},y={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:y.currentLocale,zeroFormat:y.zeroFormat,nullFormat:y.nullFormat,defaultFormat:y.defaultFormat,scalePercentBy100:y.scalePercentBy100};function M(e,r){this._input=e,this._value=r}return n=function(e){var r,l,i,t;if(n.isNumeral(e))r=e.value();else if(e===0||typeof e>"u")r=0;else if(e===null||m.isNaN(e))r=null;else if(typeof e=="string")if(c.zeroFormat&&e===c.zeroFormat)r=0;else if(c.nullFormat&&e===c.nullFormat||!e.replace(/[^0-9]+/g,"").length)r=null;else{for(l in _)if(t=typeof _[l].regexps.unformat=="function"?_[l].regexps.unformat():_[l].regexps.unformat,t&&e.match(t)){i=_[l].unformat;break}i=i||n._.stringToNumber,r=i(e)}else r=Number(e)||null;return new M(e,r)},n.version=E,n.isNumeral=function(e){return e instanceof M},n._=m={numberToFormat:function(e,r,l){var i=N[n.options.currentLocale],t=!1,o=!1,a=0,u="",f=1e12,s=1e9,d=1e6,w=1e3,h="",v=!1,p,x,b,g,T,$,F;if(e=e||0,x=Math.abs(e),n._.includes(r,"(")?(t=!0,r=r.replace(/[\(|\)]/g,"")):(n._.includes(r,"+")||n._.includes(r,"-"))&&(T=n._.includes(r,"+")?r.indexOf("+"):e<0?r.indexOf("-"):-1,r=r.replace(/[\+|\-]/g,"")),n._.includes(r,"a")&&(p=r.match(/a(k|m|b|t)?/),p=p?p[1]:!1,n._.includes(r," a")&&(u=" "),r=r.replace(new RegExp(u+"a[kmbt]?"),""),x>=f&&!p||p==="t"?(u+=i.abbreviations.trillion,e=e/f):x<f&&x>=s&&!p||p==="b"?(u+=i.abbreviations.billion,e=e/s):x<s&&x>=d&&!p||p==="m"?(u+=i.abbreviations.million,e=e/d):(x<d&&x>=w&&!p||p==="k")&&(u+=i.abbreviations.thousand,e=e/w)),n._.includes(r,"[.]")&&(o=!0,r=r.replace("[.]",".")),b=e.toString().split(".")[0],g=r.split(".")[1],$=r.indexOf(","),a=(r.split(".")[0].split(",")[0].match(/0/g)||[]).length,g?(n._.includes(g,"[")?(g=g.replace("]",""),g=g.split("["),h=n._.toFixed(e,g[0].length+g[1].length,l,g[1].length)):h=n._.toFixed(e,g.length,l),b=h.split(".")[0],n._.includes(h,".")?h=i.delimiters.decimal+h.split(".")[1]:h="",o&&Number(h.slice(1))===0&&(h="")):b=n._.toFixed(e,0,l),u&&!p&&Number(b)>=1e3&&u!==i.abbreviations.trillion)switch(b=String(Number(b)/1e3),u){case i.abbreviations.thousand:u=i.abbreviations.million;break;case i.abbreviations.million:u=i.abbreviations.billion;break;case i.abbreviations.billion:u=i.abbreviations.trillion;break}if(n._.includes(b,"-")&&(b=b.slice(1),v=!0),b.length<a)for(var k=a-b.length;k>0;k--)b="0"+b;return $>-1&&(b=b.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+i.delimiters.thousands)),r.indexOf(".")===0&&(b=""),F=b+h+(u||""),t?F=(t&&v?"(":"")+F+(t&&v?")":""):T>=0?F=T===0?(v?"-":"+")+F:F+(v?"-":"+"):v&&(F="-"+F),F},stringToNumber:function(e){var r=N[c.currentLocale],l=e,i={thousand:3,million:6,billion:9,trillion:12},t,o,a;if(c.zeroFormat&&e===c.zeroFormat)o=0;else if(c.nullFormat&&e===c.nullFormat||!e.replace(/[^0-9]+/g,"").length)o=null;else{o=1,r.delimiters.decimal!=="."&&(e=e.replace(/\./g,"").replace(r.delimiters.decimal,"."));for(t in i)if(a=new RegExp("[^a-zA-Z]"+r.abbreviations[t]+"(?:\\)|(\\"+r.currency.symbol+")?(?:\\))?)?$"),l.match(a)){o*=Math.pow(10,i[t]);break}o*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),o*=Number(e)}return o},isNaN:function(e){return typeof e=="number"&&isNaN(e)},includes:function(e,r){return e.indexOf(r)!==-1},insert:function(e,r,l){return e.slice(0,l)+r+e.slice(l)},reduce:function(e,r){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof r!="function")throw new TypeError(r+" is not a function");var l=Object(e),i=l.length>>>0,t=0,o;if(arguments.length===3)o=arguments[2];else{for(;t<i&&!(t in l);)t++;if(t>=i)throw new TypeError("Reduce of empty array with no initial value");o=l[t++]}for(;t<i;t++)t in l&&(o=r(o,l[t],t,l));return o},multiplier:function(e){var r=e.toString().split(".");return r.length<2?1:Math.pow(10,r[1].length)},correctionFactor:function(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(r,l){var i=m.multiplier(l);return r>i?r:i},1)},toFixed:function(e,r,l,i){var t=e.toString().split("."),o=r-(i||0),a,u,f,s;return t.length===2?a=Math.min(Math.max(t[1].length,o),r):a=o,f=Math.pow(10,a),s=(l(e+"e+"+a)/f).toFixed(a),i>r-a&&(u=new RegExp("\\.?0{1,"+(i-(r-a))+"}$"),s=s.replace(u,"")),s}},n.options=c,n.formats=_,n.locales=N,n.locale=function(e){return e&&(c.currentLocale=e.toLowerCase()),c.currentLocale},n.localeData=function(e){if(!e)return N[c.currentLocale];if(e=e.toLowerCase(),!N[e])throw new Error("Unknown locale : "+e);return N[e]},n.reset=function(){for(var e in y)c[e]=y[e]},n.zeroFormat=function(e){c.zeroFormat=typeof e=="string"?e:null},n.nullFormat=function(e){c.nullFormat=typeof e=="string"?e:null},n.defaultFormat=function(e){c.defaultFormat=typeof e=="string"?e:"0.0"},n.register=function(e,r,l){if(r=r.toLowerCase(),this[e+"s"][r])throw new TypeError(r+" "+e+" already registered.");return this[e+"s"][r]=l,l},n.validate=function(e,r){var l,i,t,o,a,u,f,s;if(typeof e!="string"&&(e+=""),e=e.trim(),e.match(/^\d+$/))return!0;if(e==="")return!1;try{f=n.localeData(r)}catch{f=n.localeData(n.locale())}return t=f.currency.symbol,a=f.abbreviations,l=f.delimiters.decimal,f.delimiters.thousands==="."?i="\\.":i=f.delimiters.thousands,s=e.match(/^[^\d]+/),s!==null&&(e=e.substr(1),s[0]!==t)||(s=e.match(/[^\d]+$/),s!==null&&(e=e.slice(0,-1),s[0]!==a.thousand&&s[0]!==a.million&&s[0]!==a.billion&&s[0]!==a.trillion))?!1:(u=new RegExp(i+"{2}"),e.match(/[^\d.,]/g)?!1:(o=e.split(l),o.length>2?!1:o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(u):o[0].length===1?!!o[0].match(/^\d+$/)&&!o[0].match(u)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(u)&&!!o[1].match(/^\d+$/)))},n.fn=M.prototype={clone:function(){return n(this)},format:function(e,r){var l=this._value,i=e||c.defaultFormat,t,o,a;if(r=r||Math.round,l===0&&c.zeroFormat!==null)o=c.zeroFormat;else if(l===null&&c.nullFormat!==null)o=c.nullFormat;else{for(t in _)if(i.match(_[t].regexps.format)){a=_[t].format;break}a=a||n._.numberToFormat,o=a(l,i,r)}return o},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var r=m.correctionFactor.call(null,this._value,e);function l(i,t,o,a){return i+Math.round(r*t)}return this._value=m.reduce([this._value,e],l,0)/r,this},subtract:function(e){var r=m.correctionFactor.call(null,this._value,e);function l(i,t,o,a){return i-Math.round(r*t)}return this._value=m.reduce([e],l,Math.round(this._value*r))/r,this},multiply:function(e){function r(l,i,t,o){var a=m.correctionFactor(l,i);return Math.round(l*a)*Math.round(i*a)/Math.round(a*a)}return this._value=m.reduce([this._value,e],r,1),this},divide:function(e){function r(l,i,t,o){var a=m.correctionFactor(l,i);return Math.round(l*a)/Math.round(i*a)}return this._value=m.reduce([this._value,e],r),this},difference:function(e){return Math.abs(n(this._value).subtract(e).value())}},n.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var r=e%10;return~~(e%100/10)===1?"th":r===1?"st":r===2?"nd":r===3?"rd":"th"},currency:{symbol:"$"}}),(function(){n.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,r,l){var i=n._.includes(r," BPS")?" ":"",t;return e=e*1e4,r=r.replace(/\s?BPS/,""),t=n._.numberToFormat(e,r,l),n._.includes(t,")")?(t=t.split(""),t.splice(-1,0,i+"BPS"),t=t.join("")):t=t+i+"BPS",t},unformat:function(e){return+(n._.stringToNumber(e)*1e-4).toFixed(15)}})})(),(function(){var e={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},r={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},l=e.suffixes.concat(r.suffixes.filter(function(t){return e.suffixes.indexOf(t)<0})),i=l.join("|");i="("+i.replace("B","B(?!PS)")+")",n.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(i)},format:function(t,o,a){var u,f=n._.includes(o,"ib")?r:e,s=n._.includes(o," b")||n._.includes(o," ib")?" ":"",d,w,h;for(o=o.replace(/\s?i?b/,""),d=0;d<=f.suffixes.length;d++)if(w=Math.pow(f.base,d),h=Math.pow(f.base,d+1),t===null||t===0||t>=w&&t<h){s+=f.suffixes[d],w>0&&(t=t/w);break}return u=n._.numberToFormat(t,o,a),u+s},unformat:function(t){var o=n._.stringToNumber(t),a,u;if(o){for(a=e.suffixes.length-1;a>=0;a--){if(n._.includes(t,e.suffixes[a])){u=Math.pow(e.base,a);break}if(n._.includes(t,r.suffixes[a])){u=Math.pow(r.base,a);break}}o*=u||1}return o}})})(),(function(){n.register("format","currency",{regexps:{format:/(\$)/},format:function(e,r,l){var i=n.locales[n.options.currentLocale],t={before:r.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:r.match(/([\+|\-|\)|\s|\$]*)$/)[0]},o,a,u;for(r=r.replace(/\s?\$\s?/,""),o=n._.numberToFormat(e,r,l),e>=0?(t.before=t.before.replace(/[\-\(]/,""),t.after=t.after.replace(/[\-\)]/,"")):e<0&&!n._.includes(t.before,"-")&&!n._.includes(t.before,"(")&&(t.before="-"+t.before),u=0;u<t.before.length;u++)switch(a=t.before[u],a){case"$":o=n._.insert(o,i.currency.symbol,u);break;case" ":o=n._.insert(o," ",u+i.currency.symbol.length-1);break}for(u=t.after.length-1;u>=0;u--)switch(a=t.after[u],a){case"$":o=u===t.after.length-1?o+i.currency.symbol:n._.insert(o,i.currency.symbol,-(t.after.length-(1+u)));break;case" ":o=u===t.after.length-1?o+" ":n._.insert(o," ",-(t.after.length-(1+u)+i.currency.symbol.length-1));break}return o}})})(),(function(){n.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,r,l){var i,t=typeof e=="number"&&!n._.isNaN(e)?e.toExponential():"0e+0",o=t.split("e");return r=r.replace(/e[\+|\-]{1}0/,""),i=n._.numberToFormat(Number(o[0]),r,l),i+"e"+o[1]},unformat:function(e){var r=n._.includes(e,"e+")?e.split("e+"):e.split("e-"),l=Number(r[0]),i=Number(r[1]);i=n._.includes(e,"e-")?i*=-1:i;function t(o,a,u,f){var s=n._.correctionFactor(o,a),d=o*s*(a*s)/(s*s);return d}return n._.reduce([l,Math.pow(10,i)],t,1)}})})(),(function(){n.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,r,l){var i=n.locales[n.options.currentLocale],t,o=n._.includes(r," o")?" ":"";return r=r.replace(/\s?o/,""),o+=i.ordinal(e),t=n._.numberToFormat(e,r,l),t+o}})})(),(function(){n.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,r,l){var i=n._.includes(r," %")?" ":"",t;return n.options.scalePercentBy100&&(e=e*100),r=r.replace(/\s?\%/,""),t=n._.numberToFormat(e,r,l),n._.includes(t,")")?(t=t.split(""),t.splice(-1,0,i+"%"),t=t.join("")):t=t+i+"%",t},unformat:function(e){var r=n._.stringToNumber(e);return n.options.scalePercentBy100?r*.01:r}})})(),(function(){n.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,r,l){var i=Math.floor(e/60/60),t=Math.floor((e-i*60*60)/60),o=Math.round(e-i*60*60-t*60);return i+":"+(t<10?"0"+t:t)+":"+(o<10?"0"+o:o)},unformat:function(e){var r=e.split(":"),l=0;return r.length===3?(l=l+Number(r[0])*60*60,l=l+Number(r[1])*60,l=l+Number(r[2])):r.length===2&&(l=l+Number(r[0])*60,l=l+Number(r[1])),Number(l)}})})(),n})})(B.__module)),B.__module.exports}exports.__require=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("../../../../../_virtual/numeral2.cjs");var O=B.__module.exports,P;function L(){return P||(P=1,(function(S){(function(n,m){S.exports?S.exports=m():n.numeral=m()})(O,function(){var n,m,E="2.0.6",_={},N={},y={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:y.currentLocale,zeroFormat:y.zeroFormat,nullFormat:y.nullFormat,defaultFormat:y.defaultFormat,scalePercentBy100:y.scalePercentBy100};function M(e,r){this._input=e,this._value=r}return n=function(e){var r,l,i,t;if(n.isNumeral(e))r=e.value();else if(e===0||typeof e>"u")r=0;else if(e===null||m.isNaN(e))r=null;else if(typeof e=="string")if(c.zeroFormat&&e===c.zeroFormat)r=0;else if(c.nullFormat&&e===c.nullFormat||!e.replace(/[^0-9]+/g,"").length)r=null;else{for(l in _)if(t=typeof _[l].regexps.unformat=="function"?_[l].regexps.unformat():_[l].regexps.unformat,t&&e.match(t)){i=_[l].unformat;break}i=i||n._.stringToNumber,r=i(e)}else r=Number(e)||null;return new M(e,r)},n.version=E,n.isNumeral=function(e){return e instanceof M},n._=m={numberToFormat:function(e,r,l){var i=N[n.options.currentLocale],t=!1,o=!1,a=0,u="",f=1e12,s=1e9,d=1e6,w=1e3,h="",v=!1,p,x,b,g,T,$,F;if(e=e||0,x=Math.abs(e),n._.includes(r,"(")?(t=!0,r=r.replace(/[\(|\)]/g,"")):(n._.includes(r,"+")||n._.includes(r,"-"))&&(T=n._.includes(r,"+")?r.indexOf("+"):e<0?r.indexOf("-"):-1,r=r.replace(/[\+|\-]/g,"")),n._.includes(r,"a")&&(p=r.match(/a(k|m|b|t)?/),p=p?p[1]:!1,n._.includes(r," a")&&(u=" "),r=r.replace(new RegExp(u+"a[kmbt]?"),""),x>=f&&!p||p==="t"?(u+=i.abbreviations.trillion,e=e/f):x<f&&x>=s&&!p||p==="b"?(u+=i.abbreviations.billion,e=e/s):x<s&&x>=d&&!p||p==="m"?(u+=i.abbreviations.million,e=e/d):(x<d&&x>=w&&!p||p==="k")&&(u+=i.abbreviations.thousand,e=e/w)),n._.includes(r,"[.]")&&(o=!0,r=r.replace("[.]",".")),b=e.toString().split(".")[0],g=r.split(".")[1],$=r.indexOf(","),a=(r.split(".")[0].split(",")[0].match(/0/g)||[]).length,g?(n._.includes(g,"[")?(g=g.replace("]",""),g=g.split("["),h=n._.toFixed(e,g[0].length+g[1].length,l,g[1].length)):h=n._.toFixed(e,g.length,l),b=h.split(".")[0],n._.includes(h,".")?h=i.delimiters.decimal+h.split(".")[1]:h="",o&&Number(h.slice(1))===0&&(h="")):b=n._.toFixed(e,0,l),u&&!p&&Number(b)>=1e3&&u!==i.abbreviations.trillion)switch(b=String(Number(b)/1e3),u){case i.abbreviations.thousand:u=i.abbreviations.million;break;case i.abbreviations.million:u=i.abbreviations.billion;break;case i.abbreviations.billion:u=i.abbreviations.trillion;break}if(n._.includes(b,"-")&&(b=b.slice(1),v=!0),b.length<a)for(var k=a-b.length;k>0;k--)b="0"+b;return $>-1&&(b=b.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+i.delimiters.thousands)),r.indexOf(".")===0&&(b=""),F=b+h+(u||""),t?F=(t&&v?"(":"")+F+(t&&v?")":""):T>=0?F=T===0?(v?"-":"+")+F:F+(v?"-":"+"):v&&(F="-"+F),F},stringToNumber:function(e){var r=N[c.currentLocale],l=e,i={thousand:3,million:6,billion:9,trillion:12},t,o,a;if(c.zeroFormat&&e===c.zeroFormat)o=0;else if(c.nullFormat&&e===c.nullFormat||!e.replace(/[^0-9]+/g,"").length)o=null;else{o=1,r.delimiters.decimal!=="."&&(e=e.replace(/\./g,"").replace(r.delimiters.decimal,"."));for(t in i)if(a=new RegExp("[^a-zA-Z]"+r.abbreviations[t]+"(?:\\)|(\\"+r.currency.symbol+")?(?:\\))?)?$"),l.match(a)){o*=Math.pow(10,i[t]);break}o*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),o*=Number(e)}return o},isNaN:function(e){return typeof e=="number"&&isNaN(e)},includes:function(e,r){return e.indexOf(r)!==-1},insert:function(e,r,l){return e.slice(0,l)+r+e.slice(l)},reduce:function(e,r){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof r!="function")throw new TypeError(r+" is not a function");var l=Object(e),i=l.length>>>0,t=0,o;if(arguments.length===3)o=arguments[2];else{for(;t<i&&!(t in l);)t++;if(t>=i)throw new TypeError("Reduce of empty array with no initial value");o=l[t++]}for(;t<i;t++)t in l&&(o=r(o,l[t],t,l));return o},multiplier:function(e){var r=e.toString().split(".");return r.length<2?1:Math.pow(10,r[1].length)},correctionFactor:function(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(r,l){var i=m.multiplier(l);return r>i?r:i},1)},toFixed:function(e,r,l,i){var t=e.toString().split("."),o=r-(i||0),a,u,f,s;return t.length===2?a=Math.min(Math.max(t[1].length,o),r):a=o,f=Math.pow(10,a),s=(l(e+"e+"+a)/f).toFixed(a),i>r-a&&(u=new RegExp("\\.?0{1,"+(i-(r-a))+"}$"),s=s.replace(u,"")),s}},n.options=c,n.formats=_,n.locales=N,n.locale=function(e){return e&&(c.currentLocale=e.toLowerCase()),c.currentLocale},n.localeData=function(e){if(!e)return N[c.currentLocale];if(e=e.toLowerCase(),!N[e])throw new Error("Unknown locale : "+e);return N[e]},n.reset=function(){for(var e in y)c[e]=y[e]},n.zeroFormat=function(e){c.zeroFormat=typeof e=="string"?e:null},n.nullFormat=function(e){c.nullFormat=typeof e=="string"?e:null},n.defaultFormat=function(e){c.defaultFormat=typeof e=="string"?e:"0.0"},n.register=function(e,r,l){if(r=r.toLowerCase(),this[e+"s"][r])throw new TypeError(r+" "+e+" already registered.");return this[e+"s"][r]=l,l},n.validate=function(e,r){var l,i,t,o,a,u,f,s;if(typeof e!="string"&&(e+=""),e=e.trim(),e.match(/^\d+$/))return!0;if(e==="")return!1;try{f=n.localeData(r)}catch{f=n.localeData(n.locale())}return t=f.currency.symbol,a=f.abbreviations,l=f.delimiters.decimal,f.delimiters.thousands==="."?i="\\.":i=f.delimiters.thousands,s=e.match(/^[^\d]+/),s!==null&&(e=e.substr(1),s[0]!==t)||(s=e.match(/[^\d]+$/),s!==null&&(e=e.slice(0,-1),s[0]!==a.thousand&&s[0]!==a.million&&s[0]!==a.billion&&s[0]!==a.trillion))?!1:(u=new RegExp(i+"{2}"),e.match(/[^\d.,]/g)?!1:(o=e.split(l),o.length>2?!1:o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(u):o[0].length===1?!!o[0].match(/^\d+$/)&&!o[0].match(u)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(u)&&!!o[1].match(/^\d+$/)))},n.fn=M.prototype={clone:function(){return n(this)},format:function(e,r){var l=this._value,i=e||c.defaultFormat,t,o,a;if(r=r||Math.round,l===0&&c.zeroFormat!==null)o=c.zeroFormat;else if(l===null&&c.nullFormat!==null)o=c.nullFormat;else{for(t in _)if(i.match(_[t].regexps.format)){a=_[t].format;break}a=a||n._.numberToFormat,o=a(l,i,r)}return o},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var r=m.correctionFactor.call(null,this._value,e);function l(i,t,o,a){return i+Math.round(r*t)}return this._value=m.reduce([this._value,e],l,0)/r,this},subtract:function(e){var r=m.correctionFactor.call(null,this._value,e);function l(i,t,o,a){return i-Math.round(r*t)}return this._value=m.reduce([e],l,Math.round(this._value*r))/r,this},multiply:function(e){function r(l,i,t,o){var a=m.correctionFactor(l,i);return Math.round(l*a)*Math.round(i*a)/Math.round(a*a)}return this._value=m.reduce([this._value,e],r,1),this},divide:function(e){function r(l,i,t,o){var a=m.correctionFactor(l,i);return Math.round(l*a)/Math.round(i*a)}return this._value=m.reduce([this._value,e],r),this},difference:function(e){return Math.abs(n(this._value).subtract(e).value())}},n.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var r=e%10;return~~(e%100/10)===1?"th":r===1?"st":r===2?"nd":r===3?"rd":"th"},currency:{symbol:"$"}}),(function(){n.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,r,l){var i=n._.includes(r," BPS")?" ":"",t;return e=e*1e4,r=r.replace(/\s?BPS/,""),t=n._.numberToFormat(e,r,l),n._.includes(t,")")?(t=t.split(""),t.splice(-1,0,i+"BPS"),t=t.join("")):t=t+i+"BPS",t},unformat:function(e){return+(n._.stringToNumber(e)*1e-4).toFixed(15)}})})(),(function(){var e={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},r={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},l=e.suffixes.concat(r.suffixes.filter(function(t){return e.suffixes.indexOf(t)<0})),i=l.join("|");i="("+i.replace("B","B(?!PS)")+")",n.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(i)},format:function(t,o,a){var u,f=n._.includes(o,"ib")?r:e,s=n._.includes(o," b")||n._.includes(o," ib")?" ":"",d,w,h;for(o=o.replace(/\s?i?b/,""),d=0;d<=f.suffixes.length;d++)if(w=Math.pow(f.base,d),h=Math.pow(f.base,d+1),t===null||t===0||t>=w&&t<h){s+=f.suffixes[d],w>0&&(t=t/w);break}return u=n._.numberToFormat(t,o,a),u+s},unformat:function(t){var o=n._.stringToNumber(t),a,u;if(o){for(a=e.suffixes.length-1;a>=0;a--){if(n._.includes(t,e.suffixes[a])){u=Math.pow(e.base,a);break}if(n._.includes(t,r.suffixes[a])){u=Math.pow(r.base,a);break}}o*=u||1}return o}})})(),(function(){n.register("format","currency",{regexps:{format:/(\$)/},format:function(e,r,l){var i=n.locales[n.options.currentLocale],t={before:r.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:r.match(/([\+|\-|\)|\s|\$]*)$/)[0]},o,a,u;for(r=r.replace(/\s?\$\s?/,""),o=n._.numberToFormat(e,r,l),e>=0?(t.before=t.before.replace(/[\-\(]/,""),t.after=t.after.replace(/[\-\)]/,"")):e<0&&!n._.includes(t.before,"-")&&!n._.includes(t.before,"(")&&(t.before="-"+t.before),u=0;u<t.before.length;u++)switch(a=t.before[u],a){case"$":o=n._.insert(o,i.currency.symbol,u);break;case" ":o=n._.insert(o," ",u+i.currency.symbol.length-1);break}for(u=t.after.length-1;u>=0;u--)switch(a=t.after[u],a){case"$":o=u===t.after.length-1?o+i.currency.symbol:n._.insert(o,i.currency.symbol,-(t.after.length-(1+u)));break;case" ":o=u===t.after.length-1?o+" ":n._.insert(o," ",-(t.after.length-(1+u)+i.currency.symbol.length-1));break}return o}})})(),(function(){n.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,r,l){var i,t=typeof e=="number"&&!n._.isNaN(e)?e.toExponential():"0e+0",o=t.split("e");return r=r.replace(/e[\+|\-]{1}0/,""),i=n._.numberToFormat(Number(o[0]),r,l),i+"e"+o[1]},unformat:function(e){var r=n._.includes(e,"e+")?e.split("e+"):e.split("e-"),l=Number(r[0]),i=Number(r[1]);i=n._.includes(e,"e-")?i*=-1:i;function t(o,a,u,f){var s=n._.correctionFactor(o,a),d=o*s*(a*s)/(s*s);return d}return n._.reduce([l,Math.pow(10,i)],t,1)}})})(),(function(){n.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,r,l){var i=n.locales[n.options.currentLocale],t,o=n._.includes(r," o")?" ":"";return r=r.replace(/\s?o/,""),o+=i.ordinal(e),t=n._.numberToFormat(e,r,l),t+o}})})(),(function(){n.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,r,l){var i=n._.includes(r," %")?" ":"",t;return n.options.scalePercentBy100&&(e=e*100),r=r.replace(/\s?\%/,""),t=n._.numberToFormat(e,r,l),n._.includes(t,")")?(t=t.split(""),t.splice(-1,0,i+"%"),t=t.join("")):t=t+i+"%",t},unformat:function(e){var r=n._.stringToNumber(e);return n.options.scalePercentBy100?r*.01:r}})})(),(function(){n.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,r,l){var i=Math.floor(e/60/60),t=Math.floor((e-i*60*60)/60),o=Math.round(e-i*60*60-t*60);return i+":"+(t<10?"0"+t:t)+":"+(o<10?"0"+o:o)},unformat:function(e){var r=e.split(":"),l=0;return r.length===3?(l=l+Number(r[0])*60*60,l=l+Number(r[1])*60,l=l+Number(r[2])):r.length===2&&(l=l+Number(r[0])*60,l=l+Number(r[1])),Number(l)}})})(),n})})(B.__module)),B.__module.exports}exports.__require=L;
@@ -1,11 +1,4 @@
1
1
  import { __module as v } from "../../../../../_virtual/numeral2.js";
2
- /*! @preserve
3
- * numeral.js
4
- * version : 2.0.6
5
- * author : Adam Draper
6
- * license : MIT
7
- * http://adamwdraper.github.com/Numeral-js/
8
- */
9
2
  var O = v.exports, E;
10
3
  function z() {
11
4
  return E ? v.exports : (E = 1, (function($) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),h=require("./defiPositionType.model.cjs"),b=require("../../../utils/schemas.cjs"),u=e.z.object({status:e.z.literal("initialising")}).or(e.z.object({status:e.z.literal("initialised"),balances:e.z.array(e.z.object({tokenAddress:a.addressSchemaArgentBackend,tokenBalance:e.z.string()}))})),o=e.z.object({id:e.z.number(),address:a.addressSchema,brandColor:e.z.string().optional(),name:e.z.string(),symbol:e.z.string(),decimals:e.z.number(),iconUrl:e.z.string().optional(),sendable:e.z.boolean(),popular:e.z.boolean(),refundable:e.z.boolean(),listed:e.z.boolean(),tradable:e.z.boolean(),category:e.z.union([e.z.literal("tokens"),e.z.literal("currencies"),e.z.literal("savings")]),pricingId:e.z.number().optional(),dappId:e.z.string().optional(),marketData:e.z.object({marketCap:e.z.number().default(0),marketCap24hChange:e.z.number().default(0),dailyVolume:e.z.number().default(0),rank:e.z.number().default(0)}).optional(),tags:e.z.array(e.z.string()).optional()}),k=e.z.object({tokens:e.z.array(o)}),D=o,p=e.z.object({pricingId:e.z.number(),ethValue:e.z.string(),ccyValue:e.z.string(),ethDayChange:e.z.string(),ccyDayChange:e.z.string()}),y=e.z.object({prices:e.z.array(p)}),i=e.z.object({tokenAddress:a.addressSchemaArgentBackend,principal:e.z.string(),accruedFees:e.z.string(),minPrice:e.z.string(),maxPrice:e.z.string(),currentPrice:e.z.string()}),t=e.z.object({id:e.z.string(),investmentId:e.z.string().optional(),tokenAddress:a.addressSchema.optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),n=t.extend({tokenId:e.z.string(),data:e.z.object({poolFeePercentage:e.z.string(),tickSpacingPercentage:e.z.string().optional(),token0:i,token1:i})}),P=e.z.array(n),s=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional()}),investmentId:e.z.string().optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),f=e.z.array(s),r=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional(),group:e.z.number().optional(),collateral:e.z.boolean(),debt:e.z.boolean(),lending:e.z.boolean()})}),j=e.z.array(r),c=t.extend({id:e.z.string(),data:e.z.object({delegatingTo:a.addressSchema}),totalBalances:e.z.record(e.z.string(),e.z.string())}),A=e.z.array(c),d=t.extend({investmentId:e.z.string().optional(),data:e.z.object({stakerInfo:e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().optional(),address:a.addressSchema}),accruedRewards:e.z.string(),stakedAmount:e.z.string(),pendingWithdrawal:e.z.object({amount:e.z.string(),withdrawableAfter:e.z.number()}).optional(),apy:e.z.string().optional(),totalApy:e.z.string().optional(),stakedTokenAddress:a.addressSchema,rewardTokenAddress:a.addressSchema})}),T=e.z.array(d),l=n.or(r).or(c).or(s).or(d),z=e.z.array(l),m=b.createSchemaWithWarnings({productId:e.z.string().optional(),name:e.z.string(),manageUrl:e.z.string().optional(),type:h.defiPositionTypeSchema,groups:e.z.record(e.z.string(),e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional()})).optional(),positions:z}),g=e.z.object({dappId:e.z.string(),products:e.z.array(m)}),I=e.z.object({dapps:e.z.array(g)}),S=e.z.object({name:e.z.string().optional(),tokenAddress:a.addressSchema,amount:e.z.string().optional(),claimUrl:e.z.string().optional(),claimStart:e.z.number(),claimEnd:e.z.number().optional()}),C=e.z.object({accountAddress:a.addressSchema,chain:e.z.string(),airdrops:e.z.array(S)});exports.apiAccountTokenBalancesSchema=u;exports.apiAirdropSchema=S;exports.apiCollateralizedDebtPositionSchema=r;exports.apiCollateralizedDebtPositionsSchema=j;exports.apiConcentratedLiquidityPositionSchema=n;exports.apiConcentratedLiquidityPositionsSchema=P;exports.apiDefiDecompositionProduct=m;exports.apiDefiDecompositionProducts=z;exports.apiDefiDecompositionSchema=g;exports.apiDefiDecompositionToken=i;exports.apiDefiPositionSchema=l;exports.apiDefiPositionsSchema=I;exports.apiDelegatedTokensArraySchema=A;exports.apiDelegatedTokensSchema=c;exports.apiPriceDataResponseSchema=y;exports.apiPriceDetailsSchema=p;exports.apiStakingPositionSchema=s;exports.apiStakingPositionsSchema=f;exports.apiStrkDelegatedStakingPositionsSchema=T;exports.apiStrkDelegatedStakingSchema=d;exports.apiTokenInfoResponseSchema=D;exports.apiTokenInfoSchema=o;exports.apiTokensInfoResponseSchema=k;exports.apiUnclaimedRewardsSchema=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),h=require("./defiPositionType.model.cjs"),b=require("../../../utils/schemas.cjs"),u=e.z.object({status:e.z.literal("initialising")}).or(e.z.object({status:e.z.literal("initialised"),balances:e.z.array(e.z.object({tokenAddress:a.addressSchemaArgentBackend,tokenBalance:e.z.string()}))})),o=e.z.object({id:e.z.number(),address:a.addressSchema,brandColor:e.z.string().optional(),name:e.z.string(),symbol:e.z.string(),decimals:e.z.number(),iconUrl:e.z.string().optional(),sendable:e.z.boolean(),popular:e.z.boolean(),refundable:e.z.boolean(),listed:e.z.boolean(),tradable:e.z.boolean(),category:e.z.union([e.z.literal("tokens"),e.z.literal("currencies"),e.z.literal("savings")]),pricingId:e.z.number().optional(),dappId:e.z.string().optional(),marketData:e.z.object({marketCap:e.z.number().default(0),marketCap24hChange:e.z.number().default(0),dailyVolume:e.z.number().default(0),rank:e.z.number().default(0)}).optional(),tags:e.z.array(e.z.string()).optional(),useNewBalanceOfFormat:e.z.boolean().optional()}),k=e.z.object({tokens:e.z.array(o)}),D=o,p=e.z.object({pricingId:e.z.number(),ethValue:e.z.string(),ccyValue:e.z.string(),ethDayChange:e.z.string(),ccyDayChange:e.z.string()}),y=e.z.object({prices:e.z.array(p)}),i=e.z.object({tokenAddress:a.addressSchemaArgentBackend,principal:e.z.string(),accruedFees:e.z.string(),minPrice:e.z.string(),maxPrice:e.z.string(),currentPrice:e.z.string()}),t=e.z.object({id:e.z.string(),investmentId:e.z.string().optional(),tokenAddress:a.addressSchema.optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),n=t.extend({tokenId:e.z.string(),data:e.z.object({poolFeePercentage:e.z.string(),tickSpacingPercentage:e.z.string().optional(),token0:i,token1:i})}),P=e.z.array(n),s=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional()}),investmentId:e.z.string().optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),f=e.z.array(s),r=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional(),group:e.z.number().optional(),collateral:e.z.boolean(),debt:e.z.boolean(),lending:e.z.boolean()})}),j=e.z.array(r),c=t.extend({id:e.z.string(),data:e.z.object({delegatingTo:a.addressSchema}),totalBalances:e.z.record(e.z.string(),e.z.string())}),A=e.z.array(c),d=t.extend({investmentId:e.z.string().optional(),data:e.z.object({stakerInfo:e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().optional(),address:a.addressSchema}),accruedRewards:e.z.string(),stakedAmount:e.z.string(),pendingWithdrawal:e.z.object({amount:e.z.string(),withdrawableAfter:e.z.number()}).optional(),apy:e.z.string().optional(),totalApy:e.z.string().optional(),stakedTokenAddress:a.addressSchema,rewardTokenAddress:a.addressSchema})}),T=e.z.array(d),l=n.or(r).or(c).or(s).or(d),z=e.z.array(l),m=b.createSchemaWithWarnings({productId:e.z.string().optional(),name:e.z.string(),manageUrl:e.z.string().optional(),type:h.defiPositionTypeSchema,groups:e.z.record(e.z.string(),e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional()})).optional(),positions:z}),g=e.z.object({dappId:e.z.string(),products:e.z.array(m)}),I=e.z.object({dapps:e.z.array(g)}),S=e.z.object({name:e.z.string().optional(),tokenAddress:a.addressSchema,amount:e.z.string().optional(),claimUrl:e.z.string().optional(),claimStart:e.z.number(),claimEnd:e.z.number().optional()}),C=e.z.object({accountAddress:a.addressSchema,chain:e.z.string(),airdrops:e.z.array(S)});exports.apiAccountTokenBalancesSchema=u;exports.apiAirdropSchema=S;exports.apiCollateralizedDebtPositionSchema=r;exports.apiCollateralizedDebtPositionsSchema=j;exports.apiConcentratedLiquidityPositionSchema=n;exports.apiConcentratedLiquidityPositionsSchema=P;exports.apiDefiDecompositionProduct=m;exports.apiDefiDecompositionProducts=z;exports.apiDefiDecompositionSchema=g;exports.apiDefiDecompositionToken=i;exports.apiDefiPositionSchema=l;exports.apiDefiPositionsSchema=I;exports.apiDelegatedTokensArraySchema=A;exports.apiDelegatedTokensSchema=c;exports.apiPriceDataResponseSchema=y;exports.apiPriceDetailsSchema=p;exports.apiStakingPositionSchema=s;exports.apiStakingPositionsSchema=f;exports.apiStrkDelegatedStakingPositionsSchema=T;exports.apiStrkDelegatedStakingSchema=d;exports.apiTokenInfoResponseSchema=D;exports.apiTokenInfoSchema=o;exports.apiTokensInfoResponseSchema=k;exports.apiUnclaimedRewardsSchema=C;
@@ -32,6 +32,7 @@ export declare const apiTokenInfoSchema: z.ZodObject<{
32
32
  rank: z.ZodDefault<z.ZodNumber>;
33
33
  }, z.core.$strip>>;
34
34
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
35
36
  }, z.core.$strip>;
36
37
  export type ApiTokenInfo = z.infer<typeof apiTokenInfoSchema>;
37
38
  export declare const apiTokensInfoResponseSchema: z.ZodObject<{
@@ -58,6 +59,7 @@ export declare const apiTokensInfoResponseSchema: z.ZodObject<{
58
59
  rank: z.ZodDefault<z.ZodNumber>;
59
60
  }, z.core.$strip>>;
60
61
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
61
63
  }, z.core.$strip>>;
62
64
  }, z.core.$strip>;
63
65
  export declare const apiTokenInfoResponseSchema: z.ZodObject<{
@@ -83,6 +85,7 @@ export declare const apiTokenInfoResponseSchema: z.ZodObject<{
83
85
  rank: z.ZodDefault<z.ZodNumber>;
84
86
  }, z.core.$strip>>;
85
87
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
86
89
  }, z.core.$strip>;
87
90
  export type ApiTokensInfoResponse = z.infer<typeof apiTokensInfoResponseSchema>;
88
91
  export type ApiTokenInfoResponse = z.infer<typeof apiTokenInfoResponseSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z as t } from "zod";
2
- import { addressSchemaArgentBackend as o, addressSchema as a } from "../../../chains/starknet/address.js";
2
+ import { addressSchemaArgentBackend as n, addressSchema as a } from "../../../chains/starknet/address.js";
3
3
  import { defiPositionTypeSchema as d } from "./defiPositionType.model.js";
4
4
  import { createSchemaWithWarnings as g } from "../../../utils/schemas.js";
5
5
  const P = t.object({
@@ -7,7 +7,7 @@ const P = t.object({
7
7
  }).or(t.object({
8
8
  status: t.literal("initialised"),
9
9
  balances: t.array(t.object({
10
- tokenAddress: o,
10
+ tokenAddress: n,
11
11
  tokenBalance: t.string()
12
12
  }))
13
13
  })), i = t.object({
@@ -36,7 +36,8 @@ const P = t.object({
36
36
  dailyVolume: t.number().default(0),
37
37
  rank: t.number().default(0)
38
38
  }).optional(),
39
- tags: t.array(t.string()).optional()
39
+ tags: t.array(t.string()).optional(),
40
+ useNewBalanceOfFormat: t.boolean().optional()
40
41
  }), A = t.object({
41
42
  tokens: t.array(i)
42
43
  }), I = i, m = t.object({
@@ -47,8 +48,8 @@ const P = t.object({
47
48
  ccyDayChange: t.string()
48
49
  }), T = t.object({
49
50
  prices: t.array(m)
50
- }), n = t.object({
51
- tokenAddress: o,
51
+ }), o = t.object({
52
+ tokenAddress: n,
52
53
  principal: t.string(),
53
54
  accruedFees: t.string(),
54
55
  minPrice: t.string(),
@@ -64,8 +65,8 @@ const P = t.object({
64
65
  data: t.object({
65
66
  poolFeePercentage: t.string(),
66
67
  tickSpacingPercentage: t.string().optional(),
67
- token0: n,
68
- token1: n
68
+ token0: o,
69
+ token1: o
69
70
  })
70
71
  }), C = t.array(r), s = e.extend({
71
72
  data: t.object({
@@ -74,7 +75,7 @@ const P = t.object({
74
75
  }),
75
76
  investmentId: t.string().optional(),
76
77
  totalBalances: t.record(t.string(), t.string())
77
- }), x = t.array(s), c = e.extend({
78
+ }), B = t.array(s), c = e.extend({
78
79
  data: t.object({
79
80
  apy: t.string().optional(),
80
81
  totalApy: t.string().optional(),
@@ -83,13 +84,13 @@ const P = t.object({
83
84
  debt: t.boolean(),
84
85
  lending: t.boolean()
85
86
  })
86
- }), B = t.array(c), l = e.extend({
87
+ }), w = t.array(c), l = e.extend({
87
88
  id: t.string(),
88
89
  data: t.object({
89
90
  delegatingTo: a
90
91
  }),
91
92
  totalBalances: t.record(t.string(), t.string())
92
- }), w = t.array(l), p = e.extend({
93
+ }), x = t.array(l), p = e.extend({
93
94
  investmentId: t.string().optional(),
94
95
  data: t.object({
95
96
  stakerInfo: t.object({
@@ -139,21 +140,21 @@ export {
139
140
  P as apiAccountTokenBalancesSchema,
140
141
  S as apiAirdropSchema,
141
142
  c as apiCollateralizedDebtPositionSchema,
142
- B as apiCollateralizedDebtPositionsSchema,
143
+ w as apiCollateralizedDebtPositionsSchema,
143
144
  r as apiConcentratedLiquidityPositionSchema,
144
145
  C as apiConcentratedLiquidityPositionsSchema,
145
146
  h as apiDefiDecompositionProduct,
146
147
  u as apiDefiDecompositionProducts,
147
148
  k as apiDefiDecompositionSchema,
148
- n as apiDefiDecompositionToken,
149
+ o as apiDefiDecompositionToken,
149
150
  b as apiDefiPositionSchema,
150
151
  U as apiDefiPositionsSchema,
151
- w as apiDelegatedTokensArraySchema,
152
+ x as apiDelegatedTokensArraySchema,
152
153
  l as apiDelegatedTokensSchema,
153
154
  T as apiPriceDataResponseSchema,
154
155
  m as apiPriceDetailsSchema,
155
156
  s as apiStakingPositionSchema,
156
- x as apiStakingPositionsSchema,
157
+ B as apiStakingPositionsSchema,
157
158
  R as apiStrkDelegatedStakingPositionsSchema,
158
159
  p as apiStrkDelegatedStakingSchema,
159
160
  I as apiTokenInfoResponseSchema,
@@ -186,6 +186,7 @@ export declare const collateralizedDebtPositionSchema: z.ZodObject<{
186
186
  rank: z.ZodDefault<z.ZodNumber>;
187
187
  }, z.core.$strip>>;
188
188
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
189
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
189
190
  }, z.core.$strip>, z.ZodUndefined]>;
190
191
  token: z.ZodOptional<z.ZodObject<{
191
192
  currencyValue: z.ZodString;
@@ -245,6 +246,7 @@ export declare const collateralizedDebtPositionsSchema: z.ZodArray<z.ZodObject<{
245
246
  rank: z.ZodDefault<z.ZodNumber>;
246
247
  }, z.core.$strip>>;
247
248
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
249
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
248
250
  }, z.core.$strip>, z.ZodUndefined]>;
249
251
  token: z.ZodOptional<z.ZodObject<{
250
252
  currencyValue: z.ZodString;
@@ -584,6 +586,7 @@ export declare const defiPositionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.Z
584
586
  rank: z.ZodDefault<z.ZodNumber>;
585
587
  }, z.core.$strip>>;
586
588
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
589
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
587
590
  }, z.core.$strip>, z.ZodUndefined]>;
588
591
  token: z.ZodOptional<z.ZodObject<{
589
592
  currencyValue: z.ZodString;
@@ -819,6 +822,7 @@ export declare const defiProductSchema: z.ZodObject<{
819
822
  rank: z.ZodDefault<z.ZodNumber>;
820
823
  }, z.core.$strip>>;
821
824
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
825
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
822
826
  }, z.core.$strip>, z.ZodUndefined]>;
823
827
  token: z.ZodOptional<z.ZodObject<{
824
828
  currencyValue: z.ZodString;
@@ -1058,6 +1062,7 @@ export declare const defiProductsSchema: z.ZodArray<z.ZodObject<{
1058
1062
  rank: z.ZodDefault<z.ZodNumber>;
1059
1063
  }, z.core.$strip>>;
1060
1064
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1065
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
1061
1066
  }, z.core.$strip>, z.ZodUndefined]>;
1062
1067
  token: z.ZodOptional<z.ZodObject<{
1063
1068
  currencyValue: z.ZodString;
@@ -1299,6 +1304,7 @@ export declare const defiDappsProductsSchema: z.ZodObject<{
1299
1304
  rank: z.ZodDefault<z.ZodNumber>;
1300
1305
  }, z.core.$strip>>;
1301
1306
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1307
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
1302
1308
  }, z.core.$strip>, z.ZodUndefined]>;
1303
1309
  token: z.ZodOptional<z.ZodObject<{
1304
1310
  currencyValue: z.ZodString;
@@ -25,6 +25,7 @@ export declare const airdropSchema: z.ZodObject<{
25
25
  rank: z.ZodDefault<z.ZodNumber>;
26
26
  }, z.core.$strip>>;
27
27
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
28
29
  }, z.core.$strip>>;
29
30
  amount: z.ZodOptional<z.ZodString>;
30
31
  claimUrl: z.ZodOptional<z.ZodString>;
@@ -57,6 +58,7 @@ export declare const unclaimedRewardsSchema: z.ZodArray<z.ZodObject<{
57
58
  rank: z.ZodDefault<z.ZodNumber>;
58
59
  }, z.core.$strip>>;
59
60
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
60
62
  }, z.core.$strip>>;
61
63
  amount: z.ZodOptional<z.ZodString>;
62
64
  claimUrl: z.ZodOptional<z.ZodString>;
@@ -142,5 +142,6 @@ export declare const webTokenInfoDetailsSchema: z.ZodObject<{
142
142
  rank: z.ZodDefault<z.ZodNumber>;
143
143
  }, z.core.$strip>>;
144
144
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
145
146
  }, z.core.$strip>;
146
147
  export type WebTokenInfoDetails = z.infer<typeof webTokenInfoDetailsSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.78.6",
3
+ "version": "1.78.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"
@@ -64,30 +64,30 @@
64
64
  "@types/lodash-es": "4.17.12",
65
65
  "@types/numeral": "2.0.5",
66
66
  "@types/ua-parser-js": "0.7.39",
67
- "@typescript-eslint/eslint-plugin": "8.46.3",
68
- "@typescript-eslint/parser": "8.46.3",
69
- "esbuild": "0.25.12",
67
+ "@typescript-eslint/eslint-plugin": "8.46.4",
68
+ "@typescript-eslint/parser": "8.46.4",
69
+ "esbuild": "0.27.0",
70
70
  "esbuild-register": "3.6.0",
71
71
  "eslint": "8.57.1",
72
72
  "eslint-config-prettier": "10.1.8",
73
73
  "eslint-plugin-import": "2.32.0",
74
74
  "husky": "9.1.7",
75
75
  "lint-staged": "16.2.6",
76
- "msw": "2.11.6",
76
+ "msw": "2.12.2",
77
77
  "prettier": "3.6.2",
78
- "semantic-release": "25.0.1",
78
+ "semantic-release": "25.0.2",
79
79
  "ts-node": "10.9.2",
80
80
  "ts-to-zod": "5.0.1",
81
81
  "tsx": "4.20.6",
82
82
  "typescript": "5.9.3",
83
- "vite": "7.1.12",
83
+ "vite": "7.2.2",
84
84
  "vite-plugin-dts": "4.5.4",
85
- "vitest": "4.0.6"
85
+ "vitest": "4.0.10"
86
86
  },
87
87
  "dependencies": {
88
88
  "@argent/x-multicall": "^7.1.0",
89
89
  "@langchain/core": "^1.0.0",
90
- "@langchain/google-genai": "^1.0.0",
90
+ "@langchain/google-genai": "^2.0.0",
91
91
  "@lokalise/node-api": "^15.0.0",
92
92
  "@noble/hashes": "^2.0.0",
93
93
  "@starknet-io/types-js": "0.9.2",