@gardenfi/utils 2.0.6-beta.1 → 2.0.6-beta.10

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 (67) hide show
  1. package/dist/index104.cjs +1 -1
  2. package/dist/index104.js +2 -2
  3. package/dist/index115.cjs +1 -1
  4. package/dist/index115.js +1 -1
  5. package/dist/index117.cjs +1 -1
  6. package/dist/index117.js +1 -1
  7. package/dist/index20.cjs +1 -1
  8. package/dist/index20.js +1 -1
  9. package/dist/index21.cjs +1 -1
  10. package/dist/index21.js +2 -2
  11. package/dist/index22.cjs +1 -1
  12. package/dist/index22.js +1 -1
  13. package/dist/index42.cjs +1 -1
  14. package/dist/index42.js +3 -3
  15. package/dist/index53.cjs +1 -1
  16. package/dist/index53.js +1 -1
  17. package/dist/index54.cjs +1 -1
  18. package/dist/index54.js +2 -2
  19. package/dist/index55.cjs +1 -1
  20. package/dist/index55.js +1 -1
  21. package/dist/index56.cjs +1 -1
  22. package/dist/index56.js +2 -2
  23. package/dist/index57.cjs +1 -1
  24. package/dist/index57.js +5 -5
  25. package/dist/index58.cjs +1 -1
  26. package/dist/index58.js +2 -2
  27. package/dist/index6.cjs +1 -1
  28. package/dist/index6.js +12 -17
  29. package/dist/index61.cjs +1 -1
  30. package/dist/index61.js +1 -1
  31. package/dist/index66.cjs +1 -1
  32. package/dist/index66.js +1 -1
  33. package/dist/index83.cjs +1 -1
  34. package/dist/index83.js +3 -191
  35. package/dist/index84.cjs +1 -1
  36. package/dist/index84.js +8 -18
  37. package/dist/index85.cjs +1 -1
  38. package/dist/index85.js +191 -3
  39. package/dist/index86.cjs +1 -1
  40. package/dist/index86.js +18 -8
  41. package/dist/index87.cjs +1 -1
  42. package/dist/index87.js +10 -111
  43. package/dist/index88.cjs +1 -1
  44. package/dist/index88.js +18 -15
  45. package/dist/index89.cjs +1 -1
  46. package/dist/index89.js +7 -222
  47. package/dist/index90.cjs +1 -1
  48. package/dist/index90.js +110 -40
  49. package/dist/index91.cjs +1 -1
  50. package/dist/index91.js +15 -103
  51. package/dist/index92.cjs +1 -1
  52. package/dist/index92.js +222 -16
  53. package/dist/index93.cjs +1 -1
  54. package/dist/index93.js +38 -74
  55. package/dist/index94.cjs +1 -1
  56. package/dist/index94.js +104 -18
  57. package/dist/index95.cjs +1 -1
  58. package/dist/index95.js +17 -8
  59. package/dist/index96.cjs +1 -1
  60. package/dist/index96.js +76 -10
  61. package/dist/index97.cjs +1 -1
  62. package/dist/index97.js +17 -10
  63. package/dist/index98.cjs +1 -1
  64. package/dist/index98.js +11 -18
  65. package/dist/index99.cjs +1 -1
  66. package/dist/index99.js +2 -2
  67. package/package.json +2 -2
package/dist/index97.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index63.cjs");class t extends a.BaseError{constructor(e){const{docsPath:s,field:r,metaMessages:i}=e;super(`Invalid Sign-In with Ethereum message field "${r}".`,{docsPath:s,metaMessages:i,name:"SiweInvalidMessageFieldError"})}}exports.SiweInvalidMessageFieldError=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index50.cjs"),d=require("./index30.cjs"),l=require("./index51.cjs");function a(e){if(!e||e.length===0)return[];const n=[];for(let t=0;t<e.length;t++){const{address:i,storageKeys:r}=e[t];for(let s=0;s<r.length;s++)if(r[s].length-2!==64)throw new d.InvalidStorageKeySizeError({storageKey:r[s]});if(!l.isAddress(i,{strict:!1}))throw new o.InvalidAddressError({address:i});n.push([i,r])}return n}exports.serializeAccessList=a;
package/dist/index97.js CHANGED
@@ -1,14 +1,21 @@
1
- import { BaseError as i } from "./index63.js";
2
- class d extends i {
3
- constructor(e) {
4
- const { docsPath: s, field: r, metaMessages: a } = e;
5
- super(`Invalid Sign-In with Ethereum message field "${r}".`, {
6
- docsPath: s,
7
- metaMessages: a,
8
- name: "SiweInvalidMessageFieldError"
9
- });
1
+ import { InvalidAddressError as s } from "./index50.js";
2
+ import { InvalidStorageKeySizeError as l } from "./index30.js";
3
+ import { isAddress as f } from "./index51.js";
4
+ function a(r) {
5
+ if (!r || r.length === 0)
6
+ return [];
7
+ const n = [];
8
+ for (let o = 0; o < r.length; o++) {
9
+ const { address: i, storageKeys: e } = r[o];
10
+ for (let t = 0; t < e.length; t++)
11
+ if (e[t].length - 2 !== 64)
12
+ throw new l({ storageKey: e[t] });
13
+ if (!f(i, { strict: !1 }))
14
+ throw new s({ address: i });
15
+ n.push([i, e]);
10
16
  }
17
+ return n;
11
18
  }
12
19
  export {
13
- d as SiweInvalidMessageFieldError
20
+ a as serializeAccessList
14
21
  };
package/dist/index98.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(e){if(/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)||/%[^0-9a-f]/i.test(e)||/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e))return!1;const s=a(e),f=s[1],t=s[2],i=s[3],r=s[4],l=s[5];if(!(f!=null&&f.length&&i.length>=0))return!1;if(t!=null&&t.length){if(!(i.length===0||/^\//.test(i)))return!1}else if(/^\/\//.test(i))return!1;if(!/^[a-z][a-z0-9\+\-\.]*$/.test(f.toLowerCase()))return!1;let n="";return n+=`${f}:`,t!=null&&t.length&&(n+=`//${t}`),n+=i,r!=null&&r.length&&(n+=`?${r}`),l!=null&&l.length&&(n+=`#${l}`),n}function a(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)}exports.isUri=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index63.cjs");class i extends t.BaseError{constructor({offset:r,position:s,size:e}){super(`Slice ${s==="start"?"starting":"ending"} at offset "${r}" is out-of-bounds (size: ${e}).`,{name:"SliceOffsetOutOfBoundsError"})}}class d extends t.BaseError{constructor({size:r,targetSize:s,type:e}){super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}exports.SizeExceedsPaddingSizeError=d;exports.SliceOffsetOutOfBoundsError=i;
package/dist/index98.js CHANGED
@@ -1,22 +1,15 @@
1
- function o(e) {
2
- if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e) || /%[^0-9a-f]/i.test(e) || /%[0-9a-f](:?[^0-9a-f]|$)/i.test(e))
3
- return !1;
4
- const s = a(e), f = s[1], t = s[2], i = s[3], r = s[4], l = s[5];
5
- if (!(f != null && f.length && i.length >= 0))
6
- return !1;
7
- if (t != null && t.length) {
8
- if (!(i.length === 0 || /^\//.test(i)))
9
- return !1;
10
- } else if (/^\/\//.test(i))
11
- return !1;
12
- if (!/^[a-z][a-z0-9\+\-\.]*$/.test(f.toLowerCase()))
13
- return !1;
14
- let n = "";
15
- return n += `${f}:`, t != null && t.length && (n += `//${t}`), n += i, r != null && r.length && (n += `?${r}`), l != null && l.length && (n += `#${l}`), n;
1
+ import { BaseError as o } from "./index63.js";
2
+ class d extends o {
3
+ constructor({ offset: r, position: s, size: e }) {
4
+ super(`Slice ${s === "start" ? "starting" : "ending"} at offset "${r}" is out-of-bounds (size: ${e}).`, { name: "SliceOffsetOutOfBoundsError" });
5
+ }
16
6
  }
17
- function a(e) {
18
- return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);
7
+ class n extends o {
8
+ constructor({ size: r, targetSize: s, type: e }) {
9
+ super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
10
+ }
19
11
  }
20
12
  export {
21
- o as isUri
13
+ n as SizeExceedsPaddingSizeError,
14
+ d as SliceOffsetOutOfBoundsError
22
15
  };
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index96.cjs"),O=require("./index85.cjs"),n=require("./index66.cjs");function p(i,e,s,{strict:f}={}){return O.isHex(i,{strict:!1})?l(i,e,s,{strict:f}):u(i,e,s,{strict:f})}function r(i,e){if(typeof e=="number"&&e>0&&e>n.size(i)-1)throw new t.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:n.size(i)})}function c(i,e,s){if(typeof e=="number"&&typeof s=="number"&&n.size(i)!==s-e)throw new t.SliceOffsetOutOfBoundsError({offset:s,position:"end",size:n.size(i)})}function u(i,e,s,{strict:f}={}){r(i,e);const o=i.slice(e,s);return f&&c(o,e,s),o}function l(i,e,s,{strict:f}={}){r(i,e);const o=`0x${i.replace("0x","").slice((e??0)*2,(s??i.length)*2)}`;return f&&c(o,e,s),o}exports.slice=p;exports.sliceBytes=u;exports.sliceHex=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index98.cjs"),O=require("./index83.cjs"),n=require("./index66.cjs");function p(i,e,s,{strict:f}={}){return O.isHex(i,{strict:!1})?l(i,e,s,{strict:f}):u(i,e,s,{strict:f})}function r(i,e){if(typeof e=="number"&&e>0&&e>n.size(i)-1)throw new t.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:n.size(i)})}function c(i,e,s){if(typeof e=="number"&&typeof s=="number"&&n.size(i)!==s-e)throw new t.SliceOffsetOutOfBoundsError({offset:s,position:"end",size:n.size(i)})}function u(i,e,s,{strict:f}={}){r(i,e);const o=i.slice(e,s);return f&&c(o,e,s),o}function l(i,e,s,{strict:f}={}){r(i,e);const o=`0x${i.replace("0x","").slice((e??0)*2,(s??i.length)*2)}`;return f&&c(o,e,s),o}exports.slice=p;exports.sliceBytes=u;exports.sliceHex=l;
package/dist/index99.js CHANGED
@@ -1,5 +1,5 @@
1
- import { SliceOffsetOutOfBoundsError as t } from "./index96.js";
2
- import { isHex as p } from "./index85.js";
1
+ import { SliceOffsetOutOfBoundsError as t } from "./index98.js";
2
+ import { isHex as p } from "./index83.js";
3
3
  import { size as r } from "./index66.js";
4
4
  function w(e, f, i, { strict: o } = {}) {
5
5
  return p(e, { strict: !1 }) ? u(e, f, i, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/utils",
3
- "version": "2.0.6-beta.1",
3
+ "version": "2.0.6-beta.10",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "sideEffects": false,
37
37
  "dependencies": {
38
+ "@peculiar/webcrypto": "^1.5.0",
38
39
  "@simplewebauthn/browser": "^13.1.0",
39
- "crypto-browserify": "^3.12.1",
40
40
  "jwt-decode": "^4.0.0",
41
41
  "viem": "^2.21.23"
42
42
  }