@gardenfi/utils 2.1.2-beta.7 → 2.1.2-beta.9

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 (131) hide show
  1. package/dist/index102.cjs +1 -1
  2. package/dist/index102.js +2 -2
  3. package/dist/index103.cjs +1 -1
  4. package/dist/index103.js +1 -1
  5. package/dist/index15.cjs +1 -1
  6. package/dist/index15.js +2 -2
  7. package/dist/index20.cjs +1 -1
  8. package/dist/index20.js +17 -18
  9. package/dist/index21.cjs +1 -16
  10. package/dist/index21.js +30 -112
  11. package/dist/index22.cjs +16 -1
  12. package/dist/index22.js +113 -30
  13. package/dist/index23.cjs +1 -1
  14. package/dist/index23.js +3 -3
  15. package/dist/index32.cjs +1 -1
  16. package/dist/index32.js +1 -1
  17. package/dist/index33.cjs +1 -1
  18. package/dist/index33.js +1 -1
  19. package/dist/index35.cjs +1 -1
  20. package/dist/index35.js +1 -1
  21. package/dist/index36.cjs +1 -1
  22. package/dist/index36.js +2 -2
  23. package/dist/index37.cjs +1 -1
  24. package/dist/index37.js +2 -2
  25. package/dist/index38.cjs +1 -1
  26. package/dist/index38.js +1 -1
  27. package/dist/index39.cjs +1 -1
  28. package/dist/index39.js +2 -2
  29. package/dist/index40.cjs +1 -1
  30. package/dist/index40.js +11 -11
  31. package/dist/index41.cjs +1 -1
  32. package/dist/index41.js +3 -3
  33. package/dist/index42.cjs +1 -1
  34. package/dist/index42.js +1 -1
  35. package/dist/index43.cjs +1 -1
  36. package/dist/index43.js +1 -1
  37. package/dist/index45.cjs +1 -1
  38. package/dist/index45.js +1 -1
  39. package/dist/index46.cjs +1 -1
  40. package/dist/index46.js +1 -1
  41. package/dist/index47.cjs +1 -1
  42. package/dist/index47.js +105 -33
  43. package/dist/index48.cjs +1 -1
  44. package/dist/index48.js +15 -33
  45. package/dist/index49.cjs +1 -1
  46. package/dist/index49.js +213 -59
  47. package/dist/index50.cjs +2 -1
  48. package/dist/index50.js +57 -110
  49. package/dist/index51.cjs +1 -1
  50. package/dist/index51.js +18 -64
  51. package/dist/index52.cjs +1 -1
  52. package/dist/index52.js +105 -2
  53. package/dist/index53.cjs +1 -1
  54. package/dist/index53.js +3 -16
  55. package/dist/index54.cjs +1 -1
  56. package/dist/index54.js +16 -222
  57. package/dist/index55.cjs +1 -1
  58. package/dist/index55.js +8 -231
  59. package/dist/index56.cjs +1 -2
  60. package/dist/index56.js +9 -58
  61. package/dist/index57.cjs +1 -1
  62. package/dist/index57.js +11 -21
  63. package/dist/index58.cjs +1 -1
  64. package/dist/index58.js +13 -104
  65. package/dist/index59.cjs +1 -1
  66. package/dist/index59.js +18 -3
  67. package/dist/index60.cjs +1 -1
  68. package/dist/index60.js +6 -17
  69. package/dist/index61.cjs +1 -1
  70. package/dist/index61.js +42 -8
  71. package/dist/index62.cjs +1 -1
  72. package/dist/index62.js +77 -9
  73. package/dist/index63.cjs +1 -1
  74. package/dist/index63.js +14 -11
  75. package/dist/index64.cjs +1 -1
  76. package/dist/index64.js +18 -13
  77. package/dist/index65.cjs +1 -1
  78. package/dist/index65.js +8 -18
  79. package/dist/index66.cjs +1 -1
  80. package/dist/index66.js +191 -6
  81. package/dist/index67.cjs +1 -1
  82. package/dist/index67.js +60 -38
  83. package/dist/index68.cjs +1 -1
  84. package/dist/index68.js +4 -78
  85. package/dist/index69.cjs +1 -1
  86. package/dist/index69.js +40 -14
  87. package/dist/index70.cjs +1 -1
  88. package/dist/index70.js +34 -18
  89. package/dist/index71.cjs +1 -1
  90. package/dist/index71.js +69 -8
  91. package/dist/index72.cjs +1 -1
  92. package/dist/index72.js +58 -182
  93. package/dist/index73.cjs +1 -1
  94. package/dist/index73.js +2 -65
  95. package/dist/index74.cjs +1 -1
  96. package/dist/index74.js +231 -4
  97. package/dist/index76.cjs +1 -1
  98. package/dist/index76.js +1 -1
  99. package/dist/index79.cjs +1 -1
  100. package/dist/index79.js +2 -2
  101. package/dist/index80.cjs +1 -1
  102. package/dist/index80.js +1 -1
  103. package/dist/index84.cjs +1 -1
  104. package/dist/index84.js +2 -2
  105. package/dist/index85.cjs +1 -1
  106. package/dist/index85.js +1 -1
  107. package/dist/index87.cjs +1 -1
  108. package/dist/index87.js +1 -1
  109. package/dist/index89.cjs +1 -1
  110. package/dist/index89.js +12 -8
  111. package/dist/index9.cjs +1 -1
  112. package/dist/index9.js +2 -2
  113. package/dist/index90.cjs +1 -1
  114. package/dist/index90.js +8 -12
  115. package/dist/index91.cjs +1 -1
  116. package/dist/index91.js +641 -16
  117. package/dist/index92.cjs +1 -1
  118. package/dist/index92.js +153 -624
  119. package/dist/index93.cjs +1 -1
  120. package/dist/index93.js +17 -171
  121. package/dist/index95.cjs +1 -2
  122. package/dist/index95.js +2 -3
  123. package/dist/index96.cjs +1 -1
  124. package/dist/index96.js +2 -2
  125. package/dist/index97.cjs +1 -1
  126. package/dist/index97.js +38 -2
  127. package/dist/index98.cjs +1 -1
  128. package/dist/index98.js +34 -33
  129. package/dist/index99.cjs +2 -1
  130. package/dist/index99.js +3 -39
  131. package/package.json +1 -1
package/dist/index72.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index79.cjs"),g=require("./index32.cjs"),l=require("./index56.cjs"),b=require("./index45.cjs"),x=require("./index33.cjs"),u=require("./index65.cjs"),d=require("./index46.cjs"),y=require("./index74.cjs"),A=require("./index99.cjs"),a=require("./index24.cjs"),z=require("./index86.cjs");function w(e,n){if(e.length!==n.length)throw new f.AbiEncodingLengthMismatchError({expectedLength:e.length,givenLength:n.length});const o=H({params:e,values:n}),t=p(o);return t.length===0?"0x":t}function H({params:e,values:n}){const o=[];for(let t=0;t<e.length;t++)o.push(h({param:e[t],value:n[t]}));return o}function h({param:e,value:n}){const o=m(e.type);if(o){const[t,r]=o;return P(n,{length:t,param:{...e,type:r}})}if(e.type==="tuple")return L(n,{param:e});if(e.type==="address")return E(n);if(e.type==="bool")return q(n);if(e.type.startsWith("uint")||e.type.startsWith("int")){const t=e.type.startsWith("int"),[,,r="256"]=z.integerRegex.exec(e.type)??[];return T(n,{signed:t,size:Number(r)})}if(e.type.startsWith("bytes"))return S(n,{param:e});if(e.type==="string")return I(n);throw new f.InvalidAbiEncodingTypeError(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function p(e){let n=0;for(let i=0;i<e.length;i++){const{dynamic:c,encoded:s}=e[i];c?n+=32:n+=y.size(s)}const o=[],t=[];let r=0;for(let i=0;i<e.length;i++){const{dynamic:c,encoded:s}=e[i];c?(o.push(a.numberToHex(n+r,{size:32})),t.push(s),r+=y.size(s)):o.push(s)}return u.concat([...o,...t])}function E(e){if(!x.isAddress(e))throw new g.InvalidAddressError({address:e});return{dynamic:!1,encoded:d.padHex(e.toLowerCase())}}function P(e,{length:n,param:o}){const t=n===null;if(!Array.isArray(e))throw new f.InvalidArrayError(e);if(!t&&e.length!==n)throw new f.AbiEncodingArrayLengthMismatchError({expectedLength:n,givenLength:e.length,type:`${o.type}[${n}]`});let r=!1;const i=[];for(let c=0;c<e.length;c++){const s=h({param:o,value:e[c]});s.dynamic&&(r=!0),i.push(s)}if(t||r){const c=p(i);if(t){const s=a.numberToHex(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?u.concat([s,c]):s}}if(r)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:u.concat(i.map(({encoded:c})=>c))}}function S(e,{param:n}){const[,o]=n.type.split("bytes"),t=y.size(e);if(!o){let r=e;return t%32!==0&&(r=d.padHex(r,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:u.concat([d.padHex(a.numberToHex(t,{size:32})),r])}}if(t!==Number.parseInt(o))throw new f.AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(o),value:e});return{dynamic:!1,encoded:d.padHex(e,{dir:"right"})}}function q(e){if(typeof e!="boolean")throw new l.BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:d.padHex(a.boolToHex(e))}}function T(e,{signed:n,size:o=256}){if(typeof o=="number"){const t=2n**(BigInt(o)-(n?1n:0n))-1n,r=n?-t-1n:0n;if(e>t||e<r)throw new b.IntegerOutOfRangeError({max:t.toString(),min:r.toString(),signed:n,size:o/8,value:e.toString()})}return{dynamic:!1,encoded:a.numberToHex(e,{size:32,signed:n})}}function I(e){const n=a.stringToHex(e),o=Math.ceil(y.size(n)/32),t=[];for(let r=0;r<o;r++)t.push(d.padHex(A.slice(n,r*32,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:u.concat([d.padHex(a.numberToHex(y.size(n),{size:32})),...t])}}function L(e,{param:n}){let o=!1;const t=[];for(let r=0;r<n.components.length;r++){const i=n.components[r],c=Array.isArray(e)?r:i.name,s=h({param:i,value:e[c]});t.push(s),s.dynamic&&(o=!0)}return{dynamic:o,encoded:o?p(t):u.concat(t.map(({encoded:r})=>r))}}function m(e){const n=e.match(/^(.*)\[(\d+)?\]$/);return n?[n[2]?Number(n[2]):null,n[1]]:void 0}exports.encodeAbiParameters=w;exports.getArrayComponents=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index70.cjs"),c=require("./index71.cjs");function a(o,t,s,i){if(typeof o.setBigUint64=="function")return o.setBigUint64(t,s,i);const n=BigInt(32),r=BigInt(4294967295),e=Number(s>>n&r),h=Number(s&r),u=i?4:0,l=i?0:4;o.setUint32(t+u,e,i),o.setUint32(t+l,h,i)}function d(o,t,s){return o&t^~o&s}function b(o,t,s){return o&t^o&s^t&s}class w extends c.Hash{constructor(t,s,i,n){super(),this.blockLen=t,this.outputLen=s,this.padOffset=i,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=c.createView(this.buffer)}update(t){p.aexists(this);const{view:s,buffer:i,blockLen:n}=this;t=c.toBytes(t);const r=t.length;for(let e=0;e<r;){const h=Math.min(n-this.pos,r-e);if(h===n){const u=c.createView(t);for(;n<=r-e;e+=n)this.process(u,e);continue}i.set(t.subarray(e,e+h),this.pos),this.pos+=h,e+=h,this.pos===n&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){p.aexists(this),p.aoutput(t,this),this.finished=!0;const{buffer:s,view:i,blockLen:n,isLE:r}=this;let{pos:e}=this;s[e++]=128,this.buffer.subarray(e).fill(0),this.padOffset>n-e&&(this.process(i,0),e=0);for(let f=e;f<n;f++)s[f]=0;a(i,n-8,BigInt(this.length*8),r),this.process(i,0);const h=c.createView(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,g=this.get();if(l>g.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)h.setUint32(4*f,g[f],r)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const i=t.slice(0,s);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:i,length:n,finished:r,destroyed:e,pos:h}=this;return t.length=n,t.pos=h,t.finished=r,t.destroyed=e,n%s&&t.buffer.set(i),t}}exports.Chi=d;exports.HashMD=w;exports.Maj=b;exports.setBigUint64=a;
package/dist/index72.js CHANGED
@@ -1,194 +1,70 @@
1
- import { AbiEncodingLengthMismatchError as y, InvalidAbiEncodingTypeError as u, InvalidArrayError as g, AbiEncodingArrayLengthMismatchError as l, AbiEncodingBytesSizeMismatchError as b } from "./index79.js";
2
- import { InvalidAddressError as w } from "./index32.js";
3
- import { BaseError as A } from "./index56.js";
4
- import { IntegerOutOfRangeError as x } from "./index45.js";
5
- import { isAddress as z } from "./index33.js";
6
- import { concat as f } from "./index65.js";
7
- import { padHex as d } from "./index46.js";
8
- import { size as a } from "./index74.js";
9
- import { slice as E } from "./index99.js";
10
- import { numberToHex as m, boolToHex as P, stringToHex as S } from "./index24.js";
11
- import { integerRegex as I } from "./index86.js";
12
- function K(e, t) {
13
- if (e.length !== t.length)
14
- throw new y({
15
- expectedLength: e.length,
16
- givenLength: t.length
17
- });
18
- const o = L({
19
- params: e,
20
- values: t
21
- }), n = h(o);
22
- return n.length === 0 ? "0x" : n;
1
+ import { aexists as g, aoutput as d } from "./index70.js";
2
+ import { Hash as b, createView as p, toBytes as a } from "./index71.js";
3
+ function w(o, t, s, i) {
4
+ if (typeof o.setBigUint64 == "function")
5
+ return o.setBigUint64(t, s, i);
6
+ const n = BigInt(32), h = BigInt(4294967295), e = Number(s >> n & h), r = Number(s & h), u = i ? 4 : 0, c = i ? 0 : 4;
7
+ o.setUint32(t + u, e, i), o.setUint32(t + c, r, i);
23
8
  }
24
- function L({ params: e, values: t }) {
25
- const o = [];
26
- for (let n = 0; n < e.length; n++)
27
- o.push(p({ param: e[n], value: t[n] }));
28
- return o;
9
+ function B(o, t, s) {
10
+ return o & t ^ ~o & s;
29
11
  }
30
- function p({ param: e, value: t }) {
31
- const o = W(e.type);
32
- if (o) {
33
- const [n, r] = o;
34
- return M(t, { length: n, param: { ...e, type: r } });
35
- }
36
- if (e.type === "tuple")
37
- return H(t, {
38
- param: e
39
- });
40
- if (e.type === "address")
41
- return B(t);
42
- if (e.type === "bool")
43
- return T(t);
44
- if (e.type.startsWith("uint") || e.type.startsWith("int")) {
45
- const n = e.type.startsWith("int"), [, , r = "256"] = I.exec(e.type) ?? [];
46
- return $(t, {
47
- signed: n,
48
- size: Number(r)
49
- });
50
- }
51
- if (e.type.startsWith("bytes"))
52
- return N(t, { param: e });
53
- if (e.type === "string")
54
- return C(t);
55
- throw new u(e.type, {
56
- docsPath: "/docs/contract/encodeAbiParameters"
57
- });
58
- }
59
- function h(e) {
60
- let t = 0;
61
- for (let i = 0; i < e.length; i++) {
62
- const { dynamic: c, encoded: s } = e[i];
63
- c ? t += 32 : t += a(s);
64
- }
65
- const o = [], n = [];
66
- let r = 0;
67
- for (let i = 0; i < e.length; i++) {
68
- const { dynamic: c, encoded: s } = e[i];
69
- c ? (o.push(m(t + r, { size: 32 })), n.push(s), r += a(s)) : o.push(s);
70
- }
71
- return f([...o, ...n]);
72
- }
73
- function B(e) {
74
- if (!z(e))
75
- throw new w({ address: e });
76
- return { dynamic: !1, encoded: d(e.toLowerCase()) };
12
+ function L(o, t, s) {
13
+ return o & t ^ o & s ^ t & s;
77
14
  }
78
- function M(e, { length: t, param: o }) {
79
- const n = t === null;
80
- if (!Array.isArray(e))
81
- throw new g(e);
82
- if (!n && e.length !== t)
83
- throw new l({
84
- expectedLength: t,
85
- givenLength: e.length,
86
- type: `${o.type}[${t}]`
87
- });
88
- let r = !1;
89
- const i = [];
90
- for (let c = 0; c < e.length; c++) {
91
- const s = p({ param: o, value: e[c] });
92
- s.dynamic && (r = !0), i.push(s);
15
+ class U extends b {
16
+ constructor(t, s, i, n) {
17
+ super(), this.blockLen = t, this.outputLen = s, this.padOffset = i, this.isLE = n, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = p(this.buffer);
93
18
  }
94
- if (n || r) {
95
- const c = h(i);
96
- if (n) {
97
- const s = m(i.length, { size: 32 });
98
- return {
99
- dynamic: !0,
100
- encoded: i.length > 0 ? f([s, c]) : s
101
- };
19
+ update(t) {
20
+ g(this);
21
+ const { view: s, buffer: i, blockLen: n } = this;
22
+ t = a(t);
23
+ const h = t.length;
24
+ for (let e = 0; e < h; ) {
25
+ const r = Math.min(n - this.pos, h - e);
26
+ if (r === n) {
27
+ const u = p(t);
28
+ for (; n <= h - e; e += n)
29
+ this.process(u, e);
30
+ continue;
31
+ }
32
+ i.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === n && (this.process(s, 0), this.pos = 0);
102
33
  }
103
- if (r)
104
- return { dynamic: !0, encoded: c };
34
+ return this.length += t.length, this.roundClean(), this;
105
35
  }
106
- return {
107
- dynamic: !1,
108
- encoded: f(i.map(({ encoded: c }) => c))
109
- };
110
- }
111
- function N(e, { param: t }) {
112
- const [, o] = t.type.split("bytes"), n = a(e);
113
- if (!o) {
114
- let r = e;
115
- return n % 32 !== 0 && (r = d(r, {
116
- dir: "right",
117
- size: Math.ceil((e.length - 2) / 2 / 32) * 32
118
- })), {
119
- dynamic: !0,
120
- encoded: f([d(m(n, { size: 32 })), r])
121
- };
36
+ digestInto(t) {
37
+ g(this), d(t, this), this.finished = !0;
38
+ const { buffer: s, view: i, blockLen: n, isLE: h } = this;
39
+ let { pos: e } = this;
40
+ s[e++] = 128, this.buffer.subarray(e).fill(0), this.padOffset > n - e && (this.process(i, 0), e = 0);
41
+ for (let f = e; f < n; f++)
42
+ s[f] = 0;
43
+ w(i, n - 8, BigInt(this.length * 8), h), this.process(i, 0);
44
+ const r = p(t), u = this.outputLen;
45
+ if (u % 4)
46
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
47
+ const c = u / 4, l = this.get();
48
+ if (c > l.length)
49
+ throw new Error("_sha2: outputLen bigger than state");
50
+ for (let f = 0; f < c; f++)
51
+ r.setUint32(4 * f, l[f], h);
122
52
  }
123
- if (n !== Number.parseInt(o))
124
- throw new b({
125
- expectedSize: Number.parseInt(o),
126
- value: e
127
- });
128
- return { dynamic: !1, encoded: d(e, { dir: "right" }) };
129
- }
130
- function T(e) {
131
- if (typeof e != "boolean")
132
- throw new A(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
133
- return { dynamic: !1, encoded: d(P(e)) };
134
- }
135
- function $(e, { signed: t, size: o = 256 }) {
136
- if (typeof o == "number") {
137
- const n = 2n ** (BigInt(o) - (t ? 1n : 0n)) - 1n, r = t ? -n - 1n : 0n;
138
- if (e > n || e < r)
139
- throw new x({
140
- max: n.toString(),
141
- min: r.toString(),
142
- signed: t,
143
- size: o / 8,
144
- value: e.toString()
145
- });
53
+ digest() {
54
+ const { buffer: t, outputLen: s } = this;
55
+ this.digestInto(t);
56
+ const i = t.slice(0, s);
57
+ return this.destroy(), i;
146
58
  }
147
- return {
148
- dynamic: !1,
149
- encoded: m(e, {
150
- size: 32,
151
- signed: t
152
- })
153
- };
154
- }
155
- function C(e) {
156
- const t = S(e), o = Math.ceil(a(t) / 32), n = [];
157
- for (let r = 0; r < o; r++)
158
- n.push(d(E(t, r * 32, (r + 1) * 32), {
159
- dir: "right"
160
- }));
161
- return {
162
- dynamic: !0,
163
- encoded: f([
164
- d(m(a(t), { size: 32 })),
165
- ...n
166
- ])
167
- };
168
- }
169
- function H(e, { param: t }) {
170
- let o = !1;
171
- const n = [];
172
- for (let r = 0; r < t.components.length; r++) {
173
- const i = t.components[r], c = Array.isArray(e) ? r : i.name, s = p({
174
- param: i,
175
- value: e[c]
176
- });
177
- n.push(s), s.dynamic && (o = !0);
59
+ _cloneInto(t) {
60
+ t || (t = new this.constructor()), t.set(...this.get());
61
+ const { blockLen: s, buffer: i, length: n, finished: h, destroyed: e, pos: r } = this;
62
+ return t.length = n, t.pos = r, t.finished = h, t.destroyed = e, n % s && t.buffer.set(i), t;
178
63
  }
179
- return {
180
- dynamic: o,
181
- encoded: o ? h(n) : f(n.map(({ encoded: r }) => r))
182
- };
183
- }
184
- function W(e) {
185
- const t = e.match(/^(.*)\[(\d+)?\]$/);
186
- return t ? (
187
- // Return `null` if the array is dynamic.
188
- [t[2] ? Number(t[2]) : null, t[1]]
189
- ) : void 0;
190
64
  }
191
65
  export {
192
- K as encodeAbiParameters,
193
- W as getArrayComponents
66
+ B as Chi,
67
+ U as HashMD,
68
+ L as Maj,
69
+ w as setBigUint64
194
70
  };
package/dist/index73.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index79.cjs"),z=require("./index32.cjs"),o=require("./index85.cjs"),T=require("./index33.cjs"),u=require("./index74.cjs"),q=require("./index24.cjs"),g=require("./index86.cjs");function P(e){const{domain:n,message:b,primaryType:a,types:r}=e,c=(l,h)=>{for(const v of l){const{name:I,type:s}=v,t=h[I],y=s.match(g.integerRegex);if(y&&(typeof t=="number"||typeof t=="bigint")){const[w,i,D]=y;q.numberToHex(t,{signed:i==="int",size:Number.parseInt(D)/8})}if(s==="address"&&typeof t=="string"&&!T.isAddress(t))throw new z.InvalidAddressError({address:t});const f=s.match(g.bytesRegex);if(f){const[w,i]=f;if(i&&u.size(t)!==Number.parseInt(i))throw new E.BytesSizeMismatchError({expectedSize:Number.parseInt(i),givenSize:u.size(t)})}const p=r[s];p&&(x(s),c(p,t))}};if(r.EIP712Domain&&n){if(typeof n!="object")throw new o.InvalidDomainError({domain:n});c(r.EIP712Domain,n)}if(a!=="EIP712Domain")if(r[a])c(r[a],b);else throw new o.InvalidPrimaryTypeError({primaryType:a,types:r})}function d({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function x(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new o.InvalidStructTypeError({type:e})}exports.getTypesForEIP712Domain=d;exports.validateTypedData=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;exports.crypto=o;
package/dist/index73.js CHANGED
@@ -1,67 +1,4 @@
1
- import { BytesSizeMismatchError as m } from "./index79.js";
2
- import { InvalidAddressError as w } from "./index32.js";
3
- import { InvalidDomainError as E, InvalidPrimaryTypeError as z, InvalidStructTypeError as D } from "./index85.js";
4
- import { isAddress as T } from "./index33.js";
5
- import { size as y } from "./index74.js";
6
- import { numberToHex as x } from "./index24.js";
7
- import { integerRegex as P, bytesRegex as S } from "./index86.js";
8
- function j(e) {
9
- const { domain: n, message: g, primaryType: o, types: r } = e, f = (h, b) => {
10
- for (const u of h) {
11
- const { name: l, type: s } = u, t = b[l], a = s.match(P);
12
- if (a && (typeof t == "number" || typeof t == "bigint")) {
13
- const [I, i, v] = a;
14
- x(t, {
15
- signed: i === "int",
16
- size: Number.parseInt(v) / 8
17
- });
18
- }
19
- if (s === "address" && typeof t == "string" && !T(t))
20
- throw new w({ address: t });
21
- const p = s.match(S);
22
- if (p) {
23
- const [I, i] = p;
24
- if (i && y(t) !== Number.parseInt(i))
25
- throw new m({
26
- expectedSize: Number.parseInt(i),
27
- givenSize: y(t)
28
- });
29
- }
30
- const c = r[s];
31
- c && (_(s), f(c, t));
32
- }
33
- };
34
- if (r.EIP712Domain && n) {
35
- if (typeof n != "object")
36
- throw new E({ domain: n });
37
- f(r.EIP712Domain, n);
38
- }
39
- if (o !== "EIP712Domain")
40
- if (r[o])
41
- f(r[o], g);
42
- else
43
- throw new z({ primaryType: o, types: r });
44
- }
45
- function F({ domain: e }) {
46
- return [
47
- typeof (e == null ? void 0 : e.name) == "string" && { name: "name", type: "string" },
48
- (e == null ? void 0 : e.version) && { name: "version", type: "string" },
49
- (typeof (e == null ? void 0 : e.chainId) == "number" || typeof (e == null ? void 0 : e.chainId) == "bigint") && {
50
- name: "chainId",
51
- type: "uint256"
52
- },
53
- (e == null ? void 0 : e.verifyingContract) && {
54
- name: "verifyingContract",
55
- type: "address"
56
- },
57
- (e == null ? void 0 : e.salt) && { name: "salt", type: "bytes32" }
58
- ].filter(Boolean);
59
- }
60
- function _(e) {
61
- if (e === "address" || e === "bool" || e === "string" || e.startsWith("bytes") || e.startsWith("uint") || e.startsWith("int"))
62
- throw new D({ type: e });
63
- }
1
+ const o = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
64
2
  export {
65
- F as getTypesForEIP712Domain,
66
- j as validateTypedData
3
+ o as crypto
67
4
  };
package/dist/index74.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index59.cjs");function i(e){return t.isHex(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}exports.size=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const y=BigInt(0),d=BigInt(1),N=BigInt(2);function b(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function m(t){if(!b(t))throw new Error("Uint8Array expected")}function _(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const k=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function B(t){m(t);let e="";for(let r=0;r<t.length;r++)e+=k[t[r]];return e}function x(t){const e=t.toString(16);return e.length&1?"0"+e:e}function E(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?y:BigInt("0x"+t)}const f={_0:48,_9:57,A:65,F:70,a:97,f:102};function T(t){if(t>=f._0&&t<=f._9)return t-f._0;if(t>=f.A&&t<=f.F)return t-(f.A-10);if(t>=f.a&&t<=f.f)return t-(f.a-10)}function p(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const a=T(t.charCodeAt(i)),s=T(t.charCodeAt(i+1));if(a===void 0||s===void 0){const c=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=a*16+s}return n}function H(t){return E(B(t))}function O(t){return m(t),E(B(Uint8Array.from(t).reverse()))}function U(t,e){return p(t.toString(16).padStart(e*2,"0"))}function F(t,e){return U(t,e).reverse()}function V(t){return p(x(t))}function M(t,e,r){let n;if(typeof e=="string")try{n=p(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(b(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+" of length "+r+" expected, got "+o);return n}function I(...t){let e=0;for(let n=0;n<t.length;n++){const o=t[n];m(o),e+=o.length}const r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){const i=t[n];r.set(i,o),o+=i.length}return r}function R(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}function j(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const w=t=>typeof t=="bigint"&&y<=t;function S(t,e,r){return w(t)&&w(e)&&w(r)&&e<=t&&t<r}function z(t,e,r,n){if(!S(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function C(t){let e;for(e=0;t>y;t>>=d,e+=1);return e}function D(t,e){return t>>BigInt(e)&d}function G(t,e,r){return t|(r?d:y)<<BigInt(e)}const L=t=>(N<<BigInt(t-1))-d,h=t=>new Uint8Array(t),A=t=>Uint8Array.from(t);function P(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=h(t),o=h(t),i=0;const a=()=>{n.fill(1),o.fill(0),i=0},s=(...u)=>r(o,n,...u),c=(u=h())=>{o=s(A([0]),u),n=s(),u.length!==0&&(o=s(A([1]),u),n=s())},v=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const l=[];for(;u<e;){n=s();const g=n.slice();l.push(g),u+=n.length}return I(...l)};return(u,l)=>{a(),c(u);let g;for(;!(g=l(v()));)c();return a(),g}}const q={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||b(t),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 W(t,e,r={}){const n=(o,i,a)=>{const s=q[i];if(typeof s!="function")throw new Error("invalid validator function");const c=t[o];if(!(a&&c===void 0)&&!s(c,t))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+c)};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}const J=()=>{throw new Error("not implemented")};function K(t){const e=new WeakMap;return(r,...n)=>{const o=e.get(r);if(o!==void 0)return o;const i=t(r,...n);return e.set(r,i),i}}exports.aInRange=z;exports.abool=_;exports.abytes=m;exports.bitGet=D;exports.bitLen=C;exports.bitMask=L;exports.bitSet=G;exports.bytesToHex=B;exports.bytesToNumberBE=H;exports.bytesToNumberLE=O;exports.concatBytes=I;exports.createHmacDrbg=P;exports.ensureBytes=M;exports.equalBytes=R;exports.hexToBytes=p;exports.hexToNumber=E;exports.inRange=S;exports.isBytes=b;exports.memoized=K;exports.notImplemented=J;exports.numberToBytesBE=U;exports.numberToBytesLE=F;exports.numberToHexUnpadded=x;exports.numberToVarBytesBE=V;exports.utf8ToBytes=j;exports.validateObject=W;
package/dist/index74.js CHANGED
@@ -1,7 +1,234 @@
1
- import { isHex as r } from "./index59.js";
2
- function i(t) {
3
- return r(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
1
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
+ const d = /* @__PURE__ */ BigInt(0), y = /* @__PURE__ */ BigInt(1), I = /* @__PURE__ */ BigInt(2);
3
+ function h(t) {
4
+ return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
5
+ }
6
+ function b(t) {
7
+ if (!h(t))
8
+ throw new Error("Uint8Array expected");
9
+ }
10
+ function O(t, n) {
11
+ if (typeof n != "boolean")
12
+ throw new Error(t + " boolean expected, got " + n);
13
+ }
14
+ const T = /* @__PURE__ */ Array.from({ length: 256 }, (t, n) => n.toString(16).padStart(2, "0"));
15
+ function B(t) {
16
+ b(t);
17
+ let n = "";
18
+ for (let r = 0; r < t.length; r++)
19
+ n += T[t[r]];
20
+ return n;
21
+ }
22
+ function S(t) {
23
+ const n = t.toString(16);
24
+ return n.length & 1 ? "0" + n : n;
25
+ }
26
+ function U(t) {
27
+ if (typeof t != "string")
28
+ throw new Error("hex string expected, got " + typeof t);
29
+ return t === "" ? d : BigInt("0x" + t);
30
+ }
31
+ const s = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
32
+ function E(t) {
33
+ if (t >= s._0 && t <= s._9)
34
+ return t - s._0;
35
+ if (t >= s.A && t <= s.F)
36
+ return t - (s.A - 10);
37
+ if (t >= s.a && t <= s.f)
38
+ return t - (s.a - 10);
39
+ }
40
+ function m(t) {
41
+ if (typeof t != "string")
42
+ throw new Error("hex string expected, got " + typeof t);
43
+ const n = t.length, r = n / 2;
44
+ if (n % 2)
45
+ throw new Error("hex string expected, got unpadded hex of length " + n);
46
+ const e = new Uint8Array(r);
47
+ for (let o = 0, i = 0; o < r; o++, i += 2) {
48
+ const a = E(t.charCodeAt(i)), f = E(t.charCodeAt(i + 1));
49
+ if (a === void 0 || f === void 0) {
50
+ const c = t[i] + t[i + 1];
51
+ throw new Error('hex string expected, got non-hex character "' + c + '" at index ' + i);
52
+ }
53
+ e[o] = a * 16 + f;
54
+ }
55
+ return e;
56
+ }
57
+ function V(t) {
58
+ return U(B(t));
59
+ }
60
+ function H(t) {
61
+ return b(t), U(B(Uint8Array.from(t).reverse()));
62
+ }
63
+ function v(t, n) {
64
+ return m(t.toString(16).padStart(n * 2, "0"));
65
+ }
66
+ function C(t, n) {
67
+ return v(t, n).reverse();
68
+ }
69
+ function M(t) {
70
+ return m(S(t));
71
+ }
72
+ function R(t, n, r) {
73
+ let e;
74
+ if (typeof n == "string")
75
+ try {
76
+ e = m(n);
77
+ } catch (i) {
78
+ throw new Error(t + " must be hex string or Uint8Array, cause: " + i);
79
+ }
80
+ else if (h(n))
81
+ e = Uint8Array.from(n);
82
+ else
83
+ throw new Error(t + " must be hex string or Uint8Array");
84
+ const o = e.length;
85
+ if (typeof r == "number" && o !== r)
86
+ throw new Error(t + " of length " + r + " expected, got " + o);
87
+ return e;
88
+ }
89
+ function _(...t) {
90
+ let n = 0;
91
+ for (let e = 0; e < t.length; e++) {
92
+ const o = t[e];
93
+ b(o), n += o.length;
94
+ }
95
+ const r = new Uint8Array(n);
96
+ for (let e = 0, o = 0; e < t.length; e++) {
97
+ const i = t[e];
98
+ r.set(i, o), o += i.length;
99
+ }
100
+ return r;
101
+ }
102
+ function j(t, n) {
103
+ if (t.length !== n.length)
104
+ return !1;
105
+ let r = 0;
106
+ for (let e = 0; e < t.length; e++)
107
+ r |= t[e] ^ n[e];
108
+ return r === 0;
109
+ }
110
+ function z(t) {
111
+ if (typeof t != "string")
112
+ throw new Error("string expected");
113
+ return new Uint8Array(new TextEncoder().encode(t));
114
+ }
115
+ const w = (t) => typeof t == "bigint" && d <= t;
116
+ function N(t, n, r) {
117
+ return w(t) && w(n) && w(r) && n <= t && t < r;
118
+ }
119
+ function D(t, n, r, e) {
120
+ if (!N(n, r, e))
121
+ throw new Error("expected valid " + t + ": " + r + " <= n < " + e + ", got " + n);
122
+ }
123
+ function G(t) {
124
+ let n;
125
+ for (n = 0; t > d; t >>= y, n += 1)
126
+ ;
127
+ return n;
128
+ }
129
+ function P(t, n) {
130
+ return t >> BigInt(n) & y;
131
+ }
132
+ function W(t, n, r) {
133
+ return t | (r ? y : d) << BigInt(n);
134
+ }
135
+ const q = (t) => (I << BigInt(t - 1)) - y, p = (t) => new Uint8Array(t), A = (t) => Uint8Array.from(t);
136
+ function J(t, n, r) {
137
+ if (typeof t != "number" || t < 2)
138
+ throw new Error("hashLen must be a number");
139
+ if (typeof n != "number" || n < 2)
140
+ throw new Error("qByteLen must be a number");
141
+ if (typeof r != "function")
142
+ throw new Error("hmacFn must be a function");
143
+ let e = p(t), o = p(t), i = 0;
144
+ const a = () => {
145
+ e.fill(1), o.fill(0), i = 0;
146
+ }, f = (...u) => r(o, e, ...u), c = (u = p()) => {
147
+ o = f(A([0]), u), e = f(), u.length !== 0 && (o = f(A([1]), u), e = f());
148
+ }, x = () => {
149
+ if (i++ >= 1e3)
150
+ throw new Error("drbg: tried 1000 values");
151
+ let u = 0;
152
+ const l = [];
153
+ for (; u < n; ) {
154
+ e = f();
155
+ const g = e.slice();
156
+ l.push(g), u += e.length;
157
+ }
158
+ return _(...l);
159
+ };
160
+ return (u, l) => {
161
+ a(), c(u);
162
+ let g;
163
+ for (; !(g = l(x())); )
164
+ c();
165
+ return a(), g;
166
+ };
167
+ }
168
+ const k = {
169
+ bigint: (t) => typeof t == "bigint",
170
+ function: (t) => typeof t == "function",
171
+ boolean: (t) => typeof t == "boolean",
172
+ string: (t) => typeof t == "string",
173
+ stringOrUint8Array: (t) => typeof t == "string" || h(t),
174
+ isSafeInteger: (t) => Number.isSafeInteger(t),
175
+ array: (t) => Array.isArray(t),
176
+ field: (t, n) => n.Fp.isValid(t),
177
+ hash: (t) => typeof t == "function" && Number.isSafeInteger(t.outputLen)
178
+ };
179
+ function K(t, n, r = {}) {
180
+ const e = (o, i, a) => {
181
+ const f = k[i];
182
+ if (typeof f != "function")
183
+ throw new Error("invalid validator function");
184
+ const c = t[o];
185
+ if (!(a && c === void 0) && !f(c, t))
186
+ throw new Error("param " + String(o) + " is invalid. Expected " + i + ", got " + c);
187
+ };
188
+ for (const [o, i] of Object.entries(n))
189
+ e(o, i, !1);
190
+ for (const [o, i] of Object.entries(r))
191
+ e(o, i, !0);
192
+ return t;
193
+ }
194
+ const Q = () => {
195
+ throw new Error("not implemented");
196
+ };
197
+ function X(t) {
198
+ const n = /* @__PURE__ */ new WeakMap();
199
+ return (r, ...e) => {
200
+ const o = n.get(r);
201
+ if (o !== void 0)
202
+ return o;
203
+ const i = t(r, ...e);
204
+ return n.set(r, i), i;
205
+ };
4
206
  }
5
207
  export {
6
- i as size
208
+ D as aInRange,
209
+ O as abool,
210
+ b as abytes,
211
+ P as bitGet,
212
+ G as bitLen,
213
+ q as bitMask,
214
+ W as bitSet,
215
+ B as bytesToHex,
216
+ V as bytesToNumberBE,
217
+ H as bytesToNumberLE,
218
+ _ as concatBytes,
219
+ J as createHmacDrbg,
220
+ R as ensureBytes,
221
+ j as equalBytes,
222
+ m as hexToBytes,
223
+ U as hexToNumber,
224
+ N as inRange,
225
+ h as isBytes,
226
+ X as memoized,
227
+ Q as notImplemented,
228
+ v as numberToBytesBE,
229
+ C as numberToBytesLE,
230
+ S as numberToHexUnpadded,
231
+ M as numberToVarBytesBE,
232
+ z as utf8ToBytes,
233
+ K as validateObject
7
234
  };
package/dist/index76.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index56.cjs");class i extends e.BaseError{constructor({chainId:r}){super(typeof r=="number"?`Chain ID "${r}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}exports.InvalidChainIdError=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index50.cjs");class i extends e.BaseError{constructor({chainId:r}){super(typeof r=="number"?`Chain ID "${r}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}exports.InvalidChainIdError=i;
package/dist/index76.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseError as i } from "./index56.js";
1
+ import { BaseError as i } from "./index50.js";
2
2
  class o extends i {
3
3
  constructor({ chainId: r }) {
4
4
  super(typeof r == "number" ? `Chain ID "${r}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
package/dist/index79.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index74.cjs"),n=require("./index56.cjs");class o extends n.BaseError{constructor({expectedLength:r,givenLength:e,type:t}){super([`ABI encoding array length mismatch for type ${t}.`,`Expected length: ${r}`,`Given length: ${e}`].join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index68.cjs"),n=require("./index50.cjs");class o extends n.BaseError{constructor({expectedLength:r,givenLength:e,type:t}){super([`ABI encoding array length mismatch for type ${t}.`,`Expected length: ${r}`,`Given length: ${e}`].join(`
2
2
  `),{name:"AbiEncodingArrayLengthMismatchError"})}}class a extends n.BaseError{constructor({expectedSize:r,value:e}){super(`Size of bytes "${e}" (bytes${i.size(e)}) does not match expected size (bytes${r}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class c extends n.BaseError{constructor({expectedLength:r,givenLength:e}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${r}`,`Given length (values): ${e}`].join(`
3
3
  `),{name:"AbiEncodingLengthMismatchError"})}}class d extends n.BaseError{constructor({expectedSize:r,givenSize:e}){super(`Expected bytes${r}, got bytes${e}.`,{name:"BytesSizeMismatchError"})}}class E extends n.BaseError{constructor(r,{docsPath:e}){super([`Type "${r}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
4
4
  `),{docsPath:e,name:"InvalidAbiEncodingType"})}}class g extends n.BaseError{constructor(r){super([`Value "${r}" is not a valid array.`].join(`
package/dist/index79.js CHANGED
@@ -1,5 +1,5 @@
1
- import { size as i } from "./index74.js";
2
- import { BaseError as n } from "./index56.js";
1
+ import { size as i } from "./index68.js";
2
+ import { BaseError as n } from "./index50.js";
3
3
  class c extends n {
4
4
  constructor({ expectedLength: e, givenLength: r, type: s }) {
5
5
  super([
package/dist/index80.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index81.cjs"),t=require("./index56.cjs");class i extends t.BaseError{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:r,name:"FeeCapTooHighError"})}}Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class n extends t.BaseError{constructor({cause:r,maxPriorityFeePerGas:e,maxFeePerGas:o}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${o?` = ${a.formatGwei(o)} gwei`:""}).`].join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index81.cjs"),t=require("./index50.cjs");class i extends t.BaseError{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:r,name:"FeeCapTooHighError"})}}Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class n extends t.BaseError{constructor({cause:r,maxPriorityFeePerGas:e,maxFeePerGas:o}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${o?` = ${a.formatGwei(o)} gwei`:""}).`].join(`
2
2
  `),{cause:r,name:"TipAboveFeeCapError"})}}Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});exports.FeeCapTooHighError=i;exports.TipAboveFeeCapError=n;
package/dist/index80.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { formatGwei as a } from "./index81.js";
2
- import { BaseError as o } from "./index56.js";
2
+ import { BaseError as o } from "./index50.js";
3
3
  class n extends o {
4
4
  constructor({ cause: r, maxFeePerGas: e } = {}) {
5
5
  super(`The fee cap (\`maxFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {