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

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 (232) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +20 -22
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +19 -37
  5. package/dist/index100.cjs +1 -1
  6. package/dist/index100.js +128 -2
  7. package/dist/index101.cjs +1 -1
  8. package/dist/index101.js +113 -5
  9. package/dist/index102.cjs +1 -1
  10. package/dist/index102.js +78 -10
  11. package/dist/index103.cjs +1 -1
  12. package/dist/index103.js +2 -21
  13. package/dist/index104.cjs +1 -1
  14. package/dist/index104.js +17 -6
  15. package/dist/index105.cjs +1 -1
  16. package/dist/index105.js +19 -5
  17. package/dist/index106.cjs +1 -1
  18. package/dist/index106.js +15 -36
  19. package/dist/index107.cjs +1 -1
  20. package/dist/index107.js +222 -126
  21. package/dist/index108.cjs +2 -1
  22. package/dist/index108.js +3 -2
  23. package/dist/index109.cjs +1 -2
  24. package/dist/index109.js +35 -3
  25. package/dist/index11.cjs +1 -1
  26. package/dist/index11.js +134 -19
  27. package/dist/index110.cjs +1 -1
  28. package/dist/index110.js +16 -65
  29. package/dist/index111.cjs +1 -1
  30. package/dist/index111.js +2 -2
  31. package/dist/index112.cjs +1 -1
  32. package/dist/index112.js +68 -2
  33. package/dist/index113.cjs +1 -1
  34. package/dist/index113.js +2 -35
  35. package/dist/index114.cjs +1 -1
  36. package/dist/index114.js +1 -1
  37. package/dist/index115.cjs +1 -1
  38. package/dist/index115.js +1 -1
  39. package/dist/index117.cjs +1 -1
  40. package/dist/index117.js +1 -1
  41. package/dist/index12.cjs +1 -1
  42. package/dist/index12.js +10 -136
  43. package/dist/index13.cjs +1 -1
  44. package/dist/index13.js +2 -15
  45. package/dist/index14.cjs +1 -1
  46. package/dist/index14.js +34 -2
  47. package/dist/index15.cjs +1 -1
  48. package/dist/index15.js +17 -32
  49. package/dist/index16.cjs +1 -1
  50. package/dist/index16.js +183 -14
  51. package/dist/index17.cjs +1 -1
  52. package/dist/index17.js +92 -187
  53. package/dist/index18.cjs +1 -1
  54. package/dist/index18.js +34 -92
  55. package/dist/index19.cjs +1 -1
  56. package/dist/index19.js +32 -36
  57. package/dist/index20.cjs +16 -1
  58. package/dist/index20.js +112 -30
  59. package/dist/index21.cjs +1 -16
  60. package/dist/index21.js +30 -113
  61. package/dist/index22.cjs +1 -1
  62. package/dist/index22.js +18 -31
  63. package/dist/index23.cjs +1 -1
  64. package/dist/index23.js +7 -17
  65. package/dist/index24.cjs +1 -1
  66. package/dist/index24.js +44 -6
  67. package/dist/index25.cjs +1 -1
  68. package/dist/index25.js +21 -45
  69. package/dist/index26.cjs +1 -1
  70. package/dist/index26.js +8 -21
  71. package/dist/index27.cjs +1 -1
  72. package/dist/index27.js +31 -8
  73. package/dist/index28.cjs +1 -1
  74. package/dist/index28.js +26 -31
  75. package/dist/index29.cjs +2 -1
  76. package/dist/index29.js +64 -25
  77. package/dist/index30.cjs +1 -2
  78. package/dist/index30.js +50 -64
  79. package/dist/index31.cjs +1 -1
  80. package/dist/index31.js +12 -51
  81. package/dist/index32.cjs +1 -1
  82. package/dist/index32.js +24 -12
  83. package/dist/index33.cjs +1 -1
  84. package/dist/index33.js +75 -24
  85. package/dist/index34.cjs +1 -1
  86. package/dist/index34.js +22 -74
  87. package/dist/index35.cjs +1 -1
  88. package/dist/index35.js +7 -23
  89. package/dist/index36.cjs +1 -1
  90. package/dist/index36.js +32 -7
  91. package/dist/index37.cjs +1 -1
  92. package/dist/index37.js +14 -31
  93. package/dist/index38.cjs +1 -1
  94. package/dist/index38.js +2 -16
  95. package/dist/index39.cjs +1 -1
  96. package/dist/index39.js +9 -2
  97. package/dist/index4.cjs +1 -1
  98. package/dist/index4.js +2 -2
  99. package/dist/index40.cjs +1 -1
  100. package/dist/index40.js +20 -8
  101. package/dist/index41.cjs +1 -1
  102. package/dist/index41.js +12 -20
  103. package/dist/index42.cjs +1 -1
  104. package/dist/index42.js +33 -40
  105. package/dist/index43.cjs +1 -1
  106. package/dist/index43.js +6 -25
  107. package/dist/index44.cjs +2 -1
  108. package/dist/index44.js +59 -6
  109. package/dist/index45.cjs +1 -1
  110. package/dist/index45.js +2 -14
  111. package/dist/index46.cjs +1 -1
  112. package/dist/index46.js +6 -15
  113. package/dist/index47.cjs +1 -1
  114. package/dist/index47.js +4 -5
  115. package/dist/index48.cjs +1 -1
  116. package/dist/index48.js +11 -13
  117. package/dist/index49.cjs +5 -1
  118. package/dist/index49.js +56 -10
  119. package/dist/index50.cjs +2 -1
  120. package/dist/index50.js +32 -10
  121. package/dist/index51.cjs +1 -1
  122. package/dist/index51.js +5 -11
  123. package/dist/index52.cjs +1 -1
  124. package/dist/index52.js +3 -13
  125. package/dist/index53.cjs +1 -1
  126. package/dist/index53.js +20 -54
  127. package/dist/index54.cjs +1 -1
  128. package/dist/index54.js +12 -16
  129. package/dist/index55.cjs +1 -1
  130. package/dist/index55.js +55 -5
  131. package/dist/index56.cjs +1 -1
  132. package/dist/index56.js +3 -3
  133. package/dist/index57.cjs +1 -1
  134. package/dist/index57.js +19 -169
  135. package/dist/index58.cjs +1 -1
  136. package/dist/index58.js +11 -103
  137. package/dist/index59.cjs +1 -1
  138. package/dist/index59.js +8 -21
  139. package/dist/index6.cjs +1 -1
  140. package/dist/index6.js +22 -45
  141. package/dist/index60.cjs +1 -1
  142. package/dist/index60.js +9 -11
  143. package/dist/index61.cjs +1 -1
  144. package/dist/index61.js +11 -34
  145. package/dist/index62.cjs +1 -1
  146. package/dist/index62.js +6 -6
  147. package/dist/index63.cjs +1 -2
  148. package/dist/index63.js +13 -59
  149. package/dist/index64.cjs +1 -1
  150. package/dist/index64.js +33 -2
  151. package/dist/index65.cjs +1 -1
  152. package/dist/index65.js +14 -6
  153. package/dist/index66.cjs +1 -1
  154. package/dist/index66.js +64 -4
  155. package/dist/index67.cjs +1 -1
  156. package/dist/index67.js +27 -11
  157. package/dist/index68.cjs +1 -5
  158. package/dist/index68.js +3 -57
  159. package/dist/index69.cjs +1 -2
  160. package/dist/index69.js +3 -34
  161. package/dist/index7.cjs +1 -1
  162. package/dist/index7.js +2 -24
  163. package/dist/index70.cjs +1 -1
  164. package/dist/index70.js +13 -5
  165. package/dist/index71.cjs +1 -1
  166. package/dist/index71.js +41 -3
  167. package/dist/index72.cjs +1 -1
  168. package/dist/index72.js +5 -21
  169. package/dist/index73.cjs +1 -1
  170. package/dist/index73.js +8 -8
  171. package/dist/index74.cjs +1 -1
  172. package/dist/index74.js +102 -9
  173. package/dist/index75.cjs +1 -1
  174. package/dist/index75.js +190 -10
  175. package/dist/index76.cjs +1 -1
  176. package/dist/index76.js +17 -5
  177. package/dist/index77.cjs +1 -1
  178. package/dist/index77.js +10 -12
  179. package/dist/index78.cjs +1 -1
  180. package/dist/index78.js +19 -32
  181. package/dist/index79.cjs +1 -1
  182. package/dist/index79.js +25 -14
  183. package/dist/index8.cjs +1 -1
  184. package/dist/index8.js +100 -2
  185. package/dist/index80.cjs +1 -1
  186. package/dist/index80.js +6 -64
  187. package/dist/index81.cjs +1 -1
  188. package/dist/index81.js +13 -27
  189. package/dist/index82.cjs +1 -1
  190. package/dist/index82.js +16 -3
  191. package/dist/index83.cjs +1 -1
  192. package/dist/index83.js +5 -191
  193. package/dist/index84.cjs +1 -1
  194. package/dist/index84.js +13 -18
  195. package/dist/index85.cjs +1 -1
  196. package/dist/index85.js +10 -3
  197. package/dist/index86.cjs +1 -1
  198. package/dist/index86.js +16 -8
  199. package/dist/index87.cjs +1 -1
  200. package/dist/index87.js +169 -110
  201. package/dist/index88.cjs +1 -1
  202. package/dist/index88.js +6 -14
  203. package/dist/index89.cjs +1 -1
  204. package/dist/index89.js +9 -220
  205. package/dist/index9.cjs +1 -1
  206. package/dist/index9.js +34 -90
  207. package/dist/index90.cjs +1 -1
  208. package/dist/index90.js +34 -38
  209. package/dist/index91.cjs +1 -1
  210. package/dist/index91.js +2 -2
  211. package/dist/index92.cjs +1 -1
  212. package/dist/index92.js +5 -18
  213. package/dist/index93.cjs +1 -1
  214. package/dist/index93.js +10 -78
  215. package/dist/index94.cjs +1 -1
  216. package/dist/index94.js +2 -19
  217. package/dist/index95.cjs +1 -1
  218. package/dist/index95.js +40 -6
  219. package/dist/index96.cjs +1 -1
  220. package/dist/index96.js +16 -8
  221. package/dist/index97.cjs +1 -1
  222. package/dist/index97.js +6 -11
  223. package/dist/index98.cjs +1 -1
  224. package/dist/index98.js +5 -20
  225. package/dist/index99.cjs +1 -1
  226. package/dist/index99.js +33 -34
  227. package/dist/src/index.d.ts +0 -1
  228. package/dist/src/lib/auth/siwe/siwe.d.ts +1 -2
  229. package/package.json +2 -3
  230. package/dist/index118.cjs +0 -1
  231. package/dist/index118.js +0 -21
  232. package/dist/src/lib/digestKey/digestKey.d.ts +0 -12
package/dist/index45.js CHANGED
@@ -1,16 +1,4 @@
1
- import { secp256k1 as u } from "./index42.js";
2
- import { numberToHex as i } from "./index25.js";
3
- import { serializeSignature as a } from "./index52.js";
4
- let m = !1;
5
- async function y({ hash: n, privateKey: s, to: r = "object" }) {
6
- const { r: o, s: c, recovery: e } = u.sign(n.slice(2), s.slice(2), { lowS: !0, extraEntropy: m }), t = {
7
- r: i(o, { size: 32 }),
8
- s: i(c, { size: 32 }),
9
- v: e ? 28n : 27n,
10
- yParity: e
11
- };
12
- return r === "bytes" || r === "hex" ? a({ ...t, to: r }) : t;
13
- }
1
+ const o = "2.22.23";
14
2
  export {
15
- y as sign
3
+ o as version
16
4
  };
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index54.cjs"),c=require("./index45.cjs");async function u(r){const{contractAddress:t,chainId:e,nonce:n,privateKey:a,to:i="object"}=r,o=await c.sign({hash:s.hashAuthorization({contractAddress:t,chainId:e,nonce:n}),privateKey:a,to:i});return i==="object"?{contractAddress:t,chainId:e,nonce:n,...o}:o}exports.experimental_signAuthorization=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index44.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/index46.js CHANGED
@@ -1,18 +1,9 @@
1
- import { hashAuthorization as c } from "./index54.js";
2
- import { sign as s } from "./index45.js";
3
- async function m(e) {
4
- const { contractAddress: t, chainId: n, nonce: o, privateKey: a, to: r = "object" } = e, i = await s({
5
- hash: c({ contractAddress: t, chainId: n, nonce: o }),
6
- privateKey: a,
7
- to: r
8
- });
9
- return r === "object" ? {
10
- contractAddress: t,
11
- chainId: n,
12
- nonce: o,
13
- ...i
14
- } : i;
1
+ import { BaseError as i } from "./index44.js";
2
+ class o extends i {
3
+ constructor({ chainId: r }) {
4
+ super(typeof r == "number" ? `Chain ID "${r}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
5
+ }
15
6
  }
16
7
  export {
17
- m as experimental_signAuthorization
8
+ o as InvalidChainIdError
18
9
  };
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index55.cjs"),n=require("./index45.cjs");async function t({message:e,privateKey:s}){return await n.sign({hash:a.hashMessage(e),privateKey:s,to:"hex"})}exports.signMessage=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index69.cjs");function i(e){return t.isHex(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}exports.size=i;
package/dist/index47.js CHANGED
@@ -1,8 +1,7 @@
1
- import { hashMessage as e } from "./index55.js";
2
- import { sign as o } from "./index45.js";
3
- async function i({ message: s, privateKey: a }) {
4
- return await o({ hash: e(s), privateKey: a, to: "hex" });
1
+ import { isHex as r } from "./index69.js";
2
+ function i(t) {
3
+ return r(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
5
4
  }
6
5
  export {
7
- i as signMessage
6
+ i as size
8
7
  };
package/dist/index48.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index56.cjs"),c=require("./index57.cjs"),o=require("./index45.cjs");async function u(i){const{privateKey:r,transaction:e,serializer:n=c.serializeTransaction}=i,a=e.type==="eip4844"?{...e,sidecars:!1}:e,s=await o.sign({hash:t.keccak256(n(a)),privateKey:r});return n(e,s)}exports.signTransaction=u;
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/index48.js CHANGED
@@ -1,16 +1,14 @@
1
- import { keccak256 as e } from "./index56.js";
2
- import { serializeTransaction as o } from "./index57.js";
3
- import { sign as c } from "./index45.js";
4
- async function u(n) {
5
- const { privateKey: a, transaction: r, serializer: i = o } = n, t = r.type === "eip4844" ? {
6
- ...r,
7
- sidecars: !1
8
- } : r, s = await c({
9
- hash: e(i(t)),
10
- privateKey: a
11
- });
12
- return i(r, s);
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
+ };
13
11
  }
14
12
  export {
15
- u as signTransaction
13
+ r as formatLog
16
14
  };
package/dist/index49.cjs CHANGED
@@ -1 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index58.cjs"),s=require("./index45.cjs");async function i(e){const{privateKey:t,...a}=e;return await s.sign({hash:n.hashTypedData(a),privateKey:t,to:"hex"})}exports.signTypedData=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index47.cjs"),n=require("./index44.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
+ `),{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
+ `),{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
+ `),{docsPath:e,name:"InvalidAbiEncodingType"})}}class g extends n.BaseError{constructor(r){super([`Value "${r}" is not a valid array.`].join(`
5
+ `),{name:"InvalidArrayError"})}}exports.AbiEncodingArrayLengthMismatchError=o;exports.AbiEncodingBytesSizeMismatchError=a;exports.AbiEncodingLengthMismatchError=c;exports.BytesSizeMismatchError=d;exports.InvalidAbiEncodingTypeError=E;exports.InvalidArrayError=g;
package/dist/index49.js CHANGED
@@ -1,13 +1,59 @@
1
- import { hashTypedData as o } from "./index58.js";
2
- import { sign as r } from "./index45.js";
3
- async function p(t) {
4
- const { privateKey: a, ...e } = t;
5
- return await r({
6
- hash: o(e),
7
- privateKey: a,
8
- to: "hex"
9
- });
1
+ import { size as i } from "./index47.js";
2
+ import { BaseError as n } from "./index44.js";
3
+ class c extends n {
4
+ constructor({ expectedLength: e, givenLength: r, type: s }) {
5
+ super([
6
+ `ABI encoding array length mismatch for type ${s}.`,
7
+ `Expected length: ${e}`,
8
+ `Given length: ${r}`
9
+ ].join(`
10
+ `), { name: "AbiEncodingArrayLengthMismatchError" });
11
+ }
12
+ }
13
+ class d extends n {
14
+ constructor({ expectedSize: e, value: r }) {
15
+ super(`Size of bytes "${r}" (bytes${i(r)}) does not match expected size (bytes${e}).`, { name: "AbiEncodingBytesSizeMismatchError" });
16
+ }
17
+ }
18
+ class m extends n {
19
+ constructor({ expectedLength: e, givenLength: r }) {
20
+ super([
21
+ "ABI encoding params/values length mismatch.",
22
+ `Expected length (params): ${e}`,
23
+ `Given length (values): ${r}`
24
+ ].join(`
25
+ `), { name: "AbiEncodingLengthMismatchError" });
26
+ }
27
+ }
28
+ class E extends n {
29
+ constructor({ expectedSize: e, givenSize: r }) {
30
+ super(`Expected bytes${e}, got bytes${r}.`, {
31
+ name: "BytesSizeMismatchError"
32
+ });
33
+ }
34
+ }
35
+ class g extends n {
36
+ constructor(e, { docsPath: r }) {
37
+ super([
38
+ `Type "${e}" is not a valid encoding type.`,
39
+ "Please provide a valid ABI type."
40
+ ].join(`
41
+ `), { docsPath: r, name: "InvalidAbiEncodingType" });
42
+ }
43
+ }
44
+ class l extends n {
45
+ constructor(e) {
46
+ super([`Value "${e}" is not a valid array.`].join(`
47
+ `), {
48
+ name: "InvalidArrayError"
49
+ });
50
+ }
10
51
  }
11
52
  export {
12
- p as signTypedData
53
+ c as AbiEncodingArrayLengthMismatchError,
54
+ d as AbiEncodingBytesSizeMismatchError,
55
+ m as AbiEncodingLengthMismatchError,
56
+ E as BytesSizeMismatchError,
57
+ g as InvalidAbiEncodingTypeError,
58
+ l as InvalidArrayError
13
59
  };
package/dist/index50.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index63.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 a=require("./index51.cjs"),t=require("./index44.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
+ `),{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/index50.js CHANGED
@@ -1,15 +1,37 @@
1
- import { BaseError as r } from "./index63.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"
1
+ import { formatGwei as a } from "./index51.js";
2
+ import { BaseError as o } from "./index44.js";
3
+ class n extends o {
4
+ constructor({ cause: r, maxFeePerGas: e } = {}) {
5
+ super(`The fee cap (\`maxFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
6
+ cause: r,
7
+ name: "FeeCapTooHighError"
10
8
  });
11
9
  }
12
10
  }
11
+ Object.defineProperty(n, "nodeMessage", {
12
+ enumerable: !0,
13
+ configurable: !0,
14
+ writable: !0,
15
+ value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
16
+ });
17
+ class h extends o {
18
+ constructor({ cause: r, maxPriorityFeePerGas: e, maxFeePerGas: t } = {}) {
19
+ super([
20
+ `The provided tip (\`maxPriorityFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${t ? ` = ${a(t)} gwei` : ""}).`
21
+ ].join(`
22
+ `), {
23
+ cause: r,
24
+ name: "TipAboveFeeCapError"
25
+ });
26
+ }
27
+ }
28
+ Object.defineProperty(h, "nodeMessage", {
29
+ enumerable: !0,
30
+ configurable: !0,
31
+ writable: !0,
32
+ value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
33
+ });
13
34
  export {
14
- d as InvalidAddressError
35
+ n as FeeCapTooHighError,
36
+ h as TipAboveFeeCapError
15
37
  };
package/dist/index51.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index72.cjs"),i=require("./index59.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"});const i=require("./index92.cjs"),r=require("./index93.cjs");function n(t,e="wei"){return r.formatUnits(t,i.gweiUnits[e])}exports.formatGwei=n;
package/dist/index51.js CHANGED
@@ -1,14 +1,8 @@
1
- import { LruMap as u } from "./index72.js";
2
- import { checksumAddress as c } from "./index59.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
+ import { gweiUnits as i } from "./index92.js";
2
+ import { formatUnits as o } from "./index93.js";
3
+ function f(r, t = "wei") {
4
+ return o(r, i[t]);
10
5
  }
11
6
  export {
12
- h as isAddress,
13
- r as isAddressCache
7
+ f as formatGwei
14
8
  };
package/dist/index52.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index42.cjs"),n=require("./index35.cjs"),a=require("./index53.cjs");function g({r:i,s:o,to:u="hex",v:e,yParity:r}){const s=(()=>{if(r===0||r===1)return r;if(e&&(e===27n||e===28n||e>=35n))return e%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),t=`0x${new c.secp256k1.Signature(n.hexToBigInt(i),n.hexToBigInt(o)).toCompactHex()}${s===0?"1b":"1c"}`;return u==="hex"?t:a.hexToBytes(t)}exports.serializeSignature=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/index52.js CHANGED
@@ -1,16 +1,6 @@
1
- import { secp256k1 as f } from "./index42.js";
2
- import { hexToBigInt as t } from "./index35.js";
3
- import { hexToBytes as m } from "./index53.js";
4
- function s({ r: o, s: i, to: u = "hex", v: r, yParity: e }) {
5
- const a = (() => {
6
- if (e === 0 || e === 1)
7
- return e;
8
- if (r && (r === 27n || r === 28n || r >= 35n))
9
- return r % 2n === 0n ? 1 : 0;
10
- throw new Error("Invalid `v` or `yParity` value");
11
- })(), n = `0x${new f.Signature(t(o), t(i)).toCompactHex()}${a === 0 ? "1b" : "1c"}`;
12
- return u === "hex" ? n : m(n);
1
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
13
3
  }
14
4
  export {
15
- s as serializeSignature
5
+ n as wait
16
6
  };
package/dist/index53.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index63.cjs"),l=require("./index85.cjs"),u=require("./index61.cjs"),f=require("./index35.cjs"),m=require("./index25.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 d=require("./index54.cjs"),f=require("./index55.cjs"),a=require("./index56.cjs"),l=require("./index57.cjs"),A=require("./index58.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),"bytes"),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/index53.js CHANGED
@@ -1,58 +1,24 @@
1
- import { BaseError as g } from "./index63.js";
2
- import { isHex as x } from "./index85.js";
3
- import { pad as s } from "./index61.js";
4
- import { assertSize as u } from "./index35.js";
5
- import { numberToHex as h } from "./index25.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);
1
+ import { InvalidAddressError as c } from "./index54.js";
2
+ import { stringToBytes as m } from "./index55.js";
3
+ import { keccak256 as p } from "./index56.js";
4
+ import { LruMap as u } from "./index57.js";
5
+ import { isAddress as $ } from "./index58.js";
6
+ const s = /* @__PURE__ */ new u(8192);
7
+ function h(t, o) {
8
+ if (s.has(`${t}.${o}`))
9
+ return s.get(`${t}.${o}`);
10
+ const i = t.substring(2).toLowerCase(), n = p(m(i), "bytes"), e = i.split("");
11
+ for (let r = 0; r < 40; r += 2)
12
+ n[r >> 1] >> 4 >= 8 && e[r] && (e[r] = e[r].toUpperCase()), (n[r >> 1] & 15) >= 8 && e[r + 1] && (e[r + 1] = e[r + 1].toUpperCase());
13
+ const f = `0x${e.join("")}`;
14
+ return s.set(`${t}.${o}`, f), f;
9
15
  }
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;
16
+ function w(t, o) {
17
+ if (!$(t, { strict: !1 }))
18
+ throw new c({ address: t });
19
+ return h(t, o);
51
20
  }
52
21
  export {
53
- B as boolToBytes,
54
- y as hexToBytes,
55
- T as numberToBytes,
56
- l as stringToBytes,
57
- F as toBytes
22
+ h as checksumAddress,
23
+ w as getAddress
58
24
  };
package/dist/index54.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index84.cjs"),u=require("./index53.cjs"),r=require("./index25.cjs"),a=require("./index90.cjs"),h=require("./index56.cjs");function x(n){const{chainId:e,contractAddress:c,nonce:t,to:s}=n,o=h.keccak256(i.concatHex(["0x05",a.toRlp([e?r.numberToHex(e):"0x",c,t?r.numberToHex(t):"0x"])]));return s==="bytes"?u.hexToBytes(o):o}exports.hashAuthorization=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index44.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/index54.js CHANGED
@@ -1,19 +1,15 @@
1
- import { concatHex as i } from "./index84.js";
2
- import { hexToBytes as s } from "./index53.js";
3
- import { numberToHex as n } from "./index25.js";
4
- import { toRlp as a } from "./index90.js";
5
- import { keccak256 as f } from "./index56.js";
6
- function b(e) {
7
- const { chainId: o, contractAddress: c, nonce: t, to: m } = e, r = f(i([
8
- "0x05",
9
- a([
10
- o ? n(o) : "0x",
11
- c,
12
- t ? n(t) : "0x"
13
- ])
14
- ]));
15
- return m === "bytes" ? s(r) : r;
1
+ import { BaseError as r } from "./index44.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
+ }
16
12
  }
17
13
  export {
18
- b as hashAuthorization
14
+ d as InvalidAddressError
19
15
  };
package/dist/index55.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index56.cjs"),t=require("./index86.cjs");function a(e,s){return r.keccak256(t.toPrefixedMessage(e),s)}exports.hashMessage=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index44.cjs"),l=require("./index69.cjs"),u=require("./index42.cjs"),f=require("./index34.cjs"),m=require("./index24.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/index55.js CHANGED
@@ -1,8 +1,58 @@
1
- import { keccak256 as o } from "./index56.js";
2
- import { toPrefixedMessage as t } from "./index86.js";
3
- function f(e, r) {
4
- return o(t(e), r);
1
+ import { BaseError as g } from "./index44.js";
2
+ import { isHex as x } from "./index69.js";
3
+ import { pad as s } from "./index42.js";
4
+ import { assertSize as u } from "./index34.js";
5
+ import { numberToHex as h } from "./index24.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;
5
51
  }
6
52
  export {
7
- f as hashMessage
53
+ B as boolToBytes,
54
+ y as hexToBytes,
55
+ T as numberToBytes,
56
+ l as stringToBytes,
57
+ F as toBytes
8
58
  };
package/dist/index56.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index91.cjs"),o=require("./index85.cjs"),i=require("./index53.cjs"),n=require("./index25.cjs");function u(e,r){const s=r||"hex",t=c.keccak_256(o.isHex(e,{strict:!1})?i.toBytes(e):e);return s==="bytes"?t:n.toHex(t)}exports.keccak256=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index91.cjs"),o=require("./index69.cjs"),i=require("./index55.cjs"),n=require("./index24.cjs");function u(e,r){const s=r||"hex",t=c.keccak_256(o.isHex(e,{strict:!1})?i.toBytes(e):e);return s==="bytes"?t:n.toHex(t)}exports.keccak256=u;
package/dist/index56.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { keccak_256 as c } from "./index91.js";
2
- import { isHex as i } from "./index85.js";
3
- import { toBytes as m } from "./index53.js";
4
- import { toHex as s } from "./index25.js";
2
+ import { isHex as i } from "./index69.js";
3
+ import { toBytes as m } from "./index55.js";
4
+ import { toHex as s } from "./index24.js";
5
5
  function x(t, r) {
6
6
  const e = r || "hex", o = c(i(t, { strict: !1 }) ? m(t) : t);
7
7
  return e === "bytes" ? o : s(o);
package/dist/index57.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index30.cjs"),G=require("./index73.cjs"),R=require("./index74.cjs"),S=require("./index75.cjs"),B=require("./index77.cjs"),L=require("./index84.cjs"),h=require("./index62.cjs"),t=require("./index25.cjs"),b=require("./index90.cjs"),V=require("./index92.cjs"),z=require("./index93.cjs"),C=require("./index79.cjs"),v=require("./index94.cjs");function k(e,o){const s=C.getTransactionType(e);return s==="eip1559"?_(e,o):s==="eip2930"?j(e,o):s==="eip4844"?Y(e,o):s==="eip7702"?w(e,o):M(e,o)}function w(e,o){const{authorizationList:s,chainId:i,gas:r,nonce:c,to:a,value:x,maxFeePerGas:l,maxPriorityFeePerGas:n,accessList:H,data:d}=e;z.assertTransactionEIP7702(e);const f=v.serializeAccessList(H),u=V.serializeAuthorizationList(s);return L.concatHex(["0x04",b.toRlp([t.toHex(i),c?t.toHex(c):"0x",n?t.toHex(n):"0x",l?t.toHex(l):"0x",r?t.toHex(r):"0x",a??"0x",x?t.toHex(x):"0x",d??"0x",f,u,...T(e,o)])])}function Y(e,o){const{chainId:s,gas:i,nonce:r,to:c,value:a,maxFeePerBlobGas:x,maxFeePerGas:l,maxPriorityFeePerGas:n,accessList:H,data:d}=e;z.assertTransactionEIP4844(e);let f=e.blobVersionedHashes,u=e.sidecars;if(e.blobs&&(typeof f>"u"||typeof u>"u")){const m=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(y=>t.bytesToHex(y)),P=e.kzg,p=G.blobsToCommitments({blobs:m,kzg:P});if(typeof f>"u"&&(f=S.commitmentsToVersionedHashes({commitments:p})),typeof u>"u"){const y=R.blobsToProofs({blobs:m,commitments:p,kzg:P});u=B.toBlobSidecars({blobs:m,commitments:p,proofs:y})}}const I=v.serializeAccessList(H),A=[t.toHex(s),r?t.toHex(r):"0x",n?t.toHex(n):"0x",l?t.toHex(l):"0x",i?t.toHex(i):"0x",c??"0x",a?t.toHex(a):"0x",d??"0x",I,x?t.toHex(x):"0x",f??[],...T(e,o)],q=[],g=[],E=[];if(u)for(let m=0;m<u.length;m++){const{blob:P,commitment:p,proof:y}=u[m];q.push(P),g.push(p),E.push(y)}return L.concatHex(["0x03",u?b.toRlp([A,q,g,E]):b.toRlp(A)])}function _(e,o){const{chainId:s,gas:i,nonce:r,to:c,value:a,maxFeePerGas:x,maxPriorityFeePerGas:l,accessList:n,data:H}=e;z.assertTransactionEIP1559(e);const d=v.serializeAccessList(n),f=[t.toHex(s),r?t.toHex(r):"0x",l?t.toHex(l):"0x",x?t.toHex(x):"0x",i?t.toHex(i):"0x",c??"0x",a?t.toHex(a):"0x",H??"0x",d,...T(e,o)];return L.concatHex(["0x02",b.toRlp(f)])}function j(e,o){const{chainId:s,gas:i,data:r,nonce:c,to:a,value:x,accessList:l,gasPrice:n}=e;z.assertTransactionEIP2930(e);const H=v.serializeAccessList(l),d=[t.toHex(s),c?t.toHex(c):"0x",n?t.toHex(n):"0x",i?t.toHex(i):"0x",a??"0x",x?t.toHex(x):"0x",r??"0x",H,...T(e,o)];return L.concatHex(["0x01",b.toRlp(d)])}function M(e,o){const{chainId:s=0,gas:i,data:r,nonce:c,to:a,value:x,gasPrice:l}=e;z.assertTransactionLegacy(e);let n=[c?t.toHex(c):"0x",l?t.toHex(l):"0x",i?t.toHex(i):"0x",a??"0x",x?t.toHex(x):"0x",r??"0x"];if(o){const H=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(s>0)return BigInt(s*2)+BigInt(35n+o.v-27n);const u=27n+(o.v===27n?0n:1n);if(o.v!==u)throw new F.InvalidLegacyVError({v:o.v});return u})(),d=h.trim(o.r),f=h.trim(o.s);n=[...n,t.toHex(H),d==="0x00"?"0x":d,f==="0x00"?"0x":f]}else s>0&&(n=[...n,t.toHex(s),"0x","0x"]);return b.toRlp(n)}function T(e,o){const s=o??e,{v:i,yParity:r}=s;if(typeof s.r>"u")return[];if(typeof s.s>"u")return[];if(typeof i>"u"&&typeof r>"u")return[];const c=h.trim(s.r),a=h.trim(s.s);return[typeof r=="number"?r?t.toHex(1):"0x":i===0n?"0x":i===1n?t.toHex(1):i===27n?"0x":t.toHex(1),c==="0x00"?"0x":c,a==="0x00"?"0x":a]}exports.serializeTransaction=k;exports.toYParitySignatureArray=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;