@gardenfi/utils 2.0.3 → 2.0.4

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 (113) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +22 -17
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +32 -17
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +14 -183
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +186 -92
  9. package/dist/index13.cjs +1 -16
  10. package/dist/index13.js +93 -113
  11. package/dist/index14.cjs +16 -1
  12. package/dist/index14.js +112 -30
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +18 -17
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +31 -18
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +17 -7
  19. package/dist/index18.cjs +1 -1
  20. package/dist/index18.js +6 -19
  21. package/dist/index19.cjs +1 -1
  22. package/dist/index19.js +20 -21
  23. package/dist/index20.cjs +1 -1
  24. package/dist/index20.js +21 -8
  25. package/dist/index21.cjs +1 -1
  26. package/dist/index21.js +8 -31
  27. package/dist/index22.cjs +1 -1
  28. package/dist/index22.js +31 -26
  29. package/dist/index23.cjs +1 -1
  30. package/dist/index23.js +25 -22
  31. package/dist/index24.cjs +1 -1
  32. package/dist/index24.js +22 -50
  33. package/dist/index25.cjs +1 -1
  34. package/dist/index25.js +51 -12
  35. package/dist/index26.cjs +1 -1
  36. package/dist/index26.js +12 -24
  37. package/dist/index27.cjs +1 -1
  38. package/dist/index27.js +24 -75
  39. package/dist/index28.cjs +1 -1
  40. package/dist/index28.js +74 -22
  41. package/dist/index29.cjs +1 -1
  42. package/dist/index29.js +23 -7
  43. package/dist/index30.cjs +1 -1
  44. package/dist/index30.js +7 -32
  45. package/dist/index31.cjs +1 -1
  46. package/dist/index31.js +31 -14
  47. package/dist/index32.cjs +1 -1
  48. package/dist/index32.js +16 -2
  49. package/dist/index33.cjs +1 -1
  50. package/dist/index33.js +2 -9
  51. package/dist/index34.cjs +1 -1
  52. package/dist/index34.js +8 -20
  53. package/dist/index35.cjs +1 -1
  54. package/dist/index35.js +20 -12
  55. package/dist/index36.cjs +1 -1
  56. package/dist/index36.js +10 -32
  57. package/dist/index37.cjs +1 -2
  58. package/dist/index37.js +33 -58
  59. package/dist/index38.cjs +2 -1
  60. package/dist/index38.js +60 -2
  61. package/dist/index39.cjs +1 -1
  62. package/dist/index39.js +2 -5
  63. package/dist/index4.cjs +1 -1
  64. package/dist/index4.js +2 -2
  65. package/dist/index40.cjs +1 -1
  66. package/dist/index40.js +4 -11
  67. package/dist/index41.cjs +1 -1
  68. package/dist/index41.js +11 -3
  69. package/dist/index42.cjs +1 -1
  70. package/dist/index42.js +3 -21
  71. package/dist/index43.cjs +1 -1
  72. package/dist/index43.js +21 -12
  73. package/dist/index44.cjs +1 -1
  74. package/dist/index44.js +11 -54
  75. package/dist/index45.cjs +1 -1
  76. package/dist/index45.js +55 -6
  77. package/dist/index46.cjs +1 -1
  78. package/dist/index46.js +6 -21
  79. package/dist/index47.cjs +1 -1
  80. package/dist/index47.js +21 -11
  81. package/dist/index48.cjs +1 -1
  82. package/dist/index48.js +11 -3
  83. package/dist/index49.cjs +1 -1
  84. package/dist/index49.js +3 -11
  85. package/dist/index5.cjs +1 -1
  86. package/dist/index5.js +43 -19
  87. package/dist/index50.cjs +1 -1
  88. package/dist/index50.js +11 -19
  89. package/dist/index51.cjs +1 -1
  90. package/dist/index51.js +19 -6
  91. package/dist/index52.cjs +1 -1
  92. package/dist/index52.js +6 -8
  93. package/dist/index53.cjs +1 -1
  94. package/dist/index53.js +8 -104
  95. package/dist/index54.cjs +1 -1
  96. package/dist/index54.js +102 -26
  97. package/dist/index55.cjs +1 -1
  98. package/dist/index55.js +27 -17
  99. package/dist/index56.cjs +1 -1
  100. package/dist/index56.js +16 -36
  101. package/dist/index57.cjs +1 -0
  102. package/dist/index57.js +41 -0
  103. package/dist/index6.cjs +1 -1
  104. package/dist/index6.js +19 -104
  105. package/dist/index7.cjs +1 -1
  106. package/dist/index7.js +104 -10
  107. package/dist/index8.cjs +1 -1
  108. package/dist/index8.js +15 -2
  109. package/dist/index9.cjs +1 -1
  110. package/dist/index9.js +2 -34
  111. package/dist/src/index.d.ts +1 -0
  112. package/dist/src/lib/result.d.ts +16 -0
  113. package/package.json +1 -1
package/dist/index4.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Err as c, Ok as i } from "./index11.js";
1
+ import { Err as c, Ok as i } from "./index12.js";
2
2
  import { getContract as u, erc20Abi as d, maxUint256 as m } from "viem";
3
3
  import { with0x as a } from "./index3.js";
4
- import { waitForTransactionReceipt as f } from "./index12.js";
4
+ import { waitForTransactionReceipt as f } from "./index13.js";
5
5
  const g = async (p, s, t, r) => {
6
6
  if (!r.account) return c("No account found");
7
7
  const n = u({
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n,{args:a,eventName:t}={}){return{...n,blockHash:n.blockHash?n.blockHash:null,blockNumber:n.blockNumber?BigInt(n.blockNumber):null,logIndex:n.logIndex?Number(n.logIndex):null,transactionHash:n.transactionHash?n.transactionHash:null,transactionIndex:n.transactionIndex?Number(n.transactionIndex):null,...t?{args:a,eventName:t}:{}}}exports.formatLog=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index49.cjs");function i(e){return t.isHex(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}exports.size=i;
package/dist/index40.js CHANGED
@@ -1,14 +1,7 @@
1
- function r(n, { args: t, eventName: a } = {}) {
2
- return {
3
- ...n,
4
- blockHash: n.blockHash ? n.blockHash : null,
5
- blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
6
- logIndex: n.logIndex ? Number(n.logIndex) : null,
7
- transactionHash: n.transactionHash ? n.transactionHash : null,
8
- transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
9
- ...a ? { args: t, eventName: a } : {}
10
- };
1
+ import { isHex as r } from "./index49.js";
2
+ function i(t) {
3
+ return r(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
11
4
  }
12
5
  export {
13
- r as formatLog
6
+ i as size
14
7
  };
package/dist/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n,{args:a,eventName:t}={}){return{...n,blockHash:n.blockHash?n.blockHash:null,blockNumber:n.blockNumber?BigInt(n.blockNumber):null,logIndex:n.logIndex?Number(n.logIndex):null,transactionHash:n.transactionHash?n.transactionHash:null,transactionIndex:n.transactionIndex?Number(n.transactionIndex):null,...t?{args:a,eventName:t}:{}}}exports.formatLog=r;
package/dist/index41.js CHANGED
@@ -1,6 +1,14 @@
1
- async function n(e) {
2
- return new Promise((t) => setTimeout(t, e));
1
+ function r(n, { args: t, eventName: a } = {}) {
2
+ return {
3
+ ...n,
4
+ blockHash: n.blockHash ? n.blockHash : null,
5
+ blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
6
+ logIndex: n.logIndex ? Number(n.logIndex) : null,
7
+ transactionHash: n.transactionHash ? n.transactionHash : null,
8
+ transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
9
+ ...a ? { args: t, eventName: a } : {}
10
+ };
3
11
  }
4
12
  export {
5
- n as wait
13
+ r as formatLog
6
14
  };
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index43.cjs"),f=require("./index44.cjs"),a=require("./index45.cjs"),l=require("./index46.cjs"),A=require("./index47.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c)),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
package/dist/index42.js CHANGED
@@ -1,24 +1,6 @@
1
- import { InvalidAddressError as c } from "./index43.js";
2
- import { stringToBytes as m } from "./index44.js";
3
- import { keccak256 as p } from "./index45.js";
4
- import { LruMap as u } from "./index46.js";
5
- import { isAddress as $ } from "./index47.js";
6
- const s = /* @__PURE__ */ new u(8192);
7
- function h(t, e) {
8
- if (s.has(`${t}.${e}`))
9
- return s.get(`${t}.${e}`);
10
- const i = t.substring(2).toLowerCase(), n = p(m(i)), o = i.split("");
11
- for (let r = 0; r < 40; r += 2)
12
- n[r >> 1] >> 4 >= 8 && o[r] && (o[r] = o[r].toUpperCase()), (n[r >> 1] & 15) >= 8 && o[r + 1] && (o[r + 1] = o[r + 1].toUpperCase());
13
- const f = `0x${o.join("")}`;
14
- return s.set(`${t}.${e}`, f), f;
15
- }
16
- function w(t, e) {
17
- if (!$(t, { strict: !1 }))
18
- throw new c({ address: t });
19
- return h(t, e);
1
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
20
3
  }
21
4
  export {
22
- h as checksumAddress,
23
- w as getAddress
5
+ n as wait
24
6
  };
package/dist/index43.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index37.cjs");class r extends s.BaseError{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}exports.InvalidAddressError=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index44.cjs"),f=require("./index45.cjs"),a=require("./index46.cjs"),l=require("./index47.cjs"),A=require("./index48.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c)),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
package/dist/index43.js CHANGED
@@ -1,15 +1,24 @@
1
- import { BaseError as r } from "./index37.js";
2
- class d extends r {
3
- constructor({ address: s }) {
4
- super(`Address "${s}" is invalid.`, {
5
- metaMessages: [
6
- "- Address must be a hex value of 20 bytes (40 hex characters).",
7
- "- Address must match its checksum counterpart."
8
- ],
9
- name: "InvalidAddressError"
10
- });
11
- }
1
+ import { InvalidAddressError as c } from "./index44.js";
2
+ import { stringToBytes as m } from "./index45.js";
3
+ import { keccak256 as p } from "./index46.js";
4
+ import { LruMap as u } from "./index47.js";
5
+ import { isAddress as $ } from "./index48.js";
6
+ const s = /* @__PURE__ */ new u(8192);
7
+ function h(t, e) {
8
+ if (s.has(`${t}.${e}`))
9
+ return s.get(`${t}.${e}`);
10
+ const i = t.substring(2).toLowerCase(), n = p(m(i)), o = i.split("");
11
+ for (let r = 0; r < 40; r += 2)
12
+ n[r >> 1] >> 4 >= 8 && o[r] && (o[r] = o[r].toUpperCase()), (n[r >> 1] & 15) >= 8 && o[r + 1] && (o[r + 1] = o[r + 1].toUpperCase());
13
+ const f = `0x${o.join("")}`;
14
+ return s.set(`${t}.${e}`, f), f;
15
+ }
16
+ function w(t, e) {
17
+ if (!$(t, { strict: !1 }))
18
+ throw new c({ address: t });
19
+ return h(t, e);
12
20
  }
13
21
  export {
14
- d as InvalidAddressError
22
+ h as checksumAddress,
23
+ w as getAddress
15
24
  };
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index37.cjs"),l=require("./index48.cjs"),u=require("./index36.cjs"),f=require("./index28.cjs"),m=require("./index18.cjs"),h=new TextEncoder;function A(e,n={}){return typeof e=="number"||typeof e=="bigint"?B(e,n):typeof e=="boolean"?x(e,n):l.isHex(e)?c(e,n):T(e,n)}function x(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{size:n.size})):t}const i={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(e){if(e>=i.zero&&e<=i.nine)return e-i.zero;if(e>=i.A&&e<=i.F)return e-(i.A-10);if(e>=i.a&&e<=i.f)return e-(i.a-10)}function c(e,n={}){let t=e;n.size&&(f.assertSize(t,{size:n.size}),t=u.pad(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const d=r.length/2,y=new Uint8Array(d);for(let s=0,o=0;s<d;s++){const b=g(r.charCodeAt(o++)),z=g(r.charCodeAt(o++));if(b===void 0||z===void 0)throw new a.BaseError(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);y[s]=b*16+z}return y}function B(e,n){const t=m.numberToHex(e,n);return c(t)}function T(e,n={}){const t=h.encode(e);return typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{dir:"right",size:n.size})):t}exports.boolToBytes=x;exports.hexToBytes=c;exports.numberToBytes=B;exports.stringToBytes=T;exports.toBytes=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index38.cjs");class r extends s.BaseError{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}exports.InvalidAddressError=r;
package/dist/index44.js CHANGED
@@ -1,58 +1,15 @@
1
- import { BaseError as g } from "./index37.js";
2
- import { isHex as x } from "./index48.js";
3
- import { pad as s } from "./index36.js";
4
- import { assertSize as u } from "./index28.js";
5
- import { numberToHex as h } from "./index18.js";
6
- const A = /* @__PURE__ */ new TextEncoder();
7
- function F(e, n = {}) {
8
- return typeof e == "number" || typeof e == "bigint" ? T(e, n) : typeof e == "boolean" ? B(e, n) : x(e) ? y(e, n) : l(e, n);
9
- }
10
- function B(e, n = {}) {
11
- const r = new Uint8Array(1);
12
- return r[0] = Number(e), typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { size: n.size })) : r;
13
- }
14
- const t = {
15
- zero: 48,
16
- nine: 57,
17
- A: 65,
18
- F: 70,
19
- a: 97,
20
- f: 102
21
- };
22
- function m(e) {
23
- if (e >= t.zero && e <= t.nine)
24
- return e - t.zero;
25
- if (e >= t.A && e <= t.F)
26
- return e - (t.A - 10);
27
- if (e >= t.a && e <= t.f)
28
- return e - (t.a - 10);
29
- }
30
- function y(e, n = {}) {
31
- let r = e;
32
- n.size && (u(r, { size: n.size }), r = s(r, { dir: "right", size: n.size }));
33
- let i = r.slice(2);
34
- i.length % 2 && (i = `0${i}`);
35
- const z = i.length / 2, d = new Uint8Array(z);
36
- for (let f = 0, o = 0; f < z; f++) {
37
- const b = m(i.charCodeAt(o++)), c = m(i.charCodeAt(o++));
38
- if (b === void 0 || c === void 0)
39
- throw new g(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
40
- d[f] = b * 16 + c;
1
+ import { BaseError as r } from "./index38.js";
2
+ class d extends r {
3
+ constructor({ address: s }) {
4
+ super(`Address "${s}" is invalid.`, {
5
+ metaMessages: [
6
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
7
+ "- Address must match its checksum counterpart."
8
+ ],
9
+ name: "InvalidAddressError"
10
+ });
41
11
  }
42
- return d;
43
- }
44
- function T(e, n) {
45
- const r = h(e, n);
46
- return y(r);
47
- }
48
- function l(e, n = {}) {
49
- const r = A.encode(e);
50
- return typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { dir: "right", size: n.size })) : r;
51
12
  }
52
13
  export {
53
- B as boolToBytes,
54
- y as hexToBytes,
55
- T as numberToBytes,
56
- l as stringToBytes,
57
- F as toBytes
14
+ d as InvalidAddressError
58
15
  };
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index53.cjs"),s=require("./index48.cjs"),c=require("./index44.cjs");function r(e,o){return t.keccak_256(s.isHex(e,{strict:!1})?c.toBytes(e):e)}exports.keccak256=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index38.cjs"),l=require("./index49.cjs"),u=require("./index37.cjs"),f=require("./index29.cjs"),m=require("./index19.cjs"),h=new TextEncoder;function A(e,n={}){return typeof e=="number"||typeof e=="bigint"?B(e,n):typeof e=="boolean"?x(e,n):l.isHex(e)?c(e,n):T(e,n)}function x(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{size:n.size})):t}const i={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(e){if(e>=i.zero&&e<=i.nine)return e-i.zero;if(e>=i.A&&e<=i.F)return e-(i.A-10);if(e>=i.a&&e<=i.f)return e-(i.a-10)}function c(e,n={}){let t=e;n.size&&(f.assertSize(t,{size:n.size}),t=u.pad(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const d=r.length/2,y=new Uint8Array(d);for(let s=0,o=0;s<d;s++){const b=g(r.charCodeAt(o++)),z=g(r.charCodeAt(o++));if(b===void 0||z===void 0)throw new a.BaseError(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);y[s]=b*16+z}return y}function B(e,n){const t=m.numberToHex(e,n);return c(t)}function T(e,n={}){const t=h.encode(e);return typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{dir:"right",size:n.size})):t}exports.boolToBytes=x;exports.hexToBytes=c;exports.numberToBytes=B;exports.stringToBytes=T;exports.toBytes=A;
package/dist/index45.js CHANGED
@@ -1,9 +1,58 @@
1
- import { keccak_256 as o } from "./index53.js";
2
- import { isHex as r } from "./index48.js";
3
- import { toBytes as c } from "./index44.js";
4
- function k(t, e) {
5
- return o(r(t, { strict: !1 }) ? c(t) : t);
1
+ import { BaseError as g } from "./index38.js";
2
+ import { isHex as x } from "./index49.js";
3
+ import { pad as s } from "./index37.js";
4
+ import { assertSize as u } from "./index29.js";
5
+ import { numberToHex as h } from "./index19.js";
6
+ const A = /* @__PURE__ */ new TextEncoder();
7
+ function F(e, n = {}) {
8
+ return typeof e == "number" || typeof e == "bigint" ? T(e, n) : typeof e == "boolean" ? B(e, n) : x(e) ? y(e, n) : l(e, n);
9
+ }
10
+ function B(e, n = {}) {
11
+ const r = new Uint8Array(1);
12
+ return r[0] = Number(e), typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { size: n.size })) : r;
13
+ }
14
+ const t = {
15
+ zero: 48,
16
+ nine: 57,
17
+ A: 65,
18
+ F: 70,
19
+ a: 97,
20
+ f: 102
21
+ };
22
+ function m(e) {
23
+ if (e >= t.zero && e <= t.nine)
24
+ return e - t.zero;
25
+ if (e >= t.A && e <= t.F)
26
+ return e - (t.A - 10);
27
+ if (e >= t.a && e <= t.f)
28
+ return e - (t.a - 10);
29
+ }
30
+ function y(e, n = {}) {
31
+ let r = e;
32
+ n.size && (u(r, { size: n.size }), r = s(r, { dir: "right", size: n.size }));
33
+ let i = r.slice(2);
34
+ i.length % 2 && (i = `0${i}`);
35
+ const z = i.length / 2, d = new Uint8Array(z);
36
+ for (let f = 0, o = 0; f < z; f++) {
37
+ const b = m(i.charCodeAt(o++)), c = m(i.charCodeAt(o++));
38
+ if (b === void 0 || c === void 0)
39
+ throw new g(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
40
+ d[f] = b * 16 + c;
41
+ }
42
+ return d;
43
+ }
44
+ function T(e, n) {
45
+ const r = h(e, n);
46
+ return y(r);
47
+ }
48
+ function l(e, n = {}) {
49
+ const r = A.encode(e);
50
+ return typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { dir: "right", size: n.size })) : r;
6
51
  }
7
52
  export {
8
- k as keccak256
53
+ B as boolToBytes,
54
+ y as hexToBytes,
55
+ T as numberToBytes,
56
+ l as stringToBytes,
57
+ F as toBytes
9
58
  };
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}exports.LruMap=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index54.cjs"),s=require("./index49.cjs"),c=require("./index45.cjs");function r(e,o){return t.keccak_256(s.isHex(e,{strict:!1})?c.toBytes(e):e)}exports.keccak256=r;
package/dist/index46.js CHANGED
@@ -1,24 +1,9 @@
1
- class r extends Map {
2
- constructor(e) {
3
- super(), Object.defineProperty(this, "maxSize", {
4
- enumerable: !0,
5
- configurable: !0,
6
- writable: !0,
7
- value: void 0
8
- }), this.maxSize = e;
9
- }
10
- get(e) {
11
- const t = super.get(e);
12
- return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
13
- }
14
- set(e, t) {
15
- if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
16
- const s = this.keys().next().value;
17
- s && this.delete(s);
18
- }
19
- return this;
20
- }
1
+ import { keccak_256 as o } from "./index54.js";
2
+ import { isHex as r } from "./index49.js";
3
+ import { toBytes as c } from "./index45.js";
4
+ function k(t, e) {
5
+ return o(r(t, { strict: !1 }) ? c(t) : t);
21
6
  }
22
7
  export {
23
- r as LruMap
8
+ k as keccak256
24
9
  };
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index46.cjs"),i=require("./index42.cjs"),o=/^0x[a-fA-F0-9]{40}$/,t=new c.LruMap(8192);function f(e,n){const{strict:s=!0}=n??{},r=`${e}.${s}`;if(t.has(r))return t.get(r);const u=o.test(e)?e.toLowerCase()===e?!0:s?i.checksumAddress(e)===e:!0:!1;return t.set(r,u),u}exports.isAddress=f;exports.isAddressCache=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}exports.LruMap=i;
package/dist/index47.js CHANGED
@@ -1,14 +1,24 @@
1
- import { LruMap as u } from "./index46.js";
2
- import { checksumAddress as c } from "./index42.js";
3
- const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
4
- function h(t, s) {
5
- const { strict: n = !0 } = s ?? {}, e = `${t}.${n}`;
6
- if (r.has(e))
7
- return r.get(e);
8
- const o = i.test(t) ? t.toLowerCase() === t ? !0 : n ? c(t) === t : !0 : !1;
9
- return r.set(e, o), o;
1
+ class r extends Map {
2
+ constructor(e) {
3
+ super(), Object.defineProperty(this, "maxSize", {
4
+ enumerable: !0,
5
+ configurable: !0,
6
+ writable: !0,
7
+ value: void 0
8
+ }), this.maxSize = e;
9
+ }
10
+ get(e) {
11
+ const t = super.get(e);
12
+ return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
13
+ }
14
+ set(e, t) {
15
+ if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
16
+ const s = this.keys().next().value;
17
+ s && this.delete(s);
18
+ }
19
+ return this;
20
+ }
10
21
  }
11
22
  export {
12
- h as isAddress,
13
- r as isAddressCache
23
+ r as LruMap
14
24
  };
package/dist/index48.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}exports.isHex=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index47.cjs"),i=require("./index43.cjs"),o=/^0x[a-fA-F0-9]{40}$/,t=new c.LruMap(8192);function f(e,n){const{strict:s=!0}=n??{},r=`${e}.${s}`;if(t.has(r))return t.get(r);const u=o.test(e)?e.toLowerCase()===e?!0:s?i.checksumAddress(e)===e:!0:!1;return t.set(r,u),u}exports.isAddress=f;exports.isAddressCache=t;
package/dist/index48.js CHANGED
@@ -1,6 +1,14 @@
1
- function e(t, { strict: r = !0 } = {}) {
2
- return !t || typeof t != "string" ? !1 : r ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
1
+ import { LruMap as u } from "./index47.js";
2
+ import { checksumAddress as c } from "./index43.js";
3
+ const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
4
+ function h(t, s) {
5
+ const { strict: n = !0 } = s ?? {}, e = `${t}.${n}`;
6
+ if (r.has(e))
7
+ return r.get(e);
8
+ const o = i.test(t) ? t.toLowerCase() === t ? !0 : n ? c(t) === t : !0 : !1;
9
+ return r.set(e, o), o;
3
10
  }
4
11
  export {
5
- e as isHex
12
+ h as isAddress,
13
+ r as isAddressCache
6
14
  };
package/dist/index49.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index37.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"});function r(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}exports.isHex=r;
package/dist/index49.js CHANGED
@@ -1,14 +1,6 @@
1
- import { BaseError as i } from "./index37.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
- });
10
- }
1
+ function e(t, { strict: r = !0 } = {}) {
2
+ return !t || typeof t != "string" ? !1 : r ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
11
3
  }
12
4
  export {
13
- d as SiweInvalidMessageFieldError
5
+ e as isHex
14
6
  };
package/dist/index5.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r extends URL{constructor(t,e){super(t,e)}endpoint(t){t.startsWith("/")||(t=`/${t}`);const e=`${this.pathname!=="/"?this.pathname:""}${t}`;return new r(e,this)}socket(){if(this.protocol==="https:")return this.origin.replace("https","wss");if(this.protocol==="http:")return this.origin.replace("http","ws");throw new Error("Invalid protocol")}addSearchParams(t){const e=new URLSearchParams(this.search);for(const s in t)e.set(s,t[s]);return new r(`${this.pathname}?${e.toString()}`,this)}}exports.Url=r;
1
+ "use strict";var g=t=>{throw TypeError(t)};var a=(t,e,n)=>e.has(t)||g("Cannot "+n);var u=(t,e,n)=>(a(t,e,"read from private field"),n?n.call(t):e.get(t)),l=(t,e,n)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),f=(t,e,n,r)=>(a(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i,s,o;class c{constructor(e,n,r=void 0){l(this,i);l(this,s);l(this,o);f(this,i,e),f(this,o,r),f(this,s,n)}get ok(){return u(this,i)}get error(){return u(this,o)}get val(){return u(this,s)}}i=new WeakMap,s=new WeakMap,o=new WeakMap;const d=t=>new c(!0,t),h=void 0,v=(t,...e)=>{if(typeof t=="string"&&e&&e.length>0){const n=[t,...e].map(r=>{if(r){if(r instanceof Error)return r.message;if(typeof r=="string")return r;if(r!=null&&r.toString)return r.toString()}});return new c(!1,null,n.filter(r=>r!==void 0).join(" "))}return new c(!1,null,t)};exports.Err=v;exports.Ok=d;exports.Result=c;exports.Void=h;
package/dist/index5.js CHANGED
@@ -1,26 +1,50 @@
1
- class r extends URL {
2
- constructor(t, s) {
3
- super(t, s);
1
+ var g = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var h = (t, r, n) => r.has(t) || g("Cannot " + n);
5
+ var u = (t, r, n) => (h(t, r, "read from private field"), n ? n.call(t) : r.get(t)), l = (t, r, n) => r.has(t) ? g("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, n), f = (t, r, n, e) => (h(t, r, "write to private field"), e ? e.call(t, n) : r.set(t, n), n);
6
+ var s, i, o;
7
+ class c {
8
+ constructor(r, n, e = void 0) {
9
+ l(this, s);
10
+ l(this, i);
11
+ l(this, o);
12
+ f(this, s, r), f(this, o, e), f(this, i, n);
4
13
  }
5
- endpoint(t) {
6
- t.startsWith("/") || (t = `/${t}`);
7
- const s = `${this.pathname !== "/" ? this.pathname : ""}${t}`;
8
- return new r(s, this);
14
+ get ok() {
15
+ return u(this, s);
9
16
  }
10
- socket() {
11
- if (this.protocol === "https:")
12
- return this.origin.replace("https", "wss");
13
- if (this.protocol === "http:")
14
- return this.origin.replace("http", "ws");
15
- throw new Error("Invalid protocol");
17
+ get error() {
18
+ return u(this, o);
16
19
  }
17
- addSearchParams(t) {
18
- const s = new URLSearchParams(this.search);
19
- for (const e in t)
20
- s.set(e, t[e]);
21
- return new r(`${this.pathname}?${s.toString()}`, this);
20
+ get val() {
21
+ return u(this, i);
22
22
  }
23
23
  }
24
+ s = new WeakMap(), i = new WeakMap(), o = new WeakMap();
25
+ const v = (t) => new c(!0, t), d = void 0, k = (t, ...r) => {
26
+ if (typeof t == "string" && r && r.length > 0) {
27
+ const n = [t, ...r].map((e) => {
28
+ if (e) {
29
+ if (e instanceof Error)
30
+ return e.message;
31
+ if (typeof e == "string")
32
+ return e;
33
+ if (e != null && e.toString)
34
+ return e.toString();
35
+ }
36
+ });
37
+ return new c(
38
+ !1,
39
+ null,
40
+ n.filter((e) => e !== void 0).join(" ")
41
+ );
42
+ }
43
+ return new c(!1, null, t);
44
+ };
24
45
  export {
25
- r as Url
46
+ k as Err,
47
+ v as Ok,
48
+ c as Result,
49
+ d as Void
26
50
  };
package/dist/index50.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 a=require("./index38.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;
package/dist/index50.js CHANGED
@@ -1,22 +1,14 @@
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;
16
- }
17
- function a(e) {
18
- return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);
1
+ import { BaseError as i } from "./index38.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
+ });
10
+ }
19
11
  }
20
12
  export {
21
- o as isUri
13
+ d as SiweInvalidMessageFieldError
22
14
  };
package/dist/index51.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index37.cjs");class d extends i.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;
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;
package/dist/index51.js CHANGED
@@ -1,9 +1,22 @@
1
- import { BaseError as i } from "./index37.js";
2
- class a extends i {
3
- constructor({ size: r, targetSize: s, type: e }) {
4
- super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
5
- }
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;
16
+ }
17
+ function a(e) {
18
+ return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);
6
19
  }
7
20
  export {
8
- a as SizeExceedsPaddingSizeError
21
+ o as isUri
9
22
  };
package/dist/index52.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}exports.defineChain=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index38.cjs");class d extends i.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;
package/dist/index52.js CHANGED
@@ -1,11 +1,9 @@
1
- function n(e) {
2
- return {
3
- formatters: void 0,
4
- fees: void 0,
5
- serializers: void 0,
6
- ...e
7
- };
1
+ import { BaseError as i } from "./index38.js";
2
+ class a extends i {
3
+ constructor({ size: r, targetSize: s, type: e }) {
4
+ super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (${r}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
5
+ }
8
6
  }
9
7
  export {
10
- n as defineChain
8
+ a as SizeExceedsPaddingSizeError
11
9
  };
package/dist/index53.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index54.cjs"),f=require("./index55.cjs"),c=require("./index56.cjs"),I=[],O=[],w=[],B=BigInt(0),a=BigInt(1),A=BigInt(2),S=BigInt(7),H=BigInt(256),T=BigInt(113);for(let i=0,t=a,s=1,n=0;i<24;i++){[s,n]=[n,(2*s+3*n)%5],I.push(2*(5*n+s)),O.push((i+1)*(i+2)/2%64);let o=B;for(let r=0;r<7;r++)t=(t<<a^(t>>S)*T)%H,t&A&&(o^=a<<(a<<BigInt(r))-a);w.push(o)}const[m,E]=f.split(w,!0),y=(i,t,s)=>s>32?f.rotlBH(i,t,s):f.rotlSH(i,t,s),b=(i,t,s)=>s>32?f.rotlBL(i,t,s):f.rotlSL(i,t,s);function L(i,t=24){const s=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let e=0;e<10;e++)s[e]=i[e]^i[e+10]^i[e+20]^i[e+30]^i[e+40];for(let e=0;e<10;e+=2){const h=(e+8)%10,p=(e+2)%10,d=s[p],u=s[p+1],_=y(d,u,1)^s[h],g=b(d,u,1)^s[h+1];for(let k=0;k<50;k+=10)i[e+k]^=_,i[e+k+1]^=g}let o=i[2],r=i[3];for(let e=0;e<24;e++){const h=O[e],p=y(o,r,h),d=b(o,r,h),u=I[e];o=i[u],r=i[u+1],i[u]=p,i[u+1]=d}for(let e=0;e<50;e+=10){for(let h=0;h<10;h++)s[h]=i[e+h];for(let h=0;h<10;h++)i[e+h]^=~s[(h+2)%10]&s[(h+4)%10]}i[0]^=m[n],i[1]^=E[n]}s.fill(0)}class x extends c.Hash{constructor(t,s,n,o=!1,r=24){if(super(),this.blockLen=t,this.suffix=s,this.outputLen=n,this.enableXOF=o,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,l.anumber(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=c.u32(this.state)}keccak(){c.isLE||c.byteSwap32(this.state32),L(this.state32,this.rounds),c.isLE||c.byteSwap32(this.state32),this.posOut=0,this.pos=0}update(t){l.aexists(this);const{blockLen:s,state:n}=this;t=c.toBytes(t);const o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let h=0;h<e;h++)n[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:n,blockLen:o}=this;t[n]^=s,s&128&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){l.aexists(this,!1),l.abytes(t),this.finish();const s=this.state,{blockLen:n}=this;for(let o=0,r=t.length;o<r;){this.posOut>=n&&this.keccak();const e=Math.min(n-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return l.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(l.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:s,suffix:n,outputLen:o,rounds:r,enableXOF:e}=this;return t||(t=new x(s,n,o,e,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=n,t.outputLen=o,t.enableXOF=e,t.destroyed=this.destroyed,t}}const F=(i,t,s)=>c.wrapConstructor(()=>new x(t,i,s)),P=F(1,136,256/8);exports.Keccak=x;exports.keccakP=L;exports.keccak_256=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}exports.defineChain=n;